Gossamer Forum
Home : Products : DBMan : Customization :

Re: [shann123] Emoticons in record view?

Quote Reply
Re: [shann123] Emoticons in record view? In reply to
I was interested to see if I could get this to work. I couldn't. :-) My thought was to have something like this:

Define each smiley like $smilie{filename} = emoticon; so you would have something like

$smilie{smile} = ":)";
$smilie{frown} = ":(";
$smilie{wink} = ";)";

And then using the following code:

Code:

foreach $col (keys %rec) {
foreach $file (keys %smilie) {
$graphic = "<img url/to/smilies/dir/$file.gif>";
$rec{$col} =~ s/$smilie{$file}/$graphic/g;
}
}


But it doesn't work. The reason it doesn't work is because of the nature of smilies -- the fact that they use ) and (. The substitution causes the regular expression to be interpreted as though they are really parentheses and not just characters. I tried adding \ before them and it still didn't work.

What did work is to use words to define the smilies. Here's a little script that worked just as I wanted it to:

Code:

$rec{'Name'} = "Fred smile";
$rec{'Address'} = "Bedrock frown";
$smilies{smile} = "smile";
$smilies{frown} = "frown";
$smilies{wink} = "wink";
foreach $col (sort keys %rec) {
foreach $file (sort keys %smilies) {
$graphic = "<img url/to/smilies/dir/$file.gif>";
$rec{$col} =~ s/$smilies{$file}/$graphic/;
}
}


That gets you what you want, but there's two problems. One is that people are used to using smilies and not typing out the name of the smilie. The other is that you wouldn't be able to use the word anywhere else.

But maybe this will help to point you or someone else in the right direction. :-)


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Subject Author Views Date
Thread Emoticons in record view? shann123 4643 May 19, 2005, 5:39 PM
Post Re: [shann123] Emoticons in record view?
JPDeni 4492 May 19, 2005, 8:16 PM
Thread Re: [shann123] Emoticons in record view?
Watts 4512 May 20, 2005, 3:45 PM
Thread Re: [Watts] Emoticons in record view?
shann123 4488 May 20, 2005, 4:17 PM
Thread Re: [shann123] Emoticons in record view?
shann123 4493 May 20, 2005, 4:38 PM
Thread Re: [shann123] Emoticons in record view?
JPDeni 4485 May 20, 2005, 5:48 PM
Post Re: [JPDeni] Emoticons in record view?
Watts 4457 May 23, 2005, 11:37 AM
Thread Re: [shann123] Emoticons in record view?
JPDeni 4443 May 25, 2005, 8:40 PM
Post Re: [JPDeni] Emoticons in record view?
shann123 4452 May 26, 2005, 9:28 AM