Laatste nieuws >>
'; $_sQuery = "select news_id, news_title from news order by news_date desc limit 0,3"; $rs = DBHandler::executeSelectQuery($_sQuery); while ($r= mysql_fetch_array($rs)) { $news .= '
'.$r["news_title"].'
'; } $news .= ''; if (strtolower(REQ_URL) != "index.php") { $sWebsiteTPL = new Template(DIR_ROOT.'public/templates/website.tpl'); $sWebsiteTPL->assign('VERZCODE', VERZEKERING_CODE); $sWebsiteTPL->assign('NEWS', $news); $newssub = '
Relevante links >>
'; $keyword = str_replace(".php", "", REQ_URL); $keyword = str_replace("_", " ", $keyword); $keyword = str_replace("-", " ", $keyword); $aKeywords = split(" ", $keyword); $addon = ""; foreach ($aKeywords as $key) { if ($addon != "") { $addon .= " AND "; } $addon .= "pages_att.att_value Like '%".$key."%'"; } //print_r($aKeywords); $_sQuery = "select * from pages Inner Join pages_att ON pages_att.att_page_id = pages.id Where ".$addon." and att_type = 'CONTENT_1' AND pages.url <> '".REQ_URL."' order by RAND() limit 5"; $rs = DBHandler::executeSelectQuery($_sQuery); if (mysql_num_rows($rs) == 0) { // geen resultaten $_sQuery = "select * from pages Inner Join pages_att ON pages_att.att_page_id = pages.id Where att_type = 'CONTENT_1' AND pages.url <> '".REQ_URL."' order by RAND() limit 5"; $rs = DBHandler::executeSelectQuery($_sQuery); } $i = 0; while ($r = mysql_fetch_array($rs)) { if ($i > 3) { break; } $_sQuery = "select * from pages_att WHERE att_type = 'HTML_TITLE' AND att_page_id = '".$r["att_page_id"]."'"; $rs2 = DBHandler::executeSelectQuery($_sQuery); $r2 = mysql_fetch_array($rs2); $newssub .= '
'.prepareNewsTitle(filterNews($r2["att_value"])).'
'.substr(filterNews($r["att_value"]),0,140).'
'; $i++; } $newssub .= '
'; $sWebsiteTPL->assign('SUBNEWS', $newssub); $sWebsiteTPL->assign('FOTO', '/public/templates/gfx/bg_detail_'.rand(1,3).'.jpg'); $oWebsite = new Website(&$sWebsiteTPL); $oWebsite->initiate($oWebsite); $oWebsite = $oWebsite->getObject(); echo $oWebsite->result(); } else { $sWebsiteTPL = new Template(DIR_ROOT.'public/templates/home.tpl'); $sWebsiteTPL->assign('VERZCODE', VERZEKERING_CODE); $sWebsiteTPL->assign('NEWS', $news); $oWebsite = new Website(&$sWebsiteTPL); $oWebsite->initiate($oWebsite); $oWebsite = $oWebsite->getObject(); echo $oWebsite->result(); // echo $sWebsiteTPL->result(true); } ?>