Hab deine Änderungen für PHP 5 übernommen. Das nächste Paket wird also PHP 5 kompatibel sein
Allerdings ist mir beim Testen aufgefallen, dass das mit den "0 days" Blödsinn ist.
strtotime("0 days") liefert unter PHP 4 das aktuelle Datum und die Zeit. Unter PHP 5 dürfte die Zeitinformation fehlen, eine Änderung an diesen Stellen ist also nötig. Aber was ich vorgeschlagen hab, ist wohl quatsch. Richtig wäre
strtotime(date("Y-m-d H:i:s")) oder
strtotime(date("r")). Sorry!
Hab die
absolut nötigen Änderungen mal für 0.9.7 zusammengeschrieben und werde die, wenn du es nicht machst und einverstanden bist, auf DragonPrime veröffentlichen.
$this->bbcode_second_pass_code('', 'about.php:
$time = (strtotime(date("1971-m-d H:i:s",strtotime("now -".getsetting("gameoffsetseconds",0)." seconds"))))*getsetting("daysperday",4) % strtotime("1971-01-01 00:00:00");
->
$time = (strtotime(date("1971-m-d H:i:s",strtotime(date("r")."-".getsetting("gameoffsetseconds",0)." seconds"))))*getsetting("daysperday",4) % strtotime("1971-01-01 00:00:00");
--
"Next new gameday: ".date("h:i:s a",strtotime("+$realsecstotomorrow seconds"))." (".date("H\\h i\\m s\\s",strtotime("1970-01-01 00:00:00 + $realsecstotomorrow seconds"))."),viewonly",
->
"Next new gameday: ".date("h:i:s a",strtotime(date("r")."+$realsecstotomorrow seconds"))." (".date("H\\h i\\m s\\s",strtotime("1970-01-01 00:00:00 + $realsecstotomorrow seconds"))."),viewonly",
----
common.php:
$sql="SELECT name,alive,location,sex,level,laston,loggedin,lastip,uniqueid FROM accounts WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC";
->
$sql="SELECT name,alive,location,sex,level,laston,loggedin,lastip,uniqueid FROM accounts WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC";
--
$time = convertgametime(strtotime("now"));
->
$time = convertgametime(strtotime(date("r")));
--
function convertgametime($intime){
$time = (strtotime(date("1971-m-d H:i:s",strtotime("-".getsetting("gameoffsetseconds",0)." seconds",$intime))))*getsetting("daysperday",4) % strtotime("1971-01-01 00:00:00");
return $time;
}
->
function convertgametime($intime){
$multi = getsetting("daysperday",4);
$offset = getsetting("gameoffsetseconds",0);
$fixtime = mktime(0,0,0-$offset,date("m")-$multi,date("d"),date("Y"));
$time=$multi*(strtotime(date("Y-m-d H:i:s",$intime))-$fixtime);
$time=strtotime(date("Y-m-d H:i:s",$time)."+".($multi*date("I",$intime))." hour");
$time=strtotime(date("Y-m-d H:i:s",$time)."-".date("I",$time). " hour");
$time=strtotime(date("Y-m-d H:i:s",$time)."+".(23-$multi)." hour");
return $time;
}
--
$sql = "DELETE from debuglog WHERE date <'".date("Y-m-d H:i:s",strtotime("-".(getsetting("expirecontent",180)/10)." days"))."'";
->
$sql = "DELETE from debuglog WHERE date <'".date("Y-m-d H:i:s",strtotime(date("r")."-".(getsetting("expirecontent",180)/10)." days"))."'";
--
if (strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds") > $session['lasthit'] && $session['lasthit']>0 && $session[loggedin]){
->
if (strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." seconds") > $session['lasthit'] && $session['lasthit']>0 && $session[loggedin]){
--
$session[lasthit]=strtotime("now");
->
$session[lasthit]=strtotime(date("r"));
----
configuration.php:
$time = (strtotime(date("1971-m-d H:i:s",strtotime("now -".getsetting("gameoffsetseconds",0)." seconds"))))*getsetting("daysperday",4) % strtotime("1971-01-01 00:00:00");
->
$time = (strtotime(date("1971-m-d H:i:s",strtotime(date("r")."-".getsetting("gameoffsetseconds",0)." seconds"))))*getsetting("daysperday",4) % strtotime("1971-01-01 00:00:00");
--
"Last new day: ".date("h:i:s a",strtotime("-$realsecssofartoday seconds")).",viewonly",
"Next new day: ".date("h:i:s a",strtotime("+$realsecstotomorrow seconds")).",viewonly",
->
"Last new day: ".date("h:i:s a",strtotime(date("r")."-$realsecssofartoday seconds")).",viewonly",
"Next new day: ".date("h:i:s a",strtotime(date("r")."+$realsecstotomorrow seconds")).",viewonly",
----
dag.php:
$laston=round((strtotime("0 days")-strtotime($row[laston])) / 86400,0)." days";
->
$laston=round((strtotime(date("r"))-strtotime($row[laston])) / 86400,0)." days";
----
inn.php:
$pvptimeout = date("Y-m-d H:i:s",strtotime("-$pvptime seconds"));
->
$pvptimeout = date("Y-m-d H:i:s",strtotime(date("r")."-$pvptime seconds"));
--
(laston < '".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." sec"))."' OR loggedin=0) AND
->
(laston < '".date("Y-m-d H:i:s",strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." sec"))."' OR loggedin=0) AND
----
list.php:
$sql = "SELECT acctid,name,login,alive,location,sex,level,laston,loggedin,race FROM accounts WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC, dragonkills DESC, login ASC";
->
$sql = "SELECT acctid,name,login,alive,location,sex,level,laston,loggedin,race FROM accounts WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC, dragonkills DESC, login ASC";
--
$laston=round((strtotime("0 days")-strtotime($row[laston])) / 86400,0)." days";
->
$laston=round((strtotime(date("r"))-strtotime($row[laston])) / 86400,0)." days";
----
logdnet.php:
if (strtotime($row[lastupdate])<strtotime("-1 minutes")){
->
if (strtotime($row[lastupdate])<strtotime(date("r")."-1 minutes")){
----
login.php:
$sql="SELECT laston,loggedin FROM accounts WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC";
->
$sql="SELECT laston,loggedin FROM accounts WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC";
--
$sql = "INSERT INTO bans VALUES ('{$_SERVER['REMOTE_ADDR']}','','".date("Y-m-d H:i:s",strtotime("+".($c*3)." hours"))."','Automatic System Ban: Too many failed login attempts.')";
->
$sql = "INSERT INTO bans VALUES ('{$_SERVER['REMOTE_ADDR']}','','".date("Y-m-d H:i:s",strtotime(date("r")."+".($c*3)." hours"))."','Automatic System Ban: Too many failed login attempts.')";
----
pvp.php:
$pvptimeout = date("Y-m-d H:i:s",strtotime("-$pvptime seconds"));
->
$pvptimeout = date("Y-m-d H:i:s",strtotime(date("r")."-$pvptime seconds"));
--
(laston < '".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." sec"))."' OR loggedin=0) AND
->
(laston < '".date("Y-m-d H:i:s",strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." sec"))."' OR loggedin=0) AND
--
if (strtotime($row[laston]) > strtotime("-".getsetting("LOGINTIMEOUT",900)." sec") && $row[loggedin]){
->
if (strtotime($row[laston]) > strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." sec") && $row[loggedin]){
----
referers.php
$sql = "DELETE FROM referers WHERE last<'".date("Y-m-d H:i:s",strtotime("-".getsetting("expirecontent",180)." days"))."'";
->
$sql = "DELETE FROM referers WHERE last<'".date("Y-m-d H:i:s",strtotime(date ("r")."-".getsetting("expirecontent",180)." days"))."'";
--
$diffsecs = strtotime("now")-strtotime($row['last']);
->
$diffsecs = strtotime(date("r"))-strtotime($row['last']);
----
superuser.php:
$laston=round((strtotime("0 days")-strtotime($row[laston])) / 86400,0)." Tage";
->
$laston=round((strtotime(date("r"))-strtotime($row[laston])) / 86400,0)." Tage";
----
user.php:
$sql = "UPDATE accounts SET lasthit='".date("Y-m-d H:i:s",strtotime("-".(86500/getsetting("daysperday",4))." seconds"))."' WHERE acctid='$_GET[userid]'";
->
$sql = "UPDATE accounts SET lasthit='".date("Y-m-d H:i:s",strtotime(date("r")."-".(86500/getsetting("daysperday",4))." seconds"))."' WHERE acctid='$_GET[userid]'";
--
$sql.=",\"".((int)$_POST[duration]==0?"0000-00-00":date("Y-m-d",strtotime(date("r")."+$_POST[duration] days")))."\",";
->
$sql.=",\"".((int)$_POST[duration]==0?"0000-00-00":date("Y-m-d",strtotime("+$_POST[duration] days")))."\",";
--
$expire=round((strtotime($row[banexpire])-strtotime("now")) / 86400,0)." days";
->
$expire=round((strtotime($row[banexpire])-strtotime(date("r"))) / 86400,0)." days";
--
$laston=round((strtotime("0 days")-strtotime($row[laston])) / 86400,0)." days";
->
$laston=round((strtotime(date("r"))-strtotime($row[laston])) / 86400,0)." days";')