-
Notifications
You must be signed in to change notification settings - Fork 5
/
factions.php
58 lines (52 loc) · 1.32 KB
/
factions.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
<?php
/*
* UDWBase: WOWDB Web Interface
*
* © UDW 2009-2011
*
* Released under the terms and conditions of the
* GNU General Public License (http://gnu.org).
*
*/
$smarty->config_load($conf_file, 'factions');
global $DB;
$rows = $DB->select('
SELECT factionID, team, name_loc'.$_SESSION['locale'].' as name, side
FROM ?_udwbase_factions
WHERE
reputationListID!=-1
'
);
if(!$factions = load_cache(19, 'x'))
{
unset($factions);
$factions = array();
foreach ($rows as $numRow=>$row)
{
$factions[$numRow] = array();
$factions[$numRow]['entry'] = $row['factionID'];
if ($row['team']!=0)
$factions[$numRow]['group'] = $DB->selectCell('SELECT name_loc'.$_SESSION['locale'].' FROM ?_udwbase_factions WHERE factionID=? LIMIT 1', $row['team']);
if ($row['side'])
$factions[$numRow]['side'] = $row['side'];
$factions[$numRow]['name'] = $row['name'];
}
save_cache(19, 'x', $factions);
}
global $page;
$page = array(
'Mapper' => false,
'Book' => false,
'Title' => $smarty->get_config_vars('Factions'),
'tab' => 0,
'type' => 0,
'typeid' => 0,
'path' => '[0, 7]'
);
$smarty->assign('page', $page);
// Статистика выполнения mysql запросов
$smarty->assign('mysql', $DB->getStatistics());
$smarty->assign('factions',$factions);
// Загружаем страницу
$smarty->display('factions.tpl');
?>