* PLEASE RELOAD YOUR ITEMS AND MONSTERS AFTER THIS UPDATE

* save monster loot in database in json format instead loading it every time from xml file
* store monster voices and immunities in json format
* removed useless monsters.gfx_name field from database
* convert item name to item id in loot in monsters.xml loader
* after changing template you will be redirected to latest viewed page
* display gallery add image form only on main gallery page
* fixed displaying monster loot when item.name in loot is used instead of item.id
* (intern) added new function getItemNameById($id)
* (intern) renamed database field monsters.hide_creature to hidden
This commit is contained in:
slawkens
2017-10-20 15:04:11 +02:00
parent d4900eac84
commit c2678aa91f
11 changed files with 157 additions and 129 deletions

View File

@@ -117,17 +117,26 @@ function getGuildLink($name, $generate = true)
return generateLink($url, $name);
}
function getItemImage($id, $count = 1)
{
function getItemNameById($id) {
global $db;
$tooltip = '';
$query = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'items` WHERE `id` = ' . $db->quote($id) . ' LIMIT 1;');
if($query->rowCount() == 1) {
$item = $query->fetch();
$tooltip = ' class="tooltip" title="' . $item['name'] . '"';
return $item['name'];
}
return '';
}
function getItemImage($id, $count = 1)
{
$tooltip = '';
$name = getItemNameById($id);
if(!empty($name)) {
$tooltip = ' class="tooltip" title="' . $name . '"';
}
$file_name = $id;
if($count > 1)
$file_name .= '-' . $count;