mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-24 20:17:13 +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;
|
global $database, $ranking;
|
||||||
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
||||||
$array = $database->query_return($users);
|
|
||||||
$climbers = $ranking->procRankArray();
|
$climbers = $ranking->procRankArray();
|
||||||
if(mysql_num_rows(mysql_query($users)) > 0){
|
if(mysql_num_rows(mysql_query($users)) > 0){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."medal order by week DESC LIMIT 0, 1";
|
$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';
|
$week='1';
|
||||||
}
|
}
|
||||||
while($row = mysql_fetch_array($climbers)){
|
while($row = mysql_fetch_array($climbers)){
|
||||||
$oldrank = $ranking->getUserRank($row['id']);
|
$oldrank = $ranking->getUserRank($row['userid']);
|
||||||
if($row['oldrank'] == 0){
|
if($row['oldrank'] == 0){
|
||||||
$database->updateoldrank($row['id'], $oldrank);
|
$database->updateoldrank($row['userid'], $oldrank);
|
||||||
}else{
|
}else{
|
||||||
if($week > 1){
|
if($week > 1){
|
||||||
if($row['oldrank'] > $oldrank) {
|
if($row['oldrank'] > $oldrank) {
|
||||||
$totalpoints = $row['oldrank'] - $oldrank;
|
$totalpoints = $row['oldrank'] - $oldrank;
|
||||||
$database->addclimberrankpop($row['id'], $totalpoints);
|
$database->addclimberrankpop($row['userid'], $totalpoints);
|
||||||
$database->updateoldrank($row['id'], $oldrank);
|
$database->updateoldrank($row['userid'], $oldrank);
|
||||||
} else
|
} else
|
||||||
if($row['oldrank'] < $oldrank) {
|
if($row['oldrank'] < $oldrank) {
|
||||||
$totalpoints = $oldrank - $row['oldrank'];
|
$totalpoints = $oldrank - $row['oldrank'];
|
||||||
$database->removeclimberrankpop($row['id'], $totalpoints);
|
$database->removeclimberrankpop($row['userid'], $totalpoints);
|
||||||
$database->updateoldrank($row['id'], $oldrank);
|
$database->updateoldrank($row['userid'], $oldrank);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$totalpoints = mysql_num_rows(mysql_query($users)) - $oldrank;
|
$totalpoints = mysql_num_rows(mysql_query($users)) - $oldrank;
|
||||||
$database->setclimberrankpop($row['id'], $totalpoints+1);
|
$database->setclimberrankpop($row['userid'], $totalpoints+1);
|
||||||
$database->updateoldrank($row['id'], $oldrank);
|
$database->updateoldrank($row['userid'], $oldrank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,11 @@ class MYSQL_DB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function register($username, $password, $email, $tribe, $act) {
|
function register($username, $password, $email, $tribe, $act) {
|
||||||
$time = time();
|
$time = time();
|
||||||
$timep = (strtotime(START_TIME) + PROTECTION);
|
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)";
|
$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)) {
|
if(mysql_query($q, $this->connection)) {
|
||||||
return mysql_insert_id($this->connection);
|
return mysql_insert_id($this->connection);
|
||||||
|
|||||||
@@ -22,8 +22,11 @@ class MYSQLi_DB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function register($username, $password, $email, $tribe, $act) {
|
function register($username, $password, $email, $tribe, $act) {
|
||||||
$time = time();
|
$time = time();
|
||||||
$timep = (strtotime(START_TIME) + PROTECTION);
|
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)";
|
$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)) {
|
if(mysqli_query($this->connection, $q)) {
|
||||||
return mysqli_insert_id($this->connection);
|
return mysqli_insert_id($this->connection);
|
||||||
|
|||||||
@@ -192,7 +192,7 @@
|
|||||||
if($database->countUser() > 0){
|
if($database->countUser() > 0){
|
||||||
$holder = array();
|
$holder = array();
|
||||||
if(SHOW_NATARS == True){
|
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 )
|
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||||
FROM " . TB_PREFIX . "vdata
|
FROM " . TB_PREFIX . "vdata
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||||
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||||
}else{
|
}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 )
|
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||||
FROM " . TB_PREFIX . "vdata
|
FROM " . TB_PREFIX . "vdata
|
||||||
@@ -243,6 +243,7 @@
|
|||||||
foreach($datas as $result) {
|
foreach($datas as $result) {
|
||||||
$value['userid'] = $result['userid'];
|
$value['userid'] = $result['userid'];
|
||||||
$value['username'] = $result['username'];
|
$value['username'] = $result['username'];
|
||||||
|
$value['oldrank'] = $result['oldrank'];
|
||||||
$value['alliance'] = $result['alliance'];
|
$value['alliance'] = $result['alliance'];
|
||||||
$value['aname'] = $result['allitag'];
|
$value['aname'] = $result['allitag'];
|
||||||
$value['totalpop'] = $result['totalpop'];
|
$value['totalpop'] = $result['totalpop'];
|
||||||
|
|||||||
Reference in New Issue
Block a user