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

Reply
 
Thread Tools
Advanced BBCode Permissions Details »»
Advanced BBCode Permissions
Version: 3.0, by Abe1 Abe1 is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.6.8 Rating:
Released: 08-02-2006 Last Update: 08-24-2006 Installs: 631
DB Changes Uses Plugins
 
No support by the author.

Advanced BBCode Permissions 3.0



About this hack:
This hack will give you advanced control on BBCode. You will be able to define for each usergroup what BBCode they may or may not use. This hack works for both standard AND custom BB code!

Installation information on hack:
  • Files edited: 0
  • Templates edited: 0
  • Files to upload: 0
  • Time to install: 10 seconds max
Updates:

Version 3.0 (08/03/06):
  • Initial release of this hack for vb 3.6
  • [CHANGED] Re-did the way the permissions are stored to fix a lot of bugs.

Beta test version 4.0 here: https://vborg.vbsupport.ru/showthread.php?p=1159541

Please post your comments or suggestions for this hack. I read ALL posts.

MAKE SURE YOU CLICK INSTALL!
You will get an email when a new version is released.

This hack is created for your use free of charge. No payment is requested. However, if you would like to donate money for the work I put in to this hack, a donation would show your appreciation.

Download Now

File Type: zip advanced_bbcode_permissions_3_0.zip (3.1 KB, 3325 views)

Screenshots

File Type: jpg image.JPG (41.7 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
goxy63, TAIFUN_T

Comments
  #242  
Old 06-21-2009, 10:57 PM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I Noticed that When You Activate the Mod for Usergroup 6 (Admin), the Basic BBCodes get Deactivated for Guests even if the Mod is Not Set to be Active for that Usergroup, (Bold, Size, Font, etc), so there should be some Code Lines that need to be Changed to Work on vB373 PL1.

Until a Solution can be Made by the Author, perhaps this can be Useful for some of You, (took me almost all day to Search for it).

Only Step:

You need to Create a Plugin:

Product: vBulletin
Hook Place: bbcode_parse_start
Title: BBCode Permissions For Usergroups - bbcode_parse_start
(or any you like)
Execution Order: 5
Plugin Active: Yes
PHP Code:

Quote:
if (is_member_of($this->registry->userinfo, 1,3,4,8))

{

unset($this->tag_list['no_option']['nameofbbcodetag1'], $this->tag_list['option']['nameofbbcodetag1']);


}
-1. You need to Change the nameofbbcodetag1 to the name of the Tag you need to Disable, like youtube, in Lowercase, and also the BBCode Tag Name should be in Lowercase.

-2. If you want to Disable another Tag, simply Copy the Following Code as many Tags you wish to Disable.

Quote:
unset($this->tag_list['no_option']['nameofbbcodetag1'], $this->tag_list['option']['nameofbbcodetag1']);
-3. For the Usergroups, you can see that I've Set 1,3,4,8, to be affected, but you can Choose the Usergroups that you Desire.

-4. To set another Rules for Disabling BBCode Tags for other Usergroup(s), simply Copy all the Code Below the Existing One in the same Plugin, and set the Usergroups and the Name of the BBCode Tags in the Code Line that I mentioned Above, for as many BBCode Tags as you need for those Specific Usergroups.

An so on, you can set Different Permissions for Different Usergroups.


This is a Way Around, but it Works. If somebody has a Better Solution, please Share it.

I Hope Abe1 can Share With Us an Update of this Great Mod compatible with vB373 PL1 and vB37x, because is very nice to be able to Select the Options for Each Usergroup and the Mod does.

My Best Regards.

Reply With Quote
  #243  
Old 06-24-2009, 05:07 AM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This Can be Useful Too, for Users that are Searchig to Disable Images in the Posts but Not Links for Certain Usergroups.

I searched for it on the Forum, but there was No Answer for this, so I guess it'll be Useful for some of You.

I Just did a Little Research on a Mod from Cybernetec "Advanced Permissions Based on Post Count", and Found on the Plugin "Cyb - APBOUPC - P2 (PB)", the Code needed to Disable Images and Links in Posts and in Signatures; I Edited the Code to Leave Only the Code Lines to Remove Images but Leave the Links, (it was an Test and Error process because I'm not a Coder), and I Found that it can be done with the Help of that Useful Code from Cybernetec, (all Credits are His).

Only Step:

Create a Plugin.

Product: vBulletin
Hook Place: postbit_display_complete
Title: BBCode Permissions For Usergroups - IMG - postbit_display_complete
(or the Title that you wish)
Plugin Active: Yes
PHP Code:

Code:
if (is_member_of($this->registry->userinfo, 1,3,4,8))

{


					$this->post['message'] = preg_replace('!(\\[img)(.*)(\\[\/img\\])|<img[^>]*(src|border|title)(.*)(</img>|\/>)|[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b!siU', construct_phrase('<br /><span class="smallfont"><i>'.'[[To See Images in Posts You Must Register and Activate Your Account]]'.'</i></span><br />', $forum[linkview_nb], $cyb_apboupc_viewlinks_userpostsnr), $this->post['message'].' ');


}
-1. Edit the usergroups 1,3,4,8 for the Ones You Wish that Can't See Images.

-2. Edit the Text of [[To See Images in Posts You Must Register and Activate Your Account]], to the One you Wish Users of those Usergroups to See instead of the Images.

That's it. Enjoy.

My Best Regards.

Reply With Quote
  #244  
Old 07-05-2009, 05:13 PM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've Just Figured that the Previous Code for the BBCodes is for Disabling the Parsing Options when the BBCode is Being Posted, but Not to Avoid Viewing it; to Disable the Display of Custom BBCodes on Posts you should do the Following.

There should be some Extra Code that can be Removed from the Following Code Lines, but as I'm Not a Coder I Can't Optimize it; if You Find a Way to Remove the Extra Code that isn't needed, it'll be Just Great that You Post Your Solution Here for Everybody to Benefit.

First Step:

First You Need to Add at the Beginning of Each Custom BBCode You Wish to Restrict Viewind/Displaying the Following Text

Quote:
<div id="private_bbcode">
and Add at the End of Each Custom BBCode You Added the Previous "div" Opening Tag Code.

Quote:
</div>
to Close the "div" Tag.

Again, this Uses a small part of the Code of the Mod from Cybernetec "Advanced Permissions Based on Post Count", and Found on the Plugin "Cyb - APBOUPC - P2 (PB)", the Code needed to Disable Images and Links in Posts and in Signatures; I Edited the Code to Leave Only the Code Lines to Remove BBCodes, (it was an Test and Error process because I'm not a Coder), and I Found that it can be done with the Help of that Useful Code from Cybernetec, (all Credits are His).

This Can be Included in the Plugin I Posted Just Above "BBCode Permissions For Usergroups - IMG - postbit_display_complete", because it uses the same vBulletin Hook.

Second Step:

Create a Plugin.

Product: vBulletin
Hook Place: postbit_display_complete
Title: BBCode Permissions For Usergroups - Custom BBCodes - postbit_display_complete
(or the Title that you wish)
Plugin Active: Yes
PHP Code:

Code:
if (is_member_of($this->registry->userinfo, 1,3,4,8))

{


					$this->post['message'] = preg_replace('!(<div id="private_bbcode">)(.*)(<\/div>)|[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b!siU', construct_phrase('<br />[[To See BbCodes in Posts You Must Register and Activate Your Account]]<br />', $forum[linkview_nb], $cyb_apboupc_viewlinks_userpostsnr), $this->post['message'].' ');


}
-1. Edit the usergroups 1,3,4,8 for the Ones You Wish that Can't See Custom BBCodes.

-2. Edit the Text of [[To See BBCodes in Posts You Must Register and Activate Your Account]], to the One you Wish Users of those Usergroups to See instead of the Custom BBCodes.

That's it. Enjoy.

My Best Regards.

Reply With Quote
  #245  
Old 07-12-2009, 07:26 AM
willy888 willy888 is offline
 
Join Date: Apr 2006
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think this mod must be update soon and insert in vb standard version
Reply With Quote
  #246  
Old 07-15-2009, 11:43 PM
nightbloom's Avatar
nightbloom nightbloom is offline
 
Join Date: Mar 2008
Location: Whidbey Island, WA
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EcoCav View Post
I am still unable to to use any BB code in my chat box (cyb chatbox). if I disable this plugin my chatbox works fine. Some help would be nice...
Sadly I used this on an older version of my forum and wanted to reinstitute it for a current project but the incompatibility with the chat box stopped that. My users would lynch me for taking away their chatbox.

I didnt see a work around for the Cyb chatbox either. =(
Reply With Quote
  #247  
Old 07-23-2009, 03:46 PM
|Jordan|'s Avatar
|Jordan| |Jordan| is offline
 
Join Date: Nov 2004
Posts: 479
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any chance this can mod can be updated for 3.8.x ? When i had it enabled i had weird problems where randomly bbcode wouldn't parse (tags would be visible).
Reply With Quote
  #248  
Old 07-23-2009, 06:27 PM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A Interesting Way to Hide Images and Display Only Smilies, From Thread "preg_replace - Exclude Text in Search Code Line".

Quote:
Originally Posted by inciarco View Post
--------------- Added [DATE]1248376965[/DATE] at [TIME]1248376965[/TIME] ---------------

I'd like to Share a Solution I Found for the Previously Explained Problem; now the Images are Replaced by a Text and the Smilies and other Images on the image Folder are being Displayed. :up:

On the File /includes/class_postbit.php

you should add at the End of it, right after the "}" of the Last Function:

PHP Code:
// #############################################################################

function check_img_src($tag$src


$whitelisted = array( 
                
'website.com/forum/images'
                
'website.com/forum/location2',
                
'website.com/forum/location3',
                ); 

        foreach (
$whitelisted as $bl
        { 
            if (
strstr($src$bl)) 
            { 
                return 
stripslashes($tag); 
            } 
        } 

        return 
'Text Or Code Displayed Instead Of The Images Inserted With IMG Tag';


You Should Create a Plugin as Follows:

Product: vBulletin
Hook Location: postbit_display_complete
Title: IMG BBCode Permissions For Usergroups - postbit_display_complete
(or the one you wish)
Execution Order: 5
Active Plugin: Yes

PHP Code:

PHP Code:
if (is_member_of($this->registry->userinfo1,3,4,8))

{


$this->post['message'] = preg_replace("#(<img[^>](.*)(</img>|\/>))#e""check_img_src('\\1', '\\2')"$this->post['message']);  



You can Replace the 1,3,4,8 with the Usergroup Numbers you wish the Images Not to be Displayed, but Yes the Smilies.

And Thats It... Enjoy.

My Best Regards.



--------------- Added [DATE]1248377122[/DATE] at [TIME]1248377122[/TIME] ---------------

I Appreciate the Help of Deceptor for Providing the Code I Could Take as a Great Idea to Edit and Post my Solution, and to Dismounted who gave me on his Post the Idea to Include the Function in the php File. :up:

Of course, if you could share a Better Way to do this I'd appreciate it a Lot.

My Best Regards to Both of You. :up:

Reply With Quote
  #249  
Old 07-29-2009, 02:58 PM
Sidane Sidane is offline
 
Join Date: Jan 2003
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by |Jordan| View Post
Any chance this can mod can be updated for 3.8.x ? When i had it enabled i had weird problems where randomly bbcode wouldn't parse (tags would be visible).
I'll echo this - I could make great use of this mod if it was 3.8 compatible...
Reply With Quote
  #250  
Old 07-30-2009, 06:25 PM
crouzmind's Avatar
crouzmind crouzmind is offline
 
Join Date: Feb 2009
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can i use this on vbulletin 3.8.1 if i cant then please attach the mode for vbulletin 3.8.1 coz i need it urgently.
Reply With Quote
  #251  
Old 08-02-2009, 10:46 AM
kent_lkc kent_lkc is offline
 
Join Date: Feb 2009
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

work like a charm on 3.8.3. thanks.
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 11:14 AM.


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.11090 seconds
  • Memory Usage 2,377KB
  • Queries Executed 27 (?)
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
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete