parse('main.sponsoren.sponsor', array('bedrijf' => $row[bedrijf], 'logo' => $row[small_logo], 'id' => $row[id])); } $blmain->parse('main.sponsoren'); } #informatie uit de database halen if ($instel['gastenboek'] == 1) { if (!$_GET['action']) { $result = mysql_query("SELECT * FROM race_gastenboek WHERE view = 1 ORDER BY id DESC") or die(mysql_error()); $aantal_gevonden = mysql_num_rows($result); $npages = $aantal_gevonden / $max; $npages = ceil($npages); if ($npages == '0') { $npages = 1; } if ($npages > '20') { $npages = 20; } if (!isset($_GET['page'])) { $page = 1; } else { $page = $_GET['page']; } for ($i = 1; $i < $npages + 1; $i++) { if ($page == $i) $nav[] = "" . $i . ""; else $nav[] = "" . $i . ""; } if ($page != 1) { array_unshift($nav, "Vorige"); } if ($page < $npages) { $nav[] = "Volgende"; } $nav = implode(" | ", $nav); if ($npages > 1) { $blmain->parse('main.gastenboek_main.navboven', array('nav' => $nav)); $blmain->parse('main.gastenboek_main.navonder', array('nav' => $nav)); } $berichten = mysql_num_rows($result); $beginvalue = ($page * $max) - $max; $result = mysql_query("SELECT * FROM race_gastenboek WHERE view = '1' ORDER BY id DESC LIMIT $beginvalue, $max") or die(mysql_error()); if ($aantal_berichten = mysql_num_rows($result) != '0') { $blmain->parse('main.gastenboek_main.aantal_berichten', array('aantal' => $berichten)); while ($row = mysql_fetch_array($result)) { if ($row[email]) { $email = "\"Stuur"; } else { $email = ""; } if ($row[website] == "http://" or empty($row[website])) { $website = ""; } else { $website = "\"Bekijk"; } $datum = date("d-m-Y", $row[datum]) . " om " . date("H:i:s", $row[datum]); if ($email or $icq or $website) { $blmain->parse('main.gastenboek_main.bericht.gsb_bericht_footer', array('email' => $email, 'website' => $website, 'icq' => $icq)); } if($row['comments']){ $datum = date("d-m-Y", $row[date_com]) . " om " . date("H:i:s", $row[date_com]); $comber = ereg_replace("\n", "
", $row['comments']); $comment = "Op " . $datum . " heeft de beheerder gereageerd.
" . $comber . "
"; $blmain->parse('main.gastenboek_main.bericht.comment', array('comment' => $comment)); } $blmain->parse('main.gastenboek_main.bericht', array('naam' => $row[naam], 'bericht' => $row[bericht], 'email' => $email, 'website' => $website, 'datum' => $datum, 'icq' => $icq, 'comment' => $comment)); } $blmain->parse('main.gastenboek_main'); $blmain->parse('main.quickreact', array('naam' => $_POST['naam'], 'email' => $_POST['email'], 'bericht' => $_POST['bericht'])); } else { $blmain->parse('main.geen_berichten'); } } elseif ($_GET['action'] = 'addbericht') { if ($_POST['code'] == "geel") { $bericht = str_replace("<", "<", "$_POST[bericht]"); $bericht = str_replace(">", ">", "$bericht"); mysql_query("INSERT INTO race_gastenboek (id, naam, bericht, datum, email, website, icq, ip, view, nrinv, orgnum) VALUES ('', '" . $_POST['naam'] . "', '" . nl2br($bericht) . "', '" . time() . "', '" . $_POST['email'] . "', '" . $website . "', '" . $_POST['icq'] . "', '" . $getip . "', '1', '" . $_POST['nummer'] . "', '" . $_POST['numcheck'] . "')") or die(mysql_error()); $blmain->parse('main.bericht_toegevoegd'); $bltpl->parse('main.header.redirect', array('page' => "gastenboek.php")); } else { $result = mysql_query("SELECT * FROM race_gastenboek WHERE view = '1' ORDER BY id DESC") or die(mysql_error()); $aantal_gevonden = mysql_num_rows($result); $npages = $aantal_gevonden / $max; $npages = ceil($npages); if ($npages == '0') { $npages = 1; } if ($npages > '20') { $npages = 20; } if (!isset($_GET['page'])) { $page = 1; } else { $page = $_GET['page']; } for ($i = 1; $i < $npages + 1; $i++) { if ($page == $i) $nav[] = "" . $i . ""; else $nav[] = "" . $i . ""; } if ($page != 1) { array_unshift($nav, "Vorige"); } if ($page < $npages) { $nav[] = "Volgende"; } $nav = implode(" | ", $nav); if ($npages > 1) { $blmain->parse('main.gastenboek_main.navboven', array('nav' => $nav)); $blmain->parse('main.gastenboek_main.navonder', array('nav' => $nav)); } $berichten = mysql_num_rows($result); $beginvalue = ($page * $max) - $max; $result = mysql_query("SELECT * FROM race_gastenboek WHERE view = '1' ORDER BY id DESC LIMIT $beginvalue, $max") or die(mysql_error()); if ($aantal_berichten = mysql_num_rows($result) != '0') { $blmain->parse('main.gastenboek_main.aantal_berichten', array('aantal' => $berichten)); while ($row = mysql_fetch_array($result)) { if ($row[email]) { $email = "\"Stuur"; } else { $email = ""; } if ($row[website] == "http://" or empty($row[website])) { $website = ""; } else { $website = "\"Bekijk"; } if ($row[comments]) { $datum = date("d-m-Y", $row[date_com]) . " om " . date("H:i:s", $row[date_com]); $comber = ereg_replace("\n", "
", $row['comments']); $comment = "

Op " . $datum . " heeft de beheerder gereageerd.
" . $comber . "
"; } else { $comment = ""; } $datum = date("d-m-Y", $row[datum]) . " om " . date("H:i:s", $row[datum]); if ($email or $icq or $website) { $blmain->parse('main.gastenboek_main.bericht.gsb_bericht_footer', array('email' => $email, 'website' => $website, 'icq' => $icq)); } $blmain->parse('main.gastenboek_main.bericht', array('naam' => $row[naam], 'bericht' => $row[bericht], 'email' => $email, 'website' => $website, 'datum' => $datum, 'icq' => $icq, 'comment' => $comment)); } $blmain->parse('main.gastenboek_main'); $blmain->parse('main.quickreact', array('naam' => $_POST['naam'], 'email' => $_POST['email'], 'bericht' => $_POST['bericht'])); } } } } else { echo "Gastenboek uitgeschakeld"; } $bltpl->parseout('main.header'); $blmain->parseout('main'); $bltpl->parseout('main.footer', array('version' => $CONFIG["version"])); ?>