Changeset 142 for minimanager/ahstats.php
- Timestamp:
- Nov 23, 2007, 11:29:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/ahstats.php
r19 r142 17 17 //######################################################################################################################## 18 18 function browse_auctions() { 19 global $lang_auctionhouse, $lang_global, $lang_item, $output, $ mangos_db, $realm_id,19 global $lang_auctionhouse, $lang_global, $lang_item, $output, $characters_db, $realm_id, $mangos_db, 20 20 $itemperpage, $item_datasite, $server, $user_lvl, $user_id; 21 21 … … 26 26 27 27 $sql = new SQL; 28 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);28 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 29 29 30 30 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0; … … 47 47 $result = $sql->query("SELECT `character`.`name` AS `seller`, `auctionhouse`.`item_template` AS `itemid`, `item_template`.`name` AS `itemname`, `auctionhouse`.`buyoutprice` AS `buyout`, 48 48 `auctionhouse`.`time`-unix_timestamp(), `c2`.`name` AS `encherisseur`, `auctionhouse`.`lastbid`, `auctionhouse`.`startbid`, SUBSTRING_INDEX(SUBSTRING_INDEX(`item_instance`.`data`, ' ',15), ' ',-1) AS qty, `character`.`race` AS seller_race, `c2`.`race` AS buyer_race 49 FROM `character`, `item_instance`,`item_template`, `auctionhouse` LEFT JOIN `character` c2 ON `c2`.`guid`=`auctionhouse`.`buyguid` 49 FROM `".$characters_db[$realm_id]['name']."`.`character` , `".$characters_db[$realm_id]['name']."`.`item_instance` , `".$mangos_db[$realm_id]['name']."`.`item_template` , `".$characters_db[$realm_id]['name']."`.`auctionhouse` 50 LEFT JOIN `".$characters_db[$realm_id]['name']."`.`character` c2 ON `c2`.`guid`=`auctionhouse`.`buyguid` 50 51 WHERE `auctionhouse`.`itemowner`=`character`.`guid` AND `auctionhouse`.`item_template`=`item_template`.`entry` AND `auctionhouse`.`itemguid`=`item_instance`.`guid` 51 52 $order_side ORDER BY `auctionhouse`.`$order_by` $order_dir LIMIT $start, $itemperpage"); … … 152 153 //######################################################################################################################## 153 154 function search_auctions() { 154 global $lang_auctionhouse, $lang_global, $lang_item, $output, $mangos_db, $realm_id, 155 global $lang_auctionhouse, $lang_global, $lang_item, $output, $characters_db, $realm_id, $mangos_db, 156 155 157 $itemperpage, $item_datasite, $server, $user_lvl, $user_id, $sql_search_limit; 156 158 … … 161 163 162 164 $sql = new SQL; 163 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);165 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 164 166 165 167 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "time"; … … 198 200 if ($search_quality >= 0) $item_prefix .= "AND Quality = '$search_quality' "; 199 201 200 $result = $sql->query("SELECT entry FROM item_templateWHERE name LIKE '%$search_value%' $item_prefix");202 $result = $sql->query("SELECT entry FROM `mangos`.`item_template` WHERE name LIKE '%$search_value%' $item_prefix"); 201 203 $search_filter = "AND auctionhouse.item_template IN(0"; 202 204 while ($item = $sql->fetch_row($result)) $search_filter .= ", $item[0]"; … … 224 226 redirect("ahstats.php?error=1"); 225 227 } 226 227 228 229 $result = $sql->query("SELECT `character`.`name` AS `seller`, `auctionhouse`.`item_template` AS `itemid`, `item_template`.`name` AS `itemname`, `auctionhouse`.`buyoutprice` AS `buyout`, 228 230 `auctionhouse`.`time`-unix_timestamp(), `c2`.`name` AS `encherisseur`, `auctionhouse`.`lastbid`, `auctionhouse`.`startbid`, SUBSTRING_INDEX(SUBSTRING_INDEX(`item_instance`.`data`, ' ',15), ' ',-1) AS qty, `character`.`race` AS seller_race, `c2`.`race` AS buyer_race 229 FROM ` character`, `item_instance`,`item_template`, `auctionhouse` LEFT JOIN`character` c2 ON `c2`.`guid`=`auctionhouse`.`buyguid`231 FROM `".$characters_db[$realm_id]['name']."`.`character` , `".$characters_db[$realm_id]['name']."`.`item_instance` , `".$mangos_db[$realm_id]['name']."`.`item_template` , `".$characters_db[$realm_id]['name']."`.`auctionhouse` LEFT JOIN `".$characters_db[$realm_id]['name']."`.`character` c2 ON `c2`.`guid`=`auctionhouse`.`buyguid` 230 232 WHERE `auctionhouse`.`itemowner`=`character`.`guid` AND `auctionhouse`.`item_template`=`item_template`.`entry` AND `auctionhouse`.`itemguid`=`item_instance`.`guid` $search_filter 231 233 $order_side ORDER BY `auctionhouse`.`$order_by` $order_dir LIMIT $sql_search_limit");
Note:
See TracChangeset
for help on using the changeset viewer.