mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
Item preview upgrade
This commit is contained in:
@@ -61,7 +61,7 @@ if (!empty($_GET['view']))
|
||||
if ($cmd == "getUniqueItem") {
|
||||
$sql = "SELECT * FROM `uniqueitems` WHERE `enabled`='1' AND `index`=\"{$_GET['index']}\"";
|
||||
$res = PDO_FetchRow($sql);
|
||||
|
||||
|
||||
if (empty($res['invfile'])) {
|
||||
|
||||
// if no invfile, get from other tables
|
||||
@@ -175,8 +175,21 @@ if ($cmd == "getUniqueItem") {
|
||||
|
||||
$return['props'] = $props;
|
||||
|
||||
//ddump($return);
|
||||
$sqlArmor = "SELECT * FROM armor WHERE code='{$res['code']}'";
|
||||
$sqlMisc = "SELECT * FROM misc WHERE code='{$res['code']}'";
|
||||
$sqlWeapons = "SELECT * FROM weapons WHERE code='{$res['code']}'";
|
||||
|
||||
$baseItemInfo = PDO_FetchRow($sqlArmor);
|
||||
|
||||
if (empty($baseItemInfo)) {
|
||||
$baseItemInfo = PDO_FetchRow($sqlMisc);
|
||||
}
|
||||
if (empty($baseItemInfo)) {
|
||||
$baseItemInfo = PDO_FetchRow($sqlWeapons);
|
||||
}
|
||||
|
||||
$return['baseItemInfo'] = array_filter($baseItemInfo);
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($return, JSON_INVALID_UTF8_IGNORE|JSON_PRETTY_PRINT);
|
||||
|
Reference in New Issue
Block a user