-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsmarty.php
58 lines (50 loc) · 1.8 KB
/
smarty.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
require_once('configs/config.php');
// Директория
global $cwd;
global $AoWoWconf;
$cwd = str_replace("\\", "/", getcwd());
// загружаем библиотеку Smarty
require_once('includes/Smarty-2.6.28/libs/Smarty.class.php');
class Smarty_AoWoW extends Smarty
{
function Smarty_AoWoW()
{
global $cwd;
global $AoWoWconf;
$this->Smarty();
// Папки с шаблонами, кэшом шаблонов и настройками
$this->template_dir = $cwd.'/templates/'.$AoWoWconf['aowow']['template'].'/';
$this->compile_dir = $cwd.'/cache/templates/'.$AoWoWconf['aowow']['template'].'/';
$this->config_dir = $cwd.'/configs/';
$this->cache_dir = $cwd.'/cache/';
// Режим отладки
$this->debugging = $AoWoWconf['debug'];
// Разделители
$this->left_delimiter = '{';
$this->right_delimiter = '}';
// Общее Кэширование, для этого сайта не работает
$this->caching = false;
// Имя сайта
$this->assign('app_name', $AoWoWconf['aowow']['name']);
// Ревизия
$this->assign('AOWOW_REVISION', AOWOW_REVISION);
}
function uDebug($name, $val = 'unset')
{
$this->append($name,$val);
}
function display($file)
{
// TODO: factions, npcs, objects, DB Statistics
global $allachievements, $allitems, $allspells, $allquests;
$this->assign('allachievements', $allachievements);
$this->assign('allitems', $allitems);
$this->assign('allspells', $allspells);
$this->assign('allquests', $allquests);
Smarty::Display($file);
}
}
// Объект шаблонизатора
$smarty = new Smarty_AoWoW('wowhead');
?>