Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Improved size bbcode Details »»
Improved size bbcode
Version: 1.00, by NolF NolF is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 3.6.x Rating:
Released: 05-11-2008 Last Update: Never Installs: 2
Template Edits
Re-useable Code Code Changes Translations  
No support by the author.

Improved size bbcode

Introduction:
Hi mates. This is my first "mod". Not really one as I couldn't do it using plugins etc, but has been working for over a year on my site so it's safe. I'll try to work on the presentation of this thread with time

Description:
This modification indicates how to change the default vbulletin html of the [size] bbcode and gives more than 7 size options to users.

Why?:
Good question. I moved from phpbb to vbulletin and preferred the old one better, so I modified vbulletin
Note, when you are importing using Impex, from other forum plataforms some lines need to be edited to avoid a conversion to the vbulletin system.

WARNING:
If you follow this modification in a forum using the default vbulletin bbcode, applying this hack will make all the [size=X]text[/size] very small.

Create a new bbcode instead (instructions given bellow)

Installation information on hack:
  • Files edited: 2
  • Templates edited: 1x number of styles
  • Files to upload via FTP: 2
  • Time to install: ~5 minutes
Instalation:
// This bit changes the core of vbulletin, and how this bbcode is parsed
1.--- Open /includes/class_bbcode.php with your favorite text editor
1.1- Go to line ~2249 (in 3.6.10) or search for "// [SIZE=XXX]"
1.2- reemplace
PHP Code:
'html' => '<font size="%2$s">%1$s</font>'
with
PHP Code:
'html' => '<span style="font-size: %2$spx;">%1$s</span>'
1.3- Save

// This bit will make the popup menu in the reply etc boxes
2.--- Open /clientscript/vbulletin_textedit.js with your favorite text editor
1.1- Find and reemplace
PHP Code:
option.innerHTML '<font size="' sizeoptions[n] + '">' sizeoptions[n] + '</font>'
with
PHP Code:
option.innerHTML '<span style="font-size:' sizeoptions[n] + 'px;">' sizeoptions[n] + '</span>'
1.2- Save and exit

// This step will make it go life in your forums
3.--- Upload the files

// This bit will change the numbers in the text editor popup menu to new and more usefull numbers
4.--- Go to your admincp
4.1- Styles & Templates > Style Manager > All Style Options > (down at the very end) Toolbar Menu Options
change the default set of numbers (1, 2, 3, 4, 5, 6, 7) with for example (5, 7, 11, 13, 15, 17, 20, 25, 30)
4.2- Save
4.3- Repeat for all mother styles ^^

Your done

Instalation, using a separate bbcode:
(You don't need to use this bbcode if you have installed the above modification)
1.--- AdminCP > Custom BB Codes > Add New BB Code
(optional names really)
1.1 -- Title: Improved Size
1.2 -- Tag: bsize
1.3 -- Replacement: <span style='font-size: {option}px;'>{param}</span>
1.4 -- Example: [bsize=25]Bigger[/bsize] [bsize=15]Not as big[/bsize] [bsize=7]Small[/bsize]
1.5 -- Example: [bsize=25]Bigger[/bsize] [bsize=15]Not as big[/bsize] [bsize=7]Small[/bsize]
1.6 -- Use {option}: Yes

Uninstall:
Reupload original files
/includes/class_bbcode.php
/clientscript/vbulletin_textedit.js
Revert the size box in the modified templates

FAQs
  1. It works with all 3.6.x versions
  2. It will work with 3.7 but is a bit hard to find step 2 in the compress javascripts
  3. Sorry but I don't know how to make it into a nice product
  4. It is reversible and shouldn't break your forums. Always backup before playing around though
  5. I'll try to give my best support, but this shouldn't be too problematic

Show Your Support

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

Comments
  #2  
Old 05-12-2008, 04:23 PM
princeedward's Avatar
princeedward princeedward is offline
 
Join Date: Jan 2007
Location: Deutschland
Posts: 901
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for releasing this...can be useful later...

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 04:48 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.03740 seconds
  • Memory Usage 2,212KB
  • Queries Executed 15 (?)
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
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete