replace deprecated strftime() function #2

Merged
n merged 1 commit from strftime into main 2024-03-30 22:02:55 +01:00
3 changed files with 5 additions and 13 deletions

View file

@ -295,7 +295,7 @@ function addlog($url)
createfile("$File.csv"); createfile("$File.csv");
} }
$date = strftime("%d/%m/%Y", time()); $date = date_format(date_create(), "d/m/Y");
$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");

View file

@ -6,11 +6,7 @@ function settimer($TimerName, $String)
{ {
$FileTimerName = "modules/timers/$TimerName.csv"; $FileTimerName = "modules/timers/$TimerName.csv";
if (strftime("%m", time()) < 10) { $Date = date_format(date_create(), "YmdHis");
$Date = strftime("%Y%0m%d%H%M%S", time());
} else {
$Date = strftime("%Y%m%d%H%M%S", time());
}
$fp = fopen("$FileTimerName", "w+"); $fp = fopen("$FileTimerName", "w+");
$Ligne = sprintf("\"".$Date."\",\"".$String."\"\n"); $Ligne = sprintf("\"".$Date."\",\"".$String."\"\n");
@ -26,11 +22,7 @@ function timer($TimerName, $TimerNb)
$FileTimerN = "modules/timers/$TimerName.csv"; $FileTimerN = "modules/timers/$TimerName.csv";
if (strftime("%m", time()) < 10) { $Date = date_format(date_create(), "YmdHis");
$Date = strftime("%Y%0m%d%H%M%S", time());
} else {
$Date = strftime("%Y%m%d%H%M%S", time());
}
if (!file_exists("$FileTimerN")) { if (!file_exists("$FileTimerN")) {
$timer = false; $timer = false;
@ -41,7 +33,7 @@ function timer($TimerName, $TimerNb)
fclose($fp); fclose($fp);
$FileDate = $data[0]; $FileDate = $data[0];
$Date = strftime("%Y%m%d%H%M%S", time()); $Date = date_format(date_create(), "YmdHis");
$String = $data[1]; $String = $data[1];

View file

@ -49,7 +49,7 @@ if (!(file_exists("modules/goldbook/$GoldbookFile.csv"))) {
// ajout des messages // ajout des messages
if ($param == "postgb") { if ($param == "postgb") {
if ($VMessage != "" && isset($_POST['piejacon'])) { if ($VMessage != "" && isset($_POST['piejacon'])) {
$date = strftime("%d/%m/%Y", time()); $date = date_format(date_create(), "d/m/Y");
$iheure = date("H:i"); $iheure = date("H:i");
$VMessage = ereg_replace("<", "&lt;", $VMessage); $VMessage = ereg_replace("<", "&lt;", $VMessage);
$VMessage = ereg_replace(">", "&gt;", $VMessage); $VMessage = ereg_replace(">", "&gt;", $VMessage);