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
  #22  
Old 05-31-2005, 10:05 PM
zahn zahn is offline
 
Join Date: Apr 2005
Location: Trollh?ttan, Sweden.
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice, this one worked fine for me...
Reply With Quote
  #23  
Old 05-31-2005, 10:41 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 for those who may have to reinstall this after an upgrade?
Reply With Quote
  #24  
Old 06-06-2005, 09:58 AM
blueshift's Avatar
blueshift blueshift is offline
 
Join Date: Jun 2005
Location: Newcastle, England
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very good work. This has been an on-going problem throughout vBulletin history. Nicely done.
Reply With Quote
  #25  
Old 07-06-2005, 12:29 AM
Smash World Smash World is offline
 
Join Date: Jun 2002
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great on my vB 3.0.7 board - thanks!
Reply With Quote
  #26  
Old 07-31-2005, 03:21 PM
weaver weaver is offline
 
Join Date: Mar 2004
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am getting

Quote:
" class="inlineimg" />
after some of my smilies. Is that related to this hack or something else? I've only seen it start happening after I installed this hack.

ETA: Figured it out. It will give that error if you have duplicate smilie codes.
Reply With Quote
  #27  
Old 08-05-2005, 10:18 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this problem still exist in 3.0.7?
Reply With Quote
  #28  
Old 08-19-2005, 11:44 PM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is a great hack...............thanks, it is working perfectly
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 08:31 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.04472 seconds
  • Memory Usage 2,275KB
  • Queries Executed 24 (?)
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
  • (1)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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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