View Full Version : Smilie Code Not Functioning Properly
Sunshine
03-22-2003, 01:56 PM
I've looked high and low here and no one seems to have posted about this problem before.
On my site, the smilie code is not functioning properly.
For example -
;p is a tongue face and...
;puke is of course a puking face
The problem is, the puke face never comes up. Instead what we get is the tongue face. It's not reading past the p for some reason.
The same thing is true with codes that are similar but differentiated by a 2 or 3 at the end. For example -
;welcome would be the first welcome smilie
;welcome2 would be the second welcome smilie
When you type the code for the second welcome smilie, you get the first welcome smilie with a 2 next to the image.
Any insights or suggestions would be much appreciated. We were using version 2.2.9 but upgraded to 2.3.0 last night and that did not fix the problem.
amykhar
03-22-2003, 02:04 PM
That happens at my board too. My workaround would be to name ;puke ;vomit instead. The smilie replacement code seems to work like a bad naughty word filter that would bleep out a word like assess.
Amy
Xenon
03-22-2003, 02:17 PM
i haven't tested it, because i don't have this problem (not using that much smilies ^^)
but i think this would work:
open admin/functions.php
find:
if($dosmilies) {
$bbcode=str_replace(">)", "> )", $bbcode);
$bbcode=str_replace("<)", "< )", $bbcode);
if(!isset($smilies)) {
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie");
} else {
$DB_site->data_seek(0,$smilies);
}
while ($smilie=$DB_site->fetch_array($smilies)) {
if(trim($smilie[smilietext])!="") {
$bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\">",$bbcode);
}
}
}
and change it to:
if($dosmilies) {
$bbcode=str_replace(">)", "> )", $bbcode);
$bbcode=str_replace("<)", "< )", $bbcode);
if(!isset($smilies)) {
$smilies=$DB_site->query("SELECT smilietext,smiliepath,LENGTH(smilietext) AS lgt FROM smilie ORDER BY lgt DESC");
} else {
$DB_site->data_seek(0,$smilies);
}
while ($smilie=$DB_site->fetch_array($smilies)) {
if(trim($smilie[smilietext])!="") {
$bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\">",$bbcode);
}
}
}
Sunshine
03-22-2003, 03:52 PM
Thank you very much! That did the trick! :cool:
amykhar
03-22-2003, 04:00 PM
Xenon, you should release this as a bug fix over at the .com site and here. Everybody's board has this problem.
amykhar
03-22-2003, 04:04 PM
Woah! Big bug. Installing this hack removes MANY of my smilies.
Some that were missing started with ! Not sure if that is the only problem though.
Xenon
03-23-2003, 04:24 PM
huh?
normally no smilies should disappaer, because the fix just changes the order smilies are get out of the db...
amykhar
03-23-2003, 04:31 PM
Not sure what it is doing, but with the code in, I have 2 pages of smilies in the control panel. With it out, I have about 10 pages.
Amy
Xenon
03-23-2003, 04:36 PM
it is just that line: $smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie");
which was changed, and as you can see, the new code:
$smilies=$DB_site->query("SELECT smilietext,smiliepath,LENGTH(smilietext) AS lgt FROM smilie ORDER BY lgt DESC");
couldn't change the ammount of smilies.
but as said, it's just a quickfix of the bug above, i don't know if the smilies are preloaded somewhere which could produce the bug at your board.....
i've posted it over at vb.com for the developers to look into it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.