forked from Tuxinou/Freehead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quests.php
executable file
·95 lines (81 loc) · 2.58 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?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);
$request_limit = $AoWoWconf['limit'];
if(!$quests = load_cache(QUEST_LISTING, $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.Id AND ? }
WHERE
1 = 1
{ AND ZoneOrSort = ? }
{ AND ZoneOrSort IN (?a) }
AND q.Title NOT IN ('','----','?????')
AND q.Title NOT LIKE '<DEPRECATED>%'
AND q.Title NOT LIKE '<NYI>%'
AND q.Title NOT LIKE '<nyi>%'
AND q.Title NOT LIKE '<TEST>%'
AND q.Title NOT LIKE '<TXT>%'
AND q.Title NOT LIKE '<UNUSED%'
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(QUEST_LISTING, $cache_key, $quests);
}
if(!$quests_tot = load_cache(QUEST_TOT, 'quest_tot'))
{
unset($quests_tot);
$quests_tot = $DB->select("
SELECT COUNT(q.Id) as quest_tot
FROM quest_template q
WHERE
q.Title NOT IN ('','----','?????')
AND q.Title NOT LIKE '<DEPRECATED>%'
AND q.Title NOT LIKE '<NYI>%'
AND q.Title NOT LIKE '<nyi>%'
AND q.Title NOT LIKE '<TEST>%'
AND q.Title NOT LIKE '<TXT>%'
AND q.Title NOT LIKE '<UNUSED%'
"
);
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) // TODO
);
$smarty->assign('request_limit', $request_limit);
$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');
?>