template_dir = $app->smarty_theme_path."templates/"; $smarty->compile_dir = $app->smarty_theme_path."templates_c/"; $smarty->debugging = false; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// if (!empty($app->module['name'])){ include (INC_PATH."{$app->module['name']}.module.inc.php"); if ($app->module['name'] == 'sitemap') { include (INC_PATH."banners.inc.php"); include (INC_PATH."banner8.inc.php"); include (INC_PATH."banners_left.inc.php"); } } else{ if ($app->currentPage['template'] != ''){ include (INC_PATH."{$app->currentPage['template']}.inc.php"); include (INC_PATH."banner8.inc.php"); include (INC_PATH."banners.inc.php"); include (INC_PATH."banners_left.inc.php"); //include (INC_PATH."comments.inc.php"); } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// /* if (isset($_SESSION["rate"])) { $rate = $_SESSION["rate"]; } else { if ($xmlContent = @file_get_contents("http://pfsoft.com.ua/service/currency/")){ $rss = simplexml_load_file('http://pfsoft.com.ua/service/currency/'); $rate = array(); $i = 0; foreach ($rss->Valute as $key => $item_val) { $CharCode = (string)$item_val->CharCode; if (($CharCode == 'USD') or ($CharCode == 'EUR')) { $Nominal = (int)$item_val->Nominal; $Value = $item_val->Value / $Nominal; $rate[$i]['curency_in'] = $Value; $rate[$i]['curency_out'] = $Value + ($Value * 0.01); $rate[$i++]['curency_name'] = $CharCode; } } $_SESSION["rate"] = $rate; } } $smarty->assign("rate", $rate); */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// $smarty->assign("path_to_sub1","http://berizky.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub2","http://biliy-kamin.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub3","http://bondurivka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub4","http://britavka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub5","http://verbka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub6","http://demivka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub7","http://katashin.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub8","http://kurenivka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub9","http://lugi.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub10","http://lyubomirka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub11","http://olgopil.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub12","http://rogizka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub13","http://stratiyivka.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub14","http://tartak.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub15","http://greblya.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub16","http://chechelnik.chechelnik-rada.gov.ua"); $smarty->assign("path_to_sub17","http://rda.chechelnik-rada.gov.ua"); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// if ($app->branchKeys[1] == 33) { $lastNews = $db->select ("SELECT pages.master_id, pages.h1, pages.content, pages.content_img, pages.content_img_alt, UNIX_TIMESTAMP(structure.up_date) AS up_date FROM structure, structure_ext, pages WHERE pages.master_id=structure.id AND structure_ext.master_id=structure.id AND structure.pid=207 AND structure_ext.display!='n' AND structure_ext.lang={$app->current_lang['id']} AND pages.lang={$app->current_lang['id']} ORDER BY structure.up_date DESC LIMIT 4 "); foreach ($lastNews as $lastNewsKey=>$lastNewsItem) { $lastNews[$lastNewsKey]["url"] = prepare_url("http://".$_SERVER['HTTP_HOST'].get_url(array("id"=>$lastNewsItem["master_id"],"lang"=>$app->current_lang['id']))); $lastNews[$lastNewsKey]["content"] = mb_substr(strip_tags($lastNewsItem["content"]),0,220,'utf-8')."..."; if ($lastNewsItem["content_img"] != "") { $lastNews[$lastNewsKey]["content_img"] = $lastNewsItem["content_img"].".jpg"; $lastNews[$lastNewsKey]["content_img_alt"] = $lastNewsItem["content_img_alt"]; } } $smarty->assign("lastNews",$lastNews); $smarty->assign("lastNewsUrl", prepare_url("http://".$_SERVER['HTTP_HOST'].get_url(array("id"=>207,"lang"=>$app->current_lang['id'])))); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// $smarty->assign("theme_path",$app->theme_path); $smarty->assign("app",$app); if ($app->branchKeys[0] == 6/*ІД сторіки sub*/ && $app->branchKeys[1]) { $topMenu = $app->getMenu2($app->branchKeys[1],'top'); $tmp = $db->select("SELECT structure.id AS ARRAY_KEY, structure.pid AS PARENT_KEY, structure.id, structure.pid, structure.template, structure_ext.name FROM structure, structure_ext WHERE structure_ext.master_id=structure.id AND structure.position='left' AND structure_ext.display='y' AND structure_ext.lang={$app->current_lang['id']} AND structure.pid > 0 ORDER BY structure.sorting"); // формуємо масив //print_r($tmp); $leftMenu = makeTreeMenuArray($tmp,$app->current_lang['id'],$app->branchKeys[1]); foreach ($leftMenu as $key => $value) { if ($value["template"] != "none") { $leftMenu[$key]["url"] = prepare_url($value["url"]); } else { if (!$value["external"]) { $none_page_new_id = $db->selectCell("SELECT id FROM structure WHERE pid={$value['id']} ORDER BY sorting LIMIT 1"); $leftMenu[$key]["url"] = prepare_url("http://".$_SERVER['HTTP_HOST'].get_url(array("id"=>$none_page_new_id,"lang"=>$app->current_lang['id']))); } } if ($value["sub"]) { foreach ($value["sub"] as $key2=>$value2) { if ($value2["template"] != "none") { $leftMenu[$key]["sub"][$key2]["url"] = prepare_url($value2["url"]); } else { $none_page_new_id2 = $db->selectCell("SELECT id FROM structure WHERE pid={$value2['id']} ORDER BY sorting LIMIT 1"); $leftMenu[$key]["sub"][$key2]["url"] = prepare_url("http://".$_SERVER['HTTP_HOST'].get_url(array("id"=>$none_page_new_id2,"lang"=>$app->current_lang['id']))); } } } } $smarty->assign("topMenu",$topMenu); $smarty->assign("leftMenu",$leftMenu); if ($app->branchKeys[3] && $app->currentPage["template"] != "articles" && $app->currentPage["parent_tmpl"] != "articles") { $thirdMenu = $app->getMenu($app->branchKeys[3]); foreach ($thirdMenu as $key => $value) { $thirdMenu[$key]["url"] = prepare_url($value["url"]); } $smarty->assign("thirdMenu",$thirdMenu); } } else { // формуємо верхнє меню $topMenu = $app->getMenu(0,'top'); $smarty->assign("topMenu", $topMenu); // формуємо ліве меню $tmp = $db->select("SELECT structure.id AS ARRAY_KEY, structure.pid AS PARENT_KEY, structure.id, structure.pid, structure_ext.name FROM structure, structure_ext WHERE structure_ext.master_id=structure.id AND structure_ext.display='y' AND structure_ext.lang={$app->current_lang['id']} AND structure.position='left' ORDER BY structure.sorting"); // формуємо масив $leftMenu = makeTreeMenuArray($tmp,$app->current_lang['id']); foreach ($leftMenu as $key => $value) { if ($value["id"] == 6) { foreach ($value["sub"] as $key2=>$value2) { $leftMenu[$key]["sub"][$key2]["url"] = prepare_url($value2["url"]); } } } $smarty->assign("leftMenu",$leftMenu); // формуємо праве меню if ($app->branchKeys[1]) { $rightMenu = $app->getMenu($app->branchKeys[1]); $smarty->assign("rightMenu",$rightMenu); } // формуємо меню сільрад $topSubMenu = $app->getMenu(6/*ІД сторіки sub*/); foreach ($topSubMenu as $ts => $menuUrl) { $topSubMenu[$ts]["url"] = prepare_url($menuUrl["url"]); } $smarty->assign("topSubMenu",$topSubMenu); } // main_img $smarty->assign("mainImg", explode(";",$app->currentPage["main_img"])); // поточний рік для копірайта $smarty->assign("Year", date("Y")); $smarty->display($app->smarty_display_file); /*echo "
";
print_r ($lastNews);
echo "
";*/ ?>