assign('sActive', 'aanbiedingen'); $oDesign->SetTitle('Home Page'); if($_GET['page']==='shop_random_products') { $sSitesStartPage='shop'; } else { $sSitesStartPage=sql_getval("SELECT sites_start_page FROM sites WHERE sites_id='".$oDesign->oSite->GetId()."' "); } if($sSitesStartPage==="shop") { $aProducts = sql_getarray('SELECT p.*, pf.files_link FROM products p LEFT JOIN products_files pf USING (products_id) WHERE p.products_active = 1 AND p.products_homepage = 1 GROUP BY p.products_id ORDER BY RAND() LIMIT 2'); $oDesign->assign('aProducts', $aProducts); $oDesign->ShowPage('index.tpl'); } elseif($sSitesStartPage==="news") { $aNews = sql_getarray('SELECT * FROM news WHERE news_active = 1 AND news_start_date <= NOW() AND news_end_date >= NOW() ORDER BY news_start_date DESC LIMIT 3'); $oDesign->assign('aNews', $aNews); $oDesign->ShowPage('news_startpage.tpl'); } else { include('pages.php'); } ?>