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
  #12  
Old 01-12-2007, 08:25 AM
Greek76's Avatar
Greek76 Greek76 is offline
 
Join Date: Aug 2006
Location: Planet Earth
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems to work its on my profile options but the problem I have is doing the formating correct. So if I want my font to red I would do this?[color="red"]? If so it dont work. Thanks
Reply With Quote
  #13  
Old 01-12-2007, 09:45 AM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Greek76 View Post
It seems to work its on my profile options but the problem I have is doing the formating correct. So if I want my font to red I would do this?[color="red"]? If so it dont work. Thanks
try this
Code:
[color=red]
Reply With Quote
  #14  
Old 01-12-2007, 04:47 PM
Greek76's Avatar
Greek76 Greek76 is offline
 
Join Date: Aug 2006
Location: Planet Earth
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still dont work could be because Im using 3.6.2.
Reply With Quote
  #15  
Old 01-12-2007, 09:17 PM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Greek76 View Post
Still dont work could be because Im using 3.6.2.
i installed it using 3.5.4 and reinstalled it for 3.6.4. it works for me but im not the one that can answer your question about 3.6.2. sorry. are you sure you got all the code mods correct?
Reply With Quote
  #16  
Old 01-13-2007, 05:28 PM
Greek76's Avatar
Greek76 Greek76 is offline
 
Join Date: Aug 2006
Location: Planet Earth
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I followed the instructions and they seemed pretty easy..
Reply With Quote
  #17  
Old 01-15-2007, 10:43 PM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Greek76 View Post
I followed the instructions and they seemed pretty easy..
i seem to remember that the instructions told me to make one of the fields private. i remember changing something to make it public. im not really sure what though. make sure your usergroups have permission to view it though. it was showing up for admins and not registered users till i fixed the problem
Reply With Quote
  #18  
Old 09-16-2007, 02:13 AM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i love this mod ... just installed on a heavily modded vb3.6.8 and its working without problems. thanks again!!!
Reply With Quote
  #19  
Old 09-16-2007, 06:13 AM
Dave Hawley Dave Hawley is offline
 
Join Date: Jun 2004
Location: Australia
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I may have misunderstood, but won't allowing users to add BB code mean they could exploit code in a malicious way?
Reply With Quote
  #20  
Old 09-16-2007, 01:08 PM
DiverTree's Avatar
DiverTree DiverTree is offline
 
Join Date: Jun 2006
Location: Coastal Louisiana
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave Hawley View Post
I may have misunderstood, but won't allowing users to add BB code mean they could exploit code in a malicious way?
i think you misunderstood ... this lets the users use existing bbcode to set a default font. when the user composes their message, it shows up as a plain veranda font, but when they submit their message ... the coding is automatically added.

a note for future users ... i had to set the "show default font?" profile feild to public, instead of private.
Reply With Quote
  #21  
Old 09-16-2007, 10:32 PM
Dave Hawley Dave Hawley is offline
 
Join Date: Jun 2004
Location: Australia
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, thanks DiverTree, had a feeling I was wrong
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 06:54 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.08170 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (5)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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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