Thanx again, but should I update the file (time.php) only?
I will give you a hint
This is what the current (time.php) file:
<?
echo time();
?>
well and the (vsys.php) got these codes:
[code]function getNextTurn($user){
global $conf;
$info=getCommonInfo();
$lastTurnTime=$info->lastTurnTime;
$thisTime=time();
$dif=$thisTime-$lastTurnTime;
//$nextTurn=$dif;
$nextTurnMin=$dif/60;
/*if ($nextTurnMin>$conf[“minutes_per_turn”]){
//echo “--------”;
$addTurnsF=$dif/($conf[“minutes_per_turn”]60);
$addTurns=floor($addTurnsF);
//$nextTurn1=($addTurnsF-$addTurns)$conf[“minutes_per_turn”];
$nextTurn1=$dif-(($conf[“minutes_per_turn”]60)$addTurns);
//echo $addTurns."##".$nextTurn1."##".($thisTime-$nextTurn1)."
";
$nextTurn=round($nextTurn1/60);
$addTurns+=$user->attackTurns;
addTurns($user->ID,$addTurns,$thisTime-$nextTurn1);
}else*/
{
$nextTurn=round($nextTurnMin);
}
//echo $dif."<br>";
$nextTurn=$conf["minutes_per_turn"]-$nextTurn;
if ($nextTurn<0)$nextTurn=0;
return $nextTurn;//($conf["minutes_per_turn"]-$nextTurn);
}
function getCommonInfo(){
$str=“select * from Mercenaries
“;
//echo $str;
$q = @mysql_query($str);
if (!$q) {
print ('Query failed: '.mysql_error());
return;
}
if (!@mysql_num_rows($q)) {
return 0;
}
else{
$st=””;
$st = mysql_fetch_object($q);
return $st;
}
}
//----------------------------Messages-----------------------------------------------
function getMessagesCount($userID){
$str = “SELECT COUNT(*) FROM Messages
where userID=’$userID’ “;
$q = @mysql_query($str);
if ($q){
$st = mysql_fetch_array($q);
return $st[0];
}else{return 0;}
}
function getAllMessages($userID ){
$str=“SELECT * FROM Messages
WHERE userID=’$userID’”;
//print $str;
$q = @mysql_query($str);
if (!$q) {print ('Query failed: '.mysql_error()); return; }
if (!@mysql_num_rows($q)) {return;}
else{
$st=””;
$i=0;
while ($row = mysql_fetch_object($q)){
$st[$i]=$row;
$st[$i]->subject =urldecode ($st[$i]->subject);
$st[$i]->text =urldecode ($st[$i]->text);
$i++;
}
return $st;
}
}
function getMessage($messID){
$str=“select * from Messages
where ID=’$messID’ “;
//echo $str;
$q = @mysql_query($str);
if (!$q) {
print ('Query failed: '.mysql_error());
return;
}
if (!@mysql_num_rows($q)) {
return 0;
}
else{
$st=””;
$st = mysql_fetch_object($q);
$st->subject =urldecode ($st->subject);
$st->text =urldecode ($st->text);
return $st;
}
}[/code]