mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-30 09:34:28 +00:00
fix spieler.php + multivillage.tpl and fix player register time
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
function register($username, $password, $email, $tribe, $locate, $act) {
|
||||
$time = time();
|
||||
$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)) {
|
||||
return mysql_insert_id($this->connection);
|
||||
} else {
|
||||
|
||||
@@ -71,4 +71,4 @@
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
@@ -9,10 +9,20 @@
|
||||
|
||||
//de bird
|
||||
if($displayarray['protect'] > time()){
|
||||
$uurover=date('H:i:s', ($displayarray['protect']-time())-3600);
|
||||
$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);
|
||||
$secondsDiff = $displayarray['protect'] - time();
|
||||
$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 {
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ else if(isset($_GET['c'])) {
|
||||
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 : "&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>';
|
||||
}
|
||||
}
|
||||
@@ -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>';
|
||||
}
|
||||
}
|
||||
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{
|
||||
for($i=1;$i<=count($session->villages);++$i){echo'
|
||||
<tr>
|
||||
|
||||
@@ -15,11 +15,11 @@ include("GameEngine/Village.php");
|
||||
$start = $generator->pageLoadTimeStart();
|
||||
if(isset($_GET['newdid'])) {
|
||||
$_SESSION['wid'] = $_GET['newdid'];
|
||||
if(isset($_GET['d'])){
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?d=".$_GET['d']);
|
||||
if(isset($_GET['d']) && isset($_GET['c'])){
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?d=".$_GET['d']."&c=".$_GET['c']);
|
||||
}
|
||||
else if(isset($_GET['c'])){
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?c=".$_GET['c']);
|
||||
else if(isset($_GET['d'])){
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?d=".$_GET['d']);
|
||||
}
|
||||
else{
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
|
||||
+5
-1
@@ -9,7 +9,7 @@
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
ob_start();
|
||||
include("GameEngine/Village.php");
|
||||
$start = $generator->pageLoadTimeStart();
|
||||
$profile->procProfile($_POST);
|
||||
@@ -18,6 +18,8 @@ if(isset($_GET['newdid'])) {
|
||||
$_SESSION['wid'] = $_GET['newdid'];
|
||||
if(isset($_GET['s'])){
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?s=".$_GET['s']);
|
||||
}else if(isset($_GET['uid'])){
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?uid=".$_GET['uid']);
|
||||
}else{
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
}
|
||||
@@ -144,6 +146,8 @@ else if (isset($_GET['s'])) {
|
||||
if($_GET['s'] == 4) {
|
||||
include("Templates/Profile/graphic.tpl");
|
||||
}
|
||||
}else{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?uid=".$session->uid);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user