db.mojotrollz.eu/quests.php
TheLuda 947f95fb20 Imported AoWoW.
This version of AoWoW is based on https://github.com/udw/udwbase and is
not yet usable.

An initial amount of testing has been finished, and you can import the
aowow.sql database into your world database, and create a local copy of
config.php.in as config.php to test this version.

FirePHP (http://firephp.org/) has been added for testing purposes.

Signed-off-by: TheLuda <theluda@getmangos.com>
2011-09-25 20:57:24 +02:00

65 lines
1.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* UDWBase: WOWDB Web Interface
*
* © UDW 2009-2011
*
* Released under the terms and conditions of the
* GNU General Public License (http://gnu.org).
*
*/
// Необходима функция questinfo
require_once('includes/allquests.php');
$smarty->config_load($conf_file, 'quests');
// Разделяем из запроса класс и подкласс квестов
point_delim($podrazdel, $Type, $ZoneOrSort);
$cache_str = (empty($Type) ? 'x' : intval($Type)) . '_' . (empty($ZoneOrSort) ? 'x' : intval($ZoneOrSort));
if (!$quests = load_cache(12, $cache_str)) {
unset($quests);
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');