The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
User setable default BB code formatting for each post Details »» | ||||||||||||||||||||||||||||
User setable default BB code formatting for each post
Developer Last Online: Feb 2008
Allow your users to set default formatting for each of their newpostswith the familiar BB code via the options page in their controlpanel.
This requires one file edit and adding a custom profile field. There is also the option to allow users to choose not to seeautomaticbb code. This requires another file edit and custom profilefield. (Theaddition of this option is the only change between versions1.0 and1.1.) First, open up your admincp and find the "User Profile Fields" section in the sidebar and click "Add New User Profile Field". Click "Continue" with the default Single-Line Text Field option selected. Set the following options: Title: Automatic BB Code Description: Enter the opening portion of BB code tags that youwouldlike format all of your posts (e.g. [color=red]). Multiple tagsarefine, but no text outside of the tags. Only single quotation marks(nodouble quotation marks) can be used in this field. Private Field: Yes Field Searchable on Members List: No Show on Members List: No Regular Expression: Code:
^(\[(b|i|u|color|font|size|left|center|right)(\=\'?(\#\w+\s*)+\'?)?\])*$ You can change the BB codes in the regular expression to any othersyouhave added on your forum or customize them in any way you choose.Justkeep the same formatting with the | character dividing each tag. Once you've customized this page to your satisfaction (every other option can be left as the default), click Add. Now, note the "Name" field for your new field in the User Profile Field Manager. It should be of the format "field123". You'll need to edit includes/functions_newpost.php. Find the following line: PHP Code:
PHP Code:
Save and upload the file. That's it! ------------------------------- You can also choice to allow users the option of seeing no automatic bb code. Keep in mind this part will not work if you have enabled caching of posts(vBulletinOptions > Server Settings and Optimization Options >Cached PostsLifespan should equal 0). If you need to cache posts forperformancereasons, then you're out of luck. (There's no technical wayaround this,without saving this information elsewhere in the database,since cachedposts saved parsed BB code for all users--it can't bechanged on anindividual basis as this hack does.) To do so, add a "Single-Selection Menu" custom profile field with the following options: Title: Show Automatic BB Code Description: Set this to "No" to view the forums without anyone else's automatic BB code. Options: Quote:
Field Searchable on Members List: No Show on Members List: No Display Page: Options: Thread Viewing Do not change the options from Yes and No (exactly) or the removalofautomatic BB code will not work. You can customize the rest oftheoptions as you choice. Once you're done, hit add it and again notethename of the profile field (it's in the form field123). Open up /includes/functions_bbcodeparse.php. Find the following line: PHP Code:
PHP Code:
Save and upload the file. Version 1.2: RegExp fix should allow hex values for colors. Show Your Support
|
Comments |
#2
|
|||
|
|||
Nice One I´ve installed it!
|
#3
|
|||
|
|||
I'll have to take a look at this, I think some of my members wanted something like it.
|
#4
|
|||
|
|||
Installed, but i wonder if there would be some kind of way to make it possible for other users to ignore this formatting...
I can imagine that not all of my users would appreciate this, so if they were able to choose to see other users predefined formatting or just the normal text, I think this would be a great addon! |
#5
|
||||
|
||||
You should try and limit this to font face and font color if possible.
I for one wouldn't want people to have text aligned to the right, or written in a stupidly large font or even spam a website in every single post that they make. |
#6
|
||||
|
||||
Quote:
Oblivion Knight - It's already quite possible to limit this to font and color. Just remove the additional tags from the regular expression check as I explained in the hack instructions. It already doesn't allow BB code like URLs. As for alignment and font size changes, it's easy for you to optionally remove tags. I only kept the font tag because sometimes more unusual fonts are especially small and need to be enlarged by a level or so. |
#7
|
||||
|
||||
Ok, my apologies - I didn't read the full hack description..
|
#8
|
||||
|
||||
would it be possible to make this work in a shoutbox aswell as on the forums?
|
#9
|
||||
|
||||
Very strange. I know there's a hack out there that does something similar to this (I even installed it) but now I can't find it. I wanted to know the difference in how they function so I can decide to switch.
|
#10
|
||||
|
||||
also.. sorry to post again but it dosn't seem to accept hex values as colours, it comes up with an error when you press save. is there a way to fix this?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|