Jump to content

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/28922-solved-help-with-a-shoutbox/
Share on other sites

  • 2 weeks later...
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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.