forked from coolzoom/w1x-dbwebpage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quests.php
65 lines (55 loc) · 1.75 KB
/
quests.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?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(12, $cache_key))
{
unset($quests);
$rows = $DB->select('
SELECT q.?#
{
, l.Title_loc?d AS Title_loc
}
FROM quest_template q
{ LEFT JOIN (locales_quest l) ON l.entry=q.entry AND ? }
WHERE
1 = 1
{ AND ZoneOrSort = ? }
{ AND ZoneOrSort IN (?a) }
ORDER BY Title
{LIMIT ?d}
',
$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(12, $cache_key, $quests);
}
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) // TODO
);
$smarty->assign('page', $page);
// Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору
$smarty->assign('allitems',$allitems);
$smarty->assign('quests',$quests);
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
// Загружаем страницу
$smarty->display('quests.tpl');
?>