From 0a3c559a59f456c4b2ee40c89a18221b29fe29b9 Mon Sep 17 00:00:00 2001 From: n Date: Mon, 12 Feb 2024 20:46:07 +0100 Subject: [PATCH 1/3] PHP Coding Standards fixes --- 401.php | 6 +- 404.php | 2 +- 500.php | 2 +- config/path.php | 19 +- footer.php | 16 +- header.php | 24 +- include/body.inc.php | 1 - include/head.inc.php | 9 +- include/logo.inc.php | 14 +- include/note.inc.php | 8 +- include/random.inc.php | 49 ++-- include/standard.inc.php | 508 +++++++++++++++++----------------- include/theme.inc.php | 6 +- include/timer.inc.php | 96 +++---- index.php | 453 +++++++++++++++--------------- left.php | 10 +- modules/affimages.php | 2 - modules/goldbook.php | 108 ++++---- modules/liens.php | 122 ++++---- modules/magicbox.php | 95 ++++--- modules/print.php | 24 +- pages/131208.php | 12 +- pages/avallon2011.php | 40 +-- pages/carte/1.php | 8 +- pages/carte/2.php | 14 +- pages/carte/3.php | 6 +- pages/carte/4.php | 18 +- pages/carte/6.php | 4 +- pages/carte/7.php | 4 +- pages/carte/8.php | 16 +- pages/carte/marchandise.php | 12 +- pages/challenge2015.php | 12 +- pages/forum2017.php | 14 +- pages/im_reduit.php | 14 +- pages/im_reduit_ajax.php | 14 +- pages/im_reel.php | 26 +- pages/leclub.php | 16 +- pages/livre.php | 24 +- pages/lormes2011.php | 42 +-- pages/menu.php | 4 +- pages/modules/canal.php | 4 +- pages/modules/chateau.php | 6 +- pages/modules/chateaudeau.php | 4 +- pages/modules/ferme.php | 6 +- themes/default/theme.php | 2 +- 45 files changed, 938 insertions(+), 958 deletions(-) diff --git a/401.php b/401.php index 7a00a66..b2dbd09 100644 --- a/401.php +++ b/401.php @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/footer.php b/footer.php index 002065a..4a001ee 100644 --- a/footer.php +++ b/footer.php @@ -1,15 +1,18 @@
\n"; -if ($HTTP_GET_VARS["IFRANCE"] =="1") - echo "\n"; +if ($HTTP_GET_VARS["IFRANCE"] == "1") { + echo "\n"; +} echo " @@ -20,4 +23,3 @@ echo "
\n\nCe site utilise PHP5\n{=compt_puce_b}{=compt_puce_b}\n\nPowered by PIP\n
\n"; // echo "
retour au menu
"; -?> diff --git a/header.php b/header.php index 76ed0c9..0bc1e21 100644 --- a/header.php +++ b/header.php @@ -1,18 +1,18 @@
Hits
"; - //mysql_close($link); - //echo rand(10,10000000); - //echo " Hits
"; + + setlocale(LC_ALL, 'fr_FR'); +//$link = mysql_connect("localhost", "", "") +// or die("Could not connect"); +//$hits = mysql_query("SELECT COUNT(*) FROM visit.visiteurs",$link) +// or die("Invalid query"); +//echo strftime("%A %e %B %G | %R"); +//if ($hits) +// echo mysql_result($hits,0)." Hits
"; +//mysql_close($link); +//echo rand(10,10000000); +//echo " Hits
"; ?>
diff --git a/include/body.inc.php b/include/body.inc.php index e9714a1..8274878 100644 --- a/include/body.inc.php +++ b/include/body.inc.php @@ -18,4 +18,3 @@ $noir = "#000000"; $blanc = "#FFFFFF"; */ echo ""; -?> diff --git a/include/head.inc.php b/include/head.inc.php index 5ecf57e..14d94f9 100644 --- a/include/head.inc.php +++ b/include/head.inc.php @@ -2,10 +2,11 @@ diff --git a/include/logo.inc.php b/include/logo.inc.php index e9bedb0..6a2a3ab 100644 --- a/include/logo.inc.php +++ b/include/logo.inc.php @@ -1,4 +1,5 @@ TMA"; unset($Logo); unset($RandomLogo); - -?> diff --git a/include/note.inc.php b/include/note.inc.php index deb3f95..671d1d5 100644 --- a/include/note.inc.php +++ b/include/note.inc.php @@ -1,11 +1,11 @@ \"$titre\""; + echo "\"$titre\""; } -function litebox($source,$lien,$titre,$target='_blank') +function litebox($source, $lien, $titre, $target = '_blank') { - echo "\"$titre\""; + echo "\"$titre\""; } ?>
diff --git a/include/random.inc.php b/include/random.inc.php index 16c51aa..2bb06d7 100644 --- a/include/random.inc.php +++ b/include/random.inc.php @@ -1,41 +1,42 @@ 1) - $rfile = $listfiles[mt_rand(1, count($listfiles))]; - else - $rfile =$listfiles[1]; + if (count($listfiles) > 1) { + $rfile = $listfiles[mt_rand(1, count($listfiles))]; + } else { + $rfile = $listfiles[1]; + } - @array_splice($listfiles,0); + @array_splice($listfiles, 0); - return $rfile; + return $rfile; } - -?> \ No newline at end of file diff --git a/include/standard.inc.php b/include/standard.inc.php index 039a367..5cecde0 100644 --- a/include/standard.inc.php +++ b/include/standard.inc.php @@ -1,232 +1,241 @@ ", $chaine); - $traite = str_replace($souriez[1][0], ";-)", $traite); - $traite = str_replace($souriez[2][0], ";)", $traite); - $traite = str_replace($souriez[3][0], ";o)", $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], ":-o", $traite); - $traite = str_replace($souriez[9][0], ":o( /", $traite); - $traite = str_replace($souriez[10][0], ":o(( /", $traite); - $traite = str_replace($souriez[11][0], ":((", $traite); - $traite = str_replace($souriez[12][0], ":-(", $traite); - $traite = str_replace($souriez[13][0], ":(", $traite); - $traite = str_replace($souriez[14][0], "8-)", $traite); - $traite = str_replace($souriez[15][0], ":-p", $traite); - $traite = str_replace($souriez[16][0], ";-(", $traite); - $traite = str_replace($souriez[17][0], ";-(", $traite); - $traite = str_replace($souriez[18][0], ";-(", $traite); + // smileys + 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], ";o)", $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], ":-o", $traite); + $traite = str_replace($souriez[9][0], ":o( /", $traite); + $traite = str_replace($souriez[10][0], ":o(( /", $traite); + $traite = str_replace($souriez[11][0], ":((", $traite); + $traite = str_replace($souriez[12][0], ":-(", $traite); + $traite = str_replace($souriez[13][0], ":(", $traite); + $traite = str_replace($souriez[14][0], "8-)", $traite); + $traite = str_replace($souriez[15][0], ":-p", $traite); + $traite = str_replace($souriez[16][0], ";-(", $traite); + $traite = str_replace($souriez[17][0], ";-(", $traite); + $traite = str_replace($souriez[18][0], ";-(", $traite); - // liens - //$traite = ereg_replace("\n","
",$traite); - //$traite = ereg_replace("","","\">[Lien]",$traite); - // themes - global $theme; - $traite = ereg_replace("THEME_COURANT",$theme,$traite); - return $traite; + // liens + //$traite = ereg_replace("\n","
",$traite); + //$traite = ereg_replace("","","\">[Lien]",$traite); + // themes + global $theme; + $traite = ereg_replace("THEME_COURANT", $theme, $traite); + return $traite; } // renvoie la page ou le module en cours // (nécessaire car netscape ne reconnait pas la constante __SELF__) function caller() { - include "include/theme.inc.php"; - global $section; - global $page; - global $modulepage; - global $theme; + include "include/theme.inc.php"; + global $section; + global $page; + global $modulepage; + global $theme; - if (($section != "") && ($page != "")) - $liencaller = "index.php?section=$section&page=$page&theme=$theme"; - else if ($modulepage != "") - $liencaller = "index.php?modulepage=$modulepage&theme=$theme"; - else - $liencaller = "index.php?theme=$theme"; + if (($section != "") && ($page != "")) { + $liencaller = "index.php?section=$section&page=$page&theme=$theme"; + } elseif ($modulepage != "") { + $liencaller = "index.php?modulepage=$modulepage&theme=$theme"; + } else { + $liencaller = "index.php?theme=$theme"; + } - return $liencaller; + return $liencaller; } // renvoie la page ou le module en cours, à ajouter dans un formulaire // (pour le passage de paramètres par méthode get) function formcaller() { - require_once "include/theme.inc.php"; - global $section; - global $page; - global $modulepage; - global $theme; + require_once "include/theme.inc.php"; + global $section; + global $page; + global $modulepage; + global $theme; - if (($section != "") && ($page != "")) - $formcaller = " + if (($section != "") && ($page != "")) { + $formcaller = " "; - else if ($modulepage != "") - $formcaller = " + } elseif ($modulepage != "") { + $formcaller = " "; - else - $formcaller = ""; + } else { + $formcaller = ""; + } - return $formcaller; + return $formcaller; } // formate un nombre pour stockage dans un fichier d'index function splitchar($Number) { - $byte = strval(dechex($Number)); - switch(strlen($byte)) - { - case 1: - $byte0=$byte; - $byte1=$byte2=$byte3=0; - break; - case 2: - $byte0="$byte[0]$byte[1]"; - $byte1=$byte2=$byte3=0; - break; - case 3: - $byte0="$byte[1]$byte[2]"; - $byte1=$byte[0]; - $byte2=$byte3=0; - break; - case 4: - $byte0="$byte[2]$byte[3]"; - $byte1="$byte[0]$byte[1]"; - $byte2=$byte3=0; - break; - case 5: - $byte0="$byte[3]$byte[4]"; - $byte1="$byte[1]$byte[2]"; - $byte2=$byte[0]; - $byte3=0; - break; - case 6: - $byte0="$byte[4]$byte[5]"; - $byte1="$byte[2]$byte[3]"; - $byte2="$byte[0]$byte[1]"; - $byte3=0; - case 7: - $byte0="$byte[5]$byte[6]"; - $byte1="$byte[3]$byte[4]"; - $byte2="$byte[1]$byte[2]"; - $byte3=$byte[0]; - break; - case 8: - $byte0="$byte[6]$byte[7]"; - $byte1="$byte[4]$byte[5]"; - $byte2="$byte[2]$byte[3]"; - $byte3="$byte[0]$byte[1]"; - break; - default: - echo "depassement !!!!!!"; - } + $byte = strval(dechex($Number)); + switch(strlen($byte)) { + case 1: + $byte0 = $byte; + $byte1 = $byte2 = $byte3 = 0; + break; + case 2: + $byte0 = "$byte[0]$byte[1]"; + $byte1 = $byte2 = $byte3 = 0; + break; + case 3: + $byte0 = "$byte[1]$byte[2]"; + $byte1 = $byte[0]; + $byte2 = $byte3 = 0; + break; + case 4: + $byte0 = "$byte[2]$byte[3]"; + $byte1 = "$byte[0]$byte[1]"; + $byte2 = $byte3 = 0; + break; + case 5: + $byte0 = "$byte[3]$byte[4]"; + $byte1 = "$byte[1]$byte[2]"; + $byte2 = $byte[0]; + $byte3 = 0; + break; + case 6: + $byte0 = "$byte[4]$byte[5]"; + $byte1 = "$byte[2]$byte[3]"; + $byte2 = "$byte[0]$byte[1]"; + $byte3 = 0; + // no break + case 7: + $byte0 = "$byte[5]$byte[6]"; + $byte1 = "$byte[3]$byte[4]"; + $byte2 = "$byte[1]$byte[2]"; + $byte3 = $byte[0]; + break; + case 8: + $byte0 = "$byte[6]$byte[7]"; + $byte1 = "$byte[4]$byte[5]"; + $byte2 = "$byte[2]$byte[3]"; + $byte3 = "$byte[0]$byte[1]"; + break; + default: + echo "depassement !!!!!!"; + } - $string = sprintf("%c%c%c%c",hexdec($byte3),hexdec($byte2),hexdec($byte1),hexdec($byte0)); + $string = sprintf("%c%c%c%c", hexdec($byte3), hexdec($byte2), hexdec($byte1), hexdec($byte0)); - return $string; + return $string; } // créé un fichier d'index function strfile($FileName) { - $Nb = 0; - $index[$Nb++] = "0"; - $input = fopen("$FileName.csv","r"); - while ($data = fgetcsv($input, 10000, ",")) - $index[$Nb++] = ftell($input); - fclose($input); - $index[--$Nb] = 0; - $output = fopen("$FileName.dat","w"); - fwrite($output,splitchar($Nb)); - for ($i = 0 ; $i < $Nb ; $i++) - fwrite($output,splitchar($index[$i])); - fclose($output); + $Nb = 0; + $index[$Nb++] = "0"; + $input = fopen("$FileName.csv", "r"); + while ($data = fgetcsv($input, 10000, ",")) { + $index[$Nb++] = ftell($input); + } + fclose($input); + $index[--$Nb] = 0; + $output = fopen("$FileName.dat", "w"); + fwrite($output, splitchar($Nb)); + for ($i = 0 ; $i < $Nb ; $i++) { + fwrite($output, splitchar($index[$i])); + } + fclose($output); } // lit un fichier d'index et renvoie l'index correspondant au numéro d'enregistrement -function unstr($FileName,$Num) +function unstr($FileName, $Num) { - if (!file_exists("$FileName.dat")) - strfile($FileName); + if (!file_exists("$FileName.dat")) { + strfile($FileName); + } - $indexfile = fopen("$FileName.dat","r"); - $total = hexdec(bin2hex(fread($indexfile,4))); - // echo $total; - if ($Num > $total) + $indexfile = fopen("$FileName.dat", "r"); + $total = hexdec(bin2hex(fread($indexfile, 4))); + // echo $total; + if ($Num > $total) { $Num = $total; - fseek($indexfile,($Num*4)+4); - $pos = hexdec(bin2hex(fread($indexfile,4))); - fclose($indexfile); - return $pos; + } + fseek($indexfile, ($Num * 4) + 4); + $pos = hexdec(bin2hex(fread($indexfile, 4))); + fclose($indexfile); + return $pos; } // retourne le nombre d'enregistrement d'après le fichier d'index function gettotal($FileName) { - if (!file_exists("$FileName.dat")) - strfile($FileName); - $indexfile = fopen("$FileName.dat","r"); - return hexdec(bin2hex(fread($indexfile,4))); + if (!file_exists("$FileName.dat")) { + strfile($FileName); + } + $indexfile = fopen("$FileName.dat", "r"); + return hexdec(bin2hex(fread($indexfile, 4))); } // compte le nombre d'enregistrement d'un fichier csv function countcsv($File) { -$max = 0; -$fd = fopen("$File.csv","r"); -while (fgetcsv($fd,10000 , ",")) + $max = 0; + $fd = fopen("$File.csv", "r"); + while (fgetcsv($fd, 10000, ",")) { $max++; -fclose($fd); -return $max; + } + fclose($fd); + return $max; } // créé un fichier function createfile($FileName) { - $fp = fopen($FileName,"w+"); - fclose($fp); + $fp = fopen($FileName, "w+"); + fclose($fp); } // affiche une erreur 401 function err401($msg_err) { - echo " + echo " @@ -240,92 +249,86 @@ function err401($msg_err) "; - exit(); + exit(); } // affiche une demande de mot de passe suivant le fichier password.txt function password($folder) { - //************** indentification de l'utilisateur ************* + //************** indentification de l'utilisateur ************* - $fd = fopen("$folder/password.txt","r"); - $titre = fgetcsv($fd, 10000, ","); + $fd = fopen("$folder/password.txt", "r"); + $titre = fgetcsv($fd, 10000, ","); - while($fd) - { - $data = fgetcsv($fd, 10000, ","); - $login[$i] = $data[0]; - $mdp[$i] = $data[1]; - $bienvenue[$i] = parse_string(stripcslashes($data[2])); - } - fclose($fd); + while($fd) { + $data = fgetcsv($fd, 10000, ","); + $login[$i] = $data[0]; + $mdp[$i] = $data[1]; + $bienvenue[$i] = parse_string(stripcslashes($data[2])); + } + fclose($fd); - // vide le cache - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date du passé + // vide le cache + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date du passé - if (!isset($PHP_AUTH_USER)) - { - header("WWW-Authenticate: Basic realm=\"iphp\" "); - err401("Action annulée"); - } - else - { - - if ($login[0] == $PHP_AUTH_USER) - { - echo "bienvenue superuser !"; - } - else - { - while (($login[$Cpt++] != $PHP_AUTH_USER) && ($mdp[$Cpt++] != $PHP_AUTH_PW)); - echo "bienvenue user !"; - } + if (!isset($PHP_AUTH_USER)) { + header("WWW-Authenticate: Basic realm=\"iphp\" "); + err401("Action annulée"); + } else { + + if ($login[0] == $PHP_AUTH_USER) { + echo "bienvenue superuser !"; + } else { + while (($login[$Cpt++] != $PHP_AUTH_USER) && ($mdp[$Cpt++] != $PHP_AUTH_PW)); + echo "bienvenue user !"; } + } } // créé un fichier de log function addlog($url) { - $File = "/logs/".str_replace("/","_",$url).".log"; -// si le fichier n'existe pas, on le crée: - if (!file_exists("$File.csv") ) - createfile("$File.csv"); + $File = "/logs/".str_replace("/", "_", $url).".log"; + // si le fichier n'existe pas, on le crée: + if (!file_exists("$File.csv")) { + createfile("$File.csv"); + } - $date = strftime ("%d/%m/%Y", time()); + $date = strftime("%d/%m/%Y", time()); - $string = sprintf("\"".$date."\",\"".iheure()."\",\"".$_SERVER["REMOTE_ADDR"]."\",\"".$_SERVER["HTTP_REFERER"]."\",\"".$_SERVER["HTTP_USER_AGENT"]."\"\n"); + $string = sprintf("\"".$date."\",\"".iheure()."\",\"".$_SERVER["REMOTE_ADDR"]."\",\"".$_SERVER["HTTP_REFERER"]."\",\"".$_SERVER["HTTP_USER_AGENT"]."\"\n"); - $fp = fopen("$File.csv","a"); - fwrite($fp,$string); - fclose($fp); - strfile($File); + $fp = fopen("$File.csv", "a"); + fwrite($fp, $string); + fclose($fp); + strfile($File); } // convertit les entités HTML en charactères spéciaux function html2ascii($inputstring) { - $outputstring = eregi_replace("é","é",$inputstring); - $outputstring = eregi_replace("è","è",$outputstring); - $outputstring = eregi_replace("à","à",$outputstring); - $outputstring = eregi_replace("ù","ù",$outputstring); + $outputstring = eregi_replace("é", "é", $inputstring); + $outputstring = eregi_replace("è", "è", $outputstring); + $outputstring = eregi_replace("à", "à", $outputstring); + $outputstring = eregi_replace("ù", "ù", $outputstring); - $outputstring = eregi_replace("ô","ô",$outputstring); - $outputstring = eregi_replace("ê","ê",$outputstring); - $outputstring = eregi_replace("î","î",$outputstring); - $outputstring = eregi_replace("â","â",$outputstring); - $outputstring = eregi_replace("û","û",$outputstring); + $outputstring = eregi_replace("ô", "ô", $outputstring); + $outputstring = eregi_replace("ê", "ê", $outputstring); + $outputstring = eregi_replace("î", "î", $outputstring); + $outputstring = eregi_replace("â", "â", $outputstring); + $outputstring = eregi_replace("û", "û", $outputstring); - $outputstring = eregi_replace("ï","ï",$outputstring); - $outputstring = eregi_replace("ë","ë",$outputstring); - $outputstring = eregi_replace("ç","ç",$outputstring); + $outputstring = eregi_replace("ï", "ï", $outputstring); + $outputstring = eregi_replace("ë", "ë", $outputstring); + $outputstring = eregi_replace("ç", "ç", $outputstring); - $outputstring = eregi_replace(" "," ",$outputstring); - $outputstring = eregi_replace(""","\"",$outputstring); - $outputstring = eregi_replace("&","&",$outputstring); + $outputstring = eregi_replace(" ", " ", $outputstring); + $outputstring = eregi_replace(""", "\"", $outputstring); + $outputstring = eregi_replace("&", "&", $outputstring); - return $outputstring; + return $outputstring; } // ------------------------------------------------------------------------- // @@ -349,28 +352,24 @@ fichier .dat // $filename est le nom du fichier créé pour stocker les informations -function nb_visiteurs_connecte($time,$filename="/tmp/nbweb.dat") +function nb_visiteurs_connecte($time, $filename = "/tmp/nbweb.dat") { $ip = getenv("REMOTE_ADDR"); - $date=time(); + $date = time(); - $i=0; - $ii=0; - $bool=0; + $i = 0; + $ii = 0; + $bool = 0; - if(file_exists($filename)) - { - if($fichier=fopen($filename,"r")) - { - while(!feof($fichier)) - { - $ligne=fgets($fichier,4096); - $tab=explode("|",$ligne); + if(file_exists($filename)) { + if($fichier = fopen($filename, "r")) { + while(!feof($fichier)) { + $ligne = fgets($fichier, 4096); + $tab = explode("|", $ligne); - if($tab[1]>0) - { - $tab_de_tab[$i][0]=$tab[0]; - $tab_de_tab[$i][1]=$tab[1]; + if($tab[1] > 0) { + $tab_de_tab[$i][0] = $tab[0]; + $tab_de_tab[$i][1] = $tab[1]; $i++; } @@ -379,43 +378,34 @@ function nb_visiteurs_connecte($time,$filename="/tmp/nbweb.dat") } } - for($j=0;$j<$i;$j++) - { - if(($date-chop($tab_de_tab[$j][1]))>$time) - { + for($j = 0;$j < $i;$j++) { + if(($date - chop($tab_de_tab[$j][1])) > $time) { //on ne fait rien - } - else - { - $tab_de_tab_actualise[$ii][0]=$tab_de_tab[$j][0]; - $tab_de_tab_actualise[$ii][1]=chop($tab_de_tab[$j][1]); + } else { + $tab_de_tab_actualise[$ii][0] = $tab_de_tab[$j][0]; + $tab_de_tab_actualise[$ii][1] = chop($tab_de_tab[$j][1]); $ii++; } } - for($j=0;$j<$ii;$j++) - { - if($tab_de_tab_actualise[$j][0]==$ip) - { - $bool=1; + for($j = 0;$j < $ii;$j++) { + if($tab_de_tab_actualise[$j][0] == $ip) { + $bool = 1; } } - if($bool==0) - { - $tab_de_tab_actualise[$ii][0]=$ip; - $tab_de_tab_actualise[$ii][1]=$date; + if($bool == 0) { + $tab_de_tab_actualise[$ii][0] = $ip; + $tab_de_tab_actualise[$ii][1] = $date; $ii++; } - if($fichier=fopen($filename,"w")) - { - for($j=0;$j<$ii;$j++) - { - fputs($fichier,chop($tab_de_tab_actualise[$j][0])); - fputs($fichier,"|"); - fputs($fichier,chop($tab_de_tab_actualise[$j][1])); - fputs($fichier,"\n"); + if($fichier = fopen($filename, "w")) { + for($j = 0;$j < $ii;$j++) { + fputs($fichier, chop($tab_de_tab_actualise[$j][0])); + fputs($fichier, "|"); + fputs($fichier, chop($tab_de_tab_actualise[$j][1])); + fputs($fichier, "\n"); } fclose($fichier); @@ -423,7 +413,3 @@ function nb_visiteurs_connecte($time,$filename="/tmp/nbweb.dat") return $ii; } - - - -?> diff --git a/include/theme.inc.php b/include/theme.inc.php index e0b0a56..144bd5b 100644 --- a/include/theme.inc.php +++ b/include/theme.inc.php @@ -1,5 +1,5 @@ +if (!isset($theme)) { + $theme = "default"; +} diff --git a/include/timer.inc.php b/include/timer.inc.php index 6b64bc7..8fca361 100644 --- a/include/timer.inc.php +++ b/include/timer.inc.php @@ -1,73 +1,69 @@ "; + $fp = fopen("$FileTimerName", "w+"); + $Ligne = sprintf("\"".$Date."\",\"".$String."\"\n"); + fwrite($fp, $Ligne); + fclose($fp); + // echo "fichier créé
"; } /* renvoie $string si le temps n'est pas écoulé, ou FALSE sinon */ -function timer($TimerName,$TimerNb) +function timer($TimerName, $TimerNb) { - $FileTimerN = "modules/timers/$TimerName.csv"; + $FileTimerN = "modules/timers/$TimerName.csv"; - if (strftime("%m", time()) < 10) - $Date = strftime ("%Y%0m%d%H%M%S", time()); - else - $Date = strftime ("%Y%m%d%H%M%S", time()); + if (strftime("%m", time()) < 10) { + $Date = strftime("%Y%0m%d%H%M%S", time()); + } else { + $Date = strftime("%Y%m%d%H%M%S", time()); + } - if (!file_exists("$FileTimerN")) - { - $timer = FALSE; + if (!file_exists("$FileTimerN")) { + $timer = false; + } else { + // lecture de la date stockée dans le fichier + $fp = fopen("$FileTimerN", "r"); + $data = fgetcsv($fp, 1000, ","); + fclose($fp); + + $FileDate = $data[0]; + $Date = strftime("%Y%m%d%H%M%S", time()); + + $String = $data[1]; + + if ($Date >= ($FileDate + $TimerNb)) { + // echo "date dépassée:".$Date." >= ".($FileDate+$TimerNb)."
"; + $timer = false; + } else { + $timer = $String; } - else - { - // lecture de la date stockée dans le fichier - $fp = fopen("$FileTimerN","r"); - $data = fgetcsv($fp, 1000, ","); - fclose($fp); + } - $FileDate = $data[0]; - $Date = strftime ("%Y%m%d%H%M%S", time()); - - $String = $data[1]; - - if ($Date >= ($FileDate+$TimerNb)) - { - // echo "date dépassée:".$Date." >= ".($FileDate+$TimerNb)."
"; - $timer = FALSE; - } - else - { - $timer = $String; - } - } - - return $timer; + return $timer; } /* renvoie l'heure française (format HH:MM) */ function iheure() { - if ($HTTP_GET_VARS["IFRANCE"] =="1") - $iheure=$I_HEURE_UK; - else - $iheure= date("H:i"); - return $iheure; + if ($HTTP_GET_VARS["IFRANCE"] == "1") { + $iheure = $I_HEURE_UK; + } else { + $iheure = date("H:i"); + } + return $iheure; } - -?> diff --git a/index.php b/index.php index dc19088..adff58d 100644 --- a/index.php +++ b/index.php @@ -1,13 +1,14 @@ \n"; // tableau principal // *************** gauche ***************** -if (!isset($left) || ($left ==1)) -{ -//echo "
"; - $cachefile = "tmp/left.cache.html"; - if (!file_exists($cachefile) || (filemtime($cachefile) < filemtime("modules/liens"))) - { - $cachecontent=file_get_contents("http://tma.tourmentine.com/left.php"); - $fp = fopen($cachefile,"w"); - fwrite($fp,$cachecontent); - fclose($fp); - } - echo "\n\n\n\n"; - echo "\n"; - include $cachefile; - echo "\n"; - echo "\n\n\n"; -// echo "
"; +if (!isset($left) || ($left == 1)) { + //echo "
"; + $cachefile = "tmp/left.cache.html"; + if (!file_exists($cachefile) || (filemtime($cachefile) < filemtime("modules/liens"))) { + $cachecontent = file_get_contents("http://tma.tourmentine.com/left.php"); + $fp = fopen($cachefile, "w"); + fwrite($fp, $cachecontent); + fclose($fp); + } + echo "\n\n\n\n"; + echo "\n"; + include $cachefile; + echo "\n"; + echo "\n\n\n"; + // echo "
"; } // ************** centre **************** echo "\n"; // --- gestion des modules --- -if (isset($modulepage)) -{ +if (isset($modulepage)) { + //include "include/logo.inc.php"; + switch($modulepage) { + case "sondage": + + extract($themeset, EXTR_OVERWRITE); + + $headstartcode = ""; + $headendcode = ""; + $bodyclass = "centerbody"; + $module = "sondage"; + $titre = "Résultats du sondage"; + + include "modules/magicbox.php"; + break; + case "goldbook": + unset($NbMaxPost); + extract($themeset, EXTR_OVERWRITE); + + $headstartcode = ""; + $headendcode = ""; + $bodyclass = "centerbody"; + $module = "goldbook"; + $titre = "Livre d'or"; + $GoldbookFile = "goldbook"; + echo "


\n

Laissez-nous un message...


\n"; + include "modules/magicbox.php"; + unset($bodyclass); + break; + + case "addnews": + extract($themeset, EXTR_OVERWRITE); + + if (isset($File)) { + $FileNews = $File; + } + + // fichier de news par défaut + if (!isset($FileNews)) { + $FileNews = "modules/news/news"; + } + + $headstartcode = ""; + $headendcode = ""; + $bodyclass = "centerbody"; + $module = "admin/addnews"; + $titre = "Ajout d'une nouvelle"; + + include "modules/magicbox.php"; + unset($bodyclass); + // unset($NewsFile); + // unset($File); + break; + + case "affnews": + + if (isset($File)) { + $FileNews = $File; + } + + if (!isset($FileNews)) { + $FileNews = "modules/news/pipnews"; + } + + // appel direct du module affnews ; magicbox est appelé par ce dernier + include "modules/affnews.php"; + unset($NewsFile); + // unset($newsnb); + //unset($File); + break; + + case "commentnews": + if (isset($File)) { + $FileNews = $File; + } + + if (!isset($FileNews)) { + $FileNews = "modules/news/news"; + } + + $modulepage = "affnews"; + $start = $idnews; + $NbMaxNews = 1; + include "modules/affnews.php"; + + $headstartcode = ""; + $headendcode = ""; + $bodyclass = "centerbody"; + $module = "forum"; + $titre = "Commentaires"; + //$goldbooktype = "comment"; + $forumfile = "$FileNews.$idnews.forum.csv"; + include "modules/magicbox.php"; + //$modulepage = "commentbook"; + // unset($goldbooktype); + // unset($NewsFile); + // unset($File); + break; + case "print": + if (isset($File)) { + $FileNews = $File; + } + + if (!isset($FileNews)) { + $FileNews = "modules/news/news"; + } + + include "modules/print.php"; + break; + + case "backend": + if (isset($File)) { + $FileNews = $File; + } + + if (!isset($FileNews)) { + $FileNews = "modules/news/news"; + } + + include "modules/genbackend.php"; + break; + case "chatlogin": + extract($themeset, EXTR_OVERWRITE); + $bodyclass = "centerbody"; + $module = "kikchat/login"; + $headstartcode = ""; + $headendcode = ""; + $titre = "Bienvenue sur le chat"; + $bodystartcode = "
"; + $bodyendcode = "
"; + + $footerbox = 1; + $footerboxtext = "Retour au menu"; + $footerlien = "/"; + + include "modules/magicbox.php"; + unset($bodyclass); + + break; + case "kikchat": + extract($themeset, EXTR_OVERWRITE); + $bodyclass = "centerbody"; + $module = "kikchat/post"; + $titre = "Kik it Productions' Live Chat"; + $headlien = "http://www.kik-it.com"; + $footerbox = 1; + $footerboxtext = "Retour au menu"; + $footerlien = "/"; + + include "modules/magicbox.php"; + unset($bodyclass); + break; + case "affimage": + extract($themeset, EXTR_OVERWRITE); + + // $headstartcode = ""; + // $headendcode =""; + $bodyclass = "centerbody"; + + $module = "affimages"; + $titre = $image; + $footerbox = 1; + $footerboxtext = "Retour au menu"; + $footerlien = "/"; + + include "modules/magicbox.php"; + unset($bodyclass); + break; + + default: + include "pages/menu.php"; + + } + +} else { + // ---- affichage des pages ---- + //echo "
"; + if (isset($section) && isset($page) && $page != "menu") { + // si url éronnée, affiche la page d'acceuil + if (file_exists("$section/$page.php")) { + /* echo "
"; */ + include_once "$section/$page.php"; + /* echo "
";*/ + } else { + include_once "pages/menu.php"; + } + + echo ""; + } else { //include "include/logo.inc.php"; - switch($modulepage) - { - case "sondage": - - extract($themeset, EXTR_OVERWRITE); - - $headstartcode = ""; - $headendcode =""; - $bodyclass="centerbody"; - $module = "sondage"; - $titre = "Résultats du sondage"; - - include "modules/magicbox.php"; - break; - case "goldbook": - unset($NbMaxPost); - extract($themeset, EXTR_OVERWRITE); - - $headstartcode = ""; - $headendcode =""; - $bodyclass = "centerbody"; - $module = "goldbook"; - $titre = "Livre d'or"; - $GoldbookFile = "goldbook"; - echo "


\n

Laissez-nous un message...


\n"; - include "modules/magicbox.php"; - unset($bodyclass); - break; - - case "addnews": - extract($themeset, EXTR_OVERWRITE); - - if (isset($File)) - $FileNews = $File; - - // fichier de news par défaut - if (!isset($FileNews)) - $FileNews = "modules/news/news"; - - $headstartcode = ""; - $headendcode =""; - $bodyclass = "centerbody"; - $module = "admin/addnews"; - $titre = "Ajout d'une nouvelle"; - - include "modules/magicbox.php"; - unset($bodyclass); - // unset($NewsFile); - // unset($File); - break; - - case "affnews": - - if (isset($File)) - $FileNews = $File; - - if (!isset($FileNews)) - $FileNews = "modules/news/pipnews"; - - // appel direct du module affnews ; magicbox est appelé par ce dernier - include "modules/affnews.php"; - unset($NewsFile); - // unset($newsnb); - //unset($File); - break; - - case "commentnews": - if (isset($File)) - $FileNews = $File; - - if (!isset($FileNews)) - $FileNews = "modules/news/news"; - - $modulepage="affnews"; - $start=$idnews; - $NbMaxNews=1; - include "modules/affnews.php"; - - $headstartcode = ""; - $headendcode =""; - $bodyclass = "centerbody"; - $module = "forum"; - $titre = "Commentaires"; - //$goldbooktype = "comment"; - $forumfile = "$FileNews.$idnews.forum.csv"; - include "modules/magicbox.php"; - //$modulepage = "commentbook"; - // unset($goldbooktype); - // unset($NewsFile); - // unset($File); - break; - case "print": - if (isset($File)) - $FileNews = $File; - - if (!isset($FileNews)) - $FileNews = "modules/news/news"; - - include "modules/print.php"; - break; - - case "backend": - if (isset($File)) - $FileNews = $File; - - if (!isset($FileNews)) - $FileNews = "modules/news/news"; - - include "modules/genbackend.php"; - break; - case "chatlogin": - extract($themeset, EXTR_OVERWRITE); - $bodyclass = "centerbody"; - $module = "kikchat/login"; - $headstartcode = ""; - $headendcode =""; - $titre = "Bienvenue sur le chat"; - $bodystartcode="
"; - $bodyendcode="
"; - - $footerbox = 1; - $footerboxtext = "Retour au menu"; - $footerlien = "/"; - - include "modules/magicbox.php"; - unset($bodyclass); - - break; - case "kikchat": - extract($themeset, EXTR_OVERWRITE); - $bodyclass = "centerbody"; - $module = "kikchat/post"; - $titre = "Kik it Productions' Live Chat"; - $headlien = "http://www.kik-it.com"; - $footerbox = 1; - $footerboxtext = "Retour au menu"; - $footerlien = "/"; - - include "modules/magicbox.php"; - unset($bodyclass); - break; - case "affimage": - extract($themeset, EXTR_OVERWRITE); - - // $headstartcode = ""; - // $headendcode =""; - $bodyclass = "centerbody"; - - $module = "affimages"; - $titre = $image; - $footerbox = 1; - $footerboxtext = "Retour au menu"; - $footerlien = "/"; - - include "modules/magicbox.php"; - unset($bodyclass); - break; - - default: - include "pages/menu.php"; - - } - -} - else -{ -// ---- affichage des pages ---- -//echo "
"; - if (isset($section) && isset($page) && $page != "menu") - { - // si url éronnée, affiche la page d'acceuil - if (file_exists("$section/$page.php")) - { - /* echo "
"; */ - include_once "$section/$page.php"; - /* echo "
";*/ - } - else - include_once "pages/menu.php"; - - echo ""; - } - else - { - //include "include/logo.inc.php"; - include "pages/menu.php"; - } + include "pages/menu.php"; + } } echo ""; // *************** droite ************************* /*if (!isset($right) || ($right == 1)) { - echo ""; + echo ""; echo ""; include_once "right.php"; echo ""; diff --git a/left.php b/left.php index 58aa385..c270e86 100644 --- a/left.php +++ b/left.php @@ -1,10 +1,11 @@ diff --git a/modules/affimages.php b/modules/affimages.php index 554727e..f333ae6 100644 --- a/modules/affimages.php +++ b/modules/affimages.php @@ -1,5 +1,3 @@ $image
"; - -?> diff --git a/modules/goldbook.php b/modules/goldbook.php index 06d85d0..b30cdec 100644 --- a/modules/goldbook.php +++ b/modules/goldbook.php @@ -11,9 +11,10 @@ include_once "include/standard.inc.php"; extract($_POST); -if (isset($GoldbookFile) && $GoldbookFile != "") - $GoldbookFile="default"; - +if (isset($GoldbookFile) && $GoldbookFile != "") { + $GoldbookFile = "default"; +} + $Cpt = 0; echo "
\n"; } else*/ - //echo "?modulepage=goldbook'>\n"; - echo "/livre.html'>\n"; +//echo "?modulepage=goldbook'>\n"; +echo "/livre.html'>\n"; - echo "
\n"; +//
\n"; unset($File); // si le fichier n'existe pas, on le crée: -if (!(file_exists("modules/goldbook/$GoldbookFile.csv"))) -{ - $goldbook = fopen("modules/goldbook/$GoldbookFile.csv","w+"); - fclose($goldbook); +if (!(file_exists("modules/goldbook/$GoldbookFile.csv"))) { + $goldbook = fopen("modules/goldbook/$GoldbookFile.csv", "w+"); + fclose($goldbook); } // ajout des messages -if ($param == "postgb") -{ - if ($VMessage != "" && isset($_POST['piejacon'])) - { - $date = strftime ("%d/%m/%Y", time()); - $iheure= date("H:i"); - $VMessage = ereg_replace("<","<",$VMessage); - $VMessage = ereg_replace(">",">",$VMessage); - $VMessage = parse_string(stripcslashes($VMessage)); - $VMessage = ereg_replace("\n","
",$VMessage); - $VMessage = ereg_replace("&","&",$VMessage); - $gbline = sprintf("\"".$date."\",\"".$iheure."\",\"".htmlspecialchars($VName)."\",\"".$VEmail."\",\"".$VMessage."\"\n"); - $goldbook = fopen("modules/goldbook/$GoldbookFile.csv","a"); - fwrite($goldbook,$gbline); - fclose($goldbook); - mail("n@tourmentine.com","[TMA] post livre d'or ",$VMessage,"From: ".$VName." <".$VEmail.">\r\nX-Mailer: PHP/" . phpversion()); - // mail("bernard@legaillart.com","[TMA] post livre d'or ",$VMessage,"From: ".$VName." <".$VEmail.">\r\nX-Mailer: PHP/" . phpversion()); - //unlink("$GoldbookFile.dat"); - } +if ($param == "postgb") { + if ($VMessage != "" && isset($_POST['piejacon'])) { + $date = strftime("%d/%m/%Y", time()); + $iheure = date("H:i"); + $VMessage = ereg_replace("<", "<", $VMessage); + $VMessage = ereg_replace(">", ">", $VMessage); + $VMessage = parse_string(stripcslashes($VMessage)); + $VMessage = ereg_replace("\n", "
", $VMessage); + $VMessage = ereg_replace("&", "&", $VMessage); + $gbline = sprintf("\"".$date."\",\"".$iheure."\",\"".htmlspecialchars($VName)."\",\"".$VEmail."\",\"".$VMessage."\"\n"); + $goldbook = fopen("modules/goldbook/$GoldbookFile.csv", "a"); + fwrite($goldbook, $gbline); + fclose($goldbook); + mail("n@tourmentine.com", "[TMA] post livre d'or ", $VMessage, "From: ".$VName." <".$VEmail.">\r\nX-Mailer: PHP/" . phpversion()); + // mail("bernard@legaillart.com","[TMA] post livre d'or ",$VMessage,"From: ".$VName." <".$VEmail.">\r\nX-Mailer: PHP/" . phpversion()); + //unlink("$GoldbookFile.dat"); + } } // lecture des messages -$goldbook = fopen("modules/goldbook/$GoldbookFile.csv","r"); +$goldbook = fopen("modules/goldbook/$GoldbookFile.csv", "r"); -while ($data = fgetcsv($goldbook, 1000, ",")) -{ - $VisitorDate[$Cpt] = $data[0]; - $VisitorTime[$Cpt] = $data[1]; - $VisitorName[$Cpt] = stripcslashes($data[2]); - $VisitorEmail[$Cpt] = $data[3]; - $VisitorMessage[$Cpt++] = stripcslashes($data[4]); +while ($data = fgetcsv($goldbook, 1000, ",")) { + $VisitorDate[$Cpt] = $data[0]; + $VisitorTime[$Cpt] = $data[1]; + $VisitorName[$Cpt] = stripcslashes($data[2]); + $VisitorEmail[$Cpt] = $data[3]; + $VisitorMessage[$Cpt++] = stripcslashes($data[4]); } fclose($goldbook); unset($data); unset($goldbook); // si $NbMaxPost n'est pas défini, ou si il est plus grand que le nombre d'éléments, on l'ajuste à ce nombre -if ((!isset($NbMaxPost)) || ($NbMaxPost > $Cpt)) -{ - $NbMaxPost = $Cpt; +if ((!isset($NbMaxPost)) || ($NbMaxPost > $Cpt)) { + $NbMaxPost = $Cpt; } // affichage des messages echo "
"; -if ($NbMaxPost) -for($i=0;$i<=$NbMaxPost-1;$i++) -{ - if ($VisitorName[$i] == "") - $VisitorName[$i] = "Anonyme"; +if ($NbMaxPost) { + for($i = 0;$i <= $NbMaxPost - 1;$i++) { + if ($VisitorName[$i] == "") { + $VisitorName[$i] = "Anonyme"; + } - if ($VisitorEmail[$i] != "") - $Visiteur = "".$VisitorName[$i].""; - else - $Visiteur = $VisitorName[$i]; + if ($VisitorEmail[$i] != "") { + $Visiteur = "".$VisitorName[$i].""; + } else { + $Visiteur = $VisitorName[$i]; + } - echo "Posté le ".$VisitorDate[$i]." à ".$VisitorTime[$i]." par ".$Visiteur.": + echo "Posté le ".$VisitorDate[$i]." à ".$VisitorTime[$i]." par ".$Visiteur.":
« ".$VisitorMessage[$i]." »
"; - if ($i != ($NbMaxPost-1)) - echo "
"; + if ($i != ($NbMaxPost - 1)) { + echo "
"; + } + } } echo "
"; $footerbox = 0; //$footerboxtext = "Retour au menu"; //$footerlien = "/"; - - -?> diff --git a/modules/liens.php b/modules/liens.php index 420cad7..20ee234 100644 --- a/modules/liens.php +++ b/modules/liens.php @@ -10,92 +10,80 @@ MAJ : 04/02/04 $Cpt = 0; // si le fichier n'existe pas, on le crée: -if (!(file_exists($FileName))) -{ - $fp = fopen($FileName,"w+"); - fclose($fp); +if (!(file_exists($FileName))) { + $fp = fopen($FileName, "w+"); + fclose($fp); } -$fp = fopen($FileName,"r"); +$fp = fopen($FileName, "r"); -while ($data = fgetcsv($fp, 1000, ",")) -{ - $level[$Cpt] = $data[0]; - $linkname[$Cpt] = stripcslashes($data[1]); - $url[$Cpt] = stripcslashes($data[2]); - $url[$Cpt] = preg_replace("/THEME_COURANT/",$theme,$url[$Cpt]); - $comment[$Cpt] = stripcslashes($data[3]); - $target[$Cpt] = stripcslashes($data[4]); - $Cpt++; +while ($data = fgetcsv($fp, 1000, ",")) { + $level[$Cpt] = $data[0]; + $linkname[$Cpt] = stripcslashes($data[1]); + $url[$Cpt] = stripcslashes($data[2]); + $url[$Cpt] = preg_replace("/THEME_COURANT/", $theme, $url[$Cpt]); + $comment[$Cpt] = stripcslashes($data[3]); + $target[$Cpt] = stripcslashes($data[4]); + $Cpt++; } fclose($fp); // si $NbMaxPost n'est pas défini, ou si il est plus grand que le nombre d'éléments, on l'ajuste à ce nombre -if ((!isset($NbMaxPost)) || ($NbMaxPost > $Cpt)) -{ - $NbMaxPost = $Cpt; +if ((!isset($NbMaxPost)) || ($NbMaxPost > $Cpt)) { + $NbMaxPost = $Cpt; } include "include/theme.inc.php"; -if ($Cpt <= 0) -{ - echo "Aucun lien pour l'instant
"; -} -else -{ - if (isset($TypeListe) && ($TypeListe == "deroul")) - { - echo "

"; -?> +if ($Cpt <= 0) { + echo "Aucun lien pour l'instant
"; +} else { + if (isset($TypeListe) && ($TypeListe == "deroul")) { + echo "

"; + ?> "; - for($i=0;$i<=$NbMaxPost-1;$i++) - { - echo "\n"; - } + echo "

"; - } - else - { + echo "

"; + } else { // affichage des liens - echo "
"; - for($i=0;$i<=$NbMaxPost-1;$i++) - { - if ($level[$i] == 1) - { - echo ""; - if ($url[$i] != "") - { - echo "".$linkname[$i].""; - } - else echo $linkname[$i]; - echo "
\n"; - } - else - { - echo "  "; - if ($url[$i] != "") - { - echo "".$linkname[$i].""; - } - else echo $linkname[$i]; - echo "
\n"; - } + echo "
"; + for($i = 0;$i <= $NbMaxPost - 1;$i++) { + if ($level[$i] == 1) { + echo ""; + if ($url[$i] != "") { + echo "".$linkname[$i].""; + } else { + echo $linkname[$i]; } - echo "
"; + echo "
\n"; + } else { + echo "  "; + if ($url[$i] != "") { + echo "".$linkname[$i].""; + } else { + echo $linkname[$i]; + } + echo "
\n"; + } } + echo "
"; + } } unset($FileName); unset($NbMaxPost); - ?> +?> diff --git a/modules/magicbox.php b/modules/magicbox.php index 55ee7bd..ccf6eba 100644 --- a/modules/magicbox.php +++ b/modules/magicbox.php @@ -9,75 +9,82 @@ MAJ : 23/09/01 // include "include/theme.inc.php"; extract($themeset, EXTR_OVERWRITE); -if (!isset($largeur)) - $largeur="100%"; +if (!isset($largeur)) { + $largeur = "100%"; +} -if ($boxborder == "") - $boxborder = 0; +if ($boxborder == "") { + $boxborder = 0; +} echo "\n\n"; echo "\n\n"; // ************* header ******************** echo "
+echo "
Nom/Pseudo (facultatif): @@ -37,82 +38,77 @@ else*/
Notes: Les balises HTML ne sont pas autorisés dans la boite de saisie. Les messages sont modérés, ils n'apparaitront donc pas immédiatement sur le livre d'or.
\n"; - //
\n"; -else - echo "magicbox'>\n"; +if ($boxborder != 0) { + echo "bordure'>\n"; +} else { + echo "magicbox'>\n"; +} echo " \n \n\n\n\n"; -if (isset($footerbox) && ($footerbox == 1)) -{ - echo "\n\n"; + echo ">$footerboxtext\n"; + } else { + echo "$footerboxtext"; + } + echo "$footerendcode\n"; + echo " \n\n"; } echo "
\n"; echo "$headstartcode"; -if (isset($headlien)) - echo "$titre"; -else - echo "$titre"; +if (isset($headlien)) { + echo "$titre"; +} else { + echo "$titre"; +} echo "$headendcode\n"; // ************** body ******************* echo "
"; echo "
\n\n\n\n\n
"; echo "$bodystartcode"; include "modules/".$module.".php"; echo "$bodyendcode"; echo "
\n
\n
\n"; + } + if (isset($headclass)) { + echo $headclass; + } else { + echo "head"; + } + echo "'>\n"; - echo "$footerstartcode"; - if (isset($footerlien)) - { - echo "$footerboxtext\n"; - } - else - echo "$footerboxtext"; - echo "$footerendcode\n"; - echo "
\n
\n"; @@ -100,5 +107,3 @@ unset($footerendcode); unset($footerbox); unset($footerboxtext); unset($footerlien); - -?> diff --git a/modules/print.php b/modules/print.php index 1863627..0ac3d9a 100644 --- a/modules/print.php +++ b/modules/print.php @@ -1,9 +1,11 @@ PIP @@ -18,13 +20,15 @@ function PrintPage($FileNews,$newsnb) { Posté le ".$MyNews["date"]." à ".$MyNews["heure"]." par ".$MyNews["nom"]." "; - if (isset($MyNews["icone"]) && ($MyNews["icone"] != "")) - echo "\n"; + if (isset($MyNews["icone"]) && ($MyNews["icone"] != "")) { + echo "\n"; + } - if (isset($cadrenews) && ($cadrenews != 0)) - echo "
    \n"; - else - echo "\n"; + if (isset($cadrenews) && ($cadrenews != 0)) { + echo "\n"; + } else { + echo "\n"; + } echo $MyNews["message"]."
@@ -42,6 +46,4 @@ function PrintPage($FileNews,$newsnb) { "; } -PrintPage($File,$newsnb); - -?> +PrintPage($File, $newsnb); diff --git a/pages/131208.php b/pages/131208.php index 2c4c922..e203edc 100644 --- a/pages/131208.php +++ b/pages/131208.php @@ -1,18 +1,18 @@


Images de la gare d'Avallon (13/12/2008)

- +
- - - + + + - - + +

diff --git a/pages/avallon2011.php b/pages/avallon2011.php index 30e2d88..eb38a43 100644 --- a/pages/avallon2011.php +++ b/pages/avallon2011.php @@ -1,42 +1,42 @@


Images de la gare d'Avallon (2011)

- +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - +
diff --git a/pages/carte/1.php b/pages/carte/1.php index 5a05b0f..f2a0353 100644 --- a/pages/carte/1.php +++ b/pages/carte/1.php @@ -6,12 +6,12 @@
- - + + - - + +
diff --git a/pages/carte/2.php b/pages/carte/2.php index 24be7b2..aea54a2 100644 --- a/pages/carte/2.php +++ b/pages/carte/2.php @@ -6,18 +6,18 @@
- - - + + + - - - + + + - +

diff --git a/pages/carte/3.php b/pages/carte/3.php index 19f7d89..b1c416a 100644 --- a/pages/carte/3.php +++ b/pages/carte/3.php @@ -6,9 +6,9 @@
- - - + + +

diff --git a/pages/carte/4.php b/pages/carte/4.php index ba18015..c8fb82a 100644 --- a/pages/carte/4.php +++ b/pages/carte/4.php @@ -10,19 +10,19 @@
- - - + + + - - - + + + - - - + + +

diff --git a/pages/carte/6.php b/pages/carte/6.php index 5248841..78f0906 100644 --- a/pages/carte/6.php +++ b/pages/carte/6.php @@ -6,8 +6,8 @@
- - + +

diff --git a/pages/carte/7.php b/pages/carte/7.php index 1558a21..f47baab 100644 --- a/pages/carte/7.php +++ b/pages/carte/7.php @@ -6,8 +6,8 @@
- - + +

diff --git a/pages/carte/8.php b/pages/carte/8.php index aef2f81..3b588a8 100644 --- a/pages/carte/8.php +++ b/pages/carte/8.php @@ -6,18 +6,18 @@
- - - + + + - - - + + + - - + +

cliquez ici pour revenir à la carte diff --git a/pages/carte/marchandise.php b/pages/carte/marchandise.php index cba8943..b795c41 100644 --- a/pages/carte/marchandise.php +++ b/pages/carte/marchandise.php @@ -8,14 +8,14 @@
- - - + + + - - - + + +

diff --git a/pages/challenge2015.php b/pages/challenge2015.php index 7b14cb4..74bdcfd 100644 --- a/pages/challenge2015.php +++ b/pages/challenge2015.php @@ -1,18 +1,18 @@


Challenge du club 2015

- +
- - - + + + - - + +

diff --git a/pages/forum2017.php b/pages/forum2017.php index e035ffb..8ea3bb5 100644 --- a/pages/forum2017.php +++ b/pages/forum2017.php @@ -1,19 +1,19 @@


Forum des associations 2017

- +
- - - + + + - - - + + +

diff --git a/pages/im_reduit.php b/pages/im_reduit.php index e16ef50..b770d08 100644 --- a/pages/im_reduit.php +++ b/pages/im_reduit.php @@ -6,18 +6,18 @@
- - - + + + - - - + + + - +
diff --git a/pages/im_reduit_ajax.php b/pages/im_reduit_ajax.php index e16ef50..b770d08 100644 --- a/pages/im_reduit_ajax.php +++ b/pages/im_reduit_ajax.php @@ -6,18 +6,18 @@
- - - + + + - - - + + + - +
diff --git a/pages/im_reel.php b/pages/im_reel.php index 1707ed7..9e8d626 100644 --- a/pages/im_reel.php +++ b/pages/im_reel.php @@ -1,29 +1,29 @@


Images de la gare d'Avallon

- +
- - - + + + - - - + + + - - - + + + - - - + + +

diff --git a/pages/leclub.php b/pages/leclub.php index 6a926b3..274a1a3 100644 --- a/pages/leclub.php +++ b/pages/leclub.php @@ -1,10 +1,14 @@


diff --git a/pages/livre.php b/pages/livre.php index 59f7e85..8da62b2 100644 --- a/pages/livre.php +++ b/pages/livre.php @@ -1,13 +1,13 @@ "; - //$headendcode =""; - $bodyclass = "centerbody"; - $module = "goldbook"; - $titre = "Livre d'or"; - $GoldbookFile = "goldbook"; - echo "


\n

Laissez-nous un message...


\n"; - include "modules/magicbox.php"; - unset($bodyclass); -?> + +unset($NbMaxPost); +extract($themeset, EXTR_OVERWRITE); +//$headstartcode = ""; +//$headendcode =""; +$bodyclass = "centerbody"; +$module = "goldbook"; +$titre = "Livre d'or"; +$GoldbookFile = "goldbook"; +echo "


\n

Laissez-nous un message...


\n"; +include "modules/magicbox.php"; +unset($bodyclass); diff --git a/pages/lormes2011.php b/pages/lormes2011.php index 336943f..b7f1e62 100644 --- a/pages/lormes2011.php +++ b/pages/lormes2011.php @@ -1,43 +1,43 @@


Images de la gare de Lormes (2011)

- +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + +
diff --git a/pages/menu.php b/pages/menu.php index 0ff5ffe..a9bb8eb 100644 --- a/pages/menu.php +++ b/pages/menu.php @@ -26,8 +26,8 @@ else if ((myhours >=19) && (myhours <24))

Bienvenue sur notre site.

- - + +

Nous vous souhaitons une agréable visite...

Veuillez choisir un sujet dans le menu ci-contre.




diff --git a/pages/modules/canal.php b/pages/modules/canal.php index e0171f7..f1f1f61 100644 --- a/pages/modules/canal.php +++ b/pages/modules/canal.php @@ -6,8 +6,8 @@
- - + +

diff --git a/pages/modules/chateau.php b/pages/modules/chateau.php index cf1a899..6bdc978 100644 --- a/pages/modules/chateau.php +++ b/pages/modules/chateau.php @@ -6,11 +6,11 @@
- - + + - +

diff --git a/pages/modules/chateaudeau.php b/pages/modules/chateaudeau.php index 923c8b6..77ff4c8 100644 --- a/pages/modules/chateaudeau.php +++ b/pages/modules/chateaudeau.php @@ -6,8 +6,8 @@
- - + +

diff --git a/pages/modules/ferme.php b/pages/modules/ferme.php index 0e1f22d..f9eb0b9 100644 --- a/pages/modules/ferme.php +++ b/pages/modules/ferme.php @@ -6,11 +6,11 @@
- + - - + +

diff --git a/themes/default/theme.php b/themes/default/theme.php index e8eeedd..272cafe 100644 --- a/themes/default/theme.php +++ b/themes/default/theme.php @@ -1,4 +1,5 @@ -- 2.40.1 From 0ef49023fa54b1d0b1e83cb4d53a7de3e2db09fd Mon Sep 17 00:00:00 2001 From: n Date: Mon, 12 Feb 2024 20:54:27 +0100 Subject: [PATCH 2/3] fix pictures alignement in station map pages --- pages/carte/7.php | 2 +- pages/carte/8.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/carte/7.php b/pages/carte/7.php index f47baab..8348e3e 100644 --- a/pages/carte/7.php +++ b/pages/carte/7.php @@ -4,7 +4,7 @@
- +
diff --git a/pages/carte/8.php b/pages/carte/8.php index 3b588a8..7822c1a 100644 --- a/pages/carte/8.php +++ b/pages/carte/8.php @@ -4,7 +4,7 @@
-
+
-- 2.40.1 From 67db1b0e6e703562898ec45e4fb1b2ac42176c94 Mon Sep 17 00:00:00 2001 From: n Date: Mon, 12 Feb 2024 20:56:58 +0100 Subject: [PATCH 3/3] add Gitea CI --- .gitea/workflows/lint.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitea/workflows/lint.yml diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml new file mode 100644 index 0000000..acf819b --- /dev/null +++ b/.gitea/workflows/lint.yml @@ -0,0 +1,27 @@ +name: lint +run-name: lint is launched by ${{ github.actor }} +on: [push] +jobs: + check: + runs-on: ubuntu-latest + name: lint + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - name: Install linters using Composer + run: | + export COMPOSER_HOME=/tmp + echo "{}" > composer.json + composer config --no-interaction allow-plugins.bamarni/composer-bin-plugin true + composer require --dev bamarni/composer-bin-plugin + composer bin phplint require --dev overtrue/phplint + composer require --dev friendsofphp/php-cs-fixer + - name: Lint + run: vendor/bin/phplint --no-cache --no-progress --exclude=vendor --verbose + - name: PHP CS Fixer + run: vendor/bin/php-cs-fixer fix --dry-run --verbose --diff . + - run: echo "🍏 This job's status is ${{ job.status }}." + -- 2.40.1