Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
User setable default BB code formatting for each post Details »
User setable default BB code formatting for each post
Mod Version: 1.00, by Darth Cow (Member) Darth Cow is offline
Developer Last Online: Feb 2008 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.5 Rating: (1 vote - 5.00 average) Installs: 9
Released: 11 Jan 2005 Last Update: Never Downloads: 2
Not Supported  

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Display Page: Options: Other

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

AFTER it add,


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Be sure to edit field123 in the first line to the name of the field you noted above.

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:
Yes
No
Private Field: Yes
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

ABOVE it add:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Once again, be sure to edit field123 in the first line to the nameofthe field you noted for the "Show Automatic BB Code" option.

Save and upload the file.

Version 1.2: RegExp fix should allow hex values for colors.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Default BBCode formatting for user's posts (LITE VERSION) antialiasis vBulletin 3.5 Add-ons 22 01 May 2008 05:11
Default BBCode formatting for user's posts - FULL VERSION antialiasis vBulletin 3.5 Add-ons 14 02 Aug 2007 23:38

Comments
  #2  
Old 11 Jan 2005, 15:21
HarryBO HarryBO is offline
 
Join Date: Jan 2003
Nice One Ive installed it!
Reply With Quote
  #3  
Old 12 Jan 2005, 18:19
Troak Troak is offline
 
Join Date: Jan 2003
I'll have to take a look at this, I think some of my members wanted something like it.
Reply With Quote
  #4  
Old 13 Jan 2005, 15:30
Crapaddict Crapaddict is offline
 
Join Date: Oct 2004
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!
Reply With Quote
  #5  
Old 13 Jan 2005, 15:50
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Real name: Andy
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.
Reply With Quote
  #6  
Old 15 Jan 2005, 06:13
Darth Cow's Avatar
Darth Cow Darth Cow is offline
 
Join Date: Nov 2001
Originally Posted by Crapaddict
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!
I thought about this too, but I thought that such a modification would require saving the formatting in the database. Now, it occurs to me that I could simply strip out bb code immediately at the start and end of each post on display. I'll see if I can add this in.

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.
Reply With Quote
  #7  
Old 15 Jan 2005, 08:44
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Real name: Andy
Ok, my apologies - I didn't read the full hack description..
Reply With Quote
  #8  
Old 30 Jan 2005, 16:30
ZombieAndy's Avatar
ZombieAndy ZombieAndy is offline
 
Join Date: Oct 2004
Real name: Andy
would it be possible to make this work in a shoutbox aswell as on the forums?
Reply With Quote
  #9  
Old 30 Jan 2005, 17:24
KTBleeding's Avatar
KTBleeding KTBleeding is offline
 
Join Date: Feb 2004
Real name: Tyler
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.
Reply With Quote
  #10  
Old 31 Jan 2005, 03:29
ZombieAndy's Avatar
ZombieAndy ZombieAndy is offline
 
Join Date: Oct 2004
Real name: Andy
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?
Reply With Quote
  #11  
Old 02 Feb 2005, 03:42
carpefile carpefile is offline
 
Join Date: Jul 2004
Works great ! Thanx! My users love it. Any way to limit this to certain usergroups?
Reply With Quote
  #12  
Old 07 Feb 2005, 23:34
skinny skinny is offline
 
Join Date: Jan 2002
This works very well on 3.0.6. Thanks for the hack, only takes a few minutes to install also
Reply With Quote
  #13  
Old 14 Feb 2005, 01:09
carpefile carpefile is offline
 
Join Date: Jul 2004
Is there a way to make this an option rather than a requirement once installed?
I am having a problem with new people joining and that they must choose a default bbcode when registering. Some of them have no clue even what bbcode is, so its throwing a wrench into my board growing.

Many of my existing users love it to death, so I am hoping something can be done besides uninstalling it.
Reply With Quote
  #14  
Old 14 Feb 2005, 02:49
Darth Cow's Avatar
Darth Cow Darth Cow is offline
 
Join Date: Nov 2001
Originally Posted by carpefile
Is there a way to make this an option rather than a requirement once installed?
I am having a problem with new people joining and that they must choose a default bbcode when registering. Some of them have no clue even what bbcode is, so its throwing a wrench into my board growing.

Many of my existing users love it to death, so I am hoping something can be done besides uninstalling it.
Yes, edit the option and set "Field Required" to "No."

Limiting it to certain usergroups is beyond the scope of the built in vBulletin options for profile fields.

However, you can only choose to make it actual works for certain usergroups easilly.

Change the line at the end of my code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That should work. Just change 123 to the appropriate usergroup you want to enable it for.

As for not accepting hex values, let me fix that. Replace the regular expression with the updated one in the first post.
__________________
MTGnews.com Forums
Reply With Quote
  #15  
Old 19 Feb 2005, 11:44
Creed's Avatar
Creed Creed is offline
 
Join Date: May 2002
Real name: Daniel
Talking

This is what I did with mine, works like a charm, and is much easier on the end user:

I created two User Profile Fields:

Type: Single-Line Text Box
Title: Font Color
Description: Enter your preferred font color for each post
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No

Type: Singe Selection Menu
Title: Font Face
Description: Select your preferred font face for each post
Options:
{
Arial
Arial Black
Arial Narrow
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Fixedsys
Franklin Gothic Medium
Garamond
Georgia
Impact
Lucida Console
Lucida Sans Unicode
Microsoft Sans Serif
Palatino Linotype
System
Tahoma
Times New Roman
Trebuchet MS
Verdana
}
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No

Then in your functions_newpost file edit do this (where fieldx is the field number for font color, and fieldx2 is the field number for font face):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It is working absolutely flawlessly for me

Last edited by Creed; 20 Feb 2005 at 12:48.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 18:09.

Layout Options | Width: Wide Color: