Skip to content

Commit

Permalink
replace strftime()
Browse files Browse the repository at this point in the history
replacing deprecated function strftime() with date()
  • Loading branch information
dwblmo committed Jan 21, 2022
1 parent f273c7c commit 95c096e
Show file tree
Hide file tree
Showing 26 changed files with 589 additions and 593 deletions.
2 changes: 1 addition & 1 deletion lmo/addon/classlib/classes/liga.class.php
Expand Up @@ -463,7 +463,7 @@ function showDetailsHTML() {
*/
function ligaDatumAsString ($dateFormat=null) {
$dateFormat = !is_null($dateFormat)?$dateFormat:$this->options->keyValues['DatF'];
return strftime ( $dateFormat , $this->ligaDatum);
return date($dateFormat, $this->ligaDatum);
}

/**
Expand Down
40 changes: 20 additions & 20 deletions lmo/addon/classlib/classes/pokalRunde.class.php
@@ -1,9 +1,9 @@
<?php
/**
* Class PokalRunde
* Bildet die komplette Runde eines KO Tuniers / Playoff oder Ähnlichem ab.
* Bildet die komplette Runde eines KO Tuniers / Playoff oder �hnlichem ab.
*
* @author Markus Dörfling <markus@doerfling.net>
* @author Markus D�rfling <markus@doerfling.net>
* @version $Id$
* @package classlib
*/
Expand All @@ -17,7 +17,7 @@ class pokalRunde {
var $roundNumber;

/**
* Modus 0->Tabelle / 1-> KO / 2->KO mir Rückspiel / 3->best of 3 / 5->best of 5 / 7->best of 7
* Modus 0->Tabelle / 1-> KO / 2->KO mir R�ckspiel / 3->best of 3 / 5->best of 5 / 7->best of 7
* @var integer
* @access private
*/
Expand Down Expand Up @@ -71,17 +71,17 @@ function pokalRunde($roundNumber,$mode,$begin=0,$end=0,$spieltage=null) {
}

/**
* Gibt die Nummer der Runde zurück
* Gibt die Nummer der Runde zur�ck
*
* @access public
* @return integer Modus dér Runde
* @return integer Modus d�r Runde
*/
function getRoundNumber() {
return $this->roundNumber;
}

/**
* Setzt den Modus dieser Runde zurück
* Setzt den Modus dieser Runde zur�ck
*
* @access public
* @param integer value Modus der Runde
Expand All @@ -92,10 +92,10 @@ function setMode($value) {
}

/**
* Gibt den aktuellen Modus dieser Runde zurück
* Gibt den aktuellen Modus dieser Runde zur�ck
*
* @access public
* @return integer Modus dér Runde
* @return integer Modus d�r Runde
*/
function getMode() {
return $this->mode;
Expand All @@ -113,8 +113,8 @@ function setBegin($value) {
}

/**
* Gibt den Timestamp der Rundenbegins zurück, wenn format angegeben ist wird
* das Datum im angegeben Format zurückgegeben
* Gibt den Timestamp der Rundenbegins zur�ck, wenn format angegeben ist wird
* das Datum im angegeben Format zur�ckgegeben
*
* @access public
* @param string format der Datumsausgabe
Expand All @@ -124,7 +124,7 @@ function setBegin($value) {
function getBegin($format="") {
if ($this->end != 0 ) {
if ($format == "") return $this->begin;
else return strftime($format,$this->begin);
else return date($format,$this->begin);
} else return false;
}

Expand All @@ -140,23 +140,23 @@ function setEnd($value) {
}

/**
* Gibt den Timestamp der Rundenendes zurück, wenn format angegeben ist wird
* das Datum im angegeben Format zurückgegeben
* Gibt den Timestamp der Rundenendes zur�ck, wenn format angegeben ist wird
* das Datum im angegeben Format zur�ckgegeben
*
* @access public
* @param string format der Datumsausgabe
* @see strftime()
* @return mixed Ende dér Runde
* @return mixed Ende d�r Runde
*/
function getEnd($format="") {
if ($this->end != 0 ) {
if ($format == "") return $this->end;
else return strftime($format,$this->end);
else return date($format,$this->end);
} else return false;
}

/**
* Fügt Referenzen auf Partien dieser Runde hinzu
* F�gt Referenzen auf Partien dieser Runde hinzu
*
* @access public
* @param array/object value Objecte der partien
Expand All @@ -173,7 +173,7 @@ function addPartien(&$value) {
}

/**
* Gibt Partien dieser Runde zurück, ist $Number ="" wird das komplette Array übergeben
* Gibt Partien dieser Runde zur�ck, ist $Number ="" wird das komplette Array �bergeben
*
* @access public
* @param integer Nummer der Partie
Expand All @@ -186,7 +186,7 @@ function getPartien($number="") {
}

/**
* Fügt Referenzen auf die Spieltage (und die Partien dieses Spieltags) dieser Runde hinzu
* F�gt Referenzen auf die Spieltage (und die Partien dieses Spieltags) dieser Runde hinzu
*
* @access public
* @param array/object value Objecte der Spieltage
Expand All @@ -207,7 +207,7 @@ function addSpieltage(&$value) {
}

/**
* Gibt Spieltage dieser Runde zurück, ist $Number ="" wird das komplette Array übergeben
* Gibt Spieltage dieser Runde zur�ck, ist $Number ="" wird das komplette Array �bergeben
*
* @access public
* @param integer Nummer des Spieltags
Expand All @@ -220,7 +220,7 @@ function getSpieltage($number="") {
}

/**
* Gibt die Anzahl der Spieltage dieser Pokal Runde zurück
* Gibt die Anzahl der Spieltage dieser Pokal Runde zur�ck
*
* @access public
* @return interger Anzahl der Spieltage
Expand Down
2 changes: 1 addition & 1 deletion lmo/addon/tipp/lmo-tippdir.php
Expand Up @@ -120,7 +120,7 @@
$tippfile=PATH_TO_ADDONDIR."/tipp/".$tipp_dirtipp.substr($dummy[$k],0,-4)."_".str_replace(" ","_",$_SESSION['lmotippername']).".tip";
echo "<li><a href='".$addi.$dummy[$k]."'>".$t0."</a>";
if (file_exists($tippfile)) {
echo "<br><small>".$text['tipp'][138]." ".strftime($defdateformat,filemtime($tippfile)).$t3."</small>";
echo "<br><small>".$text['tipp'][138]." ".date($defdateformat,filemtime($tippfile)).$t3."</small>";
}
echo "</li>";
}
Expand Down
2 changes: 1 addition & 1 deletion lmo/addon/tipp/lmo-tippeditko.php
Expand Up @@ -41,7 +41,7 @@

if ($datm==1) {
if ($mterm[$st-1][$i][$n]>0) {
$dum1=strftime($datf, $mterm[$st-1][$i][$n]);
$dum1=date($datf, $mterm[$st-1][$i][$n]);
} else {
$dum1="";
}?>
Expand Down
2 changes: 1 addition & 1 deletion lmo/addon/tipp/lmo-tippeditliga.php
Expand Up @@ -31,7 +31,7 @@

if ($datm==1) {
if ($mterm[$st-1][$i]>0) {
$dum1=strftime($datf, $mterm[$st-1][$i]);
$dum1=strftdateime($datf, $mterm[$st-1][$i]);
} else {
$dum1="";
}?>
Expand Down
4 changes: 2 additions & 2 deletions lmo/addon/tipp/lmo-tippemail.php
Expand Up @@ -218,7 +218,7 @@
$zeit = zeit($mterm[$st0][$dd], $datum1[$st0], $datum2[$st0]);
if ($now < $zeit && $then > $zeit) {
if ((($st == 0 && $goaltippa[$st0][$dd] == "_") || ($st > 0 && $goaltippa[$dd] == "_")) && $teama[$st0][$dd] > 0) {
$spiele = $spiele.$teams[$teama[$st0][$dd]]." - ".$teams[$teamb[$st0][$dd]]." (".$text['tipp'][87]." ".strftime("%A, %d.%m.%Y %R", $zeit).")\n";
$spiele = $spiele.$teams[$teama[$st0][$dd]]." - ".$teams[$teamb[$st0][$dd]]." (".$text['tipp'][87]." ".date("l, d.m.Y H:i", $zeit).")\n";
}
}
}
Expand All @@ -228,7 +228,7 @@
$zeit = zeit($mterm[$st0][$dd][$ddd], $datum1[$st0], $datum2[$st0]);
if ($now < $zeit && $then > $zeit) {
if ((($st == 0 && $goaltippa[$st0][$dd][$ddd] == "_") || ($st > 0 && $goaltippa[$dd][$ddd] == "_")) && $teama[$st0][$dd] > 0) {
$spiele = $spiele.$teams[$teama[$st0][$dd]]." - ".$teams[$teamb[$st0][$dd]]." (".$text['tipp'][87]." ".strftime("%A, %d.%m.%Y %R", $zeit).")\n";
$spiele = $spiele.$teams[$teama[$st0][$dd]]." - ".$teams[$teamb[$st0][$dd]]." (".$text['tipp'][87]." ".date("l, d.m.Y H:i", $zeit).")\n";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lmo/addon/tipp/lmo-tippemailviewer.php
Expand Up @@ -101,7 +101,7 @@
array_push($spiel, $spiel0);
array_push($teama, $teams[$teama0]);
array_push($teamb, $teams[$teamb0]);
array_push($zeit, strftime("%A, %d.%m.%Y %R", $zeit0));
array_push($zeit, date("l, d.m.Y H:i", $zeit0));
$anzspiele++;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lmo/addon/tipp/lmo-tippopenfileviewer.php
Expand Up @@ -136,7 +136,7 @@
$dummy1 = $dummy1+substr($deftime, 0, 2) * 60 * 60+substr($deftime, 3, 2) * 60;
}
if ($dummy1 > -1) {
$dum[2] = strftime("%d.%m.%Y", $dummy1);
$dum[2] = date("d.m.Y", $dummy1);
} else {
$dum[2] = "";
}
Expand All @@ -150,7 +150,7 @@
$dummy2 = $dummy2+substr($deftime, 0, 2) * 60 * 60+substr($deftime, 3, 2) * 60;
}
if ($dummy2 > -1) {
$dum[2] = strftime("%d.%m.%Y", $dummy2);
$dum[2] = date("d.m.Y", $dummy2);
} else {
$dum[2] = "";
}
Expand Down
8 changes: 4 additions & 4 deletions lmo/addon/tipp/lmo-tippviewer.php
Expand Up @@ -99,11 +99,11 @@
$then1 = strtotime("+".($start+$tipp_viewertage)." day");
}

$now1 = strftime("%d.%m.%Y", $now1);
$now1 = date("d.m.Y", $now1);
$now = mktime(0, 0, 0, substr($now1, 3, 2), substr($now1, 0, 2), substr($now1, -4));
$then = strftime("%d.%m.%Y", $then1);
$then = date("d.m.Y", $then1);
$then = mktime(0, 0, 0, substr($then, 3, 2), substr($then, 0, 2), substr($then, -4));
$then1 = strftime("%d.%m.%Y", ($then-1));
$then1 = date("d.m.Y", ($then-1));

for($liganr = 0; $liganr < $anzligen; $liganr++) {
$file = $dateien[$liganr];
Expand Down Expand Up @@ -339,7 +339,7 @@
if ($datm[$i] == 1) {
if ($mterm[$i] > 0) {
$datf = $defdateformat;
$dum1 = strftime($datf, $mterm[$i]);
$dum1 = date($datf, $mterm[$i]);
}
}?>
<tr>
Expand Down
32 changes: 15 additions & 17 deletions lmo/lmo-adminbasic.php
Expand Up @@ -263,10 +263,10 @@
<td class="nobr" align="left">
<input type="radio" class="form-check-input" name="xdatfselect" value="1" checked>
<select class="custom-select" name="xdatf" onChange="dolmoedit();document.getElementsByName('xdatfselect')[0].checked=true;"><?php
$dummf=array("%d.%m. %H:%M","%d.%m.%Y %H:%M","%a. %d.%m. %H:%M","%A, %d.%m. %H:%M","%a. %d.%m.%Y %H:%M","%A, %d.%m.%Y %H:%M");?>
$dummf=array("d.m. H:i", "d.m.Y H:i", "D., d.m. H:i", "l, d.m. H:i", "D., d.m.Y H:i", "l, d.m.Y H:i");?>
<option value="">__</option><?php
for($y=0;$y<count($dummf);$y++){?>
<option value="<?php echo $dummf[$y]?>"<?php if($datf==$dummf[$y]){echo " selected";}?>><?php echo strftime($dummf[$y])?></option><?php
<option value="<?php echo $dummf[$y]?>"<?php if($datf==$dummf[$y]){echo " selected";}?>><?php echo date($dummf[$y], time())?></option><?php
}?>
</select>
</td>
Expand All @@ -275,27 +275,25 @@
<td class="nobr" align="left">
<input type="radio" class="form-check-input" name="xdatfselect" value=""<?php if (!in_array($datf,$dummf)) echo " checked";?>>
<input type="text" class="lmo-formular-input" name="xdatf2" onChange="dolmoedit();document.getElementsByName('xdatf')[1].checked=true;" value="<?php echo $datf?>">
<a href="http://php.net/strftime">
<a href="https://www.php.net/manual/de/datetime.format.php">
<span class="popup">
<strong><?php echo $text[545];?></strong><br>
%a = <?php echo strftime("%a")?><br>
%A = <?php echo strftime("%A")?><br>
D = <?php echo date("D", time());?><br>
l = <?php echo date("l", time());?><br>
<strong><?php echo $text[546];?></strong><br>
%d = <?php echo strftime("%d")?><br>
%e = <?php echo strftime("%e")?><br>
d = <?php echo date("d", time());?><br>
j = <?php echo date("j", time());?><br>
<strong><?php echo $text[547];?></strong><br>
%m = <?php echo strftime("%m")?><br>
%b = <?php echo strftime("%b")?><br>
%B = <?php echo strftime("%B")?><br>
m = <?php echo date("m", time());?><br>
M = <?php echo date("M", time());?><br>
F = <?php echo date("F", time());?><br>
<strong><?php echo $text[548];?></strong><br>
%y = <?php echo strftime("%y")?><br>
%Y = <?php echo strftime("%Y")?><br><br>
%x = <?php echo strftime("%x")?><br>
y = <?php echo date("y", time());?><br>
Y = <?php echo date("Y", time());?><br>
<strong><?php echo $text[549];?></strong><br>
%H = <?php echo strftime("%H")?><br>
%M = <?php echo strftime("%M")?><br>
%R = <?php echo strftime("%R")?><br>
%r = <?php echo strftime("%r")?><br>
H = <?php echo date("H", time());?><br>
i = <?php echo date("i", time());?><br>
A = <?php echo date("A", time());?><br>
</span>
?</a>
</td>
Expand Down
2 changes: 1 addition & 1 deletion lmo/lmo-admincal.php
Expand Up @@ -130,7 +130,7 @@ function lmogeben(x){
if($heute==1){?>
<tr><?php
}?>
<td align="center" class="<?php echo $stil?>"><a href="#" onclick='lmogeben("<?php echo strftime("%d.%m.%Y",strtotime($i." ".$dath))?>")' title="Datum übernehmen"><?php echo "$k$i"?></a></td><?php
<td align="center" class="<?php echo $stil?>"><a href="#" onclick='lmogeben("<?php echo date("d.m.Y",strtotime($i." ".$dath))?>")' title="Datum übernehmen"><?php echo "$k$i"?></a></td><?php
if($heute==7){?>
</tr><?php
$j=$heute;
Expand Down
24 changes: 12 additions & 12 deletions lmo/lmo-adminedit.php
Expand Up @@ -55,7 +55,7 @@
$datum = explode('.', $datum1[$st-1]);
$dummy = strtotime($datum[0]." ".$me[intval($datum[1])]." ".$datum[2]);
if ($dummy > -1) {
$datum1[$st-1] = strftime("%d.%m.%Y", $dummy);
$datum1[$st-1] = date("d.m.Y", $dummy);
} else {
$datum1[$st-1] = "";
}
Expand All @@ -65,7 +65,7 @@
$datum = explode('.', $datum2[$st-1]);
$dummy = strtotime($datum[0]." ".$me[intval($datum[1])]." ".$datum[2]);
if ($dummy > -1) {
$datum2[$st-1] = strftime("%d.%m.%Y", $dummy);
$datum2[$st-1] = date("d.m.Y", $dummy);
} else {
$datum2[$st-1] = "";
}
Expand Down Expand Up @@ -230,10 +230,10 @@ function array_values_recursive($ary) {
$lmo_spieltermine=array_filter(array_values_recursive($mterm[$st-1]),"filterZero");
if (!empty($lmo_spieltermine)) {
if (empty($datum1[$st-1])) {
$datum1[$st-1] = strftime("%d.%m.%Y", min($lmo_spieltermine));
$datum1[$st-1] = date("d.m.Y", min($lmo_spieltermine));
}
if (empty($datum2[$st-1])) {
$datum2[$st-1] = strftime("%d.%m.%Y", max($lmo_spieltermine));
$datum2[$st-1] = date("d.m.Y", max($lmo_spieltermine));
}
}

Expand Down Expand Up @@ -377,9 +377,9 @@ function array_values_recursive($ary) {
if ($lmtype == 0) {?>
<tr><?php
if ($mterm[$st-1][$i] > 0) {
$dum1 = strftime("%d.%m.%Y", $mterm[$st-1][$i]);
$dum2 = strftime("%H:%M", $mterm[$st-1][$i]);
$dum3 = $me[intval(strftime("%m", $mterm[$st-1][$i]))]." ".strftime("%Y", $mterm[$st-1][$i]);
$dum1 = date("d.m.Y", $mterm[$st-1][$i]);
$dum2 = date("H:i", $mterm[$st-1][$i]);
$dum3 = $me[intval(date("m", $mterm[$st-1][$i]))]." ".date("Y", $mterm[$st-1][$i]);
} else {
$dum1 = "";
$dum2 = "";
Expand Down Expand Up @@ -474,9 +474,9 @@ function array_values_recursive($ary) {
}?>
<tr><?php
if ($mterm[$st-1][$i][$n] > 0) {
$dum1 = strftime("%d.%m.%Y", $mterm[$st-1][$i][$n]);
$dum2 = strftime("%H:%M", $mterm[$st-1][$i][$n]);
$dum3 = $me[intval(strftime("%m", $mterm[$st-1][$i][$n]))]." ".strftime("%Y", $mterm[$st-1][$i][$n]);
$dum1 = date("d.m.Y", $mterm[$st-1][$i][$n]);
$dum2 = date("H:i", $mterm[$st-1][$i][$n]);
$dum3 = $me[intval(date("m", $mterm[$st-1][$i][$n]))]." ".date("Y", $mterm[$st-1][$i][$n]);
} else {
$dum1 = "";
$dum2 = "";
Expand Down Expand Up @@ -567,9 +567,9 @@ function array_values_recursive($ary) {
$goalb[$st-1][$i][$n] = "_";
}?>
<td width="2">&nbsp;</td>
<td class="lmoBackMarkierung" align="right"><input title="<?php echo $text[109] ?>" class="custom-control" style="width:40px;" type="number" name="xgoala<?php echo $i.$n; ?>" tabindex="<?php echo $i.$n;?>7" min="0" size="1" maxlength="4" value="<?php echo $goala[$st-1][$i][$n]; ?>" onChange="lmotorgte('a','<?php echo $i.$n; ?>')" onKeyDown="lmotorclk('a','<?php echo $i.$n; ?>',event.keyCode)"></td>
<td class="lmoBackMarkierung" align="right"><input title="<?php echo $text[109] ?>" class="custom-control" style="width:40px;" type="number" name="xgoala<?php echo $i.$n; ?>" tabindex="<?php echo $i.$n;?>7" min="0" size="1" maxlength="4" value="<?php echo $goala[$st-1][$i][$n]; ?>"></td>
<td class="lmoBackMarkierung" align="center" width="8">:</td>
<td class="lmoBackMarkierung" align="right"><input title="<?php echo $text[110] ?>" class="custom-control" style="width:40px;" type="number" name="xgoalb<?php echo $i.$n; ?>" tabindex="<?php echo $i.$n;?>8" min="0" size="1" maxlength="4" value="<?php echo $goalb[$st-1][$i][$n]; ?>" onChange="lmotorgte('b','<?php echo $i.$n; ?>')" onKeyDown="lmotorclk('b','<?php echo $i.$n; ?>',event.keyCode)"></td>
<td class="lmoBackMarkierung" align="right"><input title="<?php echo $text[110] ?>" class="custom-control" style="width:40px;" type="number" name="xgoalb<?php echo $i.$n; ?>" tabindex="<?php echo $i.$n;?>8" min="0" size="1" maxlength="4" value="<?php echo $goalb[$st-1][$i][$n]; ?>"></td>
<td class="lmoBackMarkierung" width="3">&nbsp;</td>
<td class="lmoBackMarkierung">
<select class="custom-select" name="xmspez<?php echo $i.$n; ?>" onChange="dolmoedit()" title="<?php echo $text[111] ?>" tabindex="<?php echo $i.$n;?>9" data-width="auto">
Expand Down

0 comments on commit 95c096e

Please sign in to comment.