currentPage['id']; $currentLangId = $app->current_lang['id']; $projects = $db->select(" SELECT structure.id, structure.main_img, structure_ext.name, structure_ext.translit FROM structure, structure_ext WHERE structure.id=structure_ext.master_id AND structure.pid={$currentPageId} AND structure_ext.display='y' AND structure_ext.lang={$currentLangId} ORDER BY sorting "); foreach ($projects as $key=>$value) { $projects[$key]["url"] = get_url(array("id"=>$value["id"],"lang"=>$currentLangId)); $projects[$key]["photo"] = get_project_photo($value["id"]); $content = strip_tags($db->selectCell("SELECT content FROM pages WHERE master_id={$value['id']} AND lang={$currentLangId}")); $content = str_replace(" "," ",$content); $content = mb_substr($content,0,170)." ..."; $projects[$key]["preview"] = stripcslashes(nl2br($content)); } //print_r($projects); $smarty->assign("projects",$projects); ?>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); ?> Проекти
19:00
ПО БУДНЯХ
Новини
=>
20:30
ЩОСУБОТИ
ПостФактум
=>
19:30
ПО БУДНЯХ
На часі
=>

Проекти