source: aowow/quests.php

Last change on this file was 170, checked in by maron, 15 years ago
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1<?php
2
3// Необходима функция questinfo
4require_once('includes/allquests.php');
5
6$smarty->config_load($conf_file, 'quests');
7
8// Разделяем из запроса класс и подкласс квестов
9point_delim($podrazdel,$Type,$ZoneOrSort);
10
11$cache_str = (empty($Type)?'x':intval($Type)).'_'.(empty($ZoneOrSort)?'x':intval($ZoneOrSort));
12
13if(!$quests = load_cache(12, $cache_str))
14{
15 unset($quests);
16
17 global $DB, $quest_class, $quest_cols;
18
19 $rows = $DB->select('
20 SELECT ?#
21 FROM quest_template q
22 WHERE
23 1 = 1
24 { AND ZoneOrSort = ? }
25 { AND ZoneOrSort IN (?a) }
26 ORDER BY Title
27 {LIMIT ?d}
28 ',
29 $quest_cols[2],
30 (IsSet($ZoneOrSort))? $ZoneOrSort : DBSIMPLE_SKIP,
31 ((!IsSet($ZoneOrSort)) and $Type)? $quest_class[$Type] : DBSIMPLE_SKIP,
32 ($AoWoWconf['limit'] > 0)? $AoWoWconf['limit']: DBSIMPLE_SKIP
33 );
34 $quests = array();
35 foreach($rows as $numRow=>$row)
36 $quests[] = GetQuestInfo($row, QUEST_DATAFLAG_LISTINGS);
37
38 save_cache(12, $cache_str, $quests);
39}
40global $page;
41$page = array(
42 'Mapper' => false,
43 'Book' => false,
44 'Title' => $smarty->get_config_vars('Quests'),
45 'tab' => 0,
46 'type' => 0,
47 'typeid' => 0,
48 'path' => '[0, 3,'.$Type.' ,'.$ZoneOrSort.']'
49);
50$smarty->assign('page', $page);
51
52// Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору
53if($allitems)
54 $smarty->assign('allitems',$allitems);
55if($quests)
56 $smarty->assign('quests',$quests);
57// Количество MySQL запросов
58$smarty->assign('mysql', $DB->getStatistics());
59// Загружаем страницу
60$smarty->display('quests.tpl');
61
62?>
Note: See TracBrowser for help on using the repository browser.