fix spieler.php + multivillage.tpl and fix player register time

This commit is contained in:
unknown
2012-04-04 19:14:32 +03:00
parent 3d49190031
commit 6ef77feda0
6 changed files with 33 additions and 11 deletions
+1 -1
View File
@@ -21,7 +21,7 @@
function register($username, $password, $email, $tribe, $locate, $act) { function register($username, $password, $email, $tribe, $locate, $act) {
$time = time(); $time = time();
$timep = (time() + PROTECTION); $timep = (time() + PROTECTION);
$q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,location,act,protect) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, $locate, '$act', $timep)"; $q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,location,act,protect,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, $locate, '$act', $timep, $time)";
if(mysql_query($q, $this->connection)) { if(mysql_query($q, $this->connection)) {
return mysql_insert_id($this->connection); return mysql_insert_id($this->connection);
} else { } else {
+13 -3
View File
@@ -9,10 +9,20 @@
//de bird //de bird
if($displayarray['protect'] > time()){ if($displayarray['protect'] > time()){
$uurover=date('H:i:s', ($displayarray['protect']-time())-3600); $secondsDiff = $displayarray['protect'] - time();
$profiel = preg_replace("/\[#0]/is",'<img src="'.$gpack.'img/t/tn.gif" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>This player has '.$uurover.' hours of beginners protection left.</td></tr></table>\')">', $profiel, 1); $remainingDay = floor($secondsDiff/60/60/24);
$remainingHour = floor(($secondsDiff-($remainingDay*60*60))/3600);
$remainingMinutes = floor(($secondsDiff-($remainingDay*60*60)-($remainingHour*60*60))/60);
$remainingSeconds = floor(($secondsDiff-($remainingDay*60*60)-($remainingHour*60*60))-($remainingMinutes*60));
if(strlen($remainingSeconds) <= 1){
$nul1 = "0";}
if(strlen($remainingMinutes) <= 1){
$nul2 = "0";}
if(strlen($remainingHour) <= 1){ $nul3 = "0"; }
$left="$nul3$remainingHour:$nul2$remainingMinutes:$nul1$remainingSeconds";
$profiel = preg_replace("/\[#0]/is",'<img src="'.$gpack.'img/t/tn.gif" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>This player has '.$left.' hours of beginners protection left.</td></tr></table>\')">', $profiel, 1);
} else { } else {
$geregistreerd=date('d-m-Y', ($displayarray['timestamp'])); $geregistreerd=date('d-m-Y', ($displayarray['regtime']));
$profiel = preg_replace("/\[#0]/is",'<img src="'.$gpack.'img/t/tnd.gif" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>This player registered his account on '.$geregistreerd.'.</td></tr></table>\')">', $profiel, 1); $profiel = preg_replace("/\[#0]/is",'<img src="'.$gpack.'img/t/tnd.gif" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>This player registered his account on '.$geregistreerd.'.</td></tr></table>\')">', $profiel, 1);
} }
+9 -1
View File
@@ -58,7 +58,7 @@ else if(isset($_GET['c'])) {
for($i=1;$i<=count($session->villages);++$i){echo' for($i=1;$i<=count($session->villages);++$i){echo'
<tr> <tr>
<td class="dot '.(($_SESSION['wid'] == $returnVillageArray[$i-1]['wref'] ) ? 'hl':'').'">●</td> <td class="dot '.(($_SESSION['wid'] == $returnVillageArray[$i-1]['wref'] ) ? 'hl':'').'">●</td>
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&c=".$_GET['c']).'">'.htmlspecialchars($returnVillageArray[$i-1]['name']).'</a></td> <td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&d=".$_GET['d']).(($id>=19) ? "&id=".$id : "&c=".$_GET['c']).'">'.htmlspecialchars($returnVillageArray[$i-1]['name']).'</a></td>
<td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>'; <td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>';
} }
} }
@@ -86,6 +86,14 @@ else if(isset($_GET['aid'])) {
<td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>'; <td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>';
} }
} }
else if(isset($_GET['uid'])) {
for($i=1;$i<=count($session->villages);++$i){echo'
<tr>
<td class="dot '.(($_SESSION['wid'] == $returnVillageArray[$i-1]['wref'] ) ? 'hl':'').'">●</td>
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&uid=".$_GET['uid']).'">'.htmlspecialchars($returnVillageArray[$i-1]['name']).'</a></td>
<td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>';
}
}
else{ else{
for($i=1;$i<=count($session->villages);++$i){echo' for($i=1;$i<=count($session->villages);++$i){echo'
<tr> <tr>
+4 -4
View File
@@ -15,11 +15,11 @@ include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart(); $start = $generator->pageLoadTimeStart();
if(isset($_GET['newdid'])) { if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid']; $_SESSION['wid'] = $_GET['newdid'];
if(isset($_GET['d'])){ if(isset($_GET['d']) && isset($_GET['c'])){
header("Location: ".$_SERVER['PHP_SELF']."?d=".$_GET['d']); header("Location: ".$_SERVER['PHP_SELF']."?d=".$_GET['d']."&c=".$_GET['c']);
} }
else if(isset($_GET['c'])){ else if(isset($_GET['d'])){
header("Location: ".$_SERVER['PHP_SELF']."?c=".$_GET['c']); header("Location: ".$_SERVER['PHP_SELF']."?d=".$_GET['d']);
} }
else{ else{
header("Location: ".$_SERVER['PHP_SELF']); header("Location: ".$_SERVER['PHP_SELF']);
+5 -1
View File
@@ -9,7 +9,7 @@
## Copyright: TravianX (c) 2010-2011. All rights reserved. ## ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ## ## ##
################################################################################# #################################################################################
ob_start();
include("GameEngine/Village.php"); include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart(); $start = $generator->pageLoadTimeStart();
$profile->procProfile($_POST); $profile->procProfile($_POST);
@@ -18,6 +18,8 @@ if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid']; $_SESSION['wid'] = $_GET['newdid'];
if(isset($_GET['s'])){ if(isset($_GET['s'])){
header("Location: ".$_SERVER['PHP_SELF']."?s=".$_GET['s']); header("Location: ".$_SERVER['PHP_SELF']."?s=".$_GET['s']);
}else if(isset($_GET['uid'])){
header("Location: ".$_SERVER['PHP_SELF']."?uid=".$_GET['uid']);
}else{ }else{
header("Location: ".$_SERVER['PHP_SELF']); header("Location: ".$_SERVER['PHP_SELF']);
} }
@@ -144,6 +146,8 @@ else if (isset($_GET['s'])) {
if($_GET['s'] == 4) { if($_GET['s'] == 4) {
include("Templates/Profile/graphic.tpl"); include("Templates/Profile/graphic.tpl");
} }
}else{
header("Location: ".$_SERVER['PHP_SELF']."?uid=".$session->uid);
} }
?> ?>
</div> </div>