From 2c7d2e88b48e2f9d27b222b2d7149e8fe739cced Mon Sep 17 00:00:00 2001 From: n Date: Sun, 3 Nov 2024 21:50:57 +0100 Subject: [PATCH] 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)) {
@@ -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