Smiley tag ind i mini tagwall
Hej alle på Eksperten.Jeg har en MEGET minimal lille tagwall/Gæstebog.
Og der i ønsker jeg at putte en kode så man også kan bruge smileys i denne....
Har følgende 2 koder jeg skal have smækket sammen !!!
Smiley PHP-koden
...<?php.
function smilie($text){
$text = str_replace(":)", "<img src=smilies/smile.gif>", $text); // :)
$text = str_replace(";)", "<img src=smilies/wink.gif>", $text); // ;)
$text = str_replace(":D", "<img src=smilies/biggrin.gif>", $text);// :D
$text = str_replace(":(", "<img src=smilies/sad.gif>", $text); // :(
$text = str_replace("0-)", "<img src=smilies/blink.gif>", $text); // 0-)
$text = str_replace("(h)", "<img src=smilies/cool.gif>", $text); // (h)
$text = str_replace(":/", "<img src=smilies/dry.gif>", $text); // :/
$text = str_replace(":|", "<img src=smilies/huh.gif>", $text); // :|
$text = str_replace("=D", "<img src=smilies/laugh.gif>", $text); // =D
$text = str_replace(":@", "<img src=smilies/mad.gif>", $text); // :@
$text = str_replace(":O", "<img src=smilies/ohmy.gif>", $text); // :O
$text = str_replace(":p", "<img src=smilies/p.gif>", $text); // :p
echo $text;
}
$text = "Hi there :D, :), :(, :/!"; //Prøve tekst
smilie($text);
.?>...
Tagwall/GB PHP-koden
...<?.
if ($message)
{
$name = strip_tags($name);
$web = strip_tags($web);
$message = strip_tags($message);
$message = ereg_replace( "\r\n\r\n", "\n<P>", $message);
$date = date( "l, j F Y, h:i a");
$message = "<B><a href=\"mailto:$mail\">$name</a> </B> -- $date -- <b><a target\"_blank\" href=\"$web\">$web</a><br><br></b> $message <BR><HR>";
$fp = fopen (basename($PHP_SELF) . ".comment", "a");
fwrite ($fp, $message);
fclose ($fp);
}
@readfile(basename(($PHP_SELF . ".comment")));
?>...
