php LANG _SERVER HTTP_HOST en giduv com en ru require_once lib config

 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
<?php
/**
*
*
*
**/
$LANG = $_SERVER['HTTP_HOST'] == 'en.giduv.com' ? 'en' : 'ru';
require_once 'lib/config.php';
require_once 'dbconfig.php';
if (!defined('ZCM_NOSQL')) require_once 'dbconfig.php';
if (!defined('ZCM_NOSMARTY')) require_once 'smarty.php';
require_once 'Model/News.php';
require_once 'Model/Blocks.php';
// Новости
$total = 0;
$HeaderNews = Model_News::getHeaders(array('start'=>0,'perpage'=>5,),$total);
if ($HeaderNews) $smarty->assign('HeaderNews',$HeaderNews);
$smarty->assign('IE',strpos($_SERVER['HTTP_USER_AGENT'],'MSIE') != false);
// Меню
$_mtime = $db->selectCell('Select MAX(arLastMod) FROM ?_article');
if (!is_file($f = "data/cache/menu.html") || filemtime($f) < $_mtime || 1)
{
// Делаем меню
require_once 'fn_sitemap.php';
} else $menu = file_get_contents($f);
$smarty->assign('Menu',$menu);
// Контакты
$smarty->assign('Contacts',$db->selectRow('Select blName AS name,blText as text FROM ?_block WHERE blIntName=?','kontaktyi_na_glavnoyi'));
?>