= 1){ // wanneer de IP geblokt is naar dit adres doorsturen #echo "
"; #echo "U bent gebanned via uw IP adres: $ip.
"; #echo "De reden is dat via bovenstaand IP adres ongepaste teksten zijn geplaatst en u hiermee doorging, ondanks waarschuwingen tot een IP ban.
"; #echo "Of u heeft meerdere malen ongepaste teksten geplaatst, waardoor wij meteen tot een IP ban overgaan.

"; #echo "Mocht u dit onterecht vinden of u weet nergens van, neem dan hier contact op.
"; #echo "Leg de situatie uit en misschien wordt u dan weer toegelaten.

"; #echo "Alleen mails van een betaalde provider worden geaccepteerd (quicknet, chello, kpn etc.) DUS GEEN hotmail etc. etc.

"; #echo "Klik hier om naar de startpagina terug te keren."; ## header("Location: http://www.google.nl/"); #} else { /* Start of configurable variables */ $Config["page"] = $PHP_SELF; # The refering page (usually doesn't need to be edited) $Config["xml"] = 'guestbook.xml'; # XML text file that contains all posted data $Config["site"] = 'Angantyr gasten'; # If there is a notify address, subject line contains this site $Config["notify"] = 'webmaster@angantyr.nl peterkawa@gmail.com'; # Notify for new posts to this e-mail addresses $Config["color"] = '#D2D2D2'; # Background color $Config["style"] = 'css/guestbook.css'; # CSS style for all fonts $Config["homepage"] = 'no'; # Show homepage field ('yes', or 'no') $Config["country"] = 'no'; # Show country field ('yes', or 'no') $Config["icq"] = 'no'; # Show icq field ('yes', or 'no') $Config["skype"] = 'no'; # Show skype field ('yes', or 'no') $Config["randomchain"] = 'yes'; # Show randomchain security field ('yes', or 'no') $Config["smileys"] = 'smileys'; # Smileys directory (/ is site's root directory) $Config["pager"] = 10; # Show a portion of messages each time #--- Translation ---# $Config["msg"]["noerror"] = "Bericht ontvangen!"; $Config["msg"]["permerror"] = "Je bericht kon niet worden opgeslagen. Roep de webmaster..."; $Config["msg"]["error"] = "Vul tenminste de naam, email en de bericht velden in..."; $Config["msg"]["invalid"] = "Ooowww, je email adres is niet geldig..."; $Config["msg"]["name"] = "Naam"; $Config["msg"]["email"] = "Email"; $Config["msg"]["home"] = "Homepage"; $Config["msg"]["country"] = "Land"; $Config["msg"]["icq"] = "ICQ"; $Config["msg"]["skype"] = "Skype"; $Config["msg"]["randomchain"] = "Deze code hiernaast overtypen"; $Config["msg"]["message"] = "Bericht"; $Config["msg"]["title"] = "Berichten:"; /* End of configurable variables */ $PostData = Array(); # All data is loaded to this array $errormsg = ""; #--- Start of main program/function ---# /* Comment/Uncomment the following line to load the guestbook as a page/include respectively */ # function Guestbook ($Args) { global $Config, $HTTP_POST_VARS; if (!empty ($Args["xml"])) { $Config["xml"] = $Args["xml"]; } if (!empty ($Args["color"])) { $Config["color"] = $Args["color"]; } if (!empty ($Args["notify"])) { $Config["notify"] = $Args["notify"]; } if (!empty ($Args["page"])) { $Config["page"] = $Args["page"]; } if (!empty ($Args["site"])) { $Config["site"] = $Args["site"]; } if (!empty ($Args["homepage"])) { $Config["homepage"] = $Args["homepage"]; } # if (!empty ($Args["skype"])) { $Config["skype"] = $Args["skype"]; } if (!empty ($Args["smileys"])) { $Config["smileys"] = $Args["smileys"]; } if (!empty ($Args["msg"])) { $Config["msg"] = $Args["msg"]; } # if (!empty ($Args["pager"])) { $Config["pager"] = $Args["pager"]; } # Remove last / from smileys $Config["smileys"] = preg_replace ("/\/$/", "", $Config["smileys"]); if ($HTTP_POST_VARS["sign"] == "yes") { # ValidEmailAddress(); PostMessage(); } DisplayHeader(); ParseXML(); DisplayData(); DisplayPager(); DisplayFooter(); /* Comment/Uncomment the following line to load the guestbook as a page/include respectively */ #} #--- End of main program/function ---# /* You can change the html code here to fit your needs */ function DisplayHeader() { global $errormsg, $Config, $PHP_SELF, $HTTP_POST_VARS, $HTTP_SERVER_VARS; ?> XML Guestbook"; ?>
"
" method="post" enctype="application/x-www-form-urlencoded" name="sign" id="sign"> ">
: " value="" id="name" size="25" maxlength="50"> ">
: " value="" id="email" size="25" maxlength="50">
: " value="" size="25" maxlength="60">
:
: Code  -->  " name="f_code" size="6" maxlength="5">


">
 

"; ?> count ($PostData) - 1) { $pager2 = count ($PostData) - 1; } echo "\n"; } # End of DisplayData() /* You can change the html code here to fit your needs */ function DisplayPager() { global $HTTP_GET_VARS, $HTTP_SERVER_VARS, $Config, $PostData; $pager = $HTTP_GET_VARS['pager']; if (!settype ($pager, "integer") or $pager < 1) { $pager = 1; } $page = $HTTP_SERVER_VARS['SCRIPT_NAME'] . "?" . $HTTP_SERVER_VARS['QUERY_STRING']; if (!preg_match ("/pager=(\d)/i", $page)) { if (!empty ($HTTP_SERVER_VARS['QUERY_STRING'])) { $page .= "&pager=1"; } else { $page .= "pager=1"; } } echo "
\n"; $page = preg_replace ("/pager=(\d+)/i", "pager=%PAGE%", $page, 1); $pages = intval ((count($PostData) - 1) / $Config['pager']); if ( ((count($PostData)-1) % $Config['pager']) > 0) { $pages++; } if ($pager > 1) { $tmpage = preg_replace ("/%PAGE%/", ($pager - 1), $page, 1); echo "<< volgende   \n"; } for ($pg = 1; $pg < $pager; $pg++) { $tmpage = preg_replace ("/%PAGE%/", $pg, $page, 1); echo "$pg |\n"; } if ($pages > 1) { echo "$pager\n"; } for ($pg = $pager + 1; $pg <= $pages; $pg++) { $tmpage = preg_replace ("/%PAGE%/", $pg, $page, 1); echo "| $pg\n"; } if ($pager < $pages) { $tmpage = preg_replace ("/%PAGE%/", ($pager + 1), $page, 1); echo "   vorige >>\n"; } echo "
"; } # End of DisplayPager() # DO NOT MODIFY BELOW THIS LINE (declaration of internal functions) # ---------------------------------------------------------- function PostMessage() { global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS, $Config, $errormsg, $PostData; # Check if required fields are filled if (empty($HTTP_POST_VARS["name"]) or empty($HTTP_POST_VARS["email"]) or empty($HTTP_POST_VARS["message"])) { $errormsg = "" . $Config["msg"]["error"] . ""; # Validate e-mail address # } elseif (!eregi( '^[a-z0-9]+([_\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\.[a-z]{2,}$', $HTTP_POST_VARS["email"])) { } elseif (!eregi( '^[_a-z0-9-]+([ \.-][a-z0-9]+)*@[a-z0-9]+([\.-][a-z0-9]{1,})*\.([a-z]{2,}){1}$', $HTTP_POST_VARS["email"])) { $errormsg = "" . $Config["msg"]["invalid"] . ""; ### ### ### # Added 06-04-2006 } $gb_code = htmlspecialchars($_POST['f_code']); if(md5(md5($gb_code."extra")) != $_SESSION['image_random_value']) { // fout weergeven echo "Aiaiai... De code is FOUT"; // code was goed, afhandelen (naam checken en in database zetten e.d. ### ### ### # Passed checking } else { $date = date ("D, d M Y H:i:s O"); if (!file_exists ($Config["xml"])) { return; } $data = @file ($Config["xml"]); $fd = @fopen ($Config["xml"], "w"); # $ua = get_browser(); if ($fd <= 0) { # Reset post data $HTTP_POST_VARS["name"] = ""; $HTTP_POST_VARS["email"] = ""; $HTTP_POST_VARS["homepage"] = ""; $HTTP_POST_VARS["country"] = ""; $HTTP_POST_VARS["icq"] = ""; $HTTP_POST_VARS["skype"] = ""; $HTTP_POST_VARS["message"] = ""; $errormsg = "" . $Config["msg"]["permerror"] . ""; return; } flock ($fd, LOCK_EX); $message = htmlspecialchars($HTTP_POST_VARS["message"]); $message = preg_replace("/(\S{80})/", "$0 ", $message); $message = preg_replace("/\r\n|\r|\n/", "\\n", $message); $message = preg_replace("/\t/", "\\t", $message); $message = preg_replace("/\s+/", " ", $message); fputs ($fd, "\n"); fputs ($fd, "\n"); fputs ($fd, "\n"); fputs ($fd, "\t" . htmlspecialchars($date) . "\n"); fputs ($fd, "\t" . htmlspecialchars($HTTP_SERVER_VARS["REMOTE_ADDR"]) . "\n"); fputs ($fd, "\t" . htmlspecialchars($HTTP_SERVER_VARS["HTTP_USER_AGENT"]) . "\n"); fputs ($fd, "\t" . htmlspecialchars($HTTP_POST_VARS["name"]) . "\n"); fputs ($fd, "\t" . htmlspecialchars($HTTP_POST_VARS["email"]) . "\n"); if (strtolower ($Config["homepage"]) == "yes") { fputs ($fd, "\t" . htmlspecialchars($HTTP_POST_VARS["homepage"]) . "\n"); } if (strtolower ($Config["country"]) == "yes") { fputs ($fd, "\t" . htmlspecialchars($HTTP_POST_VARS["country"]) . "\n"); } if (strtolower ($Config["icq"]) == "yes") { fputs ($fd, "\t" . htmlspecialchars($HTTP_POST_VARS["icq"]) . "\n"); } if (strtolower ($Config["skype"]) == "yes") { fputs ($fd, "\t" . htmlspecialchars($HTTP_POST_VARS["skype"]) . "\n"); } fputs ($fd, "\t" . $message . "\n"); fputs ($fd, "\n"); for ($i = 2; $i < count ($data)-1; $i++) { fputs ($fd, $data[$i]); } fputs ($fd, "\n"); flock ($fd, LOCK_UN); fclose($fd); $errormsg = "" . $Config["msg"]["noerror"] . ""; # Notify by e-mail ********************************************************** if (!empty($Config["notify"])) { $from = "Angantyr Gasten " . $Config["site"]; $recp = $Config["notify"]; $head = "Date: " . $date . "\nContent-type: text/plain"; $subj = "Een nieuw bericht in " . $Config["site"]; $mesg = "Angantyr Gasten\n-------------\n\n"; $mesg .= "Name: $HTTP_POST_VARS[name]\n"; $mesg .= "E-mail: $HTTP_POST_VARS[email]\n"; # Added 17-5-2006: $mesg .= "IP-Adres: $HTTP_SERVER_VARS[REMOTE_ADDR]\n"; $mesg .= "Homepage: $HTTP_POST_VARS[homepage]\n"; $mesg .= "ICQ: $HTTP_POST_VARS[icq]\n"; $mesg .= "Skype: $HTTP_POST_VARS[skype]\n"; $mesg .= "\nMessage:\n" . $message; mail ($recp, $subj, $mesg, $head); } # Reset post data $HTTP_POST_VARS["name"] = ""; $HTTP_POST_VARS["email"] = ""; $HTTP_POST_VARS["homepage"] = ""; $HTTP_POST_VARS["country"] = ""; $HTTP_POST_VARS["icq"] = ""; $HTTP_POST_VARS["skype"] = ""; # Added 17-5-2006: $HTTP_SERVER_VARS["REMOTE_ADDR"] = ""; $HTTP_POST_VARS["message"] = ""; $HTTP_GET_VARS["pager"] = 1; } } function ParseXML() { global $HTTP_GET_VARS, $Config, $PostData; $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (file_exists ($Config["xml"])) { $fp = @fopen($Config["xml"], "r"); $Tag = ""; $Line = -1; while ($data = fread($fp, 4096)) { if (!@xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } } xml_parser_free($xml_parser); } function startElement($parser, $name, $attrs) { global $Config, $Tag, $Line; $Tag = strtolower($name); if ($name == "ENTRY") { $Line++; } } function endElement($parser, $name) { global $Tag; if (!empty ($name)) { $Tag = ""; } } function characterData($parser, $data) { global $Config, $PostData, $Tag, $Line; # Convert smileys symbols to images $data = str_replace (":-)", "\":-)\"", $data); $data = str_replace (":)", "\":)\"", $data); $data = str_replace (":))", "\":))\"", $data); $data = str_replace (":?", "\":?\"", $data); $data = str_replace (":(", "\":(\"", $data); $data = str_replace (":-(", "\":-(\"", $data); $data = str_replace (":'(", "\":((\"", $data); $data = str_replace (":'((", "\":-((\"", $data); $data = str_replace (":-|", "\":-|\"", $data); $data = str_replace (":|", "\":|\"", $data); $data = str_replace (";-)", "\";-)\"", $data); $data = str_replace (";)", "\";)\"", $data); $data = str_replace (";D", "\";D\"", $data); $data = str_replace (";-D", "\";-D\"", $data); $data = str_replace (":-P", "\":-P\"", $data); $data = str_replace (":P", "\":P\"", $data); $data = str_replace (";P", "\";P\"", $data); $data = str_replace (":p", "\":P\"", $data); $data = str_replace (":-D", "\":-D\"", $data); $data = str_replace (":D", "\":D\"", $data); $data = str_replace (":-[", "\":-[\"", $data); $data = str_replace (":[", "\":[\"", $data); $data = str_replace (":-/", "\":-/\"", $data); $data = str_replace (":-//","\":-//\"", $data); $data = str_replace (":boos:","\":boos:\"", $data); $data = str_replace (":ruzie:","\":ruzie:\"", $data); $data = str_replace (":band:","\":band:\"", $data); $data = str_replace (":drink:","\":drink:\"", $data); $data = str_replace (":duivel:","\":duivel:\"", $data); $data = str_replace (":roddel:","\":roddel:\"", $data); $data = str_replace (":gitaar:","\":gitaar:\"", $data); $data = str_replace (":headbang:","\":headbang:\"", $data); $data = str_replace (":knuffel:","\":knuffel:\"", $data); $data = str_replace (":spring:","\":spring:\"", $data); $data = str_replace (":respect:","\":respect:\"", $data); $data = str_replace (":sla_pc:","\":sla_pc:\"", $data); $data = str_replace (":sprakeloos:","\":sprakeloos:\"", $data); $data = str_replace (":zon:","\":zon:\"", $data); $data = str_replace (":zwaai:","\":zwaai:\"", $data); $data = str_replace (":hulde:","\":hulde:\"", $data); $data = str_replace (":cool:","\":cool:\"", $data); $data = str_replace (":nananananaaa:","\":nananananaaa:\"", $data); $data = str_replace (":feest:","\":feest:\"", $data); $data = str_replace (":kiss:","\":kiss:\"", $data); # ORIGINAL SCRIPT - Convert smileys symbols to images # $data = str_replace (":-)", "\":-)\"", $data); # $data = str_replace (":)", "\":)\"", $data); # $data = str_replace (":-(", "\":-(\"", $data); # $data = str_replace (":(", "\":(\"", $data); # $data = str_replace (":-|", "\":-|\"", $data); # $data = str_replace (":|", "\":|\"", $data); # $data = str_replace (";-)", "\";-)\"", $data); # $data = str_replace (";)", "\";)\"", $data); # $data = str_replace (";D", "\";D\"", $data); # $data = str_replace (":-P", "\":-P\"", $data); # $data = str_replace (":P", "\":P\"", $data); # $data = str_replace (";P", "\";P\"", $data); # $data = str_replace (":-D", "\":-D\"", $data); # $data = str_replace (":D", "\":D\"", $data); # $data = str_replace (":-[", "\":-[\"", $data); # $data = str_replace (":-/", "\":-/\"", $data); # $data = str_replace (":-\\","\":-//\"", $data); # Convert \n & \t to normal chars (with a nark '`') in order to make hyperlinks conversion work $data = str_replace ("\\n", "\n`", $data); $data = str_replace ("\\t", "\t`", $data); # Convert text links to hyperlinks (thanks to sylvinus@lynucs.com & andy@ldg.net) $data = preg_replace ("/(?:^|\b)((((http|https|ftp):\/\/)|(www\.))([\w\.]+)([,:%#&\/?=\w+\.-]+))(?:\b|$)/is", "$1", $data); $data = preg_replace ("/$1 at $3", $data); # Convert \n & \t to their html values $data = str_replace ("\n`", "
", $data); $data = str_replace ("\t`", "    ", $data); # Lastly, convert escaped characters, since we are not in danger any more $data = str_replace ("\\", "", $data); if (!empty($data) and !empty($Tag)) { $PostData[$Line][$Tag] .= $data; } } # } // EINDE IP BLOKKERING ?>