currentPage['id']; $currentLangId = $app->current_lang['id']; $lister_get_var_name = "p"; /*******************************/ $page = $db->selectRow("SELECT h1,content FROM pages WHERE master_id='{$currentPageId}' AND lang={$currentLangId}"); $page["h1"] = stripslashes($page["h1"]); $page["content"] = stripslashes($page["content"]); $smarty->assign("page",$page); /*******************************/ $limit_start; $articles_count = (int) getConfig("articles_count");; $num_links = 2; if (($_GET[$lister_get_var_name]) == 1 or !($_GET[$lister_get_var_name])){ $limit_start = 0; } else{ $limit_start = $articles_count * ($_GET[$lister_get_var_name]); $limit_start = $limit_start - $articles_count; } $articles = array(); $sql = " SELECT structure.id, structure.show_date, structure.main_img, UNIX_TIMESTAMP(structure.up_date) AS up_date, structure_ext.name, structure_ext.master_id, pages.h1, pages.content, pages.content_img_alt FROM structure,structure_ext,pages WHERE structure.pid='$currentPageId' AND structure_ext.master_id=structure.id AND structure_ext.lang='$currentLangId' AND structure_ext.display='y' AND pages.master_id=structure_ext.master_id AND pages.lang='$currentLangId' ORDER BY structure.up_date DESC LIMIT {$limit_start},{$articles_count} "; $tmp = $db->select($sql); foreach($tmp as $key => $value){ $articles["{$value["id"]}"]["id"] = $value["id"]; $articles["{$value["id"]}"]["show_date"] = $value["show_date"]; $articles["{$value["id"]}"]["up_date"] = $value["up_date"]; $articles["{$value["id"]}"]["main_img"] = $value["main_img"]; $articles["{$value["id"]}"]["name"] = $value["name"]; $articles["{$value["id"]}"]["h1"] = stripslashes($value["h1"]); $content = strip_tags($value["content"]); $content = str_replace(" "," ",$content); $content = explode(" ",mb_substr($content,0,150)); unset($content[count($content) - 1]); $articles["{$value["id"]}"]["preview"] = stripcslashes(nl2br(implode(" ",$content)))." ..."; $articles["{$value["id"]}"]["content_img_alt"] = $value["content_img_alt"]; $articles["{$value["id"]}"]["url"] = get_url(array("id"=>$articles["{$value["id"]}"]["id"],"lang"=>$currentLangId)); } $countSQL = "SELECT COUNT(structure_ext.master_id) FROM structure,structure_ext WHERE structure.pid='$currentPageId' AND structure_ext.master_id=structure.id AND structure_ext.lang='$currentLangId' AND structure_ext.display='y' "; $all = (int) $db->selectCell($countSQL); $articles_count = getConfig("articles_count"); $pageLister = pagination_get($all,$articles_count,$num_links,$_GET[$lister_get_var_name]); $smarty->assign("articles",$articles); $smarty->assign("pageLister",$pageLister); ?>current_lang['id']; $currentPageId = $app->currentPage['id']; $page_banners = $db->selectCell("SELECT banners FROM structure WHERE id={$currentPageId}"); $page_banners = json_decode($page_banners); $tmp = $db->selectCol("SELECT id FROM banner WHERE display='y' AND position='right' ORDER BY sorting"); $tmp = array_merge((array)$page_banners, (array)$tmp); //об'єднання масивів $banners = array(); foreach ($tmp as $key=>$banner_master_id) { $ban_ext = $db->selectRow("SELECT banner_ext.* FROM banner,banner_ext WHERE banner.position='right' AND banner.id='{$banner_master_id}' AND banner_ext.banner_master_id=banner.id AND banner_ext.lang='{$currentLangId}'"); if ($ban_ext) { $banners["{$banner_master_id}"]["sorting"] = $db->selectCell("SELECT sorting FROM banner WHERE id={$banner_master_id}"); $banners["{$banner_master_id}"]["name"] = $ban_ext["name"]; $banners["{$banner_master_id}"]["content"] = $ban_ext["content"]; $banners["{$banner_master_id}"]["design"] = $db->selectCell("SELECT design FROM banner WHERE id={$banner_master_id}"); } } uasort($banners, "sorting_banners"); //print_r($banners); $smarty->assign("banners",$banners); ?>current_lang['id']; $currentPageId = $app->currentPage['id']; $page_banners = $db->selectCell("SELECT banners FROM structure WHERE id={$currentPageId}"); $page_banners = json_decode($page_banners); $tmp = $db->selectCol("SELECT id FROM banner WHERE display='y' AND position='left' ORDER BY sorting"); $tmp = array_merge((array)$page_banners, (array)$tmp); //об'єднання масивів $banners = array(); foreach ($tmp as $key=>$banner_master_id) { $ban_ext = $db->selectRow("SELECT banner_ext.* FROM banner,banner_ext WHERE banner.position='left' AND banner.id='{$banner_master_id}' AND banner_ext.banner_master_id=banner.id AND banner_ext.lang='{$currentLangId}'"); if ($ban_ext) { $banners["{$banner_master_id}"]["sorting"] = $db->selectCell("SELECT sorting FROM banner WHERE id={$banner_master_id}"); $banners["{$banner_master_id}"]["name"] = $ban_ext["name"]; $banners["{$banner_master_id}"]["content"] = $ban_ext["content"]; $banners["{$banner_master_id}"]["design"] = $db->selectCell("SELECT design FROM banner WHERE id={$banner_master_id}"); } } uasort($banners, "sorting_banners"); //print_r($banners); $smarty->assign("banners_top",$banners); ?> Телеканал ВІТА - Новорічні скетчі. В очікуванні свята
20:30
ЩОСУБОТИ
ПостФактум
=>
19:30
ПО БУДНЯХ
На часі
=>
19:00
ПО БУДНЯХ
Новини
=>

Новорічні скетчі. В очікуванні свята