If you want to post a message in my guestbook, that you can insert smileys and ubb tags, by clicking on a smiley to or button.
So if you click on a smiley or a button the tags be placed automatically in the textatea
But that no longer works in Wamp Server 2.5
below is a part of the ubb script, there are more smileys, but those are now no importance.
<?php
ini_set('display_errors',1); // 1 == aan , 0 == uit
error_reporting(E_ALL | E_STRICT);
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("text","text"">';
}
function smileys(){
echo '
<a href="javascript:addtext("text",":B""><img src="[localhost]; alt="biggrin" border="0"></a>';
}
function ubb($text) {
$text = stripslashes($text);
$text = nl2br($text);
$text = str_replace("","\">",$text);
$text = stripslashes($text);
$text = str_replace("","<b>",$text);
$text = str_replace("","</b>",$text);
$text = str_replace("","<i>",$text);
$text = str_replace("","</i>",$text);
$text = str_replace("","<u>",$text);
$text = str_replace("","</u>",$text);
$text = str_replace(":B",'<img src="[localhost]; alt="biggrin">',$text);
return $text;
}
?>