-
Notifications
You must be signed in to change notification settings - Fork 5
/
npcs.php
62 lines (52 loc) · 1.42 KB
/
npcs.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
<?php
// Необходима функция creatureinfo
require_once('includes/allnpcs.php');
$smarty->config_load($conf_file, 'npc');
@list($type) = extract_values($podrazdel);
$cache_key = cache_key($type);
if(!$npcs = load_cache(NPC_LISTING, $cache_key))
{
unset($npcs);
$rows = $DB->select('
SELECT c.?#, c.entry
{
, l.name_loc?d AS name_loc
, l.subname_loc?d AS subname_loc
}
FROM ?_factiontemplate, creature_template c
{ LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ? }
WHERE
factiontemplateID=faction_A
{AND type=?}
ORDER BY minlevel DESC, name
{LIMIT ?d}
',
$npc_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
isset($type) ? $type : DBSIMPLE_SKIP,
($AoWoWconf['limit']!=0)? $AoWoWconf['limit']: DBSIMPLE_SKIP
);
$npcs = array();
foreach($rows as $row)
$npcs[] = creatureinfo2($row);
save_cache(NPC_LISTING, $cache_key, $npcs);
}
global $page;
$page = array(
'Mapper' => false,
'Book' => false,
'Title' => $smarty->get_config_vars('NPCs'),
'tab' => 0,
'type' => 0,
'typeid' => 0,
'path' => path(0, 4, $type)
);
$smarty->assign('page', $page);
$smarty->assign('npcs', $npcs);
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
// Загружаем страницу
$smarty->display('npcs.tpl');
?>