Viewing file: index.php (2.88 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? global $ulang, $ULANG, $alang, $ALANG;
if ($_SERVER['REMOTE_ADDR'] == '193.192.37.183')
die;
global $_LANG_ID, $ULANG, $ulang;
$_LANG_ID = array ('ukr', 'rus', 'eng' );
header("Content-type: text/html; charset: utf-8");
$_GET['lang'] = 'ukr';
include("core5.php");
$ip = "~193.164.95.254";
//if (isset($_GET['lang']))
{
setcookie("lang", $_GET['lang'], time() + 6 * 30 * 24 * 60 * 60);
}
$time_start = gettimeofday();
$smarty = new Smarty();
$smarty->template_dir = "user/templates/";
$smarty->compile_dir = "tmp/_compile_user/";
$smarty->cache_dir = "tmp/_cache_user/";
$smarty->assign('ULANG', $ULANG);
$smarty->assign('ulang', $ulang);
include "user/config.php";
if (count($AMCMS_Config) > 0)
foreach($AMCMS_Config as $key => $value)
$smarty->assign($key, $value);
foreach($Modules as $key => $value)
{
if ($value->UserMode && isset($_REQUEST['mod']) && $_REQUEST['mod'] == $value->ClassName)
{
$result = $value->User();
$time_end = gettimeofday();
$time_total = (float)($time_end['sec'] - $time_start['sec']) + ((float)($time_end['usec'] - $time_start['usec'])/1000000);
if ($_SERVER['REMOTE_ADDR'] === $ip)
{
echo "<div>User $key - $time_total</div>";
}
if (isset($result['bgcolor']))
$smarty->assign('bgcolor', $result['bgcolor']);
if (isset($result) && $result != null)
{
$AMCMS_PageHtml = Window($result, 'page');
if (count($result['GlobalParams']) > 0)
foreach($result['GlobalParams'] as $key => $value)
$smarty->assign($key, $value);
}
}
}
$Panels = array();
foreach($Modules as $key => $value)
{
if ($value->PanelMode)
{
$result = $value->Panel();
$time_end = gettimeofday();
$time_total = (float)($time_end['sec'] - $time_start['sec']) + ((float)($time_end['usec'] - $time_start['usec'])/1000000);
if ($_SERVER['REMOTE_ADDR'] === $ip)
{
echo "<div>Panel $key - $time_total</div>";
}
if (isset($result) && $result != null)
foreach($result as $key => $value)
{
$Panels[$key] = Window($value, 'panel');
}
}
}
$smarty->assign("Panels", $Panels);
$smarty->assign('page', $AMCMS_PageHtml);
$smarty->assign('Modules', $Modules);
$smarty->assign('LANG_ID', $_LANG_ID);
$time_end = gettimeofday();
$time_total = (float)($time_end['sec'] - $time_start['sec']) + ((float)($time_end['usec'] - $time_start['usec'])/1000000);
$smarty->assign('GenerationTime', $time_total);
$lang = array();
$link_lang = $_SERVER['REQUEST_URL'];
$lang[] = array('title' => "РУС", 'link' => $link_lang.'?lang=rus');
$lang[] = array('title' => "УКР", 'link' => $link_lang.'?lang=ukr');
$smarty->assign('lang', $lang);
$smarty->display('index.tpl');
mysql_close($conn);
?>
|