mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-03 11:04:24 +00:00
more fixes
This commit is contained in:
@@ -4191,7 +4191,6 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
global $database, $ranking;
|
||||
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
||||
$array = $database->query_return($users);
|
||||
$climbers = $ranking->procRankArray();
|
||||
if(mysql_num_rows(mysql_query($users)) > 0){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."medal order by week DESC LIMIT 0, 1";
|
||||
@@ -4203,25 +4202,25 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$week='1';
|
||||
}
|
||||
while($row = mysql_fetch_array($climbers)){
|
||||
$oldrank = $ranking->getUserRank($row['id']);
|
||||
$oldrank = $ranking->getUserRank($row['userid']);
|
||||
if($row['oldrank'] == 0){
|
||||
$database->updateoldrank($row['id'], $oldrank);
|
||||
$database->updateoldrank($row['userid'], $oldrank);
|
||||
}else{
|
||||
if($week > 1){
|
||||
if($row['oldrank'] > $oldrank) {
|
||||
$totalpoints = $row['oldrank'] - $oldrank;
|
||||
$database->addclimberrankpop($row['id'], $totalpoints);
|
||||
$database->updateoldrank($row['id'], $oldrank);
|
||||
$database->addclimberrankpop($row['userid'], $totalpoints);
|
||||
$database->updateoldrank($row['userid'], $oldrank);
|
||||
} else
|
||||
if($row['oldrank'] < $oldrank) {
|
||||
$totalpoints = $oldrank - $row['oldrank'];
|
||||
$database->removeclimberrankpop($row['id'], $totalpoints);
|
||||
$database->updateoldrank($row['id'], $oldrank);
|
||||
$database->removeclimberrankpop($row['userid'], $totalpoints);
|
||||
$database->updateoldrank($row['userid'], $oldrank);
|
||||
}
|
||||
}else{
|
||||
$totalpoints = mysql_num_rows(mysql_query($users)) - $oldrank;
|
||||
$database->setclimberrankpop($row['id'], $totalpoints+1);
|
||||
$database->updateoldrank($row['id'], $oldrank);
|
||||
$database->setclimberrankpop($row['userid'], $totalpoints+1);
|
||||
$database->updateoldrank($row['userid'], $oldrank);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,11 @@ class MYSQL_DB {
|
||||
}
|
||||
|
||||
function register($username, $password, $email, $tribe, $act) {
|
||||
$time = time();
|
||||
$timep = (strtotime(START_TIME) + PROTECTION);
|
||||
$time = time();
|
||||
if(strtotime(START_TIME) > time()){
|
||||
$time = strtotime(START_TIME);
|
||||
}
|
||||
$timep = ($time + PROTECTION);
|
||||
$q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, '$act', $timep, $time, $time)";
|
||||
if(mysql_query($q, $this->connection)) {
|
||||
return mysql_insert_id($this->connection);
|
||||
|
||||
@@ -22,8 +22,11 @@ class MYSQLi_DB {
|
||||
}
|
||||
|
||||
function register($username, $password, $email, $tribe, $act) {
|
||||
$time = time();
|
||||
$timep = (strtotime(START_TIME) + PROTECTION);
|
||||
$time = time();
|
||||
if(strtotime(START_TIME) > time()){
|
||||
$time = strtotime(START_TIME);
|
||||
}
|
||||
$timep = ($time + PROTECTION);
|
||||
$q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, '$act', $timep, $time, $time)";
|
||||
if(mysqli_query($this->connection, $q)) {
|
||||
return mysqli_insert_id($this->connection);
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
if($database->countUser() > 0){
|
||||
$holder = array();
|
||||
if(SHOW_NATARS == True){
|
||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, (
|
||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
|
||||
|
||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
@@ -213,7 +213,7 @@
|
||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||
}else{
|
||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, (
|
||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
|
||||
|
||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
@@ -243,6 +243,7 @@
|
||||
foreach($datas as $result) {
|
||||
$value['userid'] = $result['userid'];
|
||||
$value['username'] = $result['username'];
|
||||
$value['oldrank'] = $result['oldrank'];
|
||||
$value['alliance'] = $result['alliance'];
|
||||
$value['aname'] = $result['allitag'];
|
||||
$value['totalpop'] = $result['totalpop'];
|
||||
|
||||
Reference in New Issue
Block a user