$val) { if($sub[1].".".$sub[2] == $val) { $gdom = $key; } } $sub = $sub[0]; $nieuwpad = $_GET[path]; // Tijdelijk homepage uit mits geen testpagina vanuit beheer $query = mysql_query("SELECT * FROM bsp_domeinen WHERE domein = '$sub' AND gdomein = '$gdom' and active=1") or die(mysql_error()); if($settings = mysql_fetch_object($query)) { verander_domein($GDOMEINEN[$settings->gdomein], $KDOMEINEN[$settings->gdomein]); $template->set_filenames(array( 'header' => 'kop.tpl' )); $template->assign_vars(array( 'domein' => ( $settings->domein == "www" ? "hoofdpagina" : $settings->domein ), 'aantallinks' => $settings->aantallinks, 'achtergrondd' => $settings->achtergrond, 'titel' => $settings->titel, 'inhoud' => $settings->inhoud, 'linkkleur' => $settings->linkkleur, 'aangepast' => ( $settings->aangepast > 0 ? date("d-m-Y", $settings->aangepast) : 'Nog niet gewijzigd' ) )); ## RECLAME $query = mysql_query("SELECT * FROM bsp_reclame ORDER BY soort,id ASC") or die(mysql_error()); while($ob = mysql_fetch_assoc($query)) { if($ob['soort'] == 0) { $reclame[$ob['soort']][] = $ob; } else { $reclame[$ob['soort']][$ob['positie']][] = $ob; } } if(is_array($reclame[0])) { foreach($reclame[0] AS $key => $val) { $template->assign_block_vars('reclame_kaders', array( 'titel' => $val['titel'], 'blok' => str_replace("{achtergrondkleur}", str_replace("#", "", $settings->inhoud), stripslashes($val['blok'])) )); } } if(is_array($reclame[1][0])) { $random = rand(0, (count($reclame[1][0]) - 1)); $reclame[1][0] = $reclame[1][0][$random]; $template->assign_var('banner_links', ( strlen($reclame[1][0][url]) > 5 ? "" : "" )."".$reclame[1][0][titel].""); } if(is_array($reclame[1][1]) || $settings->eigenbanner !== "") { $random = rand(0, (count($reclame[1][1]) - 1)); $reclame[1][1] = $reclame[1][1][$random]; $banner = ( $settings->eigenbanner == "" ? ( strlen($reclame[1][1][url]) > 5 ? "" : "" )."".$reclame[1][1][titel]."" : "Reclame Beheerder" ); $template->assign_var('banner_rechts', $banner); } ## INHOUD $locaties = array( 1 => 'Links' ); $rubrieken = array(); $query = mysql_query("SELECT * FROM bsp_rubrieken WHERE domein = '$settings->id' AND id = '$nieuwpad' LIMIT 1") or die(mysql_error()); while($ob = mysql_fetch_object($query)) { $rubrieken[1][$ob->id] = array('titel' => $ob->titel, 'tekst' => $ob->tekst); $rid = $ob->id; } $links = array(); $query = mysql_query("SELECT * FROM bsp_partners WHERE rubriek = '$rid' ORDER BY rubriek,id ASC") or die(mysql_error()); while($ob = mysql_fetch_assoc($query)) { $links[$ob[rubriek]][$ob[id]] = $ob; } $query = mysql_query("SELECT titel,id FROM bsp_rubrieken WHERE domein = '$settings->id' ORDER BY id,titel") or die(mysql_error()); while($ob = mysql_fetch_object($query)) { $template->assign_block_vars('rubrieks', array( 'id' => $ob->id, 'titel2' => strtolower(str_replace(" ", "-", $ob->titel)), 'titel' => $ob->titel )); } foreach($locaties AS $hkey => $hval) { if(is_array($rubrieken[$hkey])) { foreach($rubrieken[$hkey] AS $key => $val) { $template->assign_block_vars($hval, array( 'id' => $key, 'titel' => $val[titel], 'tekst' => ( $val[tekst] == "" ? "" : $val[tekst]."
" ) )); $template->assign_vars(array( 'trefwoorden' => "$settings->domein, $val[titel]", 'titelbalk' => "$val[titel] - $settings->domein.$WEBSITE_DOMEIN", 'omschrijving' => "Alles over $settings->domein en $val[titel]" )); if(is_array($links[$key])) { foreach($links[$key] AS $lid => $link_arr) { $template->assign_block_vars($hval.".links", array( 'id' => $link_arr[id], 'titel' => $link_arr[titel].( $link_arr[tip] == 1 ? "" : "" ), 'url' => $link_arr[url] )); } } } } } ## STEMBUS $query = mysql_query("SELECT * FROM bsp_stembus WHERE domein = '$settings->id'") or die(mysql_error()); if($ob = mysql_fetch_object($query)) { $ipadres = explode("|", $ob->ipadressen); $antwoord= explode("|", $ob->antwoorden); $results = explode("|", $ob->results); $template->assign_block_vars('stembus', array( 'vraag' => htmlspecialchars($ob->vraag), 'stemmen' => array_sum($results) )); if(in_array($REMOTE_ADDR, $ipadres)) { foreach($antwoord AS $key => $val) { $template->assign_block_vars('stembus.resultaten', array( 'antwoord' => htmlspecialchars($val), 'procent' => ( (count($ipadres) > 0) ? round(($results[$key] / array_sum($results)) * 100) : 0 ) )); } } else { if(eregi("[0-9]", $_POST[stem_antwoord])) { if($ob->results == "") { for($i=0; $i < count($antwoord); $i++) { $results[$i] = 0; } } $ipadres[] = $REMOTE_ADDR; $results[$_POST[stem_antwoord]]++; mysql_query("UPDATE bsp_stembus SET ipadressen = '".implode("|", $ipadres)."', results = '".implode("|", $results)."' WHERE domein = '$settings->id'") or die(mysql_error()); header("location: http://$HTTP_HOST"); } foreach($antwoord AS $key => $val) { $template->assign_block_vars('stembus.antwoorden', array( 'antwoord' => htmlspecialchars($val), 'id' => $key )); } } } $template->pparse('header'); } else { header("location: ../index.php"); } ?>