[Suggestion] Case senstitive?!?!?!?!

Zola 05-02-2004 11:46 PM
Hey Krang,

I just had to go back to edit a post because I used a smiley and it didn't come out because I used caps. Is there any way to set those smileys by adding entries so it doesn't matter whether you do :lol: or :LOL: ? It just seemed kinda silly... ;)
evanASF27 05-02-2004 11:49 PM
yah I just made a post in Tony's fanfic thread (the date one Wink ) ...and I use
code:
1:
:d
by accident and it didn't come out as Big Grin ...

it's wierd no?
Zola 05-02-2004 11:52 PM
quote:
Originally posted by evanASF27
yah I just made a post in Tony's fanfic thread (the date one ;) ) ...and I use
code:
1:
:d
by accident and it didn't come out as :D ...

it's wierd no?


Well, MySQL is case sensitive, it's true, but I would think that for a smiley, one could either put a string-handling routine that automatically converted it to all small letters (and set the smileys to work with all small letters), or just add entries in the db so that there's an entry for each possible manifestation

:LOL:
:LOl:
:lOL:
:lOl:
:lol:
Jonny Axehandle 05-02-2004 11:58 PM
A good way to do this would be to add a ":LOL:" word filter.
evanASF27 05-03-2004 12:08 AM
quote:
Originally posted by Zola
quote:
Originally posted by evanASF27
yah I just made a post in Tony's fanfic thread (the date one ;) ) ...and I use
code:
1:
:d
by accident and it didn't come out as :D ...

it's wierd no?


Well, MySQL is case sensitive, it's true, but I would think that for a smiley, one could either put a string-handling routine that automatically converted it to all small letters (and set the smileys to work with all small letters), or just add entries in the db so that there's an entry for each possible manifestation

:LOL:
:LOl:
:lOL:
:lOl:
:lol:

you forgot

:LoL:
Krang 05-03-2004 12:09 AM
quote:
Originally posted by Zola
Hey Krang,

I just had to go back to edit a post because I used a smiley and it didn't come out because I used caps. Is there any way to set those smileys by adding entries so it doesn't matter whether you do :lol: or :LOL: ? It just seemed kinda silly... ;)

Thanks for the suggestion. The problem is, there are 15 smilies that contain letters. Some of them would be easy (for example, :d and :D), but others would require many more entries (for example, :Evil:, :EVil:, :eVil:, :evil:, :EvIl:, etc., and just imagine how many :embarrassed: would require...). It would be easiest to run a strtolower() on the smilies, but then again, that would have to run every single time a smiley is posted, possibly slowing down the forums. The best solution would probably be to add the more common ones, so let me know which ones you think would be the best to add.
Zola 05-03-2004 12:18 AM
quote:
Originally posted by Krang
Thanks for the suggestion. The problem is, there are 15 smilies that contain letters. Some of them would be easy (for example, :d and Big Grin ), but others would require many more entries (for example, :Evil:, :EVil:, :eVil:, Evil , :EvIl:, etc., and just imagine how many Embarrassed Sweatdrop would require...). It would be easiest to run a strtolower() on the smilies, but then again, that would have to run every single time a smiley is posted, possibly slowing down the forums. The best solution would probably be to add the more common ones, so let me know which ones you think would be the best to add.


Actually, all kidding aside, rather than every possible variant, what about just all caps and all small? I don't know about everyone else, but I tend to do one or the other, I don't mix up the letters. Smile
Krang 05-03-2004 12:27 AM
Ok, slight problem. I checked, and there's no way to exclude a smiley from the list, so if I added extra entries, those particular smilies would show up more than once on the list. I also tried Jonny's suggestion, but it looks like the smiley parser runs before the word filter, so :LOL: gets changed to :lol: instead of ...
Zola 05-03-2004 12:30 AM
quote:
Originally posted by Krang
Ok, slight problem. I checked, and there's no way to exclude a smiley from the list, so if I added extra entries, those particular smilies would show up more than once on the list. I also tried Jonny's suggestion, but it looks like the smiley parser runs before the word filter, so :LOL: gets changed to Laughing instead of ...


hmm... that's too bad. Frown

okay, thanks for trying, I appreciate it. We'll have to watch and see if a tweak that does it shows up.
A Clockwork Tomato 05-03-2004 08:52 AM
Computers ... they make our lives easier.

or

DO THEY? Confused
Wingnut 05-03-2004 08:55 AM
quote:
Originally posted by A Clockwork Tomato
Computers ... they make our lives easier.

or

DO THEY? Confused

Of course they do... for a price anyway.
Bentar 05-03-2004 03:18 PM
quote:
Originally posted by evanASF27
quote:
Originally posted by Zola
quote:
Originally posted by evanASF27
yah I just made a post in Tony's fanfic thread (the date one Wink ) ...and I use
code:
1:
:d
by accident and it didn't come out as Big Grin ...

it's wierd no?


Well, MySQL is case sensitive, it's true, but I would think that for a smiley, one could either put a string-handling routine that automatically converted it to all small letters (and set the smileys to work with all small letters), or just add entries in the db so that there's an entry for each possible manifestation

:LOL:
:LOl:
:lOL:
:lOl:
Laughing

you forgot

:LoL:


I have nothing of value to add to this thread - but that's never stopped me from posting before, nor will it now. I couldn't help but notice there were only 6 possibilities mentioned (5 by Zola, 1 by Evan). Six possibilities is not a integer power of 2. When defining the complete set of binary possible states (as in three letters, each either upper or lower case - i.e. two states - binary - such as 0 or 1) the total number of permutations is always an integer power of 2. For example:

For a thee 'bit' example of classic digital binary (i.e. 0 and 1) the possible permutations are:
000
001
010
011
100
101
110
111

Only six permutations were listed for the 'LOL' example. Using a 0 to represent lower case and a 1 to represent upper case, the currently given permutations are:
000 - lol (Zola)
001
010 - lOl (Zola)
011 - lOL (Zola)
100
101 - LoL (Evan)
110 - LOl (Zola)
111 - LOL (Zola)

This leaves the states 001 and 100, which represent loL and Lol, respectively Smile I'm surprised no one beat me to the post.
(The master of arcane and in this case completely useless knowledge steps back into the shadows)
Zola 05-03-2004 04:31 PM
Actually, I think I have the answer. The parser is correct, but it needs two steps.

The first step would be to lowercase it and the second step would be the substitute. Then it would work.
Dude Love 05-03-2004 05:11 PM
quote:
Originally posted by Krang
Ok, slight problem. I checked, and there's no way to exclude a smiley from the list, so if I added extra entries, those particular smilies would show up more than once on the list. I also tried Jonny's suggestion, but it looks like the smiley parser runs before the word filter, so :LOL: gets changed to Laughing instead of ...


You could always make the word filter run directly to image tags of the smilie URL, if you'd like to try that option. That *should* work.
Krang 05-04-2004 01:14 AM
quote:
Originally posted by Bentar
When defining the complete set of binary possible states (as in three letters, each either upper or lower case - i.e. two states - binary - such as 0 or 1) the total number of permutations is always an integer power of 2.

By that logic, "embarrassed" would take a total of 2048 entries... Shocked

quote:
Originally posted by Zola
Actually, I think I have the answer. The parser is correct, but it needs two steps.

The first step would be to lowercase it and the second step would be the substitute. Then it would work.

Thanks and good idea, but the possible slowdown problem mentioned above still applies. I don't think it would have that much of an impact, but with the recent server problems, it probably wouldn't be a good idea to risk it.

quote:
Originally posted by Wienberg
You could always make the word filter run directly to image tags of the smilie URL, if you'd like to try that option. That *should* work.

Unfortunately, the BBCode parser also runs before the word filter, so that wouldn't work either.