<?php
function klik(){
echo "<script language=\"JavaScript\">
function addtext(veld,text) {
text=' '+text+ ' ';
if (document.form.elements[veld].createTextRange) {
document.form.elements[veld].focus();
document.selection.createRange().duplicate().text = text;
} else {
document.form.elements[veld].focus();
document.form.elements[veld].value +=text;
}
}
</script>";
}
function buttons(){
echo '<input type="button" value="B" style="font-weight:bolt; width: 30px" onClick="javascript:addtext("bericht","[b]text[/b]")">
<input type="button" value="I" style="font-weight:bolt; width: 30px" onClick="javascript:addtext("bericht","[i]text[/i]")">
<input type="button" value="U" style="font-weight:bolt; width: 30px" onClick="javascript:addtext("bericht","[u]text[/u]")">';
}
function smileys(){
echo '
<a href="javascript:addtext("bericht",":B")"><img src="http://localhost/gastenboek/smileys/biggrin.gif" alt="biggrin" border="0"></a>
<a href="javascript:addtext("bericht",";B")"><img src="http://localhost/gastenboek/smileys/blink.gif" alt="blink" border="0"></a>
<a href="javascript:addtext("bericht",":D")"><img src="http://localhost/gastenboek/smileys/cry.gif" alt="cry" border="0"></a>
<a href="javascript:addtext("bericht",";D")"><img src="http://localhost/gastenboek/smileys/happy.gif" alt="happy" border="0"></a>
<a href="javascript:addtext("bericht",":F")"><img src="http://localhost/gastenboek/smileys/huh.gif" alt="huh" border="0"></a>
<a href="javascript:addtext("bericht",";F")"><img src="http://localhost/gastenboek/smileys/mad.gif" alt="mad" border="0"></a>
<a href="javascript:addtext("bericht",":P")"><img src="http://localhost/gastenboek/smileys/mask.gif" alt="mask" border="0"></a>
<a href="javascript:addtext("bericht",";P")"><img src="http://localhost/gastenboek/smileys/ohmy.gif" alt="ohmy" border="0"></a>
<a href="javascript:addtext("bericht",":S")"><img src="http://localhost/gastenboek/smileys/rolleyes.gif" alt="rolleyes" border="0"></a>
<a href="javascript:addtext("bericht",";S")"><img src="http://localhost/gastenboek/smileys/sad.gif" alt="sad" border="0"></a>
<a href="javascript:addtext("bericht",":T")"><img src="http://localhost/gastenboek/smileys/sleep.gif" alt="sleep" border="0"></a>
<a href="javascript:addtext("bericht",";T")"><img src="http://localhost/gastenboek/smileys/smile.gif" alt="smile" border="0"></a>
<a href="javascript:addtext("bericht",":V")"><img src="http://localhost/gastenboek/smileys/tong.gif" alt="tong" border="0"></a>
<a href="javascript:addtext("bericht",";V")"><img src="http://localhost/gastenboek/smileys/unsure.gif" alt="unsure" border="0"></a>
<a href="javascript:addtext("bericht",":W")"><img src="http://localhost/gastenboek/smileys/wacko.gif" alt="wacko" border="0"></a>
<a href="javascript:addtext("bericht",";W")"><img src="http://localhost/gastenboek/smileys/wink.gif" alt="wink" border="0"></a>';
}
function ubb($bericht) {
$bericht = stripslashes($bericht);
$bericht = nl2br($bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\">",$bericht);
$bericht = stripslashes($bericht);
$bericht = str_replace("[b]","<b>",$bericht);
$bericht = str_replace("[/b]","</b>",$bericht);
$bericht = str_replace("[i]","<i>",$bericht);
$bericht = str_replace("[/i]","</i>",$bericht);
$bericht = str_replace("[u]","<u>",$bericht);
$bericht = str_replace("[/u]","</u>",$bericht);
//De smilies staan hierzo
$bericht = str_replace(":B",'<img src="http://localhost/gastenboek/smileys/biggrin.gif" alt="biggrin">',$bericht);
$bericht = str_replace(";B",'<img src="http://localhost/gastenboek/smileys/blink.gif" alt="blink">',$bericht);
$bericht = str_replace(":D",'<img src="http://localhost/gastenboek/smileys/cry.gif" alt="cry">',$bericht);
$bericht = str_replace(";D",'<img src="http://localhost/gastenboek/smileys/happy.gif" alt="happy">',$bericht);
$bericht = str_replace(":F",'<img src="http://localhost/gastenboek/smileys/huh.gif" alt="eng">',$bericht);
$bericht = str_replace(";F",'<img src="http://localhost/gastenboek/smileys/mad.gif" alt="mad">',$bericht);
$bericht = str_replace(":P",'<img src="http://localhost/gastenboek/smileys/mask.gif" alt="mask">',$bericht);
$bericht = str_replace(";P",'<img src="http://localhost/gastenboek/smileys/ohmy.gif" alt="ohmy">',$bericht);
$bericht = str_replace(":S",'<img src="http://localhost/gastenboek/smileys/rolleyes.gif" alt="rolleyes">',$bericht);
$bericht = str_replace(";S",'<img src="http://localhost/gastenboek/smileys/sad.gif" alt="sad">',$bericht);
$bericht = str_replace(":T",'<img src="http://localhost/gastenboek/smileys/sleep.gif" alt="sleep">',$bericht);
$bericht = str_replace(";T",'<img src="http://localhost/gastenboek/smileys/smile.gif" alt="smile">',$bericht);
$bericht = str_replace(":V",'<img src="http://localhost/gastenboek/smileys/tong.gif" alt="tong">',$bericht);
$bericht = str_replace(";V",'<img src="http://localhost/gastenboek/smileys/unsure.gif" alt="unsure">',$bericht);
$bericht = str_replace(":W",'<img src="http://localhost/gastenboek/smileys/wacko.gif" alt="wacko">',$bericht);
$bericht = str_replace(";W",'<img src="http://localhost/gastenboek/smileys/wink.gif" alt="wink">',$bericht);
return $bericht;
}
?>
2.248 views
Dit script werkt niet meer in mijn nieuwe Wamp Server in de vorige versie werkte het prima, maar nu met php 5.5 niet meer.