/GameEngine/Database/db_MYSQL.php
PHP | 3174 lines | 2752 code | 258 blank | 164 comment | 239 complexity | e62bb7b17c1eb923737ba01e347014dd MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- <?php
- class MYSQL_DB {
- var $connection;
-
- function MYSQL_DB() {
- $this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
- mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
- }
-
- function register($username, $password, $email, $tribe, $locate, $act) {
- $time = time();
- $timep = ($time + PROTECTION);
- $rand = rand(8900, 9000);
- $q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,location,act,protect,clp,cp) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, $locate, '$act', $timep, '$rand', 1)";
- if(mysql_query($q, $this->connection)) {
- return mysql_insert_id($this->connection);
- } else {
- return false;
- }
- }
-
- function activate($username, $password, $email, $tribe, $locate, $act, $act2) {
- $time = time();
- $q = "INSERT INTO " . TB_PREFIX . "activate (username,password,access,email,tribe,timestamp,location,act,act2) VALUES ('$username', '$password', " . USER . ", '$email', $tribe, $time, $locate, '$act', '$act2')";
- if(mysql_query($q, $this->connection)) {
- return mysql_insert_id($this->connection);
- } else {
- return false;
- }
- }
-
- function unreg($username) {
- $q = "DELETE from " . TB_PREFIX . "activate where username = '$username'";
- return mysql_query($q, $this->connection);
- }
- function deleteReinf($id) {
- $q = "DELETE from " . TB_PREFIX . "enforcement where id = '$id'";
- mysql_query($q, $this->connection);
- }
- function updateResource($vid, $what, $number) {
-
- $q = "UPDATE " . TB_PREFIX . "vdata set " . $what . "=" . $number . " where wref = $vid";
- $result = mysql_query($q, $this->connection);
- return mysql_query($q, $this->connection);
- }
-
- function checkExist($ref, $mode) {
-
- if(!$mode) {
- $q = "SELECT username FROM " . TB_PREFIX . "users where username = '$ref' LIMIT 1";
- } else {
- $q = "SELECT email FROM " . TB_PREFIX . "users where email = '$ref' LIMIT 1";
- }
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function checkExist_activate($ref, $mode) {
-
- if(!$mode) {
- $q = "SELECT username FROM " . TB_PREFIX . "activate where username = '$ref' LIMIT 1";
- } else {
- $q = "SELECT email FROM " . TB_PREFIX . "activate where email = '$ref' LIMIT 1";
- }
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
- function updateUserField($ref, $field, $value, $mode) {
- if(!$mode) {
- $q = "UPDATE " . TB_PREFIX . "users set $field = '$value' where username = '$ref'";
- } elseif($mode==1) {
- $q = "UPDATE " . TB_PREFIX . "users set $field = '$value' where id = '$ref'";
- } elseif($mode==2) {
- $q = "UPDATE " . TB_PREFIX . "users set $field = $field + '$value' where id = '$ref'";
- }
- return mysql_query($q, $this->connection);
- }
-
- function getSitee($uid) {
- $q = "SELECT id from " . TB_PREFIX . "users where sit1 = $uid or sit2 = $uid";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function getSitee1($uid) {
- $q = "SELECT * from " . TB_PREFIX . "users where sit1 = $uid";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray;
- }
-
- function getSitee2($uid) {
- $q = "SELECT * from " . TB_PREFIX . "users where sit2 = $uid";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray;
- }
-
- function removeMeSit($uid, $uid2) {
- $q = "UPDATE " . TB_PREFIX . "users set sit1 = 0 where id = $uid and sit1 = $uid2";
- mysql_query($q, $this->connection);
- $q2 = "UPDATE " . TB_PREFIX . "users set sit2 = 0 where id = $uid and sit2 = $uid2";
- mysql_query($q2, $this->connection);
- }
-
- function getUserField($ref, $field, $mode) {
- if(!$mode) {
- $q = "SELECT $field FROM " . TB_PREFIX . "users where id = '$ref'";
- } else {
- $q = "SELECT $field FROM " . TB_PREFIX . "users where username = '$ref'";
- }
- $result = mysql_query($q, $this->connection) or die(mysql_error());
- $dbarray = mysql_fetch_array($result);
- return $dbarray[$field];
- }
-
- function getActivateField($ref, $field, $mode) {
- if(!$mode) {
- $q = "SELECT $field FROM " . TB_PREFIX . "activate where id = '$ref'";
- } else {
- $q = "SELECT $field FROM " . TB_PREFIX . "activate where username = '$ref'";
- }
- $result = mysql_query($q, $this->connection) or die(mysql_error());
- $dbarray = mysql_fetch_array($result);
- return $dbarray[$field];
- }
-
- function login($username, $password) {
- $q = "SELECT password,sessid FROM " . TB_PREFIX . "users where username = '$username'";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- if($dbarray['password'] == md5($password)) {
- return true;
- } else {
- return false;
- }
- }
-
- function checkActivate($act) {
- $q = "SELECT * FROM " . TB_PREFIX . "activate where act = '$act'";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
-
- return $dbarray;
- }
-
- function sitterLogin($username, $password) {
- $q = "SELECT sit1,sit2 FROM " . TB_PREFIX . "users where username = '$username' and access != " . BANNED;
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- if($dbarray['sit1'] != 0) {
- $q2 = "SELECT password FROM " . TB_PREFIX . "users where id = " . $dbarray['sit1'] . " and access != " . BANNED;
- $result2 = mysql_query($q2, $this->connection);
- $pw_sit1 = mysql_fetch_array($result2);
- }
- elseif($dbarray['sit2'] != 0) {
- $q3 = "SELECT password FROM " . TB_PREFIX . "users where id = " . $dbarray['sit2'] . " and access != " . BANNED;
- $result3 = mysql_query($q3, $this->connection);
- $pw_sit2 = mysql_fetch_array($result3);
- }
- if($dbarray['sit1'] != 0 || $dbarray['sit2'] != 0) {
- if($pw_sit1['password'] == md5($password) || $pw_sit2['password'] == md5($password)) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
-
- function setDeleting($uid, $mode) {
- $time = time() + 72 * 3600;
- if(!$mode) {
- $q = "INSERT into " . TB_PREFIX . "deleting values ($uid,$time)";
- } else {
- $q = "DELETE FROM " . TB_PREFIX . "deleting where uid = $uid";
- }
- mysql_query($q, $this->connection);
- }
-
- function isDeleting($uid) {
- $q = "SELECT timestamp from " . TB_PREFIX . "deleting where uid = $uid";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['timestamp'];
- }
-
- function modifyGold($userid, $amt, $mode) {
- if(!$mode) {
- $q = "UPDATE " . TB_PREFIX . "users set gold = gold - $amt where id = $userid";
- } else {
- $q = "UPDATE " . TB_PREFIX . "users set gold = gold + $amt where id = $userid";
- }
- return mysql_query($q, $this->connection);
- }
-
- /*****************************************
- Function to retrieve user array via Username or ID
- Mode 0: Search by Username
- Mode 1: Search by ID
- References: Alliance ID
- *****************************************/
-
- function getUserArray($ref, $mode) {
- if(!$mode) {
- $q = "SELECT * FROM " . TB_PREFIX . "users where username = '$ref'";
- } else {
- $q = "SELECT * FROM " . TB_PREFIX . "users where id = $ref";
- }
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function getUserWithEmail($email) {
- $q = "SELECT * FROM " . TB_PREFIX . "users where email = '$email'";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function activeModify($username, $mode) {
- $time = time();
- if(!$mode) {
- $q = "INSERT into " . TB_PREFIX . "active VALUES ('$username',$time)";
- } else {
- $q = "DELETE FROM " . TB_PREFIX . "active where username = '$username'";
- }
- return mysql_query($q, $this->connection);
- }
-
- function addActiveUser($username, $time) {
- $q = "REPLACE into " . TB_PREFIX . "active values ('$username',$time)";
- if(mysql_query($q, $this->connection)) {
- return true;
- } else {
- return false;
- }
- }
-
- function updateActiveUser($username, $time) {
- $q = "REPLACE into " . TB_PREFIX . "active (`username`, `timestamp`) values ('$username',$time)";
- $q2 = "UPDATE " . TB_PREFIX . "users set timestamp = $time where username = '$username'";
- $exec1 = mysql_query($q, $this->connection);
- $exec2 = mysql_query($q2, $this->connection);
- if($exec1 && $exec2) {
- return true;
- } else {
- return false;
- }
- }
-
- function checkSitter($username){
- $q = "SELECT * FROM ".TB_PREFIX."online WHERE name = '".$username."'";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['sitter'];
- }
-
- public function canConquerOasis($vref,$wref) {
- $AttackerFields = $this->getResourceLevel($vref);
- for($i=19;$i<=38;$i++) {
- if($AttackerFields['f'.$i.'t'] == 37) { $HeroMansionLevel = $AttackerFields['f'.$i]; }
- }
- if($this->VillageOasisCount($vref) < floor(($HeroMansionLevel-5)/5)) {
- $OasisInfo = $this->getOasisInfo($wref);
- $troopcount = $this->countOasisTroops($wref);
- if($OasisInfo['conqured'] == 0 || $OasisInfo['conqured'] != 0 && $OasisInfo['loyalty'] < 99 / min(3,(4-$this->VillageOasisCount($OasisInfo['conqured']))) && $troopcount == 0) {
- $CoordsVillage = $this->getCoor($vref);
- $CoordsOasis = $this->getCoor($wref);
- if(abs($CoordsOasis['x']-$CoordsVillage['x'])<=3 && abs($CoordsOasis['y']-$CoordsVillage['y'])<=3) {
- return True;
- } else {
- return False;
- }
- } else {
- return False;
- }
- } else {
- return False;
- }
- }
-
- public function conquerOasis($vref,$wref) {
- $vinfo = $this->getVillage($vref);
- $uid = $vinfo['owner'];
- $q = "UPDATE `".TB_PREFIX."odata` SET conqured=$vref,loyalty=100,lastupdated=".time().",owner=$uid,name='Occupied Oasis' WHERE wref=$wref";
- return mysql_query($q, $this->connection);
- }
-
- public function modifyOasisLoyalty($wref) {
- if($this->isVillageOases($wref) != 0) {
- $OasisInfo = $this->getOasisInfo($wref);
- if($OasisInfo['conqured'] != 0) {
- $LoyaltyAmendment = floor(100 / min(3,(4-$this->VillageOasisCount($OasisInfo['conqured']))));
- $q = "UPDATE `".TB_PREFIX."odata` SET loyalty=loyalty-$LoyaltyAmendment WHERE wref=$wref";
- return mysql_query($q, $this->connection);
- }
- }
- }
-
- function checkactiveSession($username, $sessid) {
- $user = $this->getUserArray($username, 0);
- $sessidarray = explode("+", $user['sessid']);
- if(in_array($sessid, $sessidarray)) {
- return true;
- } else {
- return false;
- }
- }
-
- function submitProfile($uid, $gender, $location, $birthday, $des1, $des2) {
- $q = "UPDATE " . TB_PREFIX . "users set gender = $gender, location = '$location', birthday = '$birthday', desc1 = '$des1', desc2 = '$des2' where id = $uid";
- return mysql_query($q, $this->connection);
- }
-
- function gpack($uid, $gpack) {
- $q = "UPDATE " . TB_PREFIX . "users set gpack = '$gpack' where id = $uid";
- return mysql_query($q, $this->connection);
- }
-
- function UpdateOnline($mode, $name = "", $sit = 0) {
- global $session;
- if($mode == "login") {
- $q = "INSERT IGNORE INTO " . TB_PREFIX . "online (name, time, sitter) VALUES ('$name', ".time().", ".$sit.")";
- return mysql_query($q, $this->connection);
- } else {
- $q = "DELETE FROM " . TB_PREFIX . "online WHERE name ='" . $session->username . "'";
- return mysql_query($q, $this->connection);
- }
- }
-
- //Choice placement where sector
- function generateBase($sector){
- $sector = ($sector == 0) ? rand(1, 4) : $sector;
- // (-/-) SW
- if($sector == 1){
- $x_a = (WORLD_MAX - (WORLD_MAX*2));
- $x_b = 0;
- $y_a = (WORLD_MAX - (WORLD_MAX*2));
- $y_b = 0;
- $order = "ORDER BY y DESC,x DESC";
- $mmm = rand(-1, -20);
- $x_y = "AND x < -4 AND y < $mmm";
- }
- // (+/-) SE
- elseif($sector == 2){
- $x_a = (WORLD_MAX - (WORLD_MAX*2));
- $x_b = 0;
- $y_a = 0;
- $y_b = WORLD_MAX;
- $order = "ORDER BY y ASC,x DESC";
- $mmm = rand(1, 20);
- $x_y = "AND x < -4 AND y > $mmm";
- }
- // (+/+) NE
- elseif($sector == 3){
- $x_a = 0;
- $x_b = WORLD_MAX;
- $y_a = 0;
- $y_b = WORLD_MAX;
- $order = "ORDER BY y,x ASC";
- $mmm = rand(1, 20);
- $x_y = "AND x > 4 AND y > $mmm";
- }
- // (-/+) NW
- elseif($sector == 4){
- $x_a = 0;
- $x_b = WORLD_MAX;
- $y_a = (WORLD_MAX - (WORLD_MAX*2));
- $y_b = 0;
- $order = "ORDER BY y DESC, x ASC";
- $mmm = rand(-1, -20);
- $x_y = "AND x > 4 AND y < $mmm";
- }
- $q = "SELECT * FROM ".TB_PREFIX."wdata where fieldtype = 3 and occupied = 0 $x_y and (x BETWEEN $x_a AND $x_b) and (y BETWEEN $y_a AND $y_b) $order LIMIT 20";
-
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['id'];
- }
-
- function setFieldTaken($id) {
- $q = "UPDATE " . TB_PREFIX . "wdata set occupied = 1 where id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function addVillage($wid, $uid, $username, $capital) {
- $total = count($this->getVillagesID($uid));
- if($total >= 1) {
- $vname = "????? ????";
- } else {
- $vname = "????? ".$username;
- }
-
- $time = time();
- $q = "INSERT into " . TB_PREFIX . "vdata (wref, owner, name, capital, pop, cp, celebration, wood, clay, iron, maxstore, crop, maxcrop, lastupdate, created) values
- ('$wid', '$uid', '$vname', '$capital', 2, 1, 0, 780, 780, 780, 800, 780, 800, '$time', '$time')";
- return mysql_query($q, $this->connection) or die(mysql_error());
- }
-
- function addResourceFields($vid, $type) {
- switch($type) {
- case 1:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,4,4,1,4,4,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 2:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,3,4,1,3,2,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 3:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,1,4,1,3,2,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 4:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,1,4,1,2,2,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 5:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,1,4,1,3,1,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 6:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,4,4,1,3,4,4,4,4,4,4,4,4,4,4,4,2,4,4,1,15)";
- break;
- case 7:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,1,4,4,1,2,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 8:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,3,4,4,1,2,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 9:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,3,4,4,1,1,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 10:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,3,4,1,2,2,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- case 11:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,3,1,1,3,1,4,4,3,3,2,2,3,1,4,4,2,4,4,1,15)";
- break;
- case 12:
- $q = "INSERT into " . TB_PREFIX . "fdata (vref,f1t,f2t,f3t,f4t,f5t,f6t,f7t,f8t,f9t,f10t,f11t,f12t,f13t,f14t,f15t,f16t,f17t,f18t,f26,f26t) values($vid,1,4,1,1,2,2,3,4,4,3,3,4,4,1,4,2,1,2,1,15)";
- break;
- }
- return mysql_query($q, $this->connection);
- }
- function isVillageOases($wref) {
- $q = "SELECT id, oasistype FROM " . TB_PREFIX . "wdata where id = $wref";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['oasistype'];
- }
-
- public function VillageOasisCount($vref) {
- $q = "SELECT count(*) FROM ".TB_PREFIX."odata WHERE conqured=$vref";
- $result = mysql_query($q, $this->connection);
- $row = mysql_fetch_row($result);
- return $row[0];
- }
-
- function populateOasis() {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata where oasistype != 0";
- $result = mysql_query($q, $this->connection);
- while($row = mysql_fetch_array($result)) {
- $wid = $row['id'];
-
- $this->addUnits($wid);
-
- }
- }
-
-
- /***************************
- Function to retrieve type of village via ID
- References: Village ID
- ***************************/
- function getVillageType($wref) {
- $q = "SELECT id, fieldtype FROM " . TB_PREFIX . "wdata where id = $wref";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['fieldtype'];
- }
-
- function getVillageData($wref) {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata where id = $wref";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function getVillageType2($wref) {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata where id = $wref";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['oasistype'];
- }
-
- function getVilWref($x, $y) {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata where x = $x AND y = $y";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['id'];
- }
-
- function checkVilExist($wref) {
- $q = "SELECT * FROM " . TB_PREFIX . "vdata where wref = '$wref'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function oasischecker($x, $y) {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata where x = $x AND y = $y";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- /*****************************************
- Function to retrieve if is ocuped via ID
- References: Village ID
- *****************************************/
- function getVillageState($wref) {
- $q = "SELECT oasistype,occupied FROM " . TB_PREFIX . "wdata where id = $wref";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- if($dbarray['occupied'] != 0 || $dbarray['oasistype'] != 0) {
- return true;
- } else {
- return false;
- }
- }
-
- function getProfileVillages($uid) {
- $q = "SELECT * from " . TB_PREFIX . "vdata where owner = $uid order by pop desc";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function getProfileMedal($uid) {
- $q = "SELECT id,categorie,plaats,week,img,points from " . TB_PREFIX . "medal where userid = $uid order by id desc";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
-
- }
-
- function getProfileMedalAlly($uid) {
- $q = "SELECT id,categorie,plaats,week,img,points from " . TB_PREFIX . "allimedal where allyid = $uid order by id desc";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
-
- }
-
- function getVillageID($uid) {
- $q = "SELECT wref FROM " . TB_PREFIX . "vdata WHERE owner = $uid";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['wref'];
- }
-
-
- function getVillagesID($uid) {
- $q = "SELECT wref from " . TB_PREFIX . "vdata where owner = $uid order by capital DESC";
- $result = mysql_query($q, $this->connection);
- $array = $this->mysql_fetch_all($result);
- $newarray = array();
- for($i = 0; $i < count($array); $i++) {
- array_push($newarray, $array[$i]['wref']);
- }
- return $newarray;
- }
-
- function getVillage($vid) {
- $q = "SELECT * FROM " . TB_PREFIX . "vdata where wref = $vid";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function getOasisV($vid) {
- $q = "SELECT * FROM " . TB_PREFIX . "odata where wref = $vid";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function getAInfo($id) {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata where id = $id";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function getMInfo($id) {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata left JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "vdata.wref = " . TB_PREFIX . "wdata.id where " . TB_PREFIX . "wdata.id = $id";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function getOMInfo($id) {
- $q = "SELECT * FROM " . TB_PREFIX . "wdata left JOIN " . TB_PREFIX . "odata ON " . TB_PREFIX . "odata.wref = " . TB_PREFIX . "wdata.id where " . TB_PREFIX . "wdata.id = $id";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function getOasis($vid) {
- $q = "SELECT * FROM " . TB_PREFIX . "odata where conqured = $vid";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function getOasisInfo($wid) {
- $q = "SELECT * FROM " . TB_PREFIX . "odata where wref = $wid";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_assoc($result);
- }
-
- function getVillageField($ref, $field) {
- $q = "SELECT $field FROM " . TB_PREFIX . "vdata where wref = $ref";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray[$field];
-
- }
-
- function getOasisField($ref, $field) {
- $q = "SELECT $field FROM " . TB_PREFIX . "odata where wref = $ref";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray[$field];
- }
-
- function setVillageField($ref, $field, $value) {
- $q = "UPDATE " . TB_PREFIX . "vdata set $field = '$value' where wref = $ref";
- return mysql_query($q, $this->connection);
- }
-
- function setVillageLevel($ref, $field, $value) {
- $q = "UPDATE " . TB_PREFIX . "fdata set " . $field . " = '" . $value . "' where vref = " . $ref . "";
- return mysql_query($q, $this->connection);
- }
-
- function getResourceLevel($vid) {
- $q = "SELECT * from " . TB_PREFIX . "fdata where vref = $vid";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_assoc($result);
- }
-
- function getAdminLog() {
- $q = "SELECT id,user,log,time from " . TB_PREFIX . "admin_log where id != 0 ORDER BY id DESC";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function delAdminLog($id) {
- $q = "DELETE FROM " . TB_PREFIX . "admin_log where id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function getCoor($wref) {
- $q = "SELECT x,y FROM " . TB_PREFIX . "wdata where id = $wref";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_array($result);
- }
-
- function CheckForum($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_cat where alliance = '$id'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function CountCat($id) {
- $q = "SELECT count(id) FROM " . TB_PREFIX . "forum_topic where cat = '$id'";
- $result = mysql_query($q, $this->connection);
- $row = mysql_fetch_row($result);
- return $row[0];
- }
-
- function LastTopic($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id' order by post_date";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function CheckLastTopic($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function CheckLastPost($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_post where topic = '$id'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function LastPost($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_post where topic = '$id'";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function CountTopic($id) {
- $q = "SELECT count(id) FROM " . TB_PREFIX . "forum_post where owner = '$id'";
- $result = mysql_query($q, $this->connection);
- $row = mysql_fetch_row($result);
-
- $qs = "SELECT count(id) FROM " . TB_PREFIX . "forum_topic where owner = '$id'";
- $results = mysql_query($qs, $this->connection);
- $rows = mysql_fetch_row($results);
- return $row[0] + $rows[0];
- }
-
- function CountPost($id) {
- $q = "SELECT count(id) FROM " . TB_PREFIX . "forum_post where topic = '$id'";
- $result = mysql_query($q, $this->connection);
- $row = mysql_fetch_row($result);
- return $row[0];
- }
-
- function ForumCat($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_cat where alliance = '$id' ORDER BY id";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function ForumCatEdit($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_cat where id = '$id'";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function ForumCatName($id) {
- $q = "SELECT forum_name from " . TB_PREFIX . "forum_cat where id = $id";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['forum_name'];
- }
-
- function CheckCatTopic($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function CheckResultEdit($alli) {
- $q = "SELECT * from " . TB_PREFIX . "forum_edit where alliance = '$alli'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function CheckCloseTopic($id) {
- $q = "SELECT close from " . TB_PREFIX . "forum_topic where id = '$id'";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['close'];
- }
-
- function CheckEditRes($alli) {
- $q = "SELECT result from " . TB_PREFIX . "forum_edit where alliance = '$alli'";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['result'];
- }
-
- function CreatResultEdit($alli, $result) {
- $q = "INSERT into " . TB_PREFIX . "forum_edit values (0,'$alli','$result')";
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- function UpdateResultEdit($alli, $result) {
- $date = time();
- $q = "UPDATE " . TB_PREFIX . "forum_edit set result = '$result' where alliance = '$alli'";
- return mysql_query($q, $this->connection);
- }
-
- function UpdateEditTopic($id, $title, $cat) {
- $q = "UPDATE " . TB_PREFIX . "forum_topic set title = '$title', cat = '$cat' where id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function UpdateEditForum($id, $name, $des) {
- $q = "UPDATE " . TB_PREFIX . "forum_cat set forum_name = '$name', forum_des = '$des' where id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function StickTopic($id, $mode) {
- $q = "UPDATE " . TB_PREFIX . "forum_topic set stick = '$mode' where id = '$id'";
- return mysql_query($q, $this->connection);
- }
-
- function ForumCatTopic($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id' AND stick = '' ORDER BY post_date desc";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function ForumCatTopicStick($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id' AND stick = '1' ORDER BY post_date desc";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function ShowTopic($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_topic where id = '$id'";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function ShowPost($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_post where topic = '$id'";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function ShowPostEdit($id) {
- $q = "SELECT * from " . TB_PREFIX . "forum_post where id = '$id'";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function CreatForum($owner, $alli, $name, $des, $area) {
- $q = "INSERT into " . TB_PREFIX . "forum_cat values (0,'$owner','$alli','$name','$des','$area')";
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- function CreatTopic($title, $post, $cat, $owner, $alli, $ends) {
- $date = time();
- $q = "INSERT into " . TB_PREFIX . "forum_topic values (0,'$title','$post','$date','$date','$cat','$owner','$alli','$ends','','')";
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- function CreatPost($post, $tids, $owner) {
- $date = time();
- $q = "INSERT into " . TB_PREFIX . "forum_post values (0,'$post','$tids','$owner','$date')";
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- function UpdatePostDate($id) {
- $date = time();
- $q = "UPDATE " . TB_PREFIX . "forum_topic set post_date = '$date' where id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function EditUpdateTopic($id, $post) {
- $q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post' where id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function EditUpdatePost($id, $post) {
- $q = "UPDATE " . TB_PREFIX . "forum_post set post = '$post' where id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function LockTopic($id, $mode) {
- $q = "UPDATE " . TB_PREFIX . "forum_topic set close = '$mode' where id = '$id'";
- return mysql_query($q, $this->connection);
- }
-
- function DeleteCat($id) {
- $qs = "DELETE from " . TB_PREFIX . "forum_cat where id = '$id'";
- $q = "DELETE from " . TB_PREFIX . "forum_topic where cat = '$id'";
- mysql_query($qs, $this->connection);
- return mysql_query($q, $this->connection);
- }
-
- function DeleteTopic($id) {
- $qs = "DELETE from " . TB_PREFIX . "forum_topic where id = '$id'";
- // $q = "DELETE from ".TB_PREFIX."forum_post where topic = '$id'";//
- return mysql_query($qs, $this->connection); //
- // mysql_query($q,$this->connection);
- }
-
- function DeletePost($id) {
- $q = "DELETE from " . TB_PREFIX . "forum_post where id = '$id'";
- return mysql_query($q, $this->connection);
- }
-
- function getAllianceName($id) {
- $q = "SELECT tag from " . TB_PREFIX . "alidata where id = $id";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['tag'];
- }
-
- function getAlliancePermission($ref, $field, $mode) {
- if(!$mode) {
- $q = "SELECT $field FROM " . TB_PREFIX . "ali_permission where uid = '$ref'";
- } else {
- $q = "SELECT $field FROM " . TB_PREFIX . "ali_permission where username = '$ref'";
- }
- $result = mysql_query($q, $this->connection) or die(mysql_error());
- $dbarray = mysql_fetch_array($result);
- return $dbarray[$field];
- }
-
- function getAlliance($id) {
- $q = "SELECT * from " . TB_PREFIX . "alidata where id = $id";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_assoc($result);
- }
-
- function setAlliName($aid, $name, $tag) {
- $q = "UPDATE " . TB_PREFIX . "alidata set name = '$name', tag = '$tag' where id = $aid";
- return mysql_query($q, $this->connection);
- }
-
- function isAllianceOwner($id) {
- $q = "SELECT * from " . TB_PREFIX . "alidata where leader = '$id'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function aExist($ref, $type) {
- $q = "SELECT $type FROM " . TB_PREFIX . "alidata where $type = '$ref'";
- $result = mysql_query($q, $this->connection);
- if(mysql_num_rows($result)) {
- return true;
- } else {
- return false;
- }
- }
-
- function modifyPoints($aid, $points, $amt) {
- $q = "UPDATE " . TB_PREFIX . "users set $points = $points + $amt where id = $aid";
- return mysql_query($q, $this->connection);
- }
-
- function modifyPointsAlly($aid, $points, $amt) {
- $q = "UPDATE " . TB_PREFIX . "alidata set $points = $points + $amt where id = $aid";
- return mysql_query($q, $this->connection);
- }
-
- /*****************************************
- Function to create an alliance
- References:
- *****************************************/
- function createAlliance($tag, $name, $uid, $max) {
- $q = "INSERT into " . TB_PREFIX . "alidata values (0,'$name','$tag',$uid,0,0,0,'','',$max,'','','','','','','','')";
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- /*****************************************
- Function to insert an alliance new
- References:
- *****************************************/
- function insertAlliNotice($aid, $notice) {
- $time = time();
- $q = "INSERT into " . TB_PREFIX . "ali_log values (0,'$aid','$notice',$time)";
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- /*****************************************
- Function to delete alliance if empty
- References:
- *****************************************/
- function deleteAlliance($aid) {
- $result = mysql_query("SELECT * FROM " . TB_PREFIX . "users where alliance = $aid");
- $num_rows = mysql_num_rows($result);
- if($num_rows == 0) {
- $q = "DELETE FROM " . TB_PREFIX . "alidata WHERE id = $aid";
- }
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- /*****************************************
- Function to read all alliance news
- References:
- *****************************************/
- function readAlliNotice($aid) {
- $q = "SELECT * from " . TB_PREFIX . "ali_log where aid = $aid ORDER BY date DESC";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- /*****************************************
- Function to create alliance permissions
- References: ID, notice, description
- *****************************************/
- function createAlliPermissions($uid, $aid, $rank, $opt1, $opt2, $opt3, $opt4, $opt5, $opt6, $opt7, $opt8) {
-
- $q = "INSERT into " . TB_PREFIX . "ali_permission values(0,'$uid','$aid','$rank','$opt1','$opt2','$opt3','$opt4','$opt5','$opt6','$opt7','$opt8')";
- mysql_query($q, $this->connection);
- return mysql_insert_id($this->connection);
- }
-
- /*****************************************
- Function to update alliance permissions
- References:
- *****************************************/
- function deleteAlliPermissions($uid) {
- $q = "DELETE from " . TB_PREFIX . "ali_permission where uid = '$uid'";
- return mysql_query($q, $this->connection);
- }
- /*****************************************
- Function to update alliance permissions
- References:
- *****************************************/
- function updateAlliPermissions($uid, $aid, $rank, $opt1, $opt2, $opt3, $opt4, $opt5, $opt6, $opt7) {
-
- $q = "UPDATE " . TB_PREFIX . "ali_permission SET rank = '$rank', opt1 = '$opt1', opt2 = '$opt2', opt3 = '$opt3', opt4 = '$opt4', opt5 = '$opt5', opt6 = '$opt6', opt7 = '$opt7' where uid = $uid && alliance =$aid";
- return mysql_query($q, $this->connection);
- }
-
- /*****************************************
- Function to read alliance permissions
- References: ID, notice, description
- *****************************************/
- function getAlliPermissions($uid, $aid) {
- $q = "SELECT * FROM " . TB_PREFIX . "ali_permission where uid = $uid && alliance = $aid";
- $result = mysql_query($q, $this->connection);
- return mysql_fetch_assoc($result);
- }
-
- /*****************************************
- Function to update an alliance description and notice
- References: ID, notice, description
- *****************************************/
- function submitAlliProfile($aid, $notice, $desc) {
-
- $q = "UPDATE " . TB_PREFIX . "alidata SET `notice` = '$notice', `desc` = '$desc' where id = $aid";
- return mysql_query($q, $this->connection);
- }
-
- function diplomacyInviteAdd($alli1, $alli2, $type) {
- $q = "INSERT INTO " . TB_PREFIX . "diplomacy (alli1,alli2,type,accepted) VALUES ($alli1,$alli2," . (int)intval($type) . ",0)";
- return mysql_query($q, $this->connection);
- }
-
- function diplomacyOwnOffers($session_alliance) {
- $q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli1 = $session_alliance AND accepted = 0";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function getAllianceID($name) {
- $q = "SELECT id FROM " . TB_PREFIX . "alidata WHERE tag ='" . $this->RemoveXSS($name) . "'";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- return $dbarray['id'];
- }
-
- function getDiplomacy($aid) {
- $q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE id = $aid";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function diplomacyCancelOffer($id) {
- $q = "DELETE FROM " . TB_PREFIX . "diplomacy WHERE id = $id";
- return mysql_query($q, $this->connection);
- }
-
- function diplomacyInviteAccept($id, $session_alliance) {
- $q = "UPDATE " . TB_PREFIX . "diplomacy SET accepted = 1 WHERE id = $id AND alli2 = $session_alliance";
- return mysql_query($q, $this->connection);
- }
-
- function diplomacyInviteDenied($id, $session_alliance) {
- $q = "DELETE FROM " . TB_PREFIX . "diplomacy WHERE id = $id AND alli2 = $session_alliance";
- return mysql_query($q, $this->connection);
- }
-
- function diplomacyInviteCheck($session_alliance) {
- $q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli2 = $session_alliance AND accepted = 0";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function diplomacyExistingRelationships($session_alliance) {
- $q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli2 = $session_alliance AND accepted = 1";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function diplomacyExistingRelationships2($session_alliance) {
- $q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli1 = $session_alliance AND accepted = 1";
- $result = mysql_query($q, $this->connection);
- return $this->mysql_fetch_all($result);
- }
-
- function diplomacyCancelExistingRelationship($id, $session_alliance) {
- $q = "DELETE FROM " . TB_PREFIX . "diplomacy WHERE id = $id AND alli2 = $session_alliance";
- return mysql_query($q, $this->connection);
- }
-
- function getUserAlliance($id) {
- $q = "SELECT " . TB_PREFIX . "alidata.tag from " . TB_PREFIX . "users join " . TB_PREFIX . "alidata where " . TB_PREFIX . "users.alliance = " . TB_PREFIX . "alidata.id and " . TB_PREFIX . "users.id = $id";
- $result = mysql_query($q, $this->connection);
- $dbarray = mysql_fetch_array($result);
- if($dbarray['tag'] == "") {
- return "-";
- } else {
- return $dbarray['tag'];
- }
- }
-
- function modifyResource($vid, $wood, $clay, $iron, $crop, $mode) {
- if(!$mode) {
- $q = "UPDATE " . TB_PREFIX . "vdata set wood = wood - $wood, clay = clay - $clay, iron = iron - $iron, crop = crop - $crop where wref = $vid";
- } else {
- $q = "UPDATE " . TB_PREFIX . "vdata set wood = wood + $wood, clay = clay + $clay, iron = iron + $iron, crop = crop + $crop where wref = $vid";
- }
- return mysql_query($q, $this->connection);
- }
-
- function modifyOasisResource($vid, $wood, $clay, $iron, $crop, $mode) {
- if(!$mode) {
- $q = "UPDATE " . TB_PREFIX . "odata set wood = wood - $wood, clay = clay - $clay, iron = iron - $iron, crop = crop - $crop where wref = $vid";
- } else {
- $q = "UPDATE " . TB_PREFIX . "odata set wood = wood + $wood, clay = clay + $clay, iron = iron + $iron, crop = crop + $crop where wref = $vid";
- }
- return mysql_query($q, $this->connection);
- }
-
- function getFieldLevel($vid, $field) {
- $q = "SELECT f" . $field . " from " . TB_PREFIX . "fdata where vref = $vid";
- $result = mysql_query($q, $this->connection);
- return mysql_result($result, 0);
- }
-
- function getFieldType($vid, $field) {
- $q = "SELECT f" . $field . "t from " . TB_PREFIX . "fdata where vref = $vid";
- $result = mysql_query($q, $this->connection);
- return mysql_result($result, 0);
- }
-
- function getVSumField($uid, $field) {
- $q = "SELECT sum(" . $field . ") FROM " . TB_PREFIX . "vdata where owner = $uid";
- $result = mysql_query($q, $this->connection);
- $row = mysql_fetch_row($result);
- return $row[0];
- }
-
- function updateVillage($vid) {
- $time = time();
- $q = "UPDATE " . TB_PREFIX . "vdata set lastupdate = $time where wref = $vid";
- return mysql_query($q, $this->connection);
- }
- function updateOasis($vid) {
- $time = time();
- $q = "UPDATE " . TB_PREFIX . "odata set lastupdated = $time where wref = $vid";
- return mysql_query($q, $this->connection);
- }
-
-
- function setVillageName($vid, $name) {
- $q = "UPDATE " . TB_PREFIX . "vdata set name = '$name' where wref = $vid";
- return mysql_query($q, $this->connection);
- }
-
- …
Large files files are truncated, but you can click here to view the full file