TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

change ":)" to a smiley :)

Page: 1 Reply
Jun 8th 2003#107355 Report
Member since: May 24th 2003
Posts: 212
hey

can i add code to a html/php page so that when i type : ) on the page it changes to a ?

like it does here.

thanks
Reply with Quote Reply
Jun 8th 2003#107372 Report
Member since: Mar 24th 2002
Posts: 3114
Use a PHP script for that.
You can file(); the whole file and echo it all out in a for()-loop whilst having a str_replace("","",$file); or use a regexp search for it. If you just have a few smileys you want parsed, go for the str_replace, if loads, use the regexp search..

If you have PHP support, that is. If not, then.....type the img-tag manually? :D
Reply with Quote Reply
Jun 8th 2003#107377 Report
Member since: Mar 24th 2002
Posts: 3114
This should do it;
[PHP]

$filename="main.html";

$file=file($filename);

for($i=0;$i$file[$i]=str_replace(": )",");
echo $file[$i];
}

?>
[/PHP]

Not tested, but you get the idea.

EDIT: lmao, this board parsed the " : ) " with a img-tag. -_-
Reply with Quote Reply
Jun 9th 2003#107502 Report
Member since: May 24th 2003
Posts: 212
hey, er thanks, looks alright,

i aint used that stuff b4 lol

u think u cud make me a script so it has 5 or so smileys and then i can edit the img tags? also where wud i put that code?

thanks i aint gotta clue!

also is there any alternative ways to do this?

non-php anyway, b.coz i dont think my domain has php support.

thanks 'gen
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum