if (stristr($_SERVER["SCRIPT_NAME"], "config.inc")) {
header("location:../index.php");
die();
}
$site[0] = stripslashes("Le Collectif Pour la Liberté d\'Instruction"); // Titre du site pour l'Editorial
$site[1] = stripslashes("Collectif Pour la Liberté d\'Instruction."); // Meta Description du site
$site[2] = stripslashes("homeschooling,école à la maison,instruction dans la famille,instruction parentale,non-sco, unschooling,apprentissage autonome,apprendre autrement,instruction parentale,cours par correspondance,enseignement à distance,parentalité,scolarité obligatoire,e-learning"); // Meta Mots-clés du site
$site[3] = stripslashes("http://www.cpli.eu/"); // URL du site
$site[4] = stripslashes("2"); // Nouvelles sur la page d'accueil
$site[5] = stripslashes("2"); // Activation des news ou pas
$site[6] = stripslashes("Collectif Pour la Liberté d\'Instruction."); // Meta Titre du site pour les moteurs de recherche
$site[7] = stripslashes("Index, Follow"); // Meta Méthode d'indexation du site pour les robots
$site[8] = stripslashes("14 days"); // Meta Délai d'attente du robot avant une prochaine indexation
$site[9] = stripslashes("Collectif Pour la Liberté d\'Instruction"); // Meta Auteur du site
$site[10] = stripslashes("Collectif Pour la Liberté d\'Instruction"); // Meta Propriétaire du site
$site[11] = stripslashes("zwebmaster@cpli.eu"); // Meta Adresse e-mail principale de l'auteur du site
$site[12] = stripslashes("General"); // Meta Catégorie du public visé
$site[13] = stripslashes("Global"); // Meta Mode de diffusion du site
$site[14] = stripslashes("(C) 2006"); // Meta Copyright de l'auteur du site
$site[15] = stripslashes("fr"); // Meta language
$site[16] = stripslashes("http://www.cpli.eu"); // Meta Identifier URL
$site[17] = stripslashes(""); // Slogan défilant langue principale
$site[18] = stripslashes(""); // Slogan défilant deuxième langue
$site[19] = stripslashes("E1"); // Format Dates
$site[20] = stripslashes("7"); // Messages Forum sur la page d'accueil
$site[21] = stripslashes("77"); // ID du message Livre d'or préféré
$site[22] = stripslashes("H1"); // Format Heure
$site[23] = stripslashes("@"); // Séparateur Date & Heure
$site[24] = stripslashes("N"); // Logo Copyright
$site[25] = stripslashes("B"); // Position Logo Copyright
$site[26] = stripslashes("on"); // Compression des Pages
$site[27] = stripslashes("1"); // Temps d'attente popup postage
$site[28] = stripslashes("progbar1.gif"); // Barre de progression attente popup postage
$site[29] = stripslashes(""); // Nombre de caractères des nouvelles en page d'accueil
$lang[0] = stripslashes("fr"); // Langue principale du site
$lang[1] = stripslashes(""); // Deuxième langue du site
$user[0] = stripslashes("valerie"); // Webmaster
$user[1] = stripslashes("presse@cpli.eu"); // e-mail du responsable du site
$user[2] = stripslashes(""); // # ICQ
$user[3] = stripslashes("on"); // e-mail PHP
$nom[0] = stripslashes("Accueil"); // Nom de l'accueil langue principale
$nom[1] = stripslashes("Téléchargements"); // Page des téléchargements langue principale
$nom[2] = stripslashes("Photos"); // Page des images langue principale
$nom[3] = stripslashes("Dernières mises en ligne"); // Page des liens langue principale
$nom[4] = stripslashes("Rubriques"); // Boite des articles à gauche langue principale
$nom[5] = stripslashes("Contacts"); // Boite spéciale langue principale
$nom[6] = stripslashes("Sondage"); // Sondage langue principale
$nom[7] = stripslashes("Actualités"); // Nouvelles langue principale
$nom[8] = stripslashes("Visites"); // Compteur langue principale
$nom[9] = stripslashes("Pourquoi avez-vous signé ? Témoignez."); // Livre d'or langue principale
$nom[10] = stripslashes(""); // Nom de l'accueil deuxième langue
$nom[11] = stripslashes(""); // Page des téléchargements deuxième langue
$nom[12] = stripslashes(""); // Page des images deuxième langue
$nom[13] = stripslashes(""); // Page des liens deuxième langue
$nom[14] = stripslashes(""); // Boite des articles à gauche deuxième langue
$nom[15] = stripslashes(""); // Boite spéciale deuxième langue
$nom[16] = stripslashes(""); // Sondage deuxième langue
$nom[17] = stripslashes(""); // Nouvelles deuxième langue
$nom[18] = stripslashes(""); // Compteur deuxième langue
$nom[19] = stripslashes(""); // Livre d'or deuxième langue
$nom[20] = stripslashes("Recherche"); // Recherche langue principale
$nom[21] = stripslashes(""); // Recherche deuxième langue
$nom[22] = stripslashes("Forum"); // Forum langue principale
$nom[23] = stripslashes(""); // Forum deuxième langue
$nom[24] = stripslashes("FAQ"); // FAQ langue principale
$nom[25] = stripslashes(""); // FAQ deuxième langue
$nom[26] = stripslashes("Stats"); // Statistiques langue principale
$nom[27] = stripslashes(""); // Statistiques deuxième langue
$nom[28] = stripslashes("Recommander"); // Recommander langue principale
$nom[29] = stripslashes(""); // Recommander deuxième langue
$nom[30] = stripslashes(""); // Boite des articles à droite langue principale
$nom[31] = stripslashes(""); // Boite des articles à droite deuxième langue
$nom[32] = stripslashes("Rendez-vous"); // Boite Calendrier langue principale
$nom[33] = stripslashes(""); // Boite Calendrier deuxième langue
$nom[34] = stripslashes("Préférences"); // Boite préférences utilisateur langue principale
$nom[35] = stripslashes(""); // Boite préférences utilisateur deuxième langue
$nom[36] = stripslashes("Infos diverses (RSS)"); // Boite RSS langue principale
$nom[37] = stripslashes(""); // Boite RSS deuxième langue
$nom[38] = stripslashes("Lettre d'information"); // Boite Newsletter langue principale
$nom[39] = stripslashes(""); // Boite Newsletter deuxième langue
$nom[40] = stripslashes("Webmaster - Infos"); // Boite Webmaster - Infos langue principale
$nom[41] = stripslashes(""); // Boite Webmaster - Infos deuxième langue
$page[0] = stripslashes("#FFFFFF"); // Arrière-plan du site
$page[1] = stripslashes("Verdana, Bitstream Vera Sans, sans-serif"); // Police des boites centrales
$page[2] = stripslashes("14px"); // Taille des textes des boites centrales
$page[3] = stripslashes(""); // Image de fond du site
$page[4] = stripslashes(""); // Logo du site
$page[5] = stripslashes("#FFFFFF"); // Arrière-plan du bandeau
$page[6] = stripslashes(""); // Image de fond du bandeau
$page[7] = stripslashes(""); // Transition entre pages
$page[8] = stripslashes("on"); // Affichage Temps de chargement de page ON / OFF
$page[9] = stripslashes(""); // Thème d'icônes
$page[10] = stripslashes(""); // Image de fond fixe / mouvante
$page[11] = stripslashes("cnt_1"); // Thème de compteur de visites
$page[12] = stripslashes("sml_1"); // Thème smileys
$page[13] = stripslashes(""); // Image Page en cours de chargement
$page[14] = stripslashes("no_skin"); // Thème skins
$page[15] = stripslashes("on"); // Effet animation liens
$page[16] = stripslashes("Verdana, Bitstream Vera Sans, sans-serif"); // Police des boites latérales
$page[17] = stripslashes("14px"); // Taille des textes des boites latérales
$page[18] = stripslashes("Verdana, Bitstream Vera Sans, sans-serif"); // Police du menu de navigation
$page[19] = stripslashes("16px"); // Taille des liens du menu de navigation
$page[20] = stripslashes(""); // Rollover sur les icônes
$page[21] = stripslashes(""); // paramètre inutilisé
$page[22] = stripslashes("on"); // utilisation titres longs
$page[23] = stripslashes("ava_1"); // Thème avatars
$page[24] = stripslashes(""); // Curseur dans body
$titre[0] = stripslashes("#FFFFCC"); // Couleur du titre des boites centrales
$titre[1] = stripslashes("#330099"); // Arrière-plan du titre des boites centrales
$titre[2] = stripslashes("Verdana, Bitstream Vera Sans, sans-serif"); // Police des titres des boites centrales
$titre[3] = stripslashes("16px"); // Taille des titres des boites centrales
$titre[4] = stripslashes("#FFFFCC"); // Couleur du titre des boites latérales
$titre[5] = stripslashes("#330099"); // Arrière-plan du titre des boites latérales
$titre[6] = stripslashes("Verdana, Bitstream Vera Sans, sans-serif"); // Police des titres des boites latérales
$titre[7] = stripslashes("14px"); // Taille des titres des boites latérales
$texte[0] = stripslashes("#330099"); // Couleur des textes des boites centrales
$texte[1] = stripslashes("#F0F0F0"); // Arrière-plan OFF des boites centrales
$texte[2] = stripslashes("#FFFFFF"); // Arrière-plan ON des boites centrales
$texte[3] = stripslashes("•"); // Puce articles
$texte[4] = stripslashes("2px"); // Taille des bordures
$texte[5] = stripslashes("#330099"); // Couleur des textes des boites latérales
$texte[6] = stripslashes("&H80000016"); // Arrière-plan OFF des boites latérales
$texte[7] = stripslashes("#FCFCFC"); // Arrière-plan ON des boites latérales
$bordure[0] = stripslashes("#0000CC"); // Couleur des bordures
$bordure[1] = stripslashes("#779AC1"); // Couleur de la base de la barre de défilement
$bordure[2] = stripslashes("#330099"); // Couleur des flèches de la barre de défilement
$lien[0] = stripslashes("#0066CC"); // Liens OFF des boites centrales
$lien[1] = stripslashes("#FF3366"); // Liens ON des boites centrales
$lien[2] = stripslashes("#0066CC"); // Liens OFF des boites latérales
$lien[3] = stripslashes("#FF3366"); // Liens ON des boites latérales
$lien[4] = stripslashes("#330099"); // Liens OFF de la barre de menu haute
$lien[5] = stripslashes("#FFCC00"); // Liens ON de la barre de menu haute
$barre[0] = stripslashes("#6666CC"); // Couleur des HR
$barre[1] = stripslashes("2px"); // Taille des HR
$barre[2] = stripslashes("dashed"); // Style des HR
$forum[0] = stripslashes("#FFFFCC"); // Arrière plan entêtes
$forum[1] = stripslashes("#F0F0FF"); // Arrière plan question
$forum[2] = stripslashes("#FFFFFF"); // Arrière plan réponse
$serviz[0] = stripslashes(""); // Citations ON / OFF
$serviz[1] = stripslashes("on"); // Accueil Editorial ON / OFF
$serviz[2] = stripslashes("4"); // Nb de news / page
$serviz[3] = stripslashes("on"); // Boite Articles gauche ON / OFF
$serviz[4] = stripslashes("30"); // Nb de téléchargements / page
$serviz[5] = stripslashes("80"); // Nb de liens / page
$serviz[6] = stripslashes("20"); // Nb de FAQ / page
$serviz[7] = stripslashes("7"); // Nb de messages Guestbook / page
$serviz[8] = stripslashes("on"); // Nouvelles ON / OFF
$serviz[9] = stripslashes(""); // Photos ON / OFF
$serviz[10] = stripslashes(""); // Téléchargements ON / OFF
$serviz[11] = stripslashes("on"); // Liens ON / OFF
$serviz[12] = stripslashes("on"); // Livre d'or ON / OFF
$serviz[13] = stripslashes(""); // Forum ON / OFF
$serviz[14] = stripslashes(""); // FAQ ON / OFF
$serviz[15] = stripslashes(""); // Statistiques ON / OFF
$serviz[16] = stripslashes("on"); // Publication Nouvelles ON / OFF
$serviz[17] = stripslashes("30"); // Nb de messages Forum / page
$serviz[18] = stripslashes("on"); // Catégories Forum ON / OFF
$serviz[19] = stripslashes("on"); // Bannières ON / OFF
$serviz[20] = stripslashes("5"); // Nb de messages Thread / page
$serviz[21] = stripslashes(""); // Photorama avancé ON /OFF
$serviz[22] = stripslashes("on"); // Boite Articles droit ON / OFF
$serviz[23] = stripslashes(""); // Sondage ON / OFF
$serviz[24] = stripslashes(""); // Recherche ON / OFF
$serviz[25] = stripslashes("0"); // Menu dynamique Articles gauche
$serviz[26] = stripslashes("0"); // Menu dynamique Articles droit
$serviz[27] = stripslashes(""); // libre....
$serviz[28] = stripslashes(""); // Préférences visiteurs
$serviz[29] = stripslashes(""); // Réactions aux articles
$serviz[30] = stripslashes("5"); // Nb Réactions aux articles / page
$serviz[31] = stripslashes(""); // Pseudo préférences webmaster
$serviz[32] = stripslashes("on"); // Accès à l'administration rapide
$serviz[33] = stripslashes(""); // Compteur de lecture Articles
$serviz[34] = stripslashes("on"); // Compteur de lecture Threads Forum
$serviz[35] = stripslashes(""); // Compteur de Nb de téléchargements
$serviz[36] = stripslashes(""); // Newsletter ON / OFF
$serviz[37] = stripslashes("3"); // Nb de news publiées
$serviz[38] = stripslashes(""); // RSS News ON / OFF
$serviz[39] = stripslashes("3600"); // Durée Cache RSS
$serviz[40] = stripslashes(""); // Publication dans livre d'or
$serviz[41] = stripslashes(""); // Publication dans forum
$serviz[42] = stripslashes("on"); // Option Rédacteur
$serviz[43] = stripslashes(""); // Avatar préférences webmaster
$serviz[44] = stripslashes(""); // Mise en maintenance du site
$serviz[45] = stripslashes(""); // Masquer l'icône Admin
$serviz[46] = stripslashes("8"); // Nb de messages Agenda / page
$serviz[47] = stripslashes("on"); // Agenda ON / OFF
$serviz[48] = stripslashes("10"); // Nb de messages maximum dans Tinymessage
$serviz[49] = stripslashes("Typetool"); // Choix editeur
$serviz[50] = stripslashes(""); // Nb maxi de fichiers dans data/error
$serviz[51] = stripslashes("50"); // Nb maxi de lignes dans l'anti-spam
$serviz[52] = stripslashes("10"); // Durée maxi de validité du code anti-spam
$posbox[0] = stripslashes(""); // Première boite à droite
$posbox[1] = stripslashes(""); // Seconde boite à droite
$posbox[2] = stripslashes(""); // Troisième boite à droite
$posbox[3] = stripslashes(""); // Quatrième boite à droite
$posbox[4] = stripslashes(""); // Cinquième boite à droite
$posbox[5] = stripslashes(""); // Sixième boite à droite
$posbox[6] = stripslashes(""); // Septième boite à droite
$posbox[7] = stripslashes(""); // Huitième boite à droite
$posbox[8] = stripslashes(""); // Neuvième boite à droite
$posbox[9] = stripslashes("inc/boxartg"); // Première boite à gauche
$posbox[10] = stripslashes("inc/boxartd"); // Seconde boite à gauche
$posbox[11] = stripslashes("inc/boxspec"); // Troisième boite à gauche
$posbox[12] = stripslashes(""); // Quatrième boite à gauche
$posbox[13] = stripslashes(""); // Cinquième boite à gauche
$posbox[14] = stripslashes(""); // Sixième boite à gauche
$posbox[15] = stripslashes(""); // Septième boite à gauche
$posbox[16] = stripslashes(""); // Huitième boite à gauche
$posbox[17] = stripslashes(""); // Neuvième boite à gauche
$supervision[0] = stripslashes(""); // e-mail compteur
$supervision[1] = stripslashes("1000"); // incrément de compteur pour e-mail
$supervision[2] = stripslashes(""); // e-mail publication nouvelle
$supervision[3] = stripslashes(""); // e-mail publication livre d'or
$supervision[4] = stripslashes(""); // e-mail publication forum
$supervision[5] = stripslashes("standard_2"); // Type d'e-mail PHP
$supervision[6] = stripslashes(""); // e-mail réagir aux articles
$supervision[7] = stripslashes(""); // e-mail inscription ou résiliation Newsletter
$calendar[0] = stripslashes("#D2D2D2"); // Couleur de fond des jours libre du mois
$calendar[1] = stripslashes("#FFFFCC"); // Couleur de fond du calendrier
$calendar[2] = stripslashes("#BAD0FF"); // Couleur de fond de la journée
$calendar[3] = stripslashes("#0099CC"); // Couleur de fond des dimanches
$calendar[4] = stripslashes("#BAD0FF"); // Couleur de fond de la journée quand c'est un dimanche
$calendar[5] = stripslashes("Arial, sans-serif"); // Police du calendrier
$calendar[6] = stripslashes("11px"); // Taille de la police du calendrier
$calendar[7] = stripslashes("#CC6666"); // Couleurs de la police des chiffres
$calendar[8] = stripslashes("#000066"); // Couleurs de la police des jours de la semaine
$calendar[9] = stripslashes("2"); // Taille des bordures du calendrier
$calendar[10] = stripslashes(""); // Couleur des bordures du calendrier
$calendar[11] = stripslashes(""); // Largeur du calendrier dans sa boite
$citation[0] = stripslashes("Verdana, Bitstream Vera Sans, sans-serif"); // Police des citations
$citation[1] = stripslashes("16px"); // Taille de la police des citations
$citation[2] = stripslashes("#FF6666"); // Couleur de la police des citations
$presform[0] = stripslashes("#000066"); // Couleur des textes dans les boites de choix et boutons de commande
$presform[1] = stripslashes("#F0F0F0"); // Couleur des boites de choix
$presform[2] = stripslashes("#F0F0F0"); // Couleur des boutons de commande
$presform[3] = stripslashes("#FFFFFF"); // Couleur des zone de texte
$presform[4] = stripslashes("Verdana, Bitstream Vera Sans, sans-serif"); // Police dans la présentation des formulaires
$presform[5] = stripslashes("14px"); // Taille de la police dans la présentation des formulaires
$presform[6] = stripslashes("#F0F0F0"); // Couleur de fond des textarea
$presform[7] = stripslashes("1px"); // Taille de la bordure
$presform[8] = stripslashes("#000099"); // Couleur de la bordure
$editobox[0] = stripslashes("boxhome"); // Première boite page d'accueil
$editobox[1] = stripslashes(""); // Seconde boite page d'accueil
$editobox[2] = stripslashes(""); // Troisième boite page d'accueil
$editobox[3] = stripslashes(""); // Quatrième boite page d'accueil
$configlog[0] = stripslashes("100"); // Nombre des messages visibles dans l'admin log
$configlog[1] = stripslashes(""); // Inclure les logs de la page Index/Accueil
$configlog[2] = stripslashes(""); // Inclure les logs de la page Nouvelles
$configlog[3] = stripslashes(""); // Inclure les logs de la page Photos
$configlog[4] = stripslashes(""); // Inclure les logs de la page Liens
$configlog[5] = stripslashes(""); // Inclure les logs de la page Téléchargement
$configlog[6] = stripslashes(""); // Inclure les logs de la page Livre d'or
$configlog[7] = stripslashes(""); // Inclure les logs de la page FAQ
$configlog[8] = stripslashes(""); // Inclure les logs de la page Forum
$configlog[9] = stripslashes(""); // Inclure les logs de la page Stats
$configlog[10] = stripslashes(""); // Inclure les logs de la page Admin
$members[0] = stripslashes("on"); // Activation de la zone membres
$members[1] = stripslashes(""); // Zone membre accès à la section Articles
$members[2] = stripslashes("on"); // Zone membre accès à la section Photo
$members[3] = stripslashes(""); // Zone membre accès à la section Liens
$members[4] = stripslashes(""); // Zone membre accès à la section FAQ
$members[5] = stripslashes(""); // Zone membre accès à la section Forum
$members[6] = stripslashes("on"); // Zone membre accès à la section Statistiques
$members[7] = stripslashes("on"); // Zone membre accès à la section Téléchargement
$members[8] = stripslashes(""); // Zone membre accès publication Nouvelles
$members[9] = stripslashes(""); // Zone membre accès publication Livre d'Or
$members[10] = stripslashes("on"); // Zone membre accès publication Forum
$members[11] = stripslashes(""); // Zone membre accès publication Reactions aux articles
$members[12] = stripslashes(""); // Zone membre accès à la section Livre d'Or
$members[13] = stripslashes(""); // Zone membre accès à la section Nouvelles
$members[14] = stripslashes(""); // Zone membre accès à la section Agenda
?>
/*
Functions - GuppY PHP Script - version 4.5
CeCILL Copyright (C) 2004-2005 by Laurent Duveau
Initiated by Laurent Duveau and Nicolas Alves,
followed by Albert Aymard, Jean Michel Misrachi and all the Team
Web site = http://www.freeguppy.org/
e-mail = info@aldweb.com
Version History :
v1.0 (30 December 2002) : initial release
v1.1 (02 January 2003) : added AppendDBFields() function
replaced WriteDBFields() by AppendDBFields() where appropriate
(in order to avoid overwrites when more users perform "add" simultaneously)
v1.2 (05 January 2003) : created database art.dtb for quicker display
this new database is managed by the UpdateDBart() function => see update v1.7
created databases thread.dtb and forum.dtb for quicker display of forum threads
these new databases are managed by the UpdateDBforum() function
v1.3 (06 January 2003) : moved InitDBlog() function from log.inc
added eMailTo() function
v1.4 (07 January 2003) : introduced logh.dtb for not loosing all of logd.dtb data
in case of accidental erasal of logd.dtb file
v1.5 (10 January 2003) : no change
v1.6 (23 January 2003) : added option to hide on the site the e-mail address of poster
that is insertion of a new field ($fieldd1) in database and
update in UpdateDBforum() and ActionOnFields() functions
added StartTimer() and StopTimer() functions
v1.7 (28 January 2003) : updated the eMailTo() function to add destination e-mail for recommend to a friend option
created databases links.dtb and dnload.dtb files for category sorting of links and downloads
these new databases (and art.dtb) are managed by the UpdateDBdtb() function
insertion of a new field ($fieldd2) in database
migrated news.dat management from admin.inc and upgraded it
v1.8 (05 February 2003) : added category for forum
that is update in UpdateDBforum() function
v1.9 (11 February 2003) : moved make_seed() function (renamed as MakeSeed) from boxcita.inc (also used by
the new boxban.inc banner management)
v2.0 (27 February 2003) : added advanced photo service, that is ActionOnFields() function small update
added BreakEMail() function
v2.1 (10 March 2003) : no change
v2.2 (22 April 2003) : added INCREP variable (needed for boxes free positionning)
updated UpdateDBdtb() function for left and right articles boxes management
upgraded CompteVisites() function to have it compliant to the GuppY DB
added bmp type in IsImage() function
updated souriez array definition for management of smileys themes
added DrawSmileys() function
cleanup in the images organization (Smileys)
v2.3 (27 July 2003) : replaced mtitre class by titre class in htable1()
background of central boxes also change color according to mouse move in htable()
removed link on counters numbers in counter box in the AfficheCompteur() function
added US date format management
modified DrawSmileys() function
added PathToImage() function
added $ special character management in PutHR()
v2.4 (24 September 2003) : upgraded CompteVisites() function to capture user pseudo of registered users
added SplitText() function
added react to an article option , that is new UpdateDBreact() function
slightly upgraded the FileSizeInKb() function
upgraded eMailTo() function to accept additional specific e-mailing according to webhosters
added ReadDoc() and WriteDoc() functions and upgraded all required functions accordingly
added ReadDocCounter(), WriteDocCounter() and UpdateDocCounter() functions
created many new $d[something] variables and upgraded all required functions accordingly
added GetCurrentDateTime(), FormatDate() and FormatDateStamp() functions to ease various date and time formatings
reviewed all Files Read & Write functions
added lookup for png and bmp images in IsImage() function
added FileDBExist() and DestroyDBFile() functions
added RemoveQuote() function
added 3 additional free boxes (by Nicolas Alves and Laurent Duveau)
created $typ_[name] variables and updated all scripts & functions accordingly
upgraded forum indexes for a smaller size
moved DejaVote() function from poll.php to functions.php (now also used for documents counters)
and upgraded CompteVisites() function accordingly
v3.0 (25 February 2004) : added CheckDB1Field(), CheckDB2Fields(), CountDBFields(), DeleteDBFieldById(), CutLongWords() and WrapLongWords() functions
added GenerateUID() and KeepGoodChars() function
modified ReadDoc() and ReadDocCounter() functions to take into account new forum archiving module, upgraded in all scripts accordingly
news are now published in the RSS standard Web content syndication format instead of a GuppY specific format
v4.0 (06 December 2004) : added new function Drawsmileys2() for new wywiwyg editors (by Icare)
added new items and updated write and read functions for planner management (by Nicolas Alves)
added new items and updated write and read functions for mails forum management (by Nicolas Alves)
added name of smiley in souriez (by Icare)
corrected PathToImage() (by Icare)
added mail $eFrom (webmaster e-mail) in eMailTo function to prevent ineffective mail
and added Content-Type to prevent excessive xmailer tags in the message (by Icare)
v4.5 (07 June 2005) : corrected function readDoc(),
conversion of "constant" variables in constants PHP,
added IsFlash(), compare_XXX(), MakeRadioGroup() and GetNavBar() (by Jean-Mi)
updated eMailTo, added optimized eMailHtmlTo (by JeanMi and Icare)
*/
if (stristr($_SERVER["SCRIPT_NAME"], "functions.php")) {
header("location:../index.php");
die();
}
define("CONNECTOR", "||");
define("TYP_ART", "ar");
define("TYP_BANNER", "ba");
define("TYP_DNLOAD", "dn");
define("TYP_FAQ", "fa");
define("TYP_FOOTER", "ft");
define("TYP_FORUM", "fr");
define("TYP_THREAD", "frth");
define("TYP_FREEBOX1", "f1");
define("TYP_FREEBOX2", "f2");
define("TYP_FREEBOX3", "f3");
define("TYP_FREEBOX4", "f4");
define("TYP_GUESTBK", "gb");
define("TYP_HOMEPG", "ed");
define("TYP_LINKS", "li");
define("TYP_MAIL", "ma");
define("TYP_NEWS", "ne");
define("TYP_NWL", "nl");
define("TYP_PHOTO", "ph");
define("TYP_REACT", "ra");
define("TYP_RECO", "re");
define("TYP_RSS", "rs");
define("TYP_SPECIAL", "sp");
define("TYP_THINK", "ci");
define("TYP_AGENDA", "ag");
define("DATAREP", "data/");
define("ARCHREP", CHEMIN.DATAREP."archive/");
define("CACHEREP", CHEMIN.DATAREP."cache/");
define("USEREP", CHEMIN.DATAREP."usermsg/");
define("FILECOUNTMSG", CHEMIN.DATAREP."countmsg/");
define("REDACREP", "redac/");
define("INCREP", "inc/");
define("DBEXT", ".dtb");
define("INCEXT", ".inc");
define("DBBASE", CHEMIN.DATAREP."doc");
define("DBIPBASE", CHEMIN.DATAREP."ipdoc");
define("DBPLUGIN", CHEMIN.DATAREP."plugin".DBEXT);
define("CONFIG", CHEMIN.DATAREP."config".INCEXT);
define("NEXTID", CHEMIN.DATAREP."nextid".DBEXT);
define("NEXTIDBK", CHEMIN.DATAREP."nextidbk".DBEXT);
define("DOCID", CHEMIN.DATAREP."docid".DBEXT);
define("DBNEWSLETTER", CHEMIN.DATAREP."nwlist".DBEXT);
define("DBNEWS", CHEMIN.DATAREP."news");
define("DBLOGBOOK", CHEMIN.DATAREP."logbook".DBEXT);
define("DBAGENDA", CHEMIN.DATAREP.TYP_AGENDA.DBEXT);
define("DBART", CHEMIN.DATAREP.TYP_ART.DBEXT);
define("DBDNLOAD", CHEMIN.DATAREP.TYP_DNLOAD.DBEXT);
define("DBFAQ", CHEMIN.DATAREP.TYP_FAQ.DBEXT);
define("DBFORUMCAT", CHEMIN.DATAREP.TYP_FORUM."cat".DBEXT);
define("DBFORUM", CHEMIN.DATAREP.TYP_FORUM.DBEXT);
define("DBFORUMCOUNTER", CHEMIN.DATAREP.TYP_FORUM."count".DBEXT);
define("DBTHREAD", CHEMIN.DATAREP.TYP_THREAD.DBEXT);
define("DBFORUMARCHDATE", ARCHREP.TYP_FORUM."arch".DBEXT);
define("DBFORUMARCH", ARCHREP.TYP_FORUM.DBEXT);
define("DBTHREADARCH", ARCHREP.TYP_THREAD.DBEXT);
define("DBLINKS", CHEMIN.DATAREP.TYP_LINKS.DBEXT);
define("DBPHOTO", CHEMIN.DATAREP.TYP_PHOTO.DBEXT);
define("DBPOLL", CHEMIN.DATAREP."poll".DBEXT);
define("DBIPPOLL", CHEMIN.DATAREP."ippoll".DBEXT);
define("DBREACT", CHEMIN.DATAREP.TYP_REACT.DBEXT);
define("DBRSS", CHEMIN.DATAREP.TYP_RSS.DBEXT);
define("DBCOUNTER", CHEMIN.DATAREP."counter".DBEXT);
define("DBSTATS", CHEMIN.DATAREP."stats".DBEXT);
define("DBSTATSBK", CHEMIN.DATAREP."statsbk".DBEXT);
define("DBIPSTATS", CHEMIN.DATAREP."ipstats".DBEXT);
define("DBLOGH", CHEMIN.DATAREP."logh".DBEXT);
define("DBLOGD", CHEMIN.DATAREP."logd".DBEXT);
define("DBLOGM", CHEMIN.DATAREP."logm".DBEXT);
define("DBLOGY", CHEMIN.DATAREP."logy".DBEXT);
define("DBLOGP", CHEMIN.DATAREP."logp".DBEXT);
define("DBLOGDATE", CHEMIN.DATAREP."log_date".DBEXT);
define("DBLOGFILES", CHEMIN.DATAREP."log_files".DBEXT);
define("DBLOGSTATS", CHEMIN.DATAREP."log_stats".DBEXT);
define("DBHOMEPAGE", CHEMIN.DATAREP.TYP_HOMEPG.INCEXT);
define("DBFOOT", CHEMIN.DATAREP.TYP_FOOTER.INCEXT);
define("DBSPECIAL", CHEMIN.DATAREP.TYP_SPECIAL.INCEXT);
define("DBFREEBOX1", CHEMIN.DATAREP.TYP_FREEBOX1.INCEXT);
define("DBFREEBOX2", CHEMIN.DATAREP.TYP_FREEBOX2.INCEXT);
define("DBFREEBOX3", CHEMIN.DATAREP.TYP_FREEBOX3.INCEXT);
define("DBFREEBOX4", CHEMIN.DATAREP.TYP_FREEBOX4.INCEXT);
define("DBANTISPAM", CHEMIN.DATAREP."antispam".DBEXT);
define("HIT_TIME", 1800);
define('ANTISPAM_COUNT', 100);
define('ANTISPAM_DELAY', 30);
$couleurs = array("bleu", "jaune", "marron", "or", "orange", "outremer", "rose", "rouge", "vert", "violet");
$souriez = array(
array("|:-)", "inc/img/smileys/cool.gif", "cool"),
array(";-)", "inc/img/smileys/wink.gif", "wink"),
array(":-))", "inc/img/smileys/biggrin.gif", "biggrin"),
array(":-)", "inc/img/smileys/smile.gif", "smile"),
array(":-o", "inc/img/smileys/frown.gif", "frown"),
array(":o)", "inc/img/smileys/eek.gif", "eek"),
array(":-((", "inc/img/smileys/mad.gif", "mad"),
array(":-(", "inc/img/smileys/confused.gif", "confused"),
array("8-)", "inc/img/smileys/rolleyes.gif", "rolleyes"),
array(":-p", "inc/img/smileys/tongue.gif", "tongue"),
array(";-(", "inc/img/smileys/cry.gif", "cry")
);
function souriez($chaine) {
global $souriez;
$traite = str_replace($souriez[0][0], "", $chaine);
$traite = str_replace($souriez[1][0], "", $traite);
$traite = str_replace($souriez[2][0], "", $traite);
$traite = str_replace($souriez[3][0], "", $traite);
$traite = str_replace($souriez[4][0], "", $traite);
$traite = str_replace($souriez[5][0], "", $traite);
$traite = str_replace($souriez[6][0], "", $traite);
$traite = str_replace($souriez[7][0], "", $traite);
$traite = str_replace($souriez[8][0], "", $traite);
$traite = str_replace($souriez[9][0], "", $traite);
$traite = str_replace($souriez[10][0], "", $traite);
return $traite;
}
function replaceimg($chaine) {
global $souriez,$site;
$traite = str_replace($souriez[0][0],"", $chaine);
$traite = str_replace($souriez[1][0],"", $traite);
$traite = str_replace($souriez[2][0],"", $traite);
$traite = str_replace($souriez[3][0],"", $traite);
$traite = str_replace($souriez[4][0],"", $traite);
$traite = str_replace($souriez[5][0],"", $traite);
$traite = str_replace($souriez[6][0],"", $traite);
$traite = str_replace($souriez[7][0],"", $traite);
$traite = str_replace($souriez[8][0],"", $traite);
$traite = str_replace($souriez[9][0],"", $traite);
$traite = str_replace($souriez[10][0],"", $traite);
return $traite;
}
function DrawSmileys($num) {
global $souriez;
for ($i = 0; $i < count($souriez); $i++) {
echo " ";
}
}
function DrawSmileys2() {
global $souriez;
echo " ";
for ($i = 0; $i < count($souriez); $i++) {
echo " ";
}
}
function AfficheCompteur($chemino, $hits, $grow = 1) {
$spot = "";
for ($lecon = 0; $lecon < $grow - strlen($hits); $lecon++ ) {
$spot .= "";
}
for ($lecon = 0; $lecon < strlen($hits); $lecon++) {
$cols = substr($hits, $lecon, 1);
$spot .= "";
}
echo $spot;
}
function DejaVote($file_ip, $d_time = 0) {
global $REMOTE_ADDR, $userprefs;
$remoteadr = $REMOTE_ADDR;
$nbr_connect = 0;
$var_bool = false;
$user_bool = false;
$subdata = array();
$var_ip = array();
$k = 0;
if ($d_time == 0) {
$d_time = HIT_TIME;
}
$subdata = ReadDBFields($file_ip);
$now_time = time();
for ($i = 0; $i < count($subdata); $i++) {
list($jour, $mois, $annee) = explode("/", substr($subdata[$i][1], 0, 10));
list($heure, $minute, $seconde) = explode(":", substr($subdata[$i][1], 10, 18));
if ($now_time < mktime($heure, $minute, $seconde, $mois, $jour, $annee) + $d_time) {
$nbr_connect++;
$var_ip[$k][0] = $subdata[$i][0];
if ($remoteadr == $subdata[$i][0]) {
$var_bool = true;
}
$var_ip[$k][1] = $subdata[$i][1];
if ($userprefs[5] != "") {
$uprefname = $userprefs[1];
}
else {
$uprefname = "";
}
if ($remoteadr == $subdata[$i][0] && $uprefname != $subdata[$i][2]) {
$user_bool = true;
$var_ip[$k][2] = $uprefname;
}
else {
$var_ip[$k][2] = $subdata[$i][2];
}
$k++;
}
}
if (!$var_bool) {
$var_ip[$k][0] = $remoteadr;
$var_ip[$k][1] = date("d/m/Y H:i:s");
$var_ip[$k][2] = $userprefs[1];
WriteDBFields($file_ip,$var_ip);
$nbr_connect++;
}
elseif ($user_bool) {
WriteDBFields($file_ip,$var_ip);
}
$retcmpt[0] = $var_bool;
$retcmpt[1] = $nbr_connect;
return $retcmpt;
}
function CompteVisites($file_ip, $file_counter) {
$subdata = DejaVote($file_ip);
$nbr_visit = ReadCounter($file_counter);
if (!$subdata[0] && ($nbr_visit > 0)) {
$nbr_visit++;
WriteCounter($file_counter,$nbr_visit);
}
$retcmpt[0] = $nbr_visit;
$retcmpt[1] = $subdata[1];
return $retcmpt;
}
function IsImage($extn) {
$imgok = 0;
$extn = strtolower($extn);
if ($extn == "gif" || $extn == "jpg" || $extn == "jpeg" || $extn == "png" || $extn == "bmp") {
$imgok = 1;
}
return $imgok;
}
function IsFlash($extn) {
$imgok = 0;
$extn = strtolower($extn);
if ($extn == "swf") {
$imgok = 1;
}
return $imgok;
}
function ExtImage($extn){
$extn = strtolower($extn);
if ($extn == "js"){ return "js"; }
if ($extn == "css"){ return "css"; }
if ($extn == "php"){ return "php"; }
if ($extn == "php3"){ return "php"; }
if ($extn == "htm"){ return "html"; }
if ($extn == "html"){ return "html"; }
if ($extn == "phtml"){ return "php"; }
if ($extn == "gif"){ return "gif"; }
if ($extn == "jpg"){ return "jpg"; }
if ($extn == "png"){ return "png"; }
if ($extn == "bmp"){ return "bmp"; }
if ($extn == "jpeg"){ return "jpg"; }
if ($extn == "gz"){ return "zip"; }
if ($extn == "cab"){ return "zip"; }
if ($extn == "zip"){ return "zip"; }
if ($extn == "ace"){ return "zip"; }
if ($extn == "tgz"){ return "zip"; }
if ($extn == "tar"){ return "zip"; }
if ($extn == "rar"){ return "zip"; }
if ($extn == "wav"){ return "wav"; }
if ($extn == "mid"){ return "mid"; }
if ($extn == "mp3"){ return "mp3"; }
if ($extn == "exe"){ return "exe"; }
if ($extn == "bat"){ return "bat"; }
if ($extn == "com"){ return "com"; }
if ($extn == "pif"){ return "com"; }
if ($extn == "mov"){ return "wav"; }
if ($extn == "avi"){ return "wav"; }
if ($extn == "mpg"){ return "wav"; }
if ($extn == "swf"){ return "swf"; }
if ($extn == "mpeg"){ return "wav"; }
if ($extn == "txt"){ return "txt"; }
if ($extn == "nfo"){ return "txt"; }
return "inconnu";
}
function PathAbs($matches) {
if(!preg_match("`^(https?|ftp|mailto|javascript)\://`i", $matches[3])) {
$matches[0] = $matches[1].$matches[2].CHEMIN.$matches[3];
}
return $matches[0];
}
function PathToImage($text) {
return preg_replace_callback("`( href=|src=)(\"|')?([^ >]+)`i", 'PathAbs', $text);
}
function SplitText($textin,$textlen) {
$textout = array();
$out1 = $textin;
$out2 = "";
if (strlen($textin) > $textlen) {
$tempout = strrpos(substr($textin,0,$textlen)," ");
if ($tempout < 1) {
$tempout = strpos($textin," ");
}
if ($tempout > 0) {
$out1 = substr($textin,0,$tempout);
$out2 = substr($textin,$tempout+1,strlen($textin)-$tempout);
}
}
$textout[0] = $out1;
$textout[1] = $out2;
return $textout;
}
function CutLongWord($textin,$textlen=50) {
$textout = substr($textin,0,$textlen);
return $textout;
}
function WrapLongWords($textin,$textlen=50,$textrep=" ") {
$textout = wordwrap($textin,$textlen,$textrep,1);
return $textout;
}
function FormatDateStamp($datein) {
global $site;
if ($site[19] == "E1") {
$formatout = "d/m/Y";
}
elseif ($site[19] == "E2") {
$formatout = "d.m.Y";
}
elseif ($site[19] == "U1") {
$formatout = "m/d/Y";
}
elseif ($site[19] == "U2") {
$formatout = "m.d.Y";
}
elseif ($site[19] == "C1") {
$formatout = "Y/m/d";
}
else {
$formatout = "Y.m.d";
}
$formatout .= " ".$site[23]." ";
if ($site[22] == "H1") {
$formatout .= "H:i";
}
elseif ($site[22] == "H2") {
$formatout .= "H\hi";
}
else {
$formatout .= "h:i A";
}
$dateout = date($formatout,$datein);
return $dateout;
}
function FormatDate($datein) {
global $site;
$jour = substr($datein,6,2);
$mois = substr($datein,4,2);
$annee = substr($datein,0,4);
$heure = substr($datein,8,2);
$minute = substr($datein,10,2);
if ($site[19] == "E1") {
$dateout = $jour."/".$mois."/".$annee;
}
elseif ($site[19] == "E2") {
$dateout = $jour.".".$mois.".".$annee;
}
elseif ($site[19] == "U1") {
$dateout = $mois."/".$jour."/".$annee;
}
elseif ($site[19] == "U2") {
$dateout = $mois.".".$jour.".".$annee;
}
elseif ($site[19] == "C1") {
$dateout = $annee."/".$mois."/".$jour;
}
else {
$dateout = $annee.".".$mois.".".$jour;
}
$dateout .= " ".$site[23]." ";
if ($site[22] == "H1") {
$dateout .= $heure.":".$minute;
}
elseif ($site[22] == "H2") {
$dateout .= $heure."h".$minute;
}
else {
if ($heure < 12) {
$dateout .= $heure.":".$minute." AM";
}
else {
$dateout .= ($heure-12).":".$minute." PM";
}
}
return $dateout;
}
function GetCurrentDateTime() {
$dateout = date("YmdHi");
return $dateout;
}
function FileSizeInKb($fic) {
$taille=@filesize($fic);
if ($taille !== false) {
$taille = round($taille/1024);
}
return $taille;
}
function FileDBExist($fic) {
$filetest = is_file($fic);
return $filetest;
}
function DestroyDBFile($fic) {
@chmod($fic,0755);
@chmod($fic,0777);
@unlink($fic);
}
function ReadCounter($fic) {
$DataDB = 0;
if (FileDBExist($fic)) {
$fhandle = fopen($fic, "r");
if (filesize($fic)) {
$DataDB = trim(fgets($fhandle, filesize($fic)));
}
fclose($fhandle);
}
return $DataDB;
}
function WriteCounter($fic,$DataDB) {
$fhandle = fopen($fic, "w");
fputs($fhandle, $DataDB."\n");
fclose($fhandle);
}
function ReadFullDB($fic) {
$DataDB = Array();
if (FileDBExist($fic)) {
$DataDB = implode("", file($fic));
}
return $DataDB;
}
function WriteFullDB($fic,$DataDB) {
$fhandle = fopen($fic, "w");
fputs($fhandle, $DataDB);
fclose($fhandle);
}
function AppendFullDB($fic,$DataDB) {
$fhandle = fopen($fic, "a");
fputs($fhandle, $DataDB);
fclose($fhandle);
}
function CountDBFields($fic) {
$DataNB = 0;
if (FileDBExist($fic)) {
$DataDB = file($fic);
$DataNB = count($DataDB);
}
return $DataNB;
}
function ReadDBFields($fic) {
$DataDB = array();
$Fields = array();
if (FileDBExist($fic)) {
$DataDB = file($fic);
for ($i = 0; $i < count($DataDB); $i++) {
$Fields[$i] = explode(CONNECTOR,trim($DataDB[$i]));
}
}
return $Fields;
}
function WriteDBFields($fic,$Fields) {
$fhandle = fopen($fic, "w");
$DataDB = "";
for ($i = 0; $i < count($Fields); $i++) {
for ($j = 0 ; $j < (count($Fields[$i])-1); $j++) {
$DataDB .= trim($Fields[$i][$j]).CONNECTOR;
}
$DataDB .= trim($Fields[$i][count($Fields[$i])-1])."\n";
}
fputs($fhandle, $DataDB);
fclose($fhandle);
}
function AppendDBFields($fic,$Fields) {
$fhandle = fopen($fic, "a");
$DataDB = "";
for ($i = 0 ; $i < (count($Fields)-1); $i++) {
$DataDB .= trim($Fields[$i]).CONNECTOR;
}
$DataDB .= trim($Fields[count($Fields)-1])."\n";
fputs($fhandle, $DataDB);
fclose($fhandle);
}
function DeleteDBFieldById($fic, $id=0) {
$array = explode("\n", fread(fopen($fic, "r"), filesize($fic)));
$delete = array_pop($array);
unset($array[$id]);
$newarray = array_values($array);
$fhandle = fopen($fic,"w");
for($i=0; $i< count($newarray); $i++){
fwrite($fhandle,$newarray[$i]."\n");
}
fclose($fhandle);
}
function CheckDB1Field($fic,$submit,$FieldNB) {
$controle = False;
if (FileDBExist($fic)) {
$DataDB = ReadDBFields($fic);
for ($i = 0; $i < count($DataDB); $i++) {
if (@stristr($DataDB[$i][$FieldNB],$submit)) {
$controle = True;
}
}
}
return $controle;
}
function CheckDB2Fields($fic,$submit1,$FieldNB1,$submit2,$FieldNB2) {
$controle = False;
if (FileDBExist($fic)) {
$DataDB = ReadDBFields($fic);
for ($i = 0; $i < count($DataDB); $i++) {
if (@stristr($DataDB[$i][$FieldNB1],$submit1) && @stristr($DataDB[$i][$FieldNB2],$submit2)) {
$controle = True;
}
}
}
return $controle;
}
function SelectDBFieldsByID($Fields,$id) {
$DataDB = array();
$k = 0;
for ($i = 0; $i < count($Fields); $i++) {
if ($Fields[$i][1] == $id) {
for ($j = 0 ; $j < count($Fields[$i]); $j++) {
$DataDB[$k][$j] = $Fields[$i][$j];
}
$k++;
}
}
return $DataDB;
}
function SelectDBFieldsByType($Fields,$type) {
$DataDB = array();
$k = 0;
for ($i = 0; $i < count($Fields); $i++) {
if ($Fields[$i][0] == $type) {
for ($j = 0 ; $j < count($Fields[$i]); $j++) {
$DataDB[$k][$j] = $Fields[$i][$j];
}
$k++;
}
}
return $DataDB;
}
function SelectDBFieldsByNotStatus($Fields,$status) {
$DataDB = array();
$k = 0;
for ($i = 0; $i < count($Fields); $i++) {
if ($Fields[$i][2] != $status) {
for ($j = 0 ; $j < count($Fields[$i]); $j++) {
$DataDB[$k][$j] = $Fields[$i][$j];
}
$k++;
}
}
return $DataDB;
}
function SelectDBFieldsByStatus($Fields,$status) {
$DataDB = array();
$k = 0;
for ($i = 0; $i < count($Fields); $i++) {
if ($Fields[$i][2] == $status) {
for ($j = 0 ; $j < count($Fields[$i]); $j++) {
$DataDB[$k][$j] = $Fields[$i][$j];
}
$k++;
}
}
return $DataDB;
}
function SelectDBFields($type,$status,$id) {
$DataDB = array();
if (!empty($status) && !empty($id)) {
$DataDB = SelectDBFieldsByID(SelectDBFieldsByStatus(SelectDBFieldsByType(ReadDBFields(DOCID),$type),$status),$id);
}
elseif (!empty($status)) {
$DataDB = SelectDBFieldsByStatus(SelectDBFieldsByType(ReadDBFields(DOCID),$type),$status);
}
elseif (!empty($id)) {
$DataDB = SelectDBFieldsByID(SelectDBFieldsByType(ReadDBFields(DOCID),$type),$id);
}
else {
$DataDB = SelectDBFieldsByType(ReadDBFields(DOCID),$type);
}
return $DataDB;
}
function RemoveQuote($chaine) {
$traite = str_replace("'", "", $chaine);
return $traite;
}
function RemoveConnector($chaine) {
$traite = str_replace(CONNECTOR, "", $chaine);
return $traite;
}
function RemoveBR($chaine) {
$traite = eregi_replace("
", "\n", $chaine);
return $traite;
}
function PutBR($chaine) {
$traite = str_replace(chr(10),"
",$chaine);
$traite = str_replace(chr(13),"",$traite);
return $traite;
}
function RemoveHR($chaine) {
$traite = str_replace("
", "
", $chaine);
$traite = str_replace("$","$",$traite);
return $traite;
}
function ReadDocCounter($dirid) {
$DataDB = ReadCounter($dirid.DBEXT);
return $DataDB;
}
function WriteDocCounter($dirid,$DataDB) {
WriteCounter($dirid.DBEXT,$DataDB);
}
function UpdateDocCounter($id) {
$DataDB = ReadDocCounter(DBBASE.$id);
$vote = DejaVote(DBIPBASE.$id.DBEXT,300);
if ($vote[0] == false) {
$DataDB++;
WriteDocCounter(DBBASE.$id,$DataDB);
}
return $DataDB;
}
function ReadDoc($dirid) {
global $type,$fileid,$status,$creadate,$moddate,$author,$email,
$fielda1,$fielda2,$fieldb1,$fieldb2,$fieldc1,$fieldc2,$fieldd1,$fieldd2,$fieldweb,$fieldmail;
$type = "";
$fileid = "";
$status = "";
$creadate = "";
$moddate = "";
$author = "";
$email = "";
$fielda1 = "";
$fielda2 = "";
$fieldb1 = "";
$fieldb2 = "";
$fieldc1 = "";
$fieldc2 = "";
$fieldd1 = "";
$fieldd2 = "";
$fieldweb = "";
$fieldmail = "";
if (FileDBExist($dirid.INCEXT)) {
include($dirid.INCEXT);
}
}
function WriteDoc() {
global $type,$fileid,$status,$creadate,$moddate,$author,$email,
$fielda1,$fielda2,$fieldb1,$fieldb2,$fieldc1,$fieldc2,$fieldd1,$fieldd2,$fieldweb,$fieldmail;
$rec = "
\$type = \"$type\";
\$fileid = \"$fileid\";
\$status = \"$status\";
\$creadate = \"$creadate\";
\$moddate = \"$moddate\";
\$author = stripslashes(\"$author\");
\$email = stripslashes(\"$email\");
\$fielda1 = stripslashes(\"$fielda1\");
\$fielda2 = stripslashes(\"$fielda2\");
\$fieldb1 = stripslashes(\"$fieldb1\");
\$fieldb2 = stripslashes(\"$fieldb2\");
\$fieldc1 = stripslashes(\"$fieldc1\");
\$fieldc2 = stripslashes(\"$fieldc2\");
\$fieldd1 = stripslashes(\"$fieldd1\");
\$fieldd2 = stripslashes(\"$fieldd2\");
\$fieldweb = stripslashes(\"$fieldweb\");
\$fieldmail = stripslashes(\"$fieldmail\");
?>"; ?>
WriteFullDB(DBBASE.$fileid.INCEXT,$rec);
}
function UpdateDBdtb($dtb) {
global $type,$fileid,$status,$creadate,$moddate,$author,$email,
$fielda1,$fielda2,$fieldb1,$fieldb2,$fieldc1,$fieldc2,$fieldd1,$fieldd2,$fieldweb,$fieldmail;
$db = SelectDBFields($dtb,"a","");
$dba = array();
$j = 0;
for ($i = 0; $i < count($db); $i++) {
ReadDoc(DBBASE.$db[$i][1]);
if (!($dtb == TYP_ART && trim($fielda1).trim($fielda2) == "")) {
$dba[$j][0] = RemoveConnector($fielda1);
$dba[$j][1] = RemoveConnector($fielda2);
$dba[$j][2] = RemoveConnector($fieldb1);
$dba[$j][3] = RemoveConnector($fieldb2);
$dba[$j][4] = $fileid;
if ($dtb == TYP_ART) {
$dba[$j][5] = RemoveConnector($fieldd1);
}
$j++;
}
}
WriteDBFields(CHEMIN.DATAREP.$dtb.DBEXT,$dba);
}
function UpdateDBreact($action,$id) {
global $type,$fileid,$status,$creadate,$moddate,$author,$email,
$fielda1,$fielda2,$fieldb1,$fieldb2,$fieldc1,$fieldc2,$fieldd1,$fieldd2,$fieldweb,$fieldmail;
$db = array();
if ($action == "add") {
ReadDoc(DBBASE.$id);
$db[0] = $fileid;
$db[1] = $fielda2;
AppendDBFields(DBREACT,$db);
}
else {
$db = SelectDBFields(TYP_REACT,"a","");
sort($db);
$dbf = array();
for ($i = 0; $i < count($db); $i++) {
ReadDoc(DBBASE.$db[$i][1]);
$dbf[$i][0] = $fileid;
$dbf[$i][1] = $fielda2;
}
WriteDBFields(DBREACT,$dbf);
}
}
function UpdateDBforum($action,$id) {
global $site,$type,$fileid,$status,$creadate,$moddate,$author,$email,
$fielda1,$fielda2,$fieldb1,$fieldb2,$fieldc1,$fieldc2,$fieldd1,$fieldd2,$fieldweb,$fieldmail;
$db = array();
if ($action == "add") {
ReadDoc(DBBASE.$id);
$db[0] = $creadate;
$db[1] = $fielda1;
$db[2] = $fielda2;
$db[3] = $fileid;
$db[4] = RemoveConnector($author);
$db[5] = RemoveConnector($email);
$db[6] = RemoveConnector($fieldb1);
$db[7] = $fieldd1;
$db[8] = $fieldb2;
$db[9] = $fieldmail;
AppendDBFields(DBTHREAD,$db);
}
else {
$db = SelectDBFields(TYP_FORUM,"a","");
sort($db);
$dbf = array();
for ($i = 0; $i < count($db); $i++) {
ReadDoc(DBBASE.$db[$i][1]);
$dbf[$i][0] = $creadate;
$dbf[$i][1] = $fielda1;
$dbf[$i][2] = $fielda2;
$dbf[$i][3] = $fileid;
$dbf[$i][4] = RemoveConnector($author);
$dbf[$i][5] = RemoveConnector($email);
$dbf[$i][6] = RemoveConnector($fieldb1);
$dbf[$i][7] = $fieldd1;
$dbf[$i][8] = $fieldb2;
$dbf[$i][9] = $fieldmail;
}
@sort($dbf,SORT_REGULAR);
WriteDBFields(DBTHREAD,$dbf);
}
$db = array();
$db = ReadDBFields(DBTHREAD);
$dbf = array();
$j = 0;
for ($i = 0; $i < count($db); $i++) {
if ($db[$i][2] == "0") {
$dbf[$j][0] = $db[$i][0];
$dbf[$j][1] = $db[$i][1];
$dbf[$j][2] = $db[$i][3];
$dbf[$j][3] = $db[$i][4];
$dbf[$j][4] = $db[$i][5];
$dbf[$j][5] = $db[$i][6];
$dbf[$j][6] = $db[$i][0];
$dbf[$j][7] = 0;
$dbf[$j][8] = "";
$dbf[$j][9] = "";
$dbf[$j][10] = $db[$i][7];
$dbf[$j][11] = "";
$dbf[$j][12] = $db[$i][8];
for ($k = $i+1; $k < count($db); $k++) {
if ($db[$k][1] == $dbf[$j][1]) {
$dbf[$j][0] = $db[$k][0];
$dbf[$j][7] = $dbf[$j][7]+1;
$dbf[$j][8] = $db[$k][4];
$dbf[$j][9] = $db[$k][5];
$dbf[$j][11] = $db[$k][7];
}
}
$j++;
}
}
@rsort($dbf,SORT_REGULAR);
WriteDBFields(DBFORUM,$dbf);
}
function ActionOnFields($action,$data) {
global $site,$type,$fileid,$status,$creadate,$moddate,$author,$email,
$fielda1,$fielda2,$fieldb1,$fieldb2,$fieldc1,$fieldc2,$fieldd1,$fieldd2,$fieldweb,$fieldmail;
if ($action == "del") {
$id = $data[1];
$db = ReadDBFields(DOCID);
for ($i = 0; $i < count($db); $i++) {
if ($db[$i][1] == $id) {
$db[$i][2] = "d";
}
}
WriteDBFields(DOCID,$db);
ReadDoc(DBBASE.$id);
$status = "d";
$author = addslashes($author);
$email = addslashes($email);
$fielda1 = addslashes($fielda1);
$fielda2 = addslashes($fielda2);
$fieldb1 = addslashes($fieldb1);
$fieldb2 = addslashes($fieldb2);
$fieldc1 = addslashes($fieldc1);
$fieldc2 = addslashes($fieldc2);
$fieldd1 = addslashes($fieldd1);
$fieldd2 = addslashes($fieldd2);
if($data[0] == TYP_FORUM ||$data[0] == TYP_THREAD) {
$fieldweb = addslashes($fieldweb);
$fieldmail = addslashes($fieldmail);
}
WriteDoc();
}
elseif ($action == "act") {
$id = $data[1];
$db = ReadDBFields(DOCID);
for ($i = 0; $i < count($db); $i++) {
if ($db[$i][1] == $id) {
$db[$i][2] = $data[2];
}
}
WriteDBFields(DOCID,$db);
ReadDoc(DBBASE.$id);
$status = $data[2];
$author = addslashes($author);
$email = addslashes($email);
$fielda1 = addslashes($fielda1);
$fielda2 = addslashes($fielda2);
$fieldb1 = addslashes($fieldb1);
$fieldb2 = addslashes($fieldb2);
$fieldc1 = addslashes($fieldc1);
$fieldc2 = addslashes($fieldc2);
$fieldd1 = addslashes($fieldd1);
$fieldd2 = addslashes($fieldd2);
if($data[0] == TYP_FORUM ||$data[0] == TYP_THREAD) {
$fieldweb = addslashes($fieldweb);
$fieldmail = addslashes($fieldmail);
}
WriteDoc();
}
elseif ($action == "add") {
$id = IncrNextID();
$db = array();
$db[0] = $data[0];
$db[1] = $id;
$db[2] = $data[2];
AppendDBFields(DOCID,$db);
$type = $data[0];
$fileid = $id;
$status = $data[2];
$creadate = GetCurrentDateTime();
$moddate = $creadate;
$author = addslashes(stripslashes($data[5]));
$email = addslashes(stripslashes($data[6]));
$fielda1 = addslashes(stripslashes($data[7]));
$fielda2 = addslashes(stripslashes($data[8]));
$fieldb1 = addslashes(stripslashes($data[9]));
$fieldb2 = addslashes(stripslashes($data[10]));
if ($data[0] == TYP_NWL) {
$fieldc1 = addslashes(stripslashes(replaceimg(PutHR(PutBR($data[11])))));
$fieldc2 = addslashes(stripslashes(replaceimg(PutHR(PutBR($data[12])))));
}
else {
$fieldc1 = addslashes(stripslashes(souriez(PutHR(PutBR($data[11])))));
$fieldc2 = addslashes(stripslashes(souriez(PutHR(PutBR($data[12])))));
}
$fieldd1 = addslashes(stripslashes($data[13]));
$fieldd2 = addslashes(stripslashes($data[14]));
if($data[0] == TYP_FORUM ||$data[0] == TYP_THREAD) {
$fieldweb = addslashes(stripslashes($data[15]));
$fieldmail=addslashes(stripslashes($data[16]));
}
WriteDoc();
}
elseif ($action == "mod") {
$id = $data[1];
ReadDoc(DBBASE.$id);
$moddate = GetCurrentDateTime();
$author = addslashes(stripslashes($data[5]));
$email = addslashes(stripslashes($data[6]));
$fielda1 = addslashes(stripslashes($data[7]));
$fielda2 = addslashes(stripslashes($data[8]));
$fieldb1 = addslashes(stripslashes($data[9]));
$fieldb2 = addslashes(stripslashes($data[10]));
if ($data[0] == TYP_NWL) {
$fieldc1 = addslashes(stripslashes(replaceimg(PutHR(PutBR($data[11])))));
$fieldc2 = addslashes(stripslashes(replaceimg(PutHR(PutBR($data[12])))));
}
else {
$fieldc1 = addslashes(stripslashes(souriez(PutHR(PutBR($data[11])))));
$fieldc2 = addslashes(stripslashes(souriez(PutHR(PutBR($data[12])))));
}
$fieldd1 = addslashes(stripslashes($data[13]));
$fieldd2 = addslashes(stripslashes($data[14]));
if($data[0] == TYP_FORUM ||$data[0] == TYP_THREAD) {
$fieldweb = addslashes(stripslashes($data[15]));
$fieldmail=addslashes(stripslashes($data[16]));
}
WriteDoc();
}
if ($data[0] == TYP_ART || $data[0] == TYP_LINKS || $data[0] == TYP_DNLOAD || $data[0] == TYP_PHOTO || $data[0] == TYP_FAQ || $data[0] == TYP_RSS || $data[0] == TYP_AGENDA) {
UpdateDBdtb($data[0]);
}
elseif ($data[0] == TYP_FORUM) {
UpdateDBforum($action,$id);
}
elseif ($data[0] == TYP_NEWS) {
include(CHEMIN.INCREP."funcrss.php");
UpdateDBnews();
}
elseif ($data[0] == TYP_REACT) {
UpdateDBreact($action,$id);
}
return $id;
}
function InitDBlog($typ) {
$db = array();
$db[0][0] = 0;
for ($i = 0; $i < 12; $i++) { $db[1][$i] = 0; }
for ($i = 0; $i < 2; $i++) { $db[2][$i] = 0; }
for ($i = 0; $i < 9; $i++) { $db[3][$i] = 0; }
for ($i = 0; $i < 10; $i++) { $db[4][$i] = 0; }
for ($i = 0; $i < $typ; $i++) { $db[5][$i] = 0; }
for ($i = 0; $i < $typ; $i++) { $db[6][$i] = 0; }
$db[7][0] = 1;
return $db;
}
function eMailTo($eSubject, $eMessage, $eTo) {
eMailHtmlTo($eSubject, "", $eTo, "", $eMessage);
}
function eMailHtmlTo($eSubject, $eMsgHtml, $eTo, $eFrom = "", $eMsgTxt = "") {
global $supervision, $user, $charset;
if (empty($eFrom)) {
$eFrom = trim($user[1]);
}
if ($eTo == "") {
$eTo = $eFrom;
}
if ($eMsgTxt == '')
$eMsgText = strip_tags(eregi_replace("
|
|
'; $out .= ' | '; } else { $out .= ' | '; $out .= ' | '; } $out .= ' | '; $nbpg = 1; $pgDebut = floor($currentPage / $decade) * $decade; $pgFin = ceil($currentPage / $decade) * $decade; if ($pgDebut == $pgFin) { $pgDebut = $pgFin - $decade; } if ($currentPage > $pgDebut && $currentPage <= $pgFin) { $decadeDebut = $pgDebut; $decadeFin = $pgFin; if ($nbPage >= $decadeFin) { $paq = $decade; } else{ $paq = $nbPage - $decadeDebut; } } if ($currentPage > $decade && $decadeDebut < $nbPage) { if ($nbPage - $decade + $decadeFin > $decade) { $nbPrevPage = $decade; } else { $nbPrevPage = $nbPage - $decade + $decadeFin; } if ($nbPrevPage > 1) { $txtPrevPage = $nbPrevPage." ".$web340; } else { $txtPrevPage = $nbPrevPage." ".$web341; } $out .= ''; } $out .= ' [ '; for($i = 1; $i <= $paq; $i++) { if ($i + $decadeDebut <> $currentPage) { $out .= ''.($nbpg + $decadeDebut).' '; } else { $out .= ''.($nbpg + $decadeDebut).' '; } $nbpg++; } $out .= '] '; if($currentPage <= $decadeFin && $decadeFin < $nbPage) { if($nbPage - $decade - $decadeDebut > $decade) { $nbSuivPage = $decade; } else { $nbSuivPage = $nbPage - $decade - $decadeDebut; } if ($nbSuivPage > 1) { $txtSuivPage = $nbSuivPage." ".$web337; } else { $txtSuivPage = $nbSuivPage." ".$web336; } $out .= ''; } $out .=' | '; if ($currentPage < $nbPage) { $out .= ''; $out .= ' | '; } else { $out .= ' | '; $out .= ' | '; } $out .= ' |