| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | // Необходима функция creatureinfo
|
|---|
| 4 | require('includes/allnpcs.php');
|
|---|
| 5 |
|
|---|
| 6 | $smarty->config_load($conf_file, 'npcs');
|
|---|
| 7 |
|
|---|
| 8 | global $npc_cols;
|
|---|
| 9 |
|
|---|
| 10 | // Разделяем из запроса класс и подкласс вещей
|
|---|
| 11 | point_delim($podrazdel,$type,$family);
|
|---|
| 12 |
|
|---|
| 13 | $cache_str = (empty($type)?'x':intval($type)).'_'.(empty($family)?'x':intval($family));
|
|---|
| 14 |
|
|---|
| 15 | if(!$npcs = load_cache(2, $cache_str))
|
|---|
| 16 | {
|
|---|
| 17 | unset($npcs);
|
|---|
| 18 |
|
|---|
| 19 | global $AoWoWconf;
|
|---|
| 20 | global $DB;
|
|---|
| 21 |
|
|---|
| 22 | $rows = $DB->select('
|
|---|
| 23 | SELECT c.?#, c.entry
|
|---|
| 24 | {
|
|---|
| 25 | , l.name_loc?d as `name_loc`
|
|---|
| 26 | , l.subname_loc'.$_SESSION['locale'].' as `subname_loc`
|
|---|
| 27 | }
|
|---|
| 28 | FROM ?_factiontemplate, creature_template c
|
|---|
| 29 | { LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ? }
|
|---|
| 30 | WHERE 1=1
|
|---|
| 31 | {AND type=?}
|
|---|
| 32 | {AND family=?}
|
|---|
| 33 | AND factiontemplateID=faction_A
|
|---|
| 34 | ORDER BY minlevel DESC, name
|
|---|
| 35 | {LIMIT ?d}
|
|---|
| 36 | ',
|
|---|
| 37 | $npc_cols[0],
|
|---|
| 38 | ($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
|
|---|
| 39 | ($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
|
|---|
| 40 | ($type!='')? $type: DBSIMPLE_SKIP,
|
|---|
| 41 | (isset($family))? $family: DBSIMPLE_SKIP,
|
|---|
| 42 | ($AoWoWconf['limit']!=0)? $AoWoWconf['limit']: DBSIMPLE_SKIP
|
|---|
| 43 | );
|
|---|
| 44 |
|
|---|
| 45 | $npcs = array();
|
|---|
| 46 | foreach ($rows as $numRow=>$row)
|
|---|
| 47 | {
|
|---|
| 48 | $npcs[$numRow] = array();
|
|---|
| 49 | $npcs[$numRow] = creatureinfo2($row);
|
|---|
| 50 | }
|
|---|
| 51 | save_cache(5, $cache_str, $npcs);
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | global $page;
|
|---|
| 55 | $page = array(
|
|---|
| 56 | 'Mapper' => false,
|
|---|
| 57 | 'Book' => false,
|
|---|
| 58 | 'Title' => $smarty->get_config_vars('NPCs'),
|
|---|
| 59 | 'tab' => 0,
|
|---|
| 60 | 'type' => 0,
|
|---|
| 61 | 'typeid' => 0,
|
|---|
| 62 | 'path' => '[0, 4,'.$type.','.$family.']'
|
|---|
| 63 | );
|
|---|
| 64 | $smarty->assign('page', $page);
|
|---|
| 65 |
|
|---|
| 66 | if (count($npcs>=0))
|
|---|
| 67 | $smarty->assign('npcs',$npcs);
|
|---|
| 68 | // Количество MySQL запросов
|
|---|
| 69 | $smarty->assign('mysql', $DB->getStatistics());
|
|---|
| 70 | // Загружаем страницу
|
|---|
| 71 | $smarty->display('npcs.tpl');
|
|---|
| 72 |
|
|---|
| 73 | ?>
|
|---|