Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Fix for smilie display problem Details »»
Fix for smilie display problem
Version: 1.00, by Boots Boots is offline
Developer Last Online: Feb 2015 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 12-23-2004 Last Update: Never Installs: 24
Is in Beta Stage  
No support by the author.

As many of you know, the parsing of vB smilies is rather odd and can be a huge headache when it comes to multiple codes not parsing correctly

ie:

uke: and

as you can see, the smilies are parsed by display order so
Code:
:p
gets parsed before
Code:
:puke:
therefore the longer smilie code doesn't display correctly. An easy fix is to parse the smilies in order of their code length. The following two quick hacks will do just that!

BEFORE ATTEMPTING THIS - MAKE BACKUP COPIES OF:

/includes/adminfunctions.php
/includes/functions_bbcodeparse.php

Whenever you are changing files you should always have a proper backup!



open /includes/adminfunctions.php and goto line 2192

you will see this line
Code:
	$items = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "$table ORDER BY imagecategoryid, displayorder");
replace that line with this code
Code:
	if ($table == 'smilie') 
                {
                     $items = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "smilie ORDER BY LENGTH(smilietext) DESC");  
                }
                else
                {
                    $items = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "$table ORDER BY imagecategoryid, displayorder");  
                }
open includes/functions_bbcodeparse.php and goto line 385

you will see this line
Code:
SELECT smilietext, smiliepath, smilieid FROM " . TABLE_PREFIX . "smilie
replace it with this
Code:
SELECT smilietext, smiliepath, smilieid FROM " . TABLE_PREFIX . "smilie  ORDER BY LENGTH(smilietext) DESC
After this is complete, go into your Admin CP, view your smilies and just click "Save Display Order" This will update the cached smilie's datastore. This hack won't have any effect until this is done

Enjoy proper smilies ! Let me know how it works for ya!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-24-2004, 01:18 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that's great work although theirs a mistake
PHP Code:
    if ($table == 'smilie'
                {
                     
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "smilie ORDER BY LENGTH(smilietext) DESC");  
                |
                else
                {
                    
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "$table ORDER BY imagecategoryid, displayorder");  
                } 
should read

PHP Code:
    if ($table == 'smilie'
                {
                     
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "smilie ORDER BY LENGTH(smilietext) DESC");  
                }
                else
                {
                    
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "$table ORDER BY imagecategoryid, displayorder");  
                } 
Reply With Quote
  #3  
Old 12-24-2004, 01:19 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will this also fix the :lol problem?
Reply With Quote
  #4  
Old 12-24-2004, 01:34 PM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very usefull. Thanks!
Reply With Quote
  #5  
Old 12-24-2004, 02:08 PM
Boots Boots is offline
 
Join Date: Dec 2004
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

fixed this in the original post. I don't know how the | got in there as I copied it directly from my code ? weird. Oh well, fixed now


Quote:
Originally Posted by sabret00the
that's great work although theirs a mistake
PHP Code:
    if ($table == 'smilie'
                {
                     
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "smilie ORDER BY LENGTH(smilietext) DESC");  
                |
                else
                {
                    
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "$table ORDER BY imagecategoryid, displayorder");  
                } 
should read

PHP Code:
    if ($table == 'smilie'
                {
                     
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "smilie ORDER BY LENGTH(smilietext) DESC");  
                }
                else
                {
                    
$items $DB_site->query("SELECT * FROM " TABLE_PREFIX "$table ORDER BY imagecategoryid, displayorder");  
                } 
Reply With Quote
  #6  
Old 12-24-2004, 02:10 PM
Boots Boots is offline
 
Join Date: Dec 2004
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sabret00the
will this also fix the :lol problem?
yes

(:lol

displays perfectly fine on my forum
Reply With Quote
  #7  
Old 12-24-2004, 10:08 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you please post this in a text file also for easier downloading and saving?
Reply With Quote
  #8  
Old 12-24-2004, 11:53 PM
Boots Boots is offline
 
Join Date: Dec 2004
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure thing. i'll post one up tommorow
Reply With Quote
  #9  
Old 12-25-2004, 12:55 AM
NYI Fan's Avatar
NYI Fan NYI Fan is offline
 
Join Date: Oct 2001
Location: Long Island, NY
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks, i was wondering when Iw as going to find some time to clean this mess up LOL and youve saved me the trouble!

*clicks install*
Reply With Quote
  #10  
Old 12-25-2004, 01:16 AM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fantastic! Tnx.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:56 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04745 seconds
  • Memory Usage 2,323KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete