mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-31 15:47:14 +00:00
Update Database.php
This commit is contained in:
committed by
GitHub
parent
0493be9aeb
commit
ac6a99cb89
+13
-12
@@ -785,19 +785,20 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
|
|
||||||
// no need to cache this method
|
// no need to cache this method
|
||||||
public function hasBeginnerProtection($vid) {
|
public function hasBeginnerProtection($vid) {
|
||||||
list($vid) = $this->escape_input((int) $vid);
|
list($vid) = $this->escape_input($vid);
|
||||||
$q = "SELECT u.protect
|
$q = "SELECT u.protect FROM ".TB_PREFIX."users u,".TB_PREFIX."vdata v WHERE u.id=v.owner AND v.wref=".(int) $vid." LIMIT 1";
|
||||||
FROM ". TB_PREFIX ."users u
|
$result = mysqli_query($this->dblink,$q);
|
||||||
JOIN ". TB_PREFIX ."vdata v ON u.id = v.owner
|
$dbarray = mysqli_fetch_array($result);
|
||||||
JOIN ". TB_PREFIX ."odata o ON u.id = o.owner
|
if(!empty($dbarray)) {
|
||||||
WHERE v.wref = ". $vid ." OR o.wref = ". $vid . "
|
if(time()<$dbarray[0]) {
|
||||||
LIMIT 1";
|
return true;
|
||||||
$result = mysqli_query($this->dblink,$q);
|
} else {
|
||||||
$dbarray = mysqli_fetch_array($result);
|
return false;
|
||||||
|
}
|
||||||
if(!empty($dbarray)) return time() < $dbarray[0];
|
} else {
|
||||||
else return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateUserField($ref, $field, $value, $switch) {
|
function updateUserField($ref, $field, $value, $switch) {
|
||||||
list($ref) = $this->escape_input($ref);
|
list($ref) = $this->escape_input($ref);
|
||||||
|
|||||||
Reference in New Issue
Block a user