compile_check = true; $mediart_smarty->debugging = false; //$mediart_smarty->debugging = true; $mediart_smarty->template_dir = 'themes/'; $mediart_smarty->compile_dir = 'themes/compile/'; $mediart_smarty->cache_dir = 'themes/cache/'; $mediart_smarty->config_dir = 'themes/configs/'; $mediart_smarty->left_delimiter = ''; $mediart_smarty->assign("display_lcol", "1"); $mediart_smarty->clear_compiled_tpl(); if($_GET['a'] != "login") unset($_SESSION['redirect']); if(!isset($_GET['a'])) { foreach(explode("&", str_replace("?","",strstr($_SESSION['settings']['main_site_module'], "?"))) as $v) { $action = explode("=", $v); $_GET[$action[0]] = $action[1]; } } $cur_module_name = $_GET['a']; #SWITCH if($_GET['a']) { switch ($_GET['a']) { default: if(file_exists($modules_c[$_GET['a']][file])) require($modules_c[$_GET['a']][file]); } } #MENUS foreach($menu_positions as $key => $val) { list($items, $links, $subs, $name_txt, $type) = $DB->GetRow("SELECT items, links, subs, name, type FROM ".PREFIX."menus WHERE position='".$key."'"); if($items != "" || $links != ""){ $items = unserialize($items); $links = unserialize($links); $subs = unserialize($subs); $name = usun_pl($val); $$name = array('links' => $links, 'subs' => $subs, 'items' => $items); //die(print_r($subs).print_r($links).print_r($subs)); $mediart_smarty->assign("{$name}_txt", $name_txt); } if(is_array($$name)) { $gora = $$name; $parent_s = 0; $first = 0; $typ_menu = " id='navigation'"; if($type) $typ_menu=""; $gora_m = "\n\n\n"; foreach($gora['links'] as $k => $v) { if($gora['subs'][$k] > $parent_s) $gora_m .= "\n\n"; } $link = "javascript: void(0);"; $target = ""; if($v) { $link = htmlspecialchars($v); if(!strstr($link, "http")) { //$link .= "&im=$k"; } else { $target = " target='_blank'"; } } if($type) $gora_m .= "
  • {$gora['items'][$k]}"; else $gora_m .= "
  • {$gora['items'][$k]}"; if($gora['subs'][$k] >= $gora['subs'][$k+1] && $first) $gora_m .= "
  • \n"; $parent_s = $gora['subs'][$k]; $first++; } for($i = 0; $i < ($parent_s); $i++) $gora_m .= "\n\n"; $gora_m .= ""; if($type) $gora_m = "
    {$gora_m}
    "; $gora_m = htmLawed($gora_m, array('tidy'=>'2', 'schemes' => 'href: mailto, http, https, javascript; *: http, https, javascript')); $mediart_smarty->assign("{$name}_m", $gora_m); } } #BLOKI $blocks = $DB->GetAssoc("SELECT REPLACE(title, ' ', '_'), main FROM ".PREFIX."blocks WHERE active=1 ORDER BY id"); foreach($blocks as $k => $v) { $blocks_conv[usun_pl($k)] = stripslashes($v); } $blocks = $blocks_conv; $mediart_smarty->assign("blocks", $blocks); if(is_array($blocks)) { foreach($blocks as $k => $v) { $main = str_replace("", $v, $main); } } if($_GET['a']=='home'){ $rs = $DB->Execute("SELECT ".PREFIX."blocks.*, ".PREFIX."users.login FROM ".PREFIX."blocks LEFT JOIN ".PREFIX."users ON ".PREFIX."blocks.user_id=".PREFIX."users.id WHERE ".PREFIX."blocks.active=1 AND ".PREFIX."blocks.id=2"); if ($DB->ErrorMsg()) die($DB->ErrorMsg()."
    ".$mediart_sql); $m_test="
    {$rs->fields['title']}
    {$rs->fields['main']}
    "; $rs = $DB->Execute("SELECT ".PREFIX."articles.*, ".PREFIX."users.login FROM ".PREFIX."articles LEFT JOIN ".PREFIX."users ON ".PREFIX."articles.user_id=".PREFIX."users.id WHERE ".PREFIX."articles.active=1 ORDER BY sort DESC LIMIT 4"); if ($DB->ErrorMsg()) die($DB->ErrorMsg()."
    ".$mediart_sql); $main = "

    {$modules_c[$_GET['a']][name]}

    "; $count = 0; while (!$rs->EOF) { if($count == 0) $main .= "
    "; $more = ""; if($rs->fields['main']) $more = ""; $main .= "
    {$rs->fields['title']}
    ".stripslashes($rs->fields['short'])."
    $more
    "; $count++; if($count == $_SESSION['settings']['count_news']) { $main .= "
    "; $count = 0; } $rs->MoveNext(); } if($count != $_SESSION['settings']['count_news']) $main .= "
    "; $main .= ""; $m_title = "NEWS"; } $mediart_smarty->assign("m_test", $m_test); $mediart_smarty->assign("my_acc", $my_acc); $mediart_smarty->assign("main", $main); $mediart_smarty->assign("m_title", $m_title); $mediart_smarty->assign("site_name", $_SESSION['settings']['site_name']); $mediart_smarty->assign("add_style", $add_style); $mediart_smarty->assign("add_js", $add_js); if($_SESSION['user_email']) $mediart_smarty->assign("user_email", $_SESSION['user_email']); if($metakeywords == '') $metakeywords = $_SESSION['settings']['global_metakeywords']; $mediart_smarty->assign("metakeywords", $metakeywords); if($metadescription == '') $metadescription = $_SESSION['settings']['global_metadescription']; $mediart_smarty->assign("metadescription", $metadescription); $mediart_smarty->display('header.tpl'); $mediart_smarty->display('index.tpl'); $mediart_smarty->display('footer.tpl'); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); //echo '

    Page generated in '.$total_time.' seconds.

    '."\n"; ?>