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 3 of 3

Thread: emoticons

  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Gulf
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry emoticons

    Hi everybody;

    I would like to know how the emoticons or the smilies are interpreted when saved into the database and then be viewed when calling them from the database again.

    example:
    I'm saving my message as follow:
    I'm 'mad'
    and when viewed
    I'm

    So if u have the answer in a website tutorial or u can handle it yourself i would be very thankful.

    Yours
    =======================
    =======================
    WebMaster
    =======================
    =======================

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something like this?

    Code:
    
    <%
    Function Emote(byVal str)
    
       If IsNull(str) Then Exit Function
    
       Dim EmotedStrings(5)
    
       EmotedStrings(0) = "'mad'"
       EmotedStrings(1) = "'happy'"
       EmotedStrings(2) = "'sad'"
       EmotedStrings(3) = "'embarrassed'"
       EmotedStrings(4) = "'laughing'"
    
       Dim Emoticons(5)
    
       Emoticons(0) = "<img src=""images/mad.gif"" width=""15"" height=""15"" />"
       Emoticons(1) = "<img src=""images/happy.gif"" width=""15"" height=""15"" />"
       Emoticons(2) = "<img src=""images/sad.gif"" width=""15"" height=""15"" />"
       Emoticons(3) = "<img src=""images/embarrassed.gif"" width=""15"" height=""15"" />"
       Emoticons(4) = "<img src=""images/laughing.gif"" width=""15"" height=""15"" />"
    
       Dim EmoteLoop
    
       For EmoteLoop = 0 to 5
          str = Replace(str,EmotedStrings(EmoteLoop),Emoticons(EmoteLoop))
       Next
    
       Emote = str
    
    End Function
    
    Dim teststring
    teststring = "I am 'mad' today because I am no longer 'happy'. I get 'embarrassed' easily because when I'm 'laughing' it sounds pretty 'sad'."
    Response.Write Emote(teststring)
    %>
    
    Last edited by whammy; 01-20-2003 at 11:54 PM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Gulf
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    That's what i was looking for, thank you my friend
    =======================
    =======================
    WebMaster
    =======================
    =======================


  •  

    Posting Permissions

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