Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying EMOTICONS in my comments

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
US
[tt]
How can I add emoticons to a webpage based on what user type?( you know, like this site) ---> :). I'm not sure how to search for ";;;""-"")"" special characters within the text typed.
[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

banana.gif
rockband.gif
banana.gif
 
There maybe a better way to do this but -
create the icons (as if i needed to tell you that)

then use

MESSAGE = Replace(MESSAGE,&quot;:)&quot;,&quot;<img src=smile.gif' width='10' height='10'>&quot;)
 
The way I have dealt with custom tags and &quot;emoticon&quot;-like occurences in the past is to create an array of text and pic names and then loop through with a replace function:
Code:
Dim emotArray(5,1)
emotArray(0,0) = &quot;:)&quot;
emotArray(0,1) = &quot;<img src='images/smiley.gif'>&quot;
emotArray(1,0) = &quot;:(&quot;
emotArray(1,1) = &quot;<img src='images/frowney.gif'>&quot;
emotArray(2,0) = &quot;[b]&quot;
emotArray(2,1) = &quot;<b>&quot;
emotArray(3,0) = &quot;[/b]&quot;
emotArray(3,1) = &quot;</b>&quot;
emotArray(4,0) = &quot;[IMG]&quot;
emotArray(4,1) = &quot;<img src='&quot;
emotArray(5,0) = &quot;[/IMG]&quot;
emotArray(5,1) = &quot;'>&quot;

Function ResolveEmotTags(content)
   Dim i
   For i = 0 to UBound(emotArray)
      content = Replace(content,emotArray(i,0),emotArray(i,1))
   Next
End Function

The reason I have this declared as an array is because you could put the entrie thing in an include file and then if you want to display a list (like the emoticon/Smileys link below) of available tags/smileys you could simply include the array file and loop through them displaying a two column table with emotArray(i,0) and emotArray(i,1).
Hope that helps,
-Tarwn &quot;Customer Support is an art not a service&quot; - marketing saying
&quot;So are most other forms of torture&quot; - programmers response
(The Wiz Biz - Rick Cook)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top