SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member mich's Avatar
    Join Date
    Apr 2001
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I was designing my own forum. Encounter problem on my emoticons. I've use replace keywords only when i type this..eg.

    when i type it will change to the icon.... but this is not I require... Just wonder how to generate source code as the same in this forum whenever i click on those emoticons it will change to symbol...

    Anyone can help me this???

  2. #2
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry dude..don't understand what yu mean? are you trying to ask how to change a symbol into an icon? if so, thats moreon the server-script programming..depending on whether you use php or perl, or asp etc.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  3. #3
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The back-end code we cannot give out, but feel free to look at any of the HTML code on these pages to learn from.
    Wayne Luke
    ------------


  4. #4
    SitePoint Member mich's Avatar
    Join Date
    Apr 2001
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thank you

    Never mind... maybe I'll figure on how to write the code. THanks

  5. #5
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if its perl or php, replacing a certain combination should be very simpole!

    unless i'm wrong!
    what you intedn to do it in? perl or php, or asp ..etc>?
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  6. #6
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wouldn't it just be simple search-replace?
    Code:
          $msg = ereg_replace(":\)", "<img src=\"icon_smile.gif\">", $msg);

  7. #7
    SitePoint Member mich's Avatar
    Join Date
    Apr 2001
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Source code for my forum

    Well i'm using ASP to write my own forum....


    Cokeman,
    I've no knowledge on PHP, but anyway thanks for sharing those information

  8. #8
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Weel,
    its time to make your post in Server-Side Internet Development.

    http://www.sitepointforums.com/forum....php?forumid=4

    To get the fastest response, make sure you get it in the right forum. =)
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  9. #9
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by cokeman
    Wouldn't it just be simple search-replace?
    Code:
          $msg = ereg_replace(":\)", "<img src=\"icon_smile.gif\">", $msg);
    Actually, if you're not planning to make use of regular expressions, you should use str_replace() - much quicker, I believe:

    Code:
    $msg = str_replace(":)", "<img src=\"icon_smile.gif\">", $msg);
    Hope that helps.
    Last edited by TWTCommish; Apr 10, 2001 at 19:28.

  10. #10
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't you just love Sitepoint? Seems like I learn something new here everyday Thanks for the tip Chris.. Got me curious and so I looked it up and for others like me, here's a nice benchmark from one of the user posts:

    "I just wanted to give an example of how much faster str_replace is compared to ereg_replace. Using ereg_replace to parse a radius (username/password) file with about 1000 users took me 1 minute and 29 seconds. Using str_replace it took about 5 seconds."

  11. #11
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No need to thank me - It makes me feel superior. I find putting other people down increases my own lagging self esteem. Thanks for the quote - didn't realize it was THAT much faster!

  12. #12
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL! goosh! haha..
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


Bookmarks

Posting Permissions

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