vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Administrative and Maintenance Tools - Advanced BBCode Permissions (https://vborg.vbsupport.ru/showthread.php?t=122942)

inciarco 06-21-2009 10:57 PM

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.

:)

inciarco 06-24-2009 05:07 AM

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.

:)

inciarco 07-05-2009 05:13 PM

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.

:)

willy888 07-12-2009 07:26 AM

I think this mod must be update soon and insert in vb standard version

nightbloom 07-15-2009 11:43 PM

Quote:

Originally Posted by EcoCav (Post 1635120)
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. =(

|Jordan| 07-23-2009 03:46 PM

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).

inciarco 07-23-2009 06:27 PM

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 (Post 1854196)
--------------- 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:

:)


Sidane 07-29-2009 02:58 PM

Quote:

Originally Posted by |Jordan| (Post 1854235)
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...

crouzmind 07-30-2009 06:25 PM

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.

kent_lkc 08-02-2009 10:46 AM

work like a charm on 3.8.3. thanks.


All times are GMT. The time now is 09:11 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01336 seconds
  • Memory Usage 1,793KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete