Page 1 of 1

Emoticons in comments

Posted: Thu Apr 20, 2006 10:10 pm
by Rexxer
I don't really know, whether it's a bug or whether it's supposed to be that way, but an emoticon that's entered right at the beginning of a comment is not being replaced by its' icon. I stumbled upon this after I added an emoticons.inc.php and wanted to test that. I have seen this behavior with 1.0-beta2 and a relatively current 1.1-build.

I hope someone can shed some light on this issue.

TIA,
Andre

Posted: Fri Apr 21, 2006 3:06 am
by judebert
Yes, to prevent making emoticons out of stuff that's really supposed to be symbols or text, we only convert the emoticon text if it's got a tab, space, period, exclamation point, or greater-than; AND if it ends with the same stuff (but less-than instead of greater-than) or end-of-line.

Phew.

If you want it to work at the very beginning, too, go to serendipity_event_emoticate.php, around line 175, and replace this:

Code: Select all

$element = preg_replace("/([\t\s\.\!>]+)" . $key . "([\t\s\!\.\)<]+|\$)/U",
with this:

Code: Select all

$element = preg_replace("/([\t\s\.\!>]+|^)" . $key . "([\t\s\!\.\)<]+|\$)/U",
Let me know how it works out.

Posted: Fri Apr 21, 2006 11:36 am
by Rexxer
judebert wrote:Yes, to prevent making emoticons out of stuff that's really supposed to be symbols or text, we only convert the emoticon text if it's got a tab, space, period, exclamation point, or greater-than; AND if it ends with the same stuff (but less-than instead of greater-than) or end-of-line.

Phew.
So it's intentional behavior. I'll just tell my readers, and that should do it. Thanks for the explanation :-)

Andre