Отображение предметов

This commit is contained in:
lopar 2018-06-24 18:58:15 +03:00
parent 2548e7c09c
commit 3deab714ff
2 changed files with 5 additions and 5 deletions

View File

@ -2720,8 +2720,8 @@ function showitem($row, $type = 0, $returned = false)
destructitem($row['id']);
}
$magic = magicinf($row['magic']);
$incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1;'));
$magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['magic'])->fetch_assoc();
$incmagic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['includemagic'])->fetch_assoc();
$incmagic['name'] = $row['includemagicname'];
$incmagic['cur'] = $row['includemagicdex'];
$incmagic['max'] = $row['includemagicmax'];
@ -3047,7 +3047,7 @@ function show_item($row, $txt, $place)
$ntxt = "В инвентаре";
if ($txt == "В сундук") $ntxt = "В сундуке";
$magic = magicinf($row['magic']);
$magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $$row['magic'])->fetch_assoc();
$incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1'));
$incmagic['name'] = $row['includemagicname'];
$incmagic['cur'] = $row['includemagicdex'];
@ -3291,7 +3291,7 @@ function show_item($row, $txt, $place)
* @return array
*/
function magicinf($id)
{
{ //TODO Remove it!
return db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $id)->fetch_assoc();
}

View File

@ -42,7 +42,7 @@ if ($_SESSION['receiverName']) {
db::c()->query('INSERT INTO `telegraph` (`receiver`,`text`) VALUES (?i,"?s")', $receiverId, $telegraphText);
$statusMessage = 'Сообщение отправлено.';
} else $statusMessage = 'Сообщение было оставлено пустым!';
} else $statusMessage = 'Телеграф сломался!';
}
if ($submit == 'sendItem' && $sendItemId && $user['money'] >= 1) {
$res = db::c()->query('SELECT `id`,`name` FROM `inventory` WHERE `owner` = ?i AND `id` = ?i AND `dressed` = 0 AND `setsale` = 0 AND `present` = "?s" AND `artefact` = 0', $_SESSION['uid'], $sendItemId, null)->fetch_assoc();