lupld Posted November 29, 2006 Share Posted November 29, 2006 I have a script from oxyscripts for a shoutbox (http://www.oxyscripts.com/item-418.html) and I want to put in emoticons. I would like to know if there is anything I can do to change given text, like :smile: from the message part of the form to an image tag before it get's posted into mysql. Or if there is something I can do to change it on the page before it gets displayed. I have already changed it to show the form above the shouts, allow up to 500 characters for the message, and post without entering an email. Any help would be greatly appreciated, it's for an after school project, if anyones ever heard of Academic Decathlon. Quote Link to comment https://forums.phpfreaks.com/topic/28922-solved-help-with-a-shoutbox/ Share on other sites More sharing options...
Woad.php Posted December 12, 2006 Share Posted December 12, 2006 You need to search for the smile and replace it with a picture like this:[code]$message = str_replace(":)","<img src=\"/images/smile.gif\" alt=\"Smile\">",$message);[/code]it replaces any :) in the message with the smile picture, and in the last parameter you're passing in the string (in this case $message) to be searched and replaced. Quote Link to comment https://forums.phpfreaks.com/topic/28922-solved-help-with-a-shoutbox/#findComment-139675 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.