| Line | |
|---|
| 1 | <?php
|
|---|
| 2 | $smarty->config_load($conf_file, 'factions');
|
|---|
| 3 |
|
|---|
| 4 | global $DB;
|
|---|
| 5 |
|
|---|
| 6 | $rows = $DB->select('
|
|---|
| 7 | SELECT factionID, team, name, side
|
|---|
| 8 | FROM ?_factions
|
|---|
| 9 | WHERE
|
|---|
| 10 | reputationListID!=-1
|
|---|
| 11 | '
|
|---|
| 12 | );
|
|---|
| 13 | if(!$factions = load_cache(19, 'x'))
|
|---|
| 14 | {
|
|---|
| 15 | unset($factions);
|
|---|
| 16 |
|
|---|
| 17 | $factions = array();
|
|---|
| 18 | foreach ($rows as $numRow=>$row)
|
|---|
| 19 | {
|
|---|
| 20 | $factions[$numRow] = array();
|
|---|
| 21 | $factions[$numRow]['entry'] = $row['factionID'];
|
|---|
| 22 | if ($row['team']!=0)
|
|---|
| 23 | $factions[$numRow]['group'] = $DB->selectCell('SELECT name FROM ?_factions WHERE factionID=? LIMIT 1', $row['team']);
|
|---|
| 24 | if ($row['side'])
|
|---|
| 25 | $factions[$numRow]['side'] = $row['side'];
|
|---|
| 26 | $factions[$numRow]['name'] = $row['name'];
|
|---|
| 27 | }
|
|---|
| 28 | save_cache(19, 'x', $factions);
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | global $page;
|
|---|
| 32 | $page = array(
|
|---|
| 33 | 'Mapper' => false,
|
|---|
| 34 | 'Book' => false,
|
|---|
| 35 | 'Title' => $smarty->get_config_vars('Factions'),
|
|---|
| 36 | 'tab' => 0,
|
|---|
| 37 | 'type' => 0,
|
|---|
| 38 | 'typeid' => 0,
|
|---|
| 39 | 'path' => '[0, 7]'
|
|---|
| 40 | );
|
|---|
| 41 | $smarty->assign('page', $page);
|
|---|
| 42 |
|
|---|
| 43 | // Статистика выполнения mysql запросов
|
|---|
| 44 | $smarty->assign('mysql', $DB->getStatistics());
|
|---|
| 45 | $smarty->assign('factions',$factions);
|
|---|
| 46 | // Загружаем страницу
|
|---|
| 47 | $smarty->display('factions.tpl');
|
|---|
| 48 | ?>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.