turtle-wow-source-kinda/Dumps/Source Code/18 - Development_Turtlehead Current/main/quests.php
Brian Oost a1d5bb70b2 Init
2024-08-06 18:06:40 +02:00

83 lines
2.4 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
global $smarty;
global $conf_file;
global $UDWBaseconf;
global $allitems;
// Необходима функция 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;
// tw quests
if ($podrazdel == -44) {
$rows = $DB->select('
SELECT ?# , entry as id
FROM ' . WORLD . '.quest_template q
WHERE
1 = 1
{ AND q.entry >= 30000 }
ORDER BY Title
', $quest_cols[2], (isset($ZoneOrSort)) ? $ZoneOrSort : DBSIMPLE_SKIP,
((!isset($ZoneOrSort)) and $Type) ? $quest_class[$Type] : DBSIMPLE_SKIP
);
} else {
$rows = $DB->select('
SELECT ?# , entry as id
FROM ' . WORLD . '.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) {
ini_set('mbstring.substitute_character', "none");
$row['Title'] = mb_convert_encoding($row['Title'], 'UTF-8', 'UTF-8');
$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');