#########
#ADMIN.PHP# 
#########

<?php  
include"config.php"; 
include"ubb.php"; 

if(!file_exists("config.php")){  
    echo "Reactie-Systeem V2.0 nog niet geinstalleerd, <a href=\"install.php\">installeer nu!</a>"; 
} else { 

if ($_SERVER["PHP_AUTH_USER"] != $adminuser || md5($_SERVER["PHP_AUTH_PW"]) != $adminpass)  
{  

header("WWW-Authenticate: Basic realm=\"Typ je wachtwoord en gebruikersnaam om in de admin te komen!\"");  
header("HTTP/1.0 401 Unauthorized");  

echo "Je bent niet correct ingelogd.";  
}  
else  
{  



if(empty($_GET['actie'])){ 

echo "<h2>Admin</h2><br><br>"; 

             $cat = $_GET['id']; 

             Echo'<a href="admin.php?actie=toevoegen">Toevoegen</a> | Categorie: '; 

$sql5 = "SELECT * FROM reactiesysteem_admin";  
$query5 = mysql_query($sql5);  
$bestaat5 = mysql_num_rows($query5); 

if($bestaat5 == 0){ 
echo "<select> 
<option selected>Geen</option> 
</select>"; 
} else { 
             Echo"<select name=\"cat\" id=\"cat\" onchange=\"window.location=('admin.php?actie=bewerken&id='+this.options[this.selectedIndex].value)\">\n"; 
             $sql6 = @mysql_query("SELECT id, naam FROM reactiesysteem_admin ORDER BY naam ASC"); 
              while($list6 = @mysql_fetch_assoc($sql6)) { 
                Echo "<option value=\"".$list6['id']."\""; 
                Echo ">".$list6['naam']."</option>\n"; 
        } 
echo "<option selected>Selecteer een reactie-item:</option>"; 
        Echo'</Selected>'; 
} 
} elseif ($_GET['actie'] == "bewerken"){ 
$sql = "SELECT * FROM reactiesysteem_admin WHERE id = '".$_GET['id']."' order by id";  
$query = mysql_query($sql);  
$list = mysql_fetch_object($query); 
$sql2 = "SELECT * FROM reactiesysteem WHERE rid = '".$_GET['id']."' order by id";  
$query2 = mysql_query($sql2);  
$list2 = mysql_fetch_object($query2); 
$bestaat2 = mysql_num_rows($query2); 

if($_SERVER['REQUEST_METHOD'] == "POST")  
{  

$naam = htmlentities(strip_tags($_POST['naam']));  
$beschrijving = htmlentities(strip_tags($_POST['beschrijving']));  

if(empty($naam)){ 
echo "Je bent vergeten de naam in te vullen, <a href=\"javascript.history.go(-1);\">ga terug</a>"; 
} elseif (empty($beschrijving)){ 
echo "Je bent vergeten de beschrijving in te vullen, <a href=\"javascript.history.go(-1);\">ga terug</a>"; 
} else { 

mysql_query("UPDATE reactiesysteem_admin SET naam = '".$naam."', beschrijving = '".$beschrijving."' WHERE id = '".$_GET['id']."'"); 
echo "Het reactie-item is succesvol bewerkt, <a href=\"admin.php\">naar admin</a>"; 
} 
} else { 

echo "<form method=post action=".$PHP_SELF."?actie=bewerken&id=".$_GET['id'].">"; 
echo "<i>Naam</i><br>";  
echo "<input type=text name=naam size=100 value=\"".$list->naam."\"><BR><BR>"; 
echo "<i>Beschrijving</i><br>";  
echo "<textarea type=text name=beschrijving cols=40 rows=8>".$list->beschrijving."</textarea><BR><BR><br>"; 
echo "<input type=submit name=submit value=\"Bewerk!\">";  
echo "</form>";  

echo "<h2>Reacties</h2><Br><br>"; 

if($bestaat2 == 0){ 
echo "<i>Geen Reacties</i>"; 
} else { 
echo "".$list2->naam." op ".$list2->datum." (".$list2->email.")<br>"; 
echo $bb->parse($list2->bericht); 
echo "<br><a href=\"admin.php?actie=reactie&id=".$list2->id."\">Bewerken</a> | <a href=\"admin.php?actie=dreactie&id=".$list2->id."\">Verwijderen</a><br><br><br>"; 
} 
} 
} elseif ($_GET['actie'] == "reactie"){ 
$sql3 = "SELECT * FROM reactiesysteem WHERE id = '".$_GET['id']."' order by id";  
$query3 = mysql_query($sql3);  
$list3 = mysql_fetch_object($query3); 

if($_SERVER['REQUEST_METHOD'] == "POST")  
{  

$naam = htmlentities(strip_tags($_POST['naam']));  
$email = htmlentities(strip_tags($_POST['email']));  
$bericht = htmlentities(strip_tags($_POST['bericht']));  

if(empty($naam)){ 
echo "Je bent vergeten de naam in te vullen, <a href=\"javascript.history.go(-1);\">ga terug</a>"; 
} elseif (empty($email)){ 
echo "Je bent vergeten het email-adres in te vullen, <a href=\"javascript.history.go(-1);\">ga terug</a>"; 
} elseif (empty($bericht)){ 
echo "Je bent vergeten het bericht in te vullen, <a href=\"javascript.history.go(-1);\">ga terug</a>"; 
} else { 

mysql_query("UPDATE reactiesysteem SET naam = '".$naam."', email = '".$email."', bericht = '".$bericht."' WHERE id = '".$_GET['id']."'"); 
echo "De reactie is succesvol bericht, <a href=\"admin.php\">naar admin</a>"; 
} 
} else { 

echo "<h2>Bewerken</h2><br><br>";  
echo "<form method=post action=".$PHP_SELF."?actie=reactie&id=".$_GET['id'].">"; 

echo "<i>Naam</i><br>";  
echo "<input type=text name=naam size=25 value=\"".$list3->naam."\"><BR><BR>";  

echo "<i>Email</i><br>";  
echo "<input type=text name=email size=25 value=\"".$list3->email."\"><BR><BR>";  

echo "<i>Bericht</i><br>";  
echo"<input type=\"button\" value=\"B\" style=\"font-weight:bold; width: 30px\" onClick=\"javascript:setsmilie('[b] [/b]')\">&nbsp;"; 
echo"<input type=\"button\" value=\"I\" style=\"font-weight:italic; width: 30px\" onClick=\"javascript:setsmilie('[i] [/i]')\">&nbsp;"; 
echo"<input type=\"button\" value=\"U\" style=\"font-weight:underline; width: 30px\" onClick=\"javascript:setsmilie('[u] [/u]')\">&nbsp;"; 
echo"<input type=\"button\" value=\"S\" style=\"font-weight:italic; width: 30px\" onClick=\"javascript:setsmilie('[s] [/s]')\">&nbsp;"; 
echo"<input type=\"button\" value=\"Code\" style=\"width: 35px\" onClick=\"javascript:setsmilie('[ code] [/code]')\">&nbsp;"; 
echo"<input type=\"button\" value=\"Quote\" style=\"width: 40px\" onClick=\"javascript:setsmilie('[ quote] [/quote]')\">&nbsp;"; 
echo"<input type=\"button\" value=\"Link\" style=\"font-weight:italic; width: 30px\" onClick=\"javascript:setsmilie('[url=http://www.jouwurl.nl]Jouw Tekst[/url]')\">&nbsp;"; 
echo "<br><textarea name=\"bericht\" cols=\"80\" rows=\"6\">".$list3->bericht."</textarea><BR>"; 
  echo "<BR><A class=nodec href=# onClick=document.bericht.bericht.value+=':)';document.bericht.bericht.focus();return false;><img src=smileys/smile.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':(';document.bericht.bericht.focus();return false;><img src=smileys/sad.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':p';document.bericht.bericht.focus();return false;><img src=smileys/tongue.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='(A)';document.bericht.bericht.focus();return false;><img src=smileys/angel.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':(';document.bericht.bericht.focus();return false;><img src=smileys/sad.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':D';document.bericht.bericht.focus();return false;><img src=smileys/biggrin.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':s';document.bericht.bericht.focus();return false;><img src=smileys/blink.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':$';document.bericht.bericht.focus();return false;><img src=smileys/blush.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='(H)';document.bericht.bericht.focus();return false;><img src=smileys/cool.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':\'(';document.bericht.bericht.focus();return false;><img src=smileys/cry.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='--';document.bericht.bericht.focus();return false;><img src=smileys/dry.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='^^';document.bericht.bericht.focus();return false;><img src=smileys/happy.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':|';document.bericht.bericht.focus();return false;><img src=smileys/huh.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':@';document.bericht.bericht.focus();return false;><img src=smileys/mad.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':o';document.bericht.bericht.focus();return false;><img src=smileys/ohmy.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='8S';document.bericht.bericht.focus();return false;><img src=smileys/woot.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='8)';document.bericht.bericht.focus();return false;><img src=smileys/wacko.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=';)';document.bericht.bericht.focus();return false;><img src=smileys/wink.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=';D';document.bericht.bericht.focus();return false;><img src=smileys/laugh.gif border=0></img></a>";  
echo "<br><br>"; 

echo "<input type=submit name=submit value=\"Bewerk\">";  
echo "</form>"; 
}  

} elseif ($_GET['actie'] == "dreactie"){ 
$sql4 = "SELECT * FROM reactiesysteem WHERE id = '".$_GET['id']."' order by id";  
$query4 = mysql_query($sql4);  
$list4 = mysql_fetch_object($query4); 
echo "Weet je zeker dat je dit bericht wil verwijderen, je kan het ook <a href=\"admin.php?actie=reactie&id=".$_GET['id']."\">bewerken</a><br><br>"; 
echo "".$list4->naam." op ".$list4->datum." (".$list4->email.")<br>"; 
echo $bb->parse($list4->bericht); 
echo "<br><br><a href=\"admin.php?actie=dreactie2&id=".$_GET['id']."\">Ja, ik weet het zeker!</a> | <a href=\"admin.php\">Nee, breng mij naar de admin!</a>"; 


} elseif ($_GET['actie'] == "dreactie2"){ 
mysql_query("DELETE FROM reactiesysteem WHERE id = '".$_GET['id']."'"); 
echo "Het bericht is succesvol verwijderd, <a href=\"admin.php\">naar admin</a>"; 

} elseif ($_GET['actie'] == "toevoegen"){ 
if($_SERVER['REQUEST_METHOD'] == "POST")  
{  
$naam = htmlentities(strip_tags($_POST['naam']));  
$beschrijving = htmlentities(strip_tags($_POST['beschrijving']));  

if(empty($naam)){ 
echo "Je bent vergeten de naam in te vullen, <a href=\"javascript.history.go(-1);\">ga terug</a>"; 
} elseif (empty($beschrijving)){ 
echo "Je bent vergeten de beschrijving in te vullen, <a href=\"javascript.history.go(-1);\">ga terug</a>"; 
} else { 

mysql_query("INSERT INTO reactiesysteem_admin (id, naam, beschrijving) VALUES ('','".$naam."','".$beschrijving."')"); 

$id = mysql_insert_id();  

echo "Je reactie-item is succesvol toegevoegt, <a href=\"admin.php\">naar admin</a>"; 
echo "De link om naar de te linken is: http://www.jouwsite.com/reactiesysteem.php?id=".$id.""; 
} 
} else { 
echo "<form method=post action=".$PHP_SELF."?actie=toevoegen&id=".$_GET['id'].">"; 
echo "<i>Naam</i><br>";  
echo "<input type=text name=naam size=25><BR><BR>"; 
echo "<i>Beschrijving</i><br>";  
echo "<textarea type=text name=beschrijving cols=40 rows=8></textarea><br><br>"; 
echo "<input type=submit name=submit value=\"Voeg toe!\">";  
echo "</form>";  

} 
} 
} 
} 
?>  

=========================================

##########
#CONFIG.PHP# 
##########

Leeg laten en chmoden naar 777

=========================================

#################
#REACTIESYSTEEM.PHP# 
#################


<?php  
ob_start(); 
include"config.php"; 
include"ubb.php"; 

if(!file_exists("config.php")){  
    echo "Reactie-Systeem V2.0 nog niet geinstalleerd, <a href=\"install.php\">installeer nu!</a>"; 
} else { 

//Data deleten die niet meer nodig is 
mysql_query("DELETE FROM reactiesysteem_flood WHERE Datum < '".(date("U")-$floodtijd)."'"); 
$rid = htmlentities(strip_tags($_GET['id']));  

//Reactie-Item ophalen 
$sql3 = "SELECT * FROM reactiesysteem_admin WHERE id = '".$rid."' order by id";  
$query3 = mysql_query($sql3);  
$bestaat = mysql_num_rows($query3); 


if(empty($rid) OR !is_numeric){  
header ("location: ".$PHP_SELF."?id=1"); 
} elseif ($bestaat == 0){ 
echo 'Reactie onderwerp bestaat niet!';  
} else { 


//controleren of er is verzonden 
if($_SERVER['REQUEST_METHOD'] == "POST")  
{  

//Anti Flood 

//Kijken of hij niet over zijn limiet is gegaan. 
$aantal = mysql_num_rows(mysql_query("SELECT * FROM reactiesysteem_flood WHERE IPadres = '".$_SERVER['REMOTE_ADDR']."'")); 
if($aantal >= $floodkeer) { 

if($floodmail == "wel"){ 
mail($mail,"Flooder op de site!","Gegevens:\n\n".$_SERVER['REMOTE_ADDR']."\n".gethostbyaddr($_SERVER['REMOTE_ADDR'])."\nAdres: ".$REQUEST_URI."\nUser agent: ".$HTTP_USER_AGENT."\nReferrer: ".$HTTP_REFERER."\nAantal keer vernieuwd: ".$aantal."","From: Flood melder <$mail>"); 
} 
echo $floodbericht; 
} else { 
//Data inserten omdat er een nieuw bericht is geplaatst 
mysql_query("INSERT INTO reactiesysteem_flood VALUES('".$_SERVER['REMOTE_ADDR']."','".date("U")."')"); 

//Anti-Hack/Error 
$naam = htmlentities(strip_tags($_POST['naam']));  
$email = htmlentities(strip_tags($_POST['email']));  
$bericht = htmlentities(strip_tags($_POST['bericht']));  

//lege velden check 
if(empty($naam)){  
echo $vergetennaam;  
} elseif (empty($email)){  
echo $vergetenemail;  
} elseif(empty($bericht)){  
echo $vergetenbericht;  
} else {  

//inserteren 
$sql = "INSERT INTO reactiesysteem (id, naam, email, bericht, ip, rid, datum) VALUES ('', '".$naam."', '".$email."', '".$bericht."', '".$_SERVER['REMOTE_ADDR']."','".$rid."', NOW())";  
$query = mysql_query($sql);  

if ($query)  
{  
//verzonden 
echo $bedankt;  
}  
else  
{  
//niet verzonden 
echo $error;  
}  

}  
//als er niet is verzonden, reacties laten zien ] 
} } else {  

//ophalen 
$sql2 = "SELECT * FROM reactiesysteem WHERE rid = '".$rid."' order by id";  
$query2 = mysql_query($sql2);  
$list2 = mysql_fetch_object($query2); 

$sql3 = "SELECT * FROM reactiesysteem_admin WHERE id = '".$rid."' order by id";  
$query3 = mysql_query($sql3);  
$list3 = mysql_fetch_object($query3); 

echo "".$list3->naam."<br><i>".$list3->beschrijving."</i>"; 
echo "<h2>Reacties</h2><BR><BR>";  

if (mysql_num_rows($query2) != 0) 
{  
while ($list2 = mysql_fetch_object($query2)) { 
echo "<b>Reactie door <a href=\"mailto:".$list2->email."\">".$list2->naam."</a> op ".$list2->datum."<br></b>";  
echo $bb->parse($list2->bericht);  
echo "<br><br>";  
} 
} 
else  
{  
//geen reacties 
echo "Er zijn nog geen reacties.<br><br>";  
}  

//reageren formulier 
echo "<hr><br><h2>Reageren</h2><br><br>";  
echo "<form method=post action=".$PHP_SELF."?id=".$rid." name=bericht>";  

echo "<i>Naam</i><br>";  
echo "<input type=text name=naam size=25 maxlength=20><BR><BR>";  

echo "<i>Email</i><br>";  
echo "<input type=text name=email size=25 maxlength=100><BR><BR>";  

echo "<i>Bericht</i><br>";  
echo "<textarea name=\"bericht\" cols=\"80\" rows=\"6\"></textarea><BR>"; 
  echo "<BR><A class=nodec href=# onClick=document.bericht.bericht.value+=':)';document.bericht.bericht.focus();return false;><img src=smileys/smile.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':(';document.bericht.bericht.focus();return false;><img src=smileys/sad.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':p';document.bericht.bericht.focus();return false;><img src=smileys/tongue.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='(A)';document.bericht.bericht.focus();return false;><img src=smileys/angel.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':(';document.bericht.bericht.focus();return false;><img src=smileys/sad.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':D';document.bericht.bericht.focus();return false;><img src=smileys/biggrin.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':s';document.bericht.bericht.focus();return false;><img src=smileys/blink.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':$';document.bericht.bericht.focus();return false;><img src=smileys/blush.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='(H)';document.bericht.bericht.focus();return false;><img src=smileys/cool.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':\'(';document.bericht.bericht.focus();return false;><img src=smileys/cry.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='--';document.bericht.bericht.focus();return false;><img src=smileys/dry.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='^^';document.bericht.bericht.focus();return false;><img src=smileys/happy.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':|';document.bericht.bericht.focus();return false;><img src=smileys/huh.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':@';document.bericht.bericht.focus();return false;><img src=smileys/mad.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=':o';document.bericht.bericht.focus();return false;><img src=smileys/ohmy.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='8S';document.bericht.bericht.focus();return false;><img src=smileys/woot.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+='8)';document.bericht.bericht.focus();return false;><img src=smileys/wacko.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=';)';document.bericht.bericht.focus();return false;><img src=smileys/wink.gif border=0></img></a>"; 
  echo "<A class=nodec href=# onClick=document.bericht.bericht.value+=';D';document.bericht.bericht.focus();return false;><img src=smileys/laugh.gif border=0></img></a>";  
echo "<br><br>"; 

echo "<input type=submit name=submit value=\"Reageer\">";  
echo "</form>";  


//Copyright, ik kan wel zeggen dat hij moet blijven staan, maar niemand die het doet.. 
echo "<u>Reactie systeem door <a href=\"mailto:woeterman@gmail.com\">Woeterman</a></u>";  

//afsluiten 
} } }  
?>
==========================================

######## 
#UBB.PHP# 
########


<?php 

//Ubb + Smileys 

class bbcode { 

var $username = "Ik"; 

var $tag_nosmile = array(); 
var $tag_list = array(); 

var $smiliesDir = "smileys/"; 
var $smilies = array( 
':)'    =>     "smile.gif", 
':('    =>     "sad.gif", 
':D'    =>     "biggrin.gif", 
':d'    =>     "biggrin.gif",                 
':p'    =>     "tongue.gif", 
':P'    =>     "tongue.gif", 
':-)'    =>     "unsure.gif", 
'(A)'    =>     "angel.gif", 
'(a)'    =>     "angel.gif", 
':s'    =>     "blink.gif", 
':S'    =>     "blink.gif", 
':$'    =>     "blush.gif", 
'(h)'    =>     "cool.gif", 
'(H)'    =>     "cool.gif", 
':\'('    =>     "cry.gif", 
'--'    =>     "dry.gif", 
'-_-'    =>     "dry.gif", 
'^^'    =>     "happy.gif", 
'^_^'    =>     "happy.gif", 
':|'    =>     "huh.gif", 
';d'    =>     "laugh.gif", 
';D'    =>     "laugh.gif", 
':@'    =>     "mad.gif", 
':o'    =>     "ohmy.gif", 
':O'    =>     "ohmy.gif", 
':0'    =>     "ohmy.gif", 
'8S'    =>     "woot.gif", 
'8s'    =>     "woot.gif", 
'8)'    =>     "wacko.gif", 
';)'    =>     "wink.gif", 



); 



function linksmaken($input) { 
$output = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href='\\0' target='_blank'>\\0</a>",$output);  
return $output;  
}      

function text_chop($input) {  
if(strlen($input) > 40) {  
$output = substr($output, 0, 40)."..";  
} 

return $output;  
}  



    function parse($input)    {         
        // alle [code],[php] en [no] block's vinden 
str_replace('www.', 'http://www.', $output);  
        preg_match_all("#\[code\](.*?)\[/code\]#is", $input, $this->tag_nosmile['code']); 
        preg_match_all("#\[php\](.*?)\[/php\]#is", $input, $this->tag_nosmile['php']); 
        preg_match_all("#\[no\](.*?)\[/no\]#is", $input, $this->tag_nosmile['no']); 
             
        $output = htmlentities($input); 
        $output = stripslashes($input); 

         
        // smilies 
        foreach($this->smilies AS $find => $replace) 
            $output = str_replace(htmlentities($find), "<img src='smileys/".$replace."' alt='0' />", $output); 
             
        $output = preg_replace("#\[img\](http(s)?://)([a-zA-Z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/img\]#", "<img src='\\1\\3' />", $output);  

        // letter kleur 
        $output = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "<font color='\\1'>\\2</font>", $output);  
                 
         

         
        // quote 
        $output = preg_replace('#\[quote\](.*?)\[\/quote\]#si', "<blockquote>Quote:<hr>".$this->quotequote('\\1')."<hr></blockquote>", $output); 

        // de url tag 
        $output = eregi_replace("\[url\][[:space:]]*(http://)?([^\\[]*)[[:space:]]*\[/url\]","<a href=\"http://\\2\" target=\"blank\">http://\\2</a>",$output);  
        $output = eregi_replace("\\[url=(http://)?([^\\[]*)\\][[:space:]]*([^\\[]*)[[:space:]]*\\[/url\\]","<a href=\"http://\\2\" target=\"_blank\">\\3</a>",$output);  

         
        // www.adres.nl 
        $output = preg_replace("#(^|[ \n\r\t])www.([a-z\-0-9]+).([a-z]{2,4})($|[ \n\r\t])#i", "\\1<a href='http://www.\\2.\\3'>www.\\2.\\3</a>\\4", $output);  
        // adressen met http,ftp,https 
        $output = preg_replace("#(^|[ \n\r\t])(((ftp://)|(http://)|(https://))([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+))#i", "\\1<a href='\\2' target='_blank'>\\2</a>", $output);  
        // maak automatisch van jan@jan.nl een email-link 
        $output = preg_replace("#(^|[ \n\r\t])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href='mailto:\\2@\\3'>\\2@\\3</a>", $output);  

         
        $output = nl2br($output);     
     
        return $this->parse_nosmile($output); 
    } 

     
    //+---------------------------- 
    //    no-smile zone 
    //+---------------------------- 

    function parse_nosmile($input)    { 
        // alle [code],[php] en [no] block's vinden 
        preg_match_all("#\[code\](.*?)\[/code\]#is", $input, $find_array['code']); 
        preg_match_all("#\[php\](.*?)\[/php\]#is", $input, $find_array['php']);     
        preg_match_all("#\[no\](.*?)\[/no\]#is", $input, $find_array['no']); 
         
        $output = $input; 
         
        // [code] 
        for($i=0; $i<count($find_array['code']); $i++)    { 
            $output = str_replace($find_array['code'][0][$i], "<div class=\"code\"><code>".$this->highlight_php($this->tag_nosmile['code'][1][$i]) ."</code></div>", $output); 
        } 
         
        // [php] 
        for($i=0; $i<count($find_array['php']); $i++)    { 
            $output = str_replace($find_array['php'][0][$i], "<div class=\"php\">". $this->highlight_php($this->tag_nosmile['php'][1][$i]) ."</div>", $output); 
        } 
         
        // [no] 
        for($i=0; $i<count($find_array['no']); $i++)    { 
            @$output = str_replace($find_array['no'][0][$i], htmlentities($this->tag_nosmile['no'][1][$i]), $output); 
        } 
         
        return $output; 
    } 

function makeClickable($str,$maxLen = false,$style = 0){  
if(preg_match_all("#(^|[\n ])([[:alpha:]]+://([^<>[:space:]]+[[:alnum:]/]))#",$output,$found,PREG_SET_ORDER)){  
$foundLen = count($found);  
for($i=0;$i<$foundLen;$i++){  
$visUrl = $found[$i][3];  
if($maxLen && strlen($visUrl)>$maxLen){  
if($style){  
if($maxLen) $maxLen = 30;  
$parts = explode("/",$visUrl);  
if(count($parts)>2){  
$visUrl = array_shift($parts)."/.../".array_pop($parts);  
}  
if($pos = strrpos($visUrl,"?")){  
$visUrl = substr($visUrl,0,$pos + (0.2*$maxLen))."...".substr($visUrl,-(0.12*$maxLen));  
}  
}else{  
$visUrl = substr($visUrl,0,floor(0.677 * $maxLen))."...".substr($visUrl,- floor(0.333*$maxLen));  
}  
}  
$output = preg_replace("#(^|[\n ])".preg_quote($found[$i][2])."#",$found[$i][1]."<a href=\"".$found[$i][2]."\" title=\"visit: ".htmlentities($found[$i][2])."\" target=\"_blank\">".$visUrl."</a>",$output);  
}  
}  
return $output;  
}  
             
    //+---------------------------- 
    //    de php highlighten 
    //+---------------------------- 
          
    function highlight_php($code) 
    { 
    global $map; 
    $code = str_replace("<br>", "", $code); 
    $code = str_replace("<br />", "", $code); 
    $code = str_replace("&gt;", ">", $code); 
    $code = str_replace("&lt;", "<", $code); 
    $code = str_replace("&amp;", "&", $code); 
    $code = str_replace("&quot;", "\"", $code);          
    $code = str_replace('$', '\$', $code); 
    $code = str_replace('\n', '\\\\n', $code); 
    $code = str_replace('\r', '\\\\r', $code); 
    $code = str_replace('\t', '\\\\t', $code); 
    $code = trim($code); 
    $code = stripslashes($code);   
     
        if (!strpos($code,"<?") and substr($code,0,2)!="<?") { 
            $code="<?php\n".trim($code)."\n?>"; 
            $addedtags=1; 
        }  
    ob_start(); 
    $oldlevel=error_reporting(0); 
    highlight_string($code); 
    error_reporting($oldlevel); 
    $regel = ob_get_contents(); 
    ob_end_clean(); 

        if ($addedtags) { 
          $openingpos = strpos($buffer,'<?php'); 
          $closingpos = strrpos($buffer, '?'); 
          $buffer=substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5); 
        }  
    $regel = explode("<br />", $regel); 
    $code = '<table cellspacing="0" style="font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;border: 1px solid #C0C0C0; border-bottom: none;" cellpadding="3" width="500px" bgcolor="#E8E8E8" nowrap=\"nowrap\"> 

    <tr> 
    <td align="left" colspan="2" valign="middle"><strong> Code</strong></td> 
       </tr></table>'; 
    $code .= "<div style=\"overflow:auto; overflow-x: scroll; width:500px\" align=\"left\">"; 

    $code .= "<table border=\"0\" style=\"border: 1 solid #000000\" cellspacing=\"0\" width=\"500\">"; 
    $code .= "<tr><td width=\"20\" style=\"border-left: 1px solid #C0C0C0; border-top: 1px solid #C0C0C0; border-bottom: 1px solid #C0C0C0; background-color:#FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;\" align=\"right\"><code>"; 
    for($i = 0; $i < (count($regel)); $i++){ 
        $t = $i; 
        $t++; 
        $code .= "<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;'>".$t."<br />"; 
    } 
    $code .= "</code></td><td width=\"100%\" style=\"border: 1px solid #CCCCCC; background-color:#FFFFFF;\" nowrap=\"nowrap\">"; 
    for($i = 0; $i < (count($regel)); $i++){ 
        $t = $i; 
        $t++; 
        $code .= $regel[$i]."<br />"; 
    } 
    $code .= "</tr></td>"; 
    $code .= "</table></div>"; 
    $code = str_replace("<font", "<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;'", $code);  
    $code = str_replace("</font>", "</span>", $code); 
     
    $code = str_replace('color="#000000"','class="zwart"',$code); 
    $code = str_replace('color="#0000BB"','class="blajouw"',$code); 
    $code = str_replace('color="#007700"','class="groen"',$code); 
    $code = str_replace('color="#DD0000"','class="rood"',$code); 
    $code = str_replace('color="#FF8000"','class="oranje"',$code);  
    $code = str_replace("<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;' class=\"blajouw\">&lt;?php", "<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;' class=\"rood\"><strong>&lt;?php</strong>", $code); 
    $code = str_replace("<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;' class=\"blajouw\">?&gt;", "<span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;' class=\"rood\"><strong>?&gt;</strong>", $code); 

    return $code; 
    } 
        // Nesting Quote 
    function quotequote($article) { 
    $article = str_replace("[..]","",$article); 
     
    $article = preg_replace("_\[quote\](.*?)\[\/quote\]_si", "[..]", $article); 
    $article = preg_replace("_\[code](.*?)\[\/code\]_si", "[..]", $article); 
    $article = preg_replace("_\[img\](.*?)\[\/img\]_si", "[..]", $article); 
    $article = preg_replace("_\[php](.*?)\[\/php\]_si", "[..]", $article); 

    return $article; 

    }  
     

         
} 

$bb = new bbcode; 


?> 

==========================================

######## 
#README# 
######## 

README: 

Om een item aan te maken ga je naar admin.php 
Voordat alles werkt, eerst install.php 

CONFIG.PHP CHMODEN NAAR 777 

Hoe chmod ik? 

1) Download filezilla van http://surfnet.dl.sourceforge.net/sourceforge/filezilla/FileZilla_2_2_17.zip 

2) Installeer het (constant next) 

3) connect naar je ftp 

4) rechtermuisknop op config.php 

5) kies chmod 

6) voer 777 in, en klik op OK 

=========================================

##### 
#SQL# 
##### 
create table reactiesysteem ( 
   id int(11) not null auto_increment, 
   naam varchar(150) not null, 
   email varchar(150), 
   bericht varchar(250) not null, 
   datum varchar(10) not null, 
   rid int(11) not null default '0', 
   ip varchar(20) not null, 
   primary key (id) 
) type=MyISAM; 

CREATE TABLE reactiesysteem_flood ( 
  IPadres varchar(255) NOT NULL default '', 
  Datum varchar(255) NOT NULL default '' 
) TYPE=MyISAM; 

create table reactiesysteem_admin ( 
   id int(11) not null auto_increment, 
   naam text NOT NULL default '', 
   beschrijving text NOT NULL default '', 
   primary key (id) 
) type=MyISAM; 
==========================================
##########
#INSTALL.PHP#
##########


<?php
error_reporting(E_ALL);
if(!file_exists("config.php")){ 
	echo "Je moet wel een leeg bestand genaamd config.php uploaden, en die chmoden tot 777 voordat je kan installeren!";
} else {

//controleren of er is verzonden 
if($_SERVER['REQUEST_METHOD'] == "POST") 
{ 

if($_POST['adminpass'] != $_POST['adminpass2']){
echo "De wachtwoorden komen niet overeen, <a href=\"javascript:history.go(-1);\">ga terug.</a>";
} else {
$errorsql2 = addslashes($_POST['errorsql']); 
$errordb2 = addslashes($_POST['errordb']); 

$bedankt2 = addslashes($_POST['bedankt']); 
$error2 = addslashes($_POST['error']); 
$vergetennaam2 = addslashes($_POST['vergetennaam']); 
$vergetenemail2 = addslashes($_POST['vergetenemail']); 
$vergetenbericht2 = addslashes($_POST['vergetenbericht']); 

$host2 = addslashes($_POST['host']); 
$user2 = addslashes($_POST['user']); 
$pass2 = addslashes($_POST['pass']); 
$dbnaam2 = addslashes($_POST['dbnaam']); 

$adminpass2 = md5(addslashes($_POST['adminpass'])); 
$adminuser2 = addslashes($_POST['adminuser']); 

$floodtijd2 = addslashes($_POST['floodtijd']); 
$floodkeer2 = addslashes($_POST['floodkeer']); 
$floodmail2 = addslashes($_POST['floodmail']); 
$floodbericht2 = addslashes($_POST['floodbericht']); 
$mail2 = addslashes($_POST['mail']); 

$file = fopen("config.php","w+"); 


fputs ($file, "<?php\n\n");

fputs ($file, "\$errorsql = \"$errorsql2\";\n"); 
fputs ($file, "\$errordb = \"$errordb2\";\n\n"); 

fputs ($file, "\$bedankt = \"$bedankt2\";\n"); 
fputs ($file, "\$error = \"$error2\";\n"); 
fputs ($file, "\$vergetennaam = \"$vergetennaam2\";\n"); 
fputs ($file, "\$vergetenemail = \"$vergetenemail2\";\n"); 
fputs ($file, "\$vergetenbericht = \"$vergetenbericht2\";\n\n"); 

fputs ($file, "\$adminpass = \"$adminpass2\";\n"); 
fputs ($file, "\$adminuser = \"$adminuser2\";\n\n");

fputs ($file, "\$host = \"$host2\";\n"); 
fputs ($file, "\$user = \"$user2\";\n"); 
fputs ($file, "\$pass = \"$pass2\";\n"); 
fputs ($file, "\$dbnaam = \"$dbnaam2\";\n\n"); 

fputs ($file, "\$floodkeer = \"$floodkeer2\";\n"); 
fputs ($file, "\$floodtijd = \"$floodtijd2\";\n");  
fputs ($file, "\$floodmail = \"$floodmail2\";\n");  
fputs ($file, "\$mail = \"$mail2\";\n\n");  
fputs ($file, "\$floodbericht = \"$floodbericht2\";\n\n");  
fputs ($file, "mysql_connect(\$host, \$user, \$pass) or die(\$errorsql);\n"); 
fputs ($file, "mysql_select_db(\$dbnaam) or die(\$errordb);\n\n"); 



fputs ($file, "?>");

include"config.php";

mysql_query("create table reactiesysteem ( 
   id int(11) not null auto_increment, 
   naam varchar(150) not null, 
   email varchar(150), 
   bericht varchar(250) not null, 
   datum varchar(10) not null, 
   rid int(11) not null default '0',
   ip varchar(20) not null, 
   primary key (id)
) TYPE=MyISAM") or die("<p><b>Fout:</b></p><p>".mysql_error()."</p>");  

mysql_query("CREATE TABLE reactiesysteem_flood (
  IPadres varchar(255) NOT NULL default '',
  Datum varchar(255) NOT NULL default ''
) TYPE=MyISAM") or die("<p><b>Fout:</b></p><p>".mysql_error()."</p>");  

mysql_query("create table reactiesysteem_admin ( 
   id int(11) not null auto_increment, 
   naam text NOT NULL default '',
   beschrijving text NOT NULL default '',
   primary key (id)
) TYPE=MyISAM") or die("<p><b>Fout:</b></p><p>".mysql_error()."</p>");  




echo "Gelukt, verwijder nu dit bestand!"; 

} } else {
echo "<B>Install</B><br><br>"; 
echo "<form method=post action=".$PHP_SELF.">"; 

echo "<b>Errors MySQL</b><Br><br>";
echo "<i>Error als het mis gaat bij MySQL</i><br>"; 
echo "<input type=text name=errorsql size=50 value=\"MySQL gegevens zijn niet correct!\"><BR>"; 
echo "<i>Error als het mis gaat bij MySQL Database</i><br>"; 
echo "<input type=text name=errordb size=50 value=\"Database gegevens zijn niet correct!\"><BR><BR>"; 

echo "<b>Berichten bij posten bericht</b><br><br>";
echo "<i>Bericht als het bericht is gepost</i><br>"; 
echo "<input type=text name=bedankt size=50 value=\"Bedankt voor je bericht.\"><BR>"; 
echo "<i>Bericht als het bericht niet is gepost</i><br>"; 
echo "<input type=text name=error size=50 value=\"Er is iets fout gegaan, je bericht is niet verzonden.\"><BR>"; 
echo "<i>Bericht als de naam is vergeten</i><br>"; 
echo "<input type=text name=vergetennaam size=50 value = \"Je bent vergeten je naam in te vullen.\"><BR>"; 
echo "<i>Bericht als het email-adres is vergeten</i><br>"; 
echo "<input type=text name=vergetenemail size=50 value = \"Je bent vergeten je email-adres in te vullen.\"><BR>"; 
echo "<i>Bericht als het bericht is vergeten</i><br>"; 
echo "<input type=text name=vergetenbericht size=50 value = \"Je bent vergeten je bericht in te vullen.\"><BR><BR>"; 

echo "<b>MySQL gegevens</b><br><br>";
echo "<i>Host</i><br>"; 
echo "<input type=text name=host size=50 value=localhost><BR>"; 
echo "<i>Username</i><br>"; 
echo "<input type=text name=user size=50 value=username><BR>"; 
echo "<i>Wachtwoord</i><br>"; 
echo "<input type=password name=pass size=50 value=password><BR>"; 
echo "<i>Database</i><br>"; 
echo "<input type=text name=dbnaam size=50 value=database><BR><BR>"; 

echo "<b>Admin Gegevens</b><br><br>";
echo "<i>Gebruikersnaam</i><br>"; 
echo "<input type=text name=adminuser size=50 value=gebruiker><BR>"; 
echo "<i>Wachtwoord</i><br>"; 
echo "<input type=password name=adminpass size=50 value=password><BR>"; 
echo "<i>Wachtwoord Controle</i><br>"; 
echo "<input type=password name=adminpass2 size=50 value=password><BR><BR>";

echo "<b>Flood</b><br><br>";
echo "Een gebruiker mag binnen <input type=text name=floodtijd size=3 value=60> seconden maar <input type=text name=floodkeer size=2 value=3> keer een bericht posten, als hij het limiet overschrijd krijgt hij <input type=text name=floodbericht size=25 value=\"dit bericht\"> en wil ik <input type=text name=floodmail size=5 value=\"wel/niet\"> een mailtje ontvangen, zo ja, is <input type=text name=mail size=25 value=\"ik@ik.nl\"> mijn email adres!<br><Br>"; 

echo "<input type=submit name=submit value=\"Install!\">"; 
echo "</form>"; 

echo "<b>Je kan html gebruiken!</b>";
} }
?>
