From 2c7d2e88b48e2f9d27b222b2d7149e8fe739cced Mon Sep 17 00:00:00 2001 From: n Date: Sun, 3 Nov 2024 21:50:57 +0100 Subject: [PATCH 1/2] fix some warnings --- include/head.inc.php | 2 +- include/standard.inc.php | 2 +- index.php | 6 +++--- modules/goldbook.php | 19 +++++-------------- modules/magicbox.php | 16 ++++++++++++---- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/include/head.inc.php b/include/head.inc.php index 14d94f9..ac0b1dd 100644 --- a/include/head.inc.php +++ b/include/head.inc.php @@ -2,7 +2,7 @@ ","\">[Lien]",$traite); // themes global $theme; - $traite = ereg_replace("THEME_COURANT", $theme, $traite); + $traite = str_replace("THEME_COURANT", $theme, $traite); return $traite; } diff --git a/index.php b/index.php index 0adfacf..4c3230c 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ \n"; - $modulepage = "commentnews"; - $gbparam = "\n"; -} -else*/ -//echo "?modulepage=goldbook'>\n"; echo "/livre.html'>\n"; echo "
\n\n\n\n"; if (isset($footerbox) && ($footerbox == 1)) { -- 2.40.1 From b12fc8bcbd0ecd53cfd201766f6008ebcf58c02e Mon Sep 17 00:00:00 2001 From: n Date: Sun, 3 Nov 2024 22:10:58 +0100 Subject: [PATCH 2/2] do not attempt to write to $GoldbookFile.csv, send info via e-mail instead --- modules/goldbook.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/goldbook.php b/modules/goldbook.php index 956e8fc..02e196d 100644 --- a/modules/goldbook.php +++ b/modules/goldbook.php @@ -48,9 +48,9 @@ if (isset($param) && $param == "postgb") { $VMessage = str_replace("\n", "
", $VMessage); $VMessage = str_replace("&", "&", $VMessage); $gbline = sprintf("\"".$date."\",\"".$iheure."\",\"".htmlspecialchars($VName)."\",\"".$VEmail."\",\"".$VMessage."\"\n"); - $goldbook = fopen("modules/goldbook/$GoldbookFile.csv", "a"); - fwrite($goldbook, $gbline); - fclose($goldbook); + // $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()); //unlink("$GoldbookFile.dat"); } -- 2.40.1
@@ -34,7 +26,6 @@ echo "
-
Nom/Pseudo (facultatif): e-mail (facultatif):
Message:
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"; @@ -47,15 +38,15 @@ if (!(file_exists("modules/goldbook/$GoldbookFile.csv"))) { } // ajout des messages -if ($param == "postgb") { +if (isset($param) && $param == "postgb") { if ($VMessage != "" && isset($_POST['piejacon'])) { $date = date_format(date_create(), "d/m/Y"); $iheure = date("H:i"); - $VMessage = ereg_replace("<", "<", $VMessage); - $VMessage = ereg_replace(">", ">", $VMessage); + $VMessage = str_replace("<", "<", $VMessage); + $VMessage = str_replace(">", ">", $VMessage); $VMessage = parse_string(stripcslashes($VMessage)); - $VMessage = ereg_replace("\n", "
", $VMessage); - $VMessage = ereg_replace("&", "&", $VMessage); + $VMessage = str_replace("\n", "
", $VMessage); + $VMessage = str_replace("&", "&", $VMessage); $gbline = sprintf("\"".$date."\",\"".$iheure."\",\"".htmlspecialchars($VName)."\",\"".$VEmail."\",\"".$VMessage."\"\n"); $goldbook = fopen("modules/goldbook/$GoldbookFile.csv", "a"); fwrite($goldbook, $gbline); diff --git a/modules/magicbox.php b/modules/magicbox.php index ccf6eba..c80e8e1 100644 --- a/modules/magicbox.php +++ b/modules/magicbox.php @@ -38,13 +38,17 @@ if (isset($headclass)) { } echo "'>\n"; -echo "$headstartcode"; +if (isset($headstartcode)) { + echo "$headstartcode"; +} if (isset($headlien)) { echo "$titre"; } else { echo "$titre"; } -echo "$headendcode\n"; +if (isset($headendcode)) { + echo "$headendcode\n"; +} // ************** body ******************* echo "
"; echo "
\n\n\n\n\n
"; -echo "$bodystartcode"; +if (isset($bodystartcode)) { + echo "$bodystartcode"; +} include "modules/".$module.".php"; -echo "$bodyendcode"; +if (isset($bodyencode)) { + echo "$bodyencode"; +} echo "
\n
\n