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

Reply
 
Thread Tools
Default BBCode formatting for user's posts (LITE VERSION) Details »»
Default BBCode formatting for user's posts (LITE VERSION)
Version: 1.00, by antialiasis antialiasis is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 04-10-2006 Last Update: 04-21-2006 Installs: 11
Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

Quote:
This hack in a nutshell: All users on your forum will be able to add optional BBCode to format all of their posts with.

This was inspired by DarthCow's user setable default BB code formatting for each post hack for vBulletin 3.0, borrows a couple of regular expressions from it and used it for reference in one spot. Everything else is my own.
This version of the Default BBCode hack does not have the "enable or disable default BBcode for individual posts you make" feature. The full hack is located here, but it is a Code Modification. Also go there for screenshots.

Version 1.02: Regular expression bug with colors and fonts fixed.

Version 1.01: Regular expression for "Default BBCode" field edited to support fonts with spaces in them.



ADDITIONAL FEATURES

-choose in your user CP whether to see any default BBCode at all

1 Product install
2 Custom profile fields
1 Template edit (in 2 templates)
2 Plugin edits


INSTALLATION INSTRUCTIONS

1. Download the product and import it.
2. Add two custom profile fields:

Profile field type: Single-line textbox
Title: Default BBCode
Description: You may choose to make a default BBCode formatting for each post. Allowed tags: [b] [i] [u] [left] [right] [center] [font] [color] [size] Please type in only the opening tags.
Max length of allowed user input: Doesn't really matter, but make sure it's enough
Display size: 25
Field Required: No
Field Editable by User: Yes
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No
Regular expression: ^(\[(b|i|u|left|right|center|font|color|size)(\=(\'|") ?(#[0-9a-fA-F]+)?[\w\s]+)?('|")?\])*$
Display Page: Options: Other

(Here you can edit the description and regular expression to allow or disallow BBCode - in the regular expression, just make sure to separate all of them with |.)

Profile field type: Single-selection radio buttons
Title: Show Default BBCode?
Description: Selecting no will cause all posts to be displayed without users' automatic BBCode formatting.
Options: Yes
No
Set Default: Yes
Field Required: No
Field Editable by User: Yes
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No
Allow user to input their own value for this option: No
Display Page: Options: Thread Viewing

3. Make the following edits:



############## TEMPLATE EDITS ###################

In postbit and postbit_legacy

FIND

Code:
$post[message]
REPLACE with

Code:
                   <if condition="$post['dbbcopen'] AND ($bbuserinfo['field234'] == 'Yes')">$post[dbbcopen]</if>
                   $post[message]
                   <if condition="$post['dbbcclose'] AND ($bbuserinfo['field234'] == 'Yes')">$post[dbbcclose]</if>
Replace "field234" with your "Show Default BBCode?" field.



################## PLUGIN EDITS ##################

After installing the product, you will have to edit the following plugins:

Set default BBCode for post preview
Default BBCode setup

Find "field6" in both of them and replace it with your "Default BBCode" field.



At this point the installation should be complete. Enjoy!

Show Your Support

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

Comments
  #2  
Old 04-11-2006, 05:41 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not bad there.
Reply With Quote
  #3  
Old 04-11-2006, 06:00 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So it's working for you?
Reply With Quote
  #4  
Old 05-18-2006, 08:44 PM
Basit Basit is offline
 
Join Date: Apr 2004
Location: London
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Installed it on my forum. But it change all hisotry threads with default font settings which is not good as thats not what user want. They may want to use default settings in most of their threads but not all 1000s of threads they made in last 4-5 years.

Obvious solution is to go for other thread which does provide this functionality that is allow it in thread to select/deselect this option. But I hope you will manage to add this functionality as part of plug-in. Its easy to manage a plug-in than code modifications.

Looking foward to see future versions of this hack.

Regards,
Reply With Quote
  #5  
Old 05-18-2006, 09:31 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've gotten better at this, so I might be able to get the full functionality into a product - we'll see about it. Thanks for the comment.
Reply With Quote
  #6  
Old 10-03-2006, 01:14 AM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ive been interested in something like this for some time now ... but im new to it all and need to ask ...

Quote:
Replace "field234" with your "Show Default BBCode?" field.
what is my "Show Default BBCode?"
Reply With Quote
  #7  
Old 10-03-2006, 08:08 PM
Zelos's Avatar
Zelos Zelos is offline
 
Join Date: Jun 2006
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does this still work with 3.6?



Quote:
Originally Posted by DiverTree
ive been interested in something like this for some time now ... but im new to it all and need to ask ...



what is my "Show Default BBCode?"
Whatever feild number "Show Default BBCode?" was when you put it in
Reply With Quote
  #8  
Old 10-03-2006, 08:14 PM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do i find my default bbcode?
Reply With Quote
  #9  
Old 10-09-2006, 10:23 PM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

duh, took me a few ... er, i mean ... a little while, but i figure it out. its the field number that you assign to it when you make it in the profile options. lol. :tired:
Reply With Quote
  #10  
Old 12-03-2006, 07:02 PM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i got a problem ... i have my default font set up. i no longer change my font to my prefered font when i make a post.

when i view my own posts my new default shows up, but when others view my posts it shows up like the font your reading now. can you help me fix it so everyone sees the font ive chosen for default? (considering that they have chosen "yes" to "show default font?" in the user cp)

nevermind ... i had the permissions set to private in the control panel ... works like a charm now except that unregistered or users not logged in dont see the users default font.
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:01 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.04733 seconds
  • Memory Usage 2,298KB
  • 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
  • (2)bbcode_code
  • (3)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