Ignore:
Timestamp:
Mar 13, 2008, 8:18:42 PM (17 years ago)
Author:
george
Message:

Aktualizace na minimanager 0.1.6g.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/scripts/del_lib.php

    r178 r307  
    1818        $sql_01 = new SQL;
    1919        $sql_01->connect($characters_db[$realm]['addr'], $characters_db[$realm]['user'], $characters_db[$realm]['pass'], $characters_db[$realm]['name']);
    20         $query = $sql_01->query("SELECT account,online FROM `character` WHERE guid ='$guid' LIMIT 1");
     20        $query = $sql_01->query("SELECT account,online FROM `characters` WHERE guid ='$guid' LIMIT 1");
    2121        $owner_acc_id = $sql_01->result($query, 0, 'account');
    2222        $sql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     
    6464                foreach ($characters_db as $db){
    6565                        $sql_01->connect($db['addr'], $db['user'], $db['pass'], $db['name']);
    66                         $result = $sql_01->query("SELECT guid FROM `character` WHERE account='$acc_id'");
     66                        $result = $sql_01->query("SELECT guid FROM `characters` WHERE account='$acc_id'");
    6767                        while ($row = $sql_01->fetch_array($result)) {
    6868                                        foreach ($tab_del_user_characters as $value)
     
    100100        $query = $sql_01->query("DELETE FROM guild_rank WHERE guildid = '$guid'");
    101101
    102         //clean data inside character.data field
     102        //clean data inside characters.data field
    103103        $temp = $sql_01->query("SELECT guid FROM guild_member WHERE guildid = '$guid'");
    104104        while ($guild_member = $sql_01->fetch_row($temp)){
    105                 $char_data = $sql_01->query("SELECT data FROM `character` WHERE guid = '$guild_member[0]'");
     105                $char_data = $sql_01->query("SELECT data FROM `characters` WHERE guid = '$guild_member[0]'");
    106106                $data = $sql_01->result($char_data, 0, 'data');
    107107                $data = explode(' ',$data);
     
    109109                $data[CHAR_DATA_OFFSET_GUILD_RANK] = 0;
    110110                $data = implode(" ",$data);
    111                 $query = $sql_01->query("UPDATE `character` SET data = '$data' WHERE guid = '$guild_member[0]'");
     111                $query = $sql_01->query("UPDATE `characters` SET data = '$data' WHERE guid = '$guild_member[0]'");
    112112                }
    113113
     
    123123}
    124124
     125//##########################################################################################
     126//Delete Arena Team
     127function del_arenateam($guid,$realm){
     128        global $characters_db, $realm_db;
     129
     130        require_once("scripts/defines.php");
     131
     132        $sql_01 = new SQL;
     133        $sql_01->connect($characters_db[$realm]['addr'], $characters_db[$realm]['user'], $characters_db[$realm]['pass'], $characters_db[$realm]['name']);
     134        $query = $sql_01->query("DELETE FROM arena_team WHERE arenateamid = '$guid'");
     135        $query = $sql_01->query("DELETE FROM arena_team_stats WHERE arenateamid = '$guid'");
     136
     137// Cant clean the character data field since the data is incorrect on these fields
     138// http://wiki.udbforums.org/index.php/Character_data
     139        //clean data inside characters.data field
     140        //$temp = $sql_01->query("SELECT guid FROM arena_team_member WHERE arenateamid = '$guid'");
     141        //while ($arenateam_member = $sql_01->fetch_row($temp)){
     142        //      $char_data = $sql_01->query("SELECT data FROM `characters` WHERE guid = '$arenateam_member[0]'");
     143        //      $data = $sql_01->result($char_data, 0, 'data');
     144        //      $data = explode(' ',$data);
     145        //      $data[CHAR_DATA_OFFSET_GUILD_ID] = 0;
     146        //      $data[CHAR_DATA_OFFSET_GUILD_RANK] = 0;
     147        //      $data = implode(" ",$data);
     148        //      $query = $sql_01->query("UPDATE `characters` SET data = '$data' WHERE guid = '$arenateam_member[0]'");
     149        //      }
     150    //
     151        $query = $sql_01->query("DELETE FROM arena_team_member WHERE arenateamid = '$guid'");
     152
     153        if ($sql_01->affected_rows()){
     154                $sql_01->close();
     155                return true;
     156                } else {
     157                                $sql_01->close();
     158                                return false;
     159                                }
     160}
     161
    125162?>
Note: See TracChangeset for help on using the changeset viewer.