$name = str_replace(LOCALE_GLYPH_OF, '', $name); } $g_glyphs[$glyph['entry']] = array('name' => (string) $name, 'description' => (string) spell_desc($glyph['spellid']), 'icon' => (string) $glyph['iconname'], 'type' => (int) ($glyph['typeflags'] & 1 ? 2 : 1), 'classs' => (int) $glyph['subclass'], 'skill' => (int) 2); } save_cache(25, 'x', $g_glyphs); } echo 'var g_glyphs=' . php2js($g_glyphs); break; case 'talent-icon': $iconname = strtolower($_GET['icon']); if (!$DB->selectCell('SELECT 1 FROM ?_spellicons WHERE iconname = ?', $iconname)) { exit; } if ($name = load_cache(21, $iconname)) { header('Content-type: image/jpeg'); imagejpeg(imagecreatefromjpeg('cache/images/' . $iconname . '.jpg')); } else { header('Content-type: image/jpeg'); $im = @imagecreatefromjpeg('images/icons/medium/' . $iconname . '.jpg'); if (!$im) { exit; } imagetograyscale($im); imagejpeg($im, 'cache/images/' . $iconname . '.jpg'); imagejpeg($im); save_cache(21, $iconname, $iconname); } break; default: break; }
SELECT c.?#, c.entry { , l.name_loc?d as `name_loc` , l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc` } FROM ?_factiontemplate, creature_template c { LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ? } WHERE 1=1 {AND type=?} {AND family=?} AND factiontemplateID=faction_A ORDER BY minlevel DESC, name {LIMIT ?d} ', $npc_cols[0], $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $type != '' ? $type : DBSIMPLE_SKIP, isset($family) ? $family : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $npcs = array(); foreach ($rows as $numRow => $row) { $npcs[$numRow] = array(); $npcs[$numRow] = creatureinfo2($row); } save_cache(5, $cache_str, $npcs); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('NPCs'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => '[0, 4,' . $type . ',' . $family . ']'); $smarty->assign('page', $page); if (count($npcs >= 0)) { $smarty->assign('npcs', $npcs); } // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу $smarty->display('npcs.tpl');
$itemset['spells'][$x]['bonus'] = $row['bonus' . $j]; $x++; } } for ($i = 0; $i <= $x - 1; $i++) { for ($j = $i; $j <= $x - 1; $j++) { if ($itemset['spells'][$j]['bonus'] < $itemset['spells'][$i]['bonus']) { unset($tmp); $tmp = $itemset['spells'][$i]; $itemset['spells'][$i] = $itemset['spells'][$j]; $itemset['spells'][$j] = $tmp; } } } } save_cache(8, $id, $itemset); } $smarty->assign('itemset', $itemset); global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $itemset['name'] . ' - ' . $smarty->get_config_vars('Item_Sets'), 'tab' => 0, 'type' => 4, 'typeid' => $itemset['entry'], 'path' => '[0, 2]'); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // --Передаем данные шаблонизатору-- // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору if (isset($allitems)) { $smarty->assign('allitems', $allitems); } if (isset($allitems)) {
} else { $spells['sort'] = "'name'"; // просто спеллы $rows = $DB->select(' SELECT ?#, `s`.`spellID` FROM ?_spell s, ?_spellicons i WHERE i.id=s.spellicon {LIMIT ?d} ', $spell_cols[2], $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); } foreach ($rows as $i => $row) { $spells['data'][] = spellinfo2($row); } save_cache(15, $cache_str, $spells); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => ($title ? $title . ' - ' : '') . $smarty->get_config_vars('Spells'), 'tab' => 0, 'type' => 6, 'typeid' => 0, 'path' => "[0, 1, " . intval($s1) . ", " . intval($s2) . ", " . intval($s3) . "]", 'sort' => isset($spells['sort']) ? $spells['sort'] : "'level','name'"); $smarty->assign('page', $page); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору if (isset($allitems)) { $smarty->assign('allitems', $allitems); } if (count($allspells) >= 0) { $smarty->assign('allspells', $allspells); } if (count($spells) >= 0) { $smarty->assign('spells', $spells['data']);
global $DB, $quest_class, $quest_cols; $rows = $DB->select(' SELECT ?# FROM ?_quest_template q WHERE 1 = 1 { AND ZoneOrSort = ? } { AND ZoneOrSort IN (?a) } ORDER BY Title {LIMIT ?d} ', $quest_cols[2], isset($ZoneOrSort) ? $ZoneOrSort : DBSIMPLE_SKIP, (!isset($ZoneOrSort) and $Type) ? $quest_class[$Type] : DBSIMPLE_SKIP, $UDWBaseconf['limit'] > 0 ? $UDWBaseconf['limit'] : DBSIMPLE_SKIP); $quests = array(); foreach ($rows as $numRow => $row) { $quests[] = GetQuestInfo($row, QUEST_DATAFLAG_LISTINGS); } save_cache(12, $cache_str, $quests); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Quests'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => '[0, 3,' . $Type . ' ,' . $ZoneOrSort . ']'); $smarty->assign('page', $page); // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору if ($allitems) { $smarty->assign('allitems', $allitems); } if ($quests) { $smarty->assign('quests', $quests); } // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу $smarty->display('quests.tpl');
<?php require_once 'includes/allitemsets.php'; $smarty->config_load($conf_file, 'itemset'); $cache_key = cache_key(); if (!($itemsets = load_cache(ITEMSET_LISTING, $cache_key))) { unset($itemsets); $rows = $DB->select(' SELECT ?# FROM ?_itemset ORDER by name_loc' . $_SESSION['locale'] . ' {LIMIT ?d}', $itemset_col[0], $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $itemsets = array(); foreach ($rows as $row) { $itemsets[] = itemsetinfo2($row); } save_cache(ITEMSET_LISTING, $cache_key, $itemsets); } $smarty->assign('itemsets', $itemsets); global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Item_Sets'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => '[0, 2]'); $smarty->assign('page', $page); // --Передаем данные шаблонизатору-- // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Запускаем шаблонизатор $smarty->display('itemsets.tpl');
WHERE ReqCreatureOrGOId1=? OR ReqCreatureOrGOId2=? OR ReqCreatureOrGOId3=? OR ReqCreatureOrGOId4=? ', $quest_cols[2], $id, $id, $id, $id); if ($rows_qo) { $npc['objectiveof'] = array(); foreach ($rows_qo as $numRow => $row) { $npc['objectiveof'][] = GetQuestInfo($row, 0xffffff); } } unset($rows_qo); // Положения созданий божих: position($npc['entry'], 'creature'); save_cache(1, $npc['entry'], $npc); } global $page; $page = array('Mapper' => true, 'Book' => false, 'Title' => $npc['name'] . ' - ' . $smarty->get_config_vars('NPCs'), 'tab' => 0, 'type' => 1, 'typeid' => $npc['entry'], 'path' => '[0,4,' . $npc['type'] . ']'); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору if (isset($allitems)) { $smarty->assign('allitems', $allitems); } if (isset($allspells)) { $smarty->assign('allspells', $allspells); } $smarty->assign('npc', $npc); // Количество MySQL запросов
if (!($items = load_cache(7, $cache_key))) { unset($items); // Составляем запрос к БД, выполняющий поиск по заданным классу и подклассу $rows = $DB->select(' SELECT ?#, i.entry, maxcount {, l.name_loc?d AS name_loc} FROM ?_icons, item_template i {LEFT JOIN (locales_item l) ON l.entry=i.entry AND ?d} WHERE id=displayid { AND class = ? } { AND subclass = ? } { AND InventoryType = ? } ORDER BY quality DESC, name { LIMIT ?d } ', $item_cols[2], $_SESSION['locale'] ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] ? 1 : DBSIMPLE_SKIP, isset($class) ? $class : DBSIMPLE_SKIP, isset($subclass) ? $subclass : DBSIMPLE_SKIP, isset($type) ? $type : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $items = array(); foreach ($rows as $row) { $items[] = iteminfo2($row); } save_cache(7, $cache_key, $items); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Items'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => path(0, 0, $type, $subclass, $class)); $smarty->assign('page', $page); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('allitems', $allitems); $smarty->assign('items', $items); // Загружаем страницу $smarty->display('items.tpl');
$object['criteria_of'][] = achievementinfo2($row); } } // Положения объектофф: $object['position'] = position($object['entry'], 'gameobject'); // Исправить type, чтобы подсвечивались event-овые объекты if ($object['position']) { foreach ($object['position'] as $z => $zone) { foreach ($zone['points'] as $p => $pos) { if ($pos['type'] == 0 && ($events = event_find(array('object_guid' => $pos['guid'])))) { $names = array_select_key(event_name($events), 'name'); $object['position'][$z]['points'][$p]['type'] = 4; $object['position'][$z]['points'][$p]['events'] = implode(", ", $names); } } } } save_cache(OBJECT_PAGE, $cache_key, $object); } global $page; $page = array('Mapper' => true, 'Book' => $object['pagetext'] ? true : false, 'Title' => $object['name'] . ' - ' . $smarty->get_config_vars('Objects'), 'tab' => 0, 'type' => 2, 'typeid' => $object['entry'], 'username' => $_SESSION['username'], 'path' => path(0, 5, $object['type'])); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); $smarty->assign('screenshots', getscreenshots($page['type'], $page['typeid'])); $smarty->assign('wh_ss', get_wowhead_screenshots($page['type'], $page['typeid'], 'page')); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('reputation', getreputation($page['username'])); $smarty->assign('object', $object); $smarty->display('object.tpl');
// Цель критерии $rows = $DB->select(' SELECT a.id, a.faction, a.name_loc?d AS name, a.description_loc?d AS description, a.category, a.points, s.iconname, z.areatableID FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID WHERE a.icon = s.id AND a.id = c.refAchievement AND c.type IN (?a) AND c.value1 = ?d GROUP BY a.id ORDER BY a.name_loc?d ', $_SESSION['locale'], $_SESSION['locale'], array(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM), $item['entry'], $_SESSION['locale']); if ($rows) { $item['criteria_of'] = array(); foreach ($rows as $row) { allachievementsinfo2($row['id']); $item['criteria_of'][] = achievementinfo2($row); } } save_cache(ITEM_PAGE, $cache_key, $item); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $item['name'] . ' - ' . $smarty->get_config_vars('Items'), 'tab' => 0, 'type' => 3, 'typeid' => $item['entry'], 'path' => path(0, 0, $item['type'], $item['subclass'], $item['classs'])); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('item', $item); $smarty->display('item.tpl');
$cache_key = cache_key($class, $subclass, $type); if (!($items = load_cache(ITEM_LISTING, $cache_key))) { unset($items); // Составляем запрос к БД, выполняющий поиск по заданным классу и подклассу $rows = $DB->select(' SELECT ?#, i.entry, maxcount {, l.name_loc?d AS name_loc} FROM ?_icons, item_template i {LEFT JOIN (locales_item l) ON l.entry=i.entry AND ?d} WHERE id=displayid { AND class = ? } { AND subclass = ? } { AND InventoryType = ? } ORDER BY quality DESC, name { LIMIT ?d } ', $item_cols[2], $_SESSION['locale'] ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] ? 1 : DBSIMPLE_SKIP, isset($class) ? $class : DBSIMPLE_SKIP, isset($subclass) ? $subclass : DBSIMPLE_SKIP, isset($type) ? $type : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $items = array(); foreach ($rows as $row) { $items[] = iteminfo2($row); } save_cache(ITEM_LISTING, $cache_key, $items); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Items'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => path(0, 0, $type, $subclass, $class)); $smarty->assign('page', $page); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('items', $items); // Загружаем страницу $smarty->display('items.tpl');
array_unshift($achievement['series'], $tmp); } } $tmp = end($achievement['series']); while ($tmp) { $end = end($achievement['series']); $tmp = $DB->selectRow(' SELECT id, name_loc?d AS name, parent FROM ?_achievement WHERE parent = ? ', $_SESSION['locale'], $end['id']); if ($tmp) { array_push($achievement['series'], $tmp); } } if (count($achievement['series']) <= 1) { unset($achievement['series']); } save_cache(ACHIEVEMENT_PAGE, $cache_key, $achievement); } } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $achievement['name'] . ' - ' . $smarty->get_config_vars('Achievement'), 'tab' => 0, 'type' => 9, 'typeid' => $achievement['id'], 'path' => path(0, 9, $achievement['category2'], $achievement['category1'])); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('achievement', $achievement); // Загружаем страницу $smarty->display('achievement.tpl');
// мы - героик �ПС, определ�ем позицию по нормалу $npc['position'] = position($normal_entry, 'creature', 2); } else { // мы - нормал �ПС или �ПС без �ложно�ти $npc['position'] = position($npc['entry'], 'creature', 1); } // И�править type, чтобы под�вечивали�ь event-овые NPC if ($npc['position']) { foreach ($npc['position'] as $z => $zone) { foreach ($zone['points'] as $p => $pos) { if ($pos['type'] == 0 && ($events = event_find(array('creature_guid' => $pos['guid'])))) { $names = array_select_key(event_name($events), 'name'); $npc['position'][$z]['points'][$p]['type'] = 4; $npc['position'][$z]['points'][$p]['events'] = implode(", ", $names); } } } } save_cache(NPC_PAGE, $cache_key, $npc); } } global $page; $page = array('Mapper' => true, 'Book' => false, 'Title' => $npc['name'] . ' - ' . $smarty->get_config_vars('NPCs'), 'tab' => 0, 'type' => 1, 'typeid' => $npc['entry'], 'path' => path(0, 4, $npc['type'])); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); $smarty->assign('npc', $npc); // Количе�тво MySQL запро�ов $smarty->assign('mysql', $DB->getStatistics()); // Запу�каем шаблонизатор $smarty->display('npc.tpl');
if ($spell['name']) { $x .= 'name: \'' . str_normalize($spell['name']) . '\','; } if ($spell['icon']) { $x .= 'icon: \'' . str_normalize($spell['icon']) . '\','; } if ($spell['info']) { $x .= 'tooltip: \'' . str_normalize($spell['info']) . '\''; } $x .= '});'; break; case 'quest': if (!($quest = load_cache(11, $id))) { require_once 'includes/allquests.php'; $quest = GetDBQuestInfo($id, QUEST_DATAFLAG_AJAXTOOLTIP); $quest['tooltip'] = GetQuestTooltip($quest); save_cache(11, $id, $quest); } $x .= '$WowheadPower.registerQuest(' . $id . ', 0,{'; if ($quest['name']) { $x .= 'name: \'' . str_normalize($quest['name']) . '\','; } if ($quest['tooltip']) { $x .= 'tooltip: \'' . str_normalize($quest['tooltip']) . '\''; } $x .= '});'; break; default: break; } echo $x;
$achievements = array(); $achievements['data'] = array(); foreach ($rows as $row) { $achievements['data'][] = achievementinfo2($row); } if (isset($category)) { $catrow = $DB->selectRow(' SELECT c1.id, c1.name_loc?d AS name, c2.id AS id2 FROM ?_achievementcategory c1 LEFT JOIN (?_achievementcategory c2) ON c1.parentAchievement != -1 AND c1.parentAchievement = c2.id WHERE c1.id = ? ', $_SESSION['locale'], $category); if ($catrow) { $achievements['category1'] = $catrow['id']; $achievements['category2'] = $catrow['id2']; $achievements['category'] = $catrow['name']; } } save_cache(24, $cache_key, $achievements); } } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => ($achievements['category'] ? $achievements['category'] . ' - ' : '') . $smarty->get_config_vars('Achievements'), 'tab' => 0, 'type' => 9, 'typeid' => 0, 'path' => path(0, 9, $achievements['category1'], $achievements['category2'])); $smarty->assign('page', $page); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('allachievements', $allachievements); $smarty->assign('achievements', $achievements); // Загружаем страницу $smarty->display('achievements.tpl');
SELECT name_loc' . $_SESSION['locale'] . ' AS name, mapID as id FROM ?_udwbase_zones WHERE areatableID=?d LIMIT 1 ', $lootid); if ($row) { $item['fishedin'][] = array_merge($row, $drop); } } } unset($row); unset($num); } unset($drops_fi); save_cache(5, $item['entry'], $item); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $item['name'] . ' - ' . $smarty->get_config_vars('Items'), 'tab' => 0, 'type' => 3, 'typeid' => $item['entry'], 'path' => '[0,0,' . $item['classs'] . ',' . $item['subclass'] . ']'); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); if (isset($allitems)) { $smarty->assign('allitems', $allitems); } if (isset($allspells)) { $smarty->assign('allspells', $allspells); } $smarty->assign('item', $item);
$cache_key = cache_key($type); if (!($npcs = load_cache(NPC_LISTING, $cache_key))) { unset($npcs); $rows = $DB->select(' SELECT c.?#, c.entry { , l.name_loc?d AS name_loc , l.subname_loc?d AS subname_loc } FROM ?_factiontemplate, creature_template c { LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ? } WHERE factiontemplateID=faction_A {AND type=?} ORDER BY minlevel DESC, name {LIMIT ?d} ', $npc_cols[0], $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, isset($type) ? $type : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $npcs = array(); foreach ($rows as $row) { $npcs[] = creatureinfo2($row); } save_cache(NPC_LISTING, $cache_key, $npcs); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('NPCs'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => path(0, 4, $family, $type)); $smarty->assign('page', $page); $smarty->assign('npcs', $npcs); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу $smarty->display('npcs.tpl');
$itemset['spells'][$x]['entry'] = $row['spell' . $j]; $itemset['spells'][$x]['tooltip'] = spell_desc($row['spell' . $j]); $itemset['spells'][$x]['bonus'] = $row['bonus' . $j]; $x++; } } for ($i = 0; $i <= $x - 1; $i++) { for ($j = $i; $j <= $x - 1; $j++) { if ($itemset['spells'][$j]['bonus'] < $itemset['spells'][$i]['bonus']) { unset($tmp); $tmp = $itemset['spells'][$i]; $itemset['spells'][$i] = $itemset['spells'][$j]; $itemset['spells'][$j] = $tmp; } } } } save_cache(ITEMSET_PAGE, $cache_key, $itemset); } $smarty->assign('itemset', $itemset); global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $itemset['name'] . ' - ' . $smarty->get_config_vars('Item_Sets'), 'tab' => 0, 'type' => 4, 'typeid' => $itemset['entry'], 'path' => '[0, 2]'); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); $smarty->assign('screenshots', getscreenshots($page['type'], $page['typeid'])); // --Передаем данные шаблонизатору-- // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Запускаем шаблонизатор $smarty->display('itemset.tpl');
FROM quest_template WHERE RewRepFaction1=?d OR RewRepFaction2=?d OR RewRepFaction3=?d OR RewRepFaction4=?d ', $quest_cols[2], $id, $id, $id, $id); if ($quests_rows) { $faction['quests'] = array(); foreach ($quests_rows as $i => $row) { $faction['quests'][] = GetQuestInfo($row, 0xffffff); } unset($quests_rows); } // Faction cache save_cache(18, $faction['entry'], $faction); } } $page = array('Mapper' => false, 'Book' => false, 'Title' => $faction['name'] . ' - ' . $smarty->get_config_vars('Factions'), 'tab' => 0, 'type' => 8, 'typeid' => $faction['entry'], 'path' => '[0, 7, 0]'); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Данные о квесте $smarty->assign('faction', $faction); // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору if (isset($allitems)) { $smarty->assign('allitems', $allitems); } /* if (isset($npcs)) $smarty->assign('npcs',$npcs);
$quest['criteria_of'] = array(); foreach ($rows as $row) { allachievementsinfo2($row['id']); $quest['criteria_of'][] = achievementinfo2($row); } } // Награды и благодарности, присылаемые почтой if ($quest['RewMailTemplateId']) { if (!($quest['mailrewards'] = loot('quest_mail_loot_template', $quest['entry']))) { unset($quest['mailrewards']); } } if ($quest['RewMailDelaySecs']) { $quest['maildelay'] = sec_to_time($quest['RewMailDelaySecs']); } save_cache(10, $cache_key, $quest); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $quest['Title'] . ' - ' . $smarty->get_config_vars('Quests'), 'tab' => 0, 'type' => 5, 'typeid' => $quest['entry'], 'path' => path(0, 5)); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Данные о квесте $smarty->assign('quest', $quest); // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору $smarty->assign('allitems', $allitems); $smarty->assign('allspells', $allspells); $smarty->assign('allachievements', $allachievements); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу
} $data[$i]['name'] = preg_replace('/[\\r\\n]+/', " ", localizedName($row)); // TODO: Расположение $data[$i]['location'] = "[-1]"; // Тип объекта $data[$i]['type'] = isset($type) ? $type : $row['type']; $t_name = trim($data[$i]['name']); $i++; } save_cache(OBJECT_LISTING, $cache_key, $data); } if (!($object_tot = load_cache(OBJECT_TOT, 'object_tot'))) { unset($object_tot); // Получаем данные по этому типу объектов $object_tot = $DB->select(' SELECT COUNT(g.entry) as num_objects FROM gameobject_template g WHERE g.name <> "" '); save_cache(OBJECT_TOT, 'object_tot', $object_tot[0]['num_objects']); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Objects'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => path(0, 5, $type)); $smarty->assign('page', $page); // Передаем массив данных шаблонизатору $smarty->assign('data', $data); $smarty->assign('objects_tot', is_array($object_tot) ? $object_tot[0]['num_objects'] : $object_tot); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->display('objects.tpl');
SELECT a.id, a.faction, a.name_loc?d AS name, a.description_loc?d AS description, a.category, a.points, s.iconname, z.areatableID FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID WHERE a.icon = s.id AND a.id = c.refAchievement AND c.type IN (?a) AND c.value1 = ?d GROUP BY a.id ORDER BY a.name_loc?d ', $_SESSION['locale'], $_SESSION['locale'], array(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION), $faction['entry'], $_SESSION['locale']); if ($rows) { $faction['criteria_of'] = array(); foreach ($rows as $row) { allachievementsinfo2($row['id']); $faction['criteria_of'][] = achievementinfo2($row); } } save_cache(FACTION_PAGE, $cache_key, $faction); } } $page = array('Mapper' => false, 'Book' => false, 'Title' => $faction['name'] . ' - ' . $smarty->get_config_vars('Factions'), 'tab' => 0, 'type' => 8, 'typeid' => $faction['entry'], 'path' => path(0, 7, $faction['category2'], $faction['category'])); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Данные о квесте $smarty->assign('faction', $faction); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу $smarty->display('faction.tpl');
', $_SESSION['locale'], $_SESSION['locale'], array(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST), $quest['entry'], $_SESSION['locale']); if ($rows) { $quest['criteria_of'] = array(); foreach ($rows as $row) { allachievementsinfo2($row['id']); $quest['criteria_of'][] = achievementinfo2($row); } } // Награды и благодарности, присылаемые почтой if ($quest['RewMailTemplateId']) { if (!($quest['mailrewards'] = loot('mail_loot_template', $quest['RewMailTemplateId']))) { unset($quest['mailrewards']); } } if ($quest['RewMailDelaySecs']) { $quest['maildelay'] = sec_to_time($quest['RewMailDelaySecs']); } save_cache(QUEST_PAGE, $cache_key, $quest); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $quest['Title'] . ' - ' . $smarty->get_config_vars('Quests'), 'tab' => 0, 'type' => 5, 'typeid' => $quest['entry'], 'path' => path(0, 5)); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); $smarty->assign('screenshots', getscreenshots($page['type'], $page['typeid'])); // Данные о квесте $smarty->assign('quest', $quest); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу $smarty->display('quest.tpl');
{ AND a.lockproperties1=3 AND 1=?} { AND a.lockproperties2=1 AND 1=?} { AND g.entry = q.?#} ORDER by name {LIMIT ?d} ', ($type == -3 or $type == -4) ? 'skill' : DBSIMPLE_SKIP, $type == -5 ? 'skill' : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $type == -2 ? 'q' : DBSIMPLE_SKIP, ($type == -3 or $type == -4 or $type == -5) ? 'a' : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $type > 0 ? $type : DBSIMPLE_SKIP, ($type == -3 or $type == -4) ? 1 : DBSIMPLE_SKIP, $type == -5 ? 1 : DBSIMPLE_SKIP, $type == -3 ? 1 : DBSIMPLE_SKIP, $type == -4 ? 1 : DBSIMPLE_SKIP, $type == -5 ? 1 : DBSIMPLE_SKIP, $type == -2 ? 'id' : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $i = 0; $data = array(); foreach ($rows as $numRow => $row) { $data[$i] = array(); $data[$i]['entry'] = $row['entry']; if (isset($row['skill'])) { $data[$i]['skill'] = $row['skill']; } $data[$i]['name'] = $row['name_loc'] ? $row['name_loc'] : $row['name']; // TODO: Расположение $data[$i]['location'] = "[-1]"; // Тип объекта $data[$i]['type'] = isset($type) ? $type : $row['type']; $i++; } save_cache(4, intval($type), $data); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Objects'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => '[0, 5,' . $podrazdel . ']'); $smarty->assign('page', $page); // Передаем массив данных шаблонизатору $smarty->assign('data', $data); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->display('objects.tpl');
FROM ?_gameobject_involvedrelation q, ?_gameobject_template g {LEFT JOIN (?_locales_gameobject l) ON l.entry = g.entry AND ?} WHERE q.quest=?d AND g.entry=q.id ', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $quest['entry']); if ($rows) { foreach ($rows as $tmp) { if (!empty($tmp['name_loc'])) { $tmp['name'] = $tmp['name_loc']; } $quest['end'][] = array_merge($tmp, array('type' => 'object')); } } unset($rows); save_cache(10, $quest['entry'], $quest); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $quest['Title'] . ' - ' . $smarty->get_config_vars('Quests'), 'tab' => 0, 'type' => 5, 'typeid' => $quest['entry'], 'path' => '[]'); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Данные о квесте $smarty->assign('quest', $quest); // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору if (isset($allitems)) { $smarty->assign('allitems', $allitems); } if (isset($allspells)) { $smarty->assign('allspells', $allspells); }
if ($event) { if ($event['npcs_guid'] && ($ids = $DB->selectCol('SELECT id FROM creature WHERE guid IN (?a) GROUP BY id', $event['npcs_guid']))) { $event['npcs'] = array(); foreach ($ids as $crid) { $event['npcs'][] = creatureinfo($crid); } } if ($event['objects_guid'] && ($ids = $DB->selectCol('SELECT id FROM gameobject WHERE guid IN (?a) GROUP BY id', $event['objects_guid']))) { $event['objects'] = array(); foreach ($ids as $goid) { $event['objects'][] = objectinfo($goid); } } if ($event['creatures_quests_id']) { $event['quests'] = array(); foreach ($event['creatures_quests_id'] as $qid) { $event['quests'][] = GetDBQuestInfo($qid['quest'], 0xffffff); } } save_cache(EVENT_PAGE, $cache_key, $achievement); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $event['name'] . ' - ' . $smarty->get_config_vars('Event'), 'tab' => 0, 'type' => 11, 'typeid' => $event['id'], 'path' => path(0, 11)); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('event', $event); // Загружаем страницу $smarty->display('event.tpl');
{ LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ? } WHERE factiontemplateID=faction_A {AND type=?} ORDER BY minlevel DESC, name {LIMIT ?d} ', $npc_cols[0], $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $type != '' ? $type : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $npcs = array(); foreach ($rows as $row) { $npcs[] = creatureinfo2($row); } save_cache(NPC_LISTING, $cache_key, $npcs); } if (!($npc_tot = load_cache(NPC_TOT, 'npc_tot'))) { unset($npc_tot); $npc_tot = $DB->select(' SELECT COUNT(entry) as npc_tot FROM creature_template c '); save_cache(NPC_TOT, 'npc_tot', $npc_tot); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('NPCs'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'username' => $_SESSION['username'], 'path' => path(0, 4, $type)); $smarty->assign('page', $page); $smarty->assign('npcs', $npcs); $smarty->assign('npc_tot', is_array($npc_tot) ? $npc_tot[0]['npc_tot'] : $npc_tot); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); $smarty->assign('reputation', getreputation($page['username'])); // Загружаем страницу $smarty->display('npcs.tpl');
FROM ?_factions f1 { LEFT JOIN (?_factions f2) ON f1.team <> ?d } WHERE f1.reputationListID != -1 { AND f1.team = f2.?# } { AND f1.team = ? } ORDER BY name ', $_SESSION['locale'], !isset($category) ? 'factionID' : DBSIMPLE_SKIP, isset($category) ? intval($c1) : DBSIMPLE_SKIP, intval($c2), !isset($category) ? 0 : DBSIMPLE_SKIP, !isset($category) ? 'factionID' : DBSIMPLE_SKIP, isset($category) ? $category : DBSIMPLE_SKIP); if ($c1 && !$c2) { $entrys = array(); foreach ($factions as $f) { $entrys[] = $f['entry']; } $factions = array_merge($factions, $DB->select(' SELECT f1.factionID AS entry, f1.team, f1.name_loc?d AS name, f1.side, f1.team AS category2, ?d AS category FROM ?_factions f1 WHERE f1.reputationListID != -1 { AND f1.team IN (?a) } ', $_SESSION['locale'], intval($c2), !empty($entrys) ? $entrys : DBSIMPLE_SKIP)); } save_cache(FACTION_LISTING, $cache_key, $factions); } global $page; $page = array('Title' => $smarty->get_config_vars('Factions'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => path(0, 7, $c1, $c2)); $smarty->assign('page', $page); $smarty->assign('factions', $factions); // Статистика выполнения mysql запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу $smarty->display('factions.tpl');
FROM gameobject_involvedrelation i, quest_template q WHERE i.id = ?d AND q.entry = i.quest ', $quest_cols[2], $id); if ($rows_qe) { $object['ends'] = array(); foreach ($rows_qe as $numRow => $row) { $object['ends'][] = GetQuestInfo($row, 0xffffff); } } unset($rows_qe); // Положения объектофф: $data = $DB->select('SELECT position_y as y, position_x as x, map as m, spawntimesecs FROM gameobject WHERE id = ?d', $id); position($data); save_cache(3, $object['entry'], $object); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $object['name'] . ' - ' . $smarty->get_config_vars('Objects'), 'tab' => 0, 'type' => 2, 'typeid' => $object['entry'], 'path' => '[0,5,' . $object['type'] . ']'); if ($object['pagetext']) { $page['Book'] = true; } $page['Mapper'] = true; $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); if (isset($allitems)) { $smarty->assign('allitems', $allitems); } if (isset($object)) { $smarty->assign('object', $object);
<?php // Необходима функция questinfo require_once 'includes/allquests.php'; $smarty->config_load($conf_file, 'quest'); // Разделяем из запроса класс и подкласс квестов @(list($Type, $ZoneOrSort) = extract_values($podrazdel)); $cache_key = cache_key($Type, $ZoneOrSort); if (!($quests = load_cache(QUEST_LISTING, $cache_key))) { unset($quests); $rows = $DB->select("\n\t\tSELECT q.?#\n\t\t{\n\t\t\t, l.Title_loc?d AS Title_loc\n\t\t}\n\t\tFROM quest_template q\n\t\t{ LEFT JOIN (locales_quest l) ON l.entry=q.entry AND ? }\n\t\tWHERE\n\t\t\t1 = 1\n\t\t\t{ AND ZoneOrSort = ? }\n\t\t\t{ AND ZoneOrSort IN (?a) }\n\t\t\tAND q.Title NOT IN ('','----','?????')\n\t\t\tAND q.Title NOT LIKE '<DEPRECATED>%'\n\t\t\tAND q.Title NOT LIKE '<NYI>%'\n\t\t\tAND q.Title NOT LIKE '<nyi>%'\n\t\t\tAND q.Title NOT LIKE '<TEST>%'\n\t\t\tAND q.Title NOT LIKE '<TXT>%'\n\t\t\tAND q.Title NOT LIKE '<UNUSED%'\n\t\tORDER BY Title\n\t\t{LIMIT ?d}\n\t\t", $quest_cols[2], $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, isset($ZoneOrSort) ? $ZoneOrSort : DBSIMPLE_SKIP, !isset($ZoneOrSort) && isset($Type) ? $quest_class[$Type] : DBSIMPLE_SKIP, $AoWoWconf['limit'] > 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP); $quests = array(); foreach ($rows as $row) { $quests[] = GetQuestInfo($row, QUEST_DATAFLAG_LISTINGS); } save_cache(QUEST_LISTING, $cache_key, $quests); } if (!($quests_tot = load_cache(QUEST_TOT, 'quest_tot'))) { unset($quests_tot); $quests_tot = $DB->select("\n\t\tSELECT COUNT(q.entry) as quest_tot\n\t\tFROM quest_template q\n\t\tWHERE\n\t\t\tq.Title NOT IN ('','----','?????')\n\t\t\tAND q.Title NOT LIKE '<DEPRECATED>%'\n\t\t\tAND q.Title NOT LIKE '<NYI>%'\n\t\t\tAND q.Title NOT LIKE '<nyi>%'\n\t\t\tAND q.Title NOT LIKE '<TEST>%'\n\t\t\tAND q.Title NOT LIKE '<TXT>%'\n\t\t\tAND q.Title NOT LIKE '<UNUSED%'\n\t\t"); save_cache(QUEST_LISTING, 'quest_tot', $quests_tot[0]['quest_tot']); } global $page; $page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Quests'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => path(0, 3, $Type, $ZoneOrSort)); $smarty->assign('page', $page); $smarty->assign('quests', $quests); $smarty->assign('quests_tot', is_array($quests_tot) ? $quests_tot[0]['quest_tot'] : $quests_tot); // Количество MySQL запросов $smarty->assign('mysql', $DB->getStatistics()); // Загружаем страницу $smarty->display('quests.tpl');