Viewing file: index.php (3.56 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? // error_reporting(1); if ($_SERVER['HTTP_HOST'] == "www.zt4ever.org.ua") { // $ref=$_SERVER['QUERY_STRING']; $uri=$_SERVER['REQUEST_URI']; // echo $uri; // var_dump($_SERVER); if ($ref!='') $ref='?'.$ref; header('HTTP/1.1 301 Moved Permanently'); header('Location: http://zt4ever.org.ua'.$uri); //echo 'Location: http://zt4ever.org.ua/'.$uri.$ref; die; } global $ulang, $ULANG, $alang, $ALANG; global $_LANG_ID, $ULANG, $ulang; $_LANG_ID = array ('ukr', 'rus', 'eng' ); header("Content-type: text/html; charset: utf-8"); include("core5.php"); $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(); if (isset($result) && $result != null) { if (file_exists("user/languages/".strtolower($value->ClassName)."-{$ulang}.js")) $smarty->assign('LocalModuleLanguageScript', strtolower($value->ClassName)); $AMCMS_PageHtml = Window($result, 'page'); $smarty->assign('Title', $result['Title']); 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) { // $time_start = gettimeofday(); $result = $value->Panel(); /* $time_end = gettimeofday(); $time_total = (float)($time_end['sec'] - $time_start['sec']) + ((float)($time_end['usec'] - $time_start['usec'])/1000000); echo $value->ClassName." - ".$time_total."<br />";*/ if (isset($result) && $result != null) foreach($result as $key => $value) { if ($key == "Pages" || $key == "News" || $key == "Photochapter" || $key == "Forum") $Panels[$key] = Window($value, 'page'); else $Panels[$key] = Window($value, 'panel', $value['class']); } } } $smarty->assign("Panels", $Panels); $smarty->assign('page', $AMCMS_PageHtml); $smarty->assign('Modules', $Modules); $video_id = GetParam("first-video"); $videoObj = new Videogallery(); $video = $videoObj->VideosTable->GetRowById($video_id); $smarty->assign('video', $video); $blog_id = GetParam("blog"); $blogObj = new Blog(); $blog = $blogObj->Table->GetRowById($blog_id); $smarty->assign('blog', $blog); $Photomanager = new AMPhotomanager($params); $blog_photo = $Photomanager->GetMainPhoto("Blog", "news_id={$blog_id}"); $smarty->assign('blog_photo', $blog_photo); $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' => "<img align=\"absmiddle\" src=\"/user/images/rus.jpg\" />", 'link' => $link_lang.'?lang=ukr'); $lang[] = array('title' => "<img align=\"absmiddle\" src=\"/user/images/ukr.jpg\" />", 'link' => $link_lang.'?lang=eng'); $smarty->assign('lang', $lang); // if ($_SESSION['user_id'] == 2) $smarty->display('index-new.tpl'); // else // $smarty->display('index.tpl'); mysql_close($conn); ?>
|