Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Adding smileys -

    How would I do this? I've tried everything, I've tried adding this line to my code:

    PHP Code:
    if ($message==":happy:"
       
    $message "<img src='crown_gold.gif'>" 
    How would I add a smileys system on this? http://chataddict.netau.net/index.php

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Use str_replace(). You can use arrays for the parameters so you can list all smileys in one array and the images to replace them with in another array.

    http://us2.php.net/manual/en/function.str-replace.php

  • #3
    New Coder
    Join Date
    Jan 2009
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ok, but how would I use it?...I'm a noobie at PHP....

  • #4
    New Coder
    Join Date
    Jan 2009
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Anyone?...

  • #5
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Click on the link I provided and follow the examples in the manual.

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Quote Originally Posted by SRBuckey5266 View Post
    Ok, but how would I use it?...I'm a noobie at PHP....
    Quote Originally Posted by Fumigator View Post
    Click on the link I provided and follow the examples in the manual.
    Yes, hope you don't need to be a noobie forever
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •