Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

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
  #112  
Old 04-05-2007, 05:26 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This post explains how to make misc.php?do=bbcode reflect these permissions. Disallowed codes will not appear.

In misc.php, find:

PHP Code:
    $specialbbcode[] = array();

    
$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());

    
$bbcodes $db->query_read_slave("SELECT * FROM " TABLE_PREFIX "bbcode ORDER BY bbcodetag, twoparams");
    while (
$bbcode $db->fetch_array($bbcodes))
    {
        
$bbcode['output'] = $bbcode_parser->do_parse($bbcode['bbcodeexample'], falsefalsetruefalsetrue);

        
$bbcode['bbcodeexample'] = htmlspecialchars_uni($bbcode['bbcodeexample']);
        if (
$bbcode['twoparams'])
        {
            
$bbcode['tag'] = '[' $bbcode['bbcodetag'] . '=<span class="highlight">' $vbphrase['option'] . '</span>]<span class="highlight">' $vbphrase['value'] . '</span>[/' $bbcode['bbcodetag'] . ']';
        }
        else
        {
            
$bbcode['tag'] = '[' $bbcode['bbcodetag'] . ']<span class="highlight">' $vbphrase['value'] . '</span>[/' $bbcode['bbcodetag'] . ']';
        }

        (
$hook vBulletinHook::fetch_hook('misc_bbcode_bit')) ? eval($hook) : false;

        eval(
'$template[\'bbcodebits\'] .= "' fetch_template('help_bbcodes_bbcode') . '";');
        eval(
'$template[\'bbcodelinks\'] .= "' fetch_template('help_bbcodes_link') . '";');
    } 
Replace this segment with:
PHP Code:
    $specialbbcode[] = array();

    
$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());
    
$bbcode_parser->set_parse_userinfo($vbulletin->userinfo);

    
$bbcodes $db->query_read_slave("SELECT * FROM " TABLE_PREFIX "bbcode ORDER BY bbcodetag, twoparams");
    while (
$bbcode $db->fetch_array($bbcodes))
    {
        
$bbcode['output'] = $bbcode_parser->parse($bbcode['bbcodeexample'], 2); // , false, false, true, false, true);
        
$has_option $bbcode['twoparams'] ? "option" "no_option";

        if (
$bbcode_parser->tag_list["$has_option"]["$bbcode[bbcodetag]"])
        {
            
$bbcode['bbcodeexample'] = htmlspecialchars_uni($bbcode['bbcodeexample']);

            if (
$bbcode['twoparams'])
            {
                
$bbcode['tag'] = '[' $bbcode['bbcodetag'] . '=<span class="highlight">' $vbphrase['option'] . '</span>]<span class="highlight">' $vbphrase['value'] . '</span>[/' $bbcode['bbcodetag'] . ']';
            }
            else
            {
                
$bbcode['tag'] = '[' $bbcode['bbcodetag'] . ']<span class="highlight">' $vbphrase['value'] . '</span>[/' $bbcode['bbcodetag'] . ']';
            }

            (
$hook vBulletinHook::fetch_hook('misc_bbcode_bit')) ? eval($hook) : false;

            eval(
'$template[\'bbcodebits\'] .= "' fetch_template('help_bbcodes_bbcode') . '";');
            eval(
'$template[\'bbcodelinks\'] .= "' fetch_template('help_bbcodes_link') . '";');
        }
    } 
Reply With Quote
  #113  
Old 04-05-2007, 03:11 PM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thincom2000 View Post
This post explains how to make misc.php?do=bbcode reflect these permissions.
Thanks for this. I now see that the allowed codes do, in fact, show the "Example Output" properly... and the disallowed codes do not.

Is there a way to prevent the disallowed codes *from appearing at all?*



It also seemed to introduce a new "phantom" BBcode at the bottom of the list:

Any way to get rid of that?
Reply With Quote
  #114  
Old 04-07-2007, 03:36 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tralala View Post
Is there a way to prevent the disallowed codes *from appearing at all?*
Please see my above post again. I included the entire *find* code to clear up some problems you may be having.
Reply With Quote
  #115  
Old 04-07-2007, 06:45 PM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the edit, thincom2000. That took care of the "phantom" BBcode at the bottom of the list.

But I still have a disallowed code showing up on Registered Users' misc.php?do=bbcode page. The example output doesn't display... but the code is still listed there.

Anything else I can try? I appreciate all the help and sharing!
Reply With Quote
  #116  
Old 04-14-2007, 02:27 AM
Tulsa Tulsa is offline
 
Join Date: Jul 2005
Location: Broken Arrow, Oklahoma
Posts: 475
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by johnstires View Post
This mod conflicts with the news module for vba cmps. In the news module bbcode only gets parsed for the most recently entered thread. All other threads lose thier parsing. See here for an example:

http://www.prenatalyogacenter.com/cm...php?page=press

When I disable ABBcode the module works fine. Anyone know how to fix this?
Since I have this same issue, was there ever a solution to it?
Reply With Quote
  #117  
Old 04-14-2007, 03:24 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tralala View Post
But I still have a disallowed code showing up on Registered Users' misc.php?do=bbcode page.
What code is it?

Also not necessarily directed at you, but does anyone know what happens if we have more than 32 BB-codes? Integer overflow? I'm at 29 right now.
Reply With Quote
  #118  
Old 04-14-2007, 04:31 PM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thincom2000 View Post
What code is it?
This is one only allowed to Admins and mods:
https://vborg.vbsupport.ru/showthread.php?t=143468

And yet registered users still see it in that BBCode page. It just doesn't render an example. I'd rather that entry not appear at all, if that's possible.
Reply With Quote
  #119  
Old 04-14-2007, 07:34 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are using the most recent code above, this is only possible if the BB-code still exists in the tag list. The BB-Code permissions hack removes forbidden BB-codes from the list. If you are having issues on the misc.php?do=bbcode page after making my edit, then most likely these users will be able to post this parsed bb-code as well.

First test with other BB-codes to make sure it is an issue only with your iframe code.

Make sure your Registered Users definitely have this tag turned off. Make sure the user you are testing isn't a member of any groups that are allowed to use the tag.

Make sure you have under 32 BB-codes in the permissions list, since I believe strange behavior may occur beyond this number.

Make sure you only have one instance of the BB-code in the BB-code Manager. If you have a version that uses an option and one that doesn't, you can run into problems.
Reply With Quote
  #120  
Old 04-18-2007, 11:07 AM
Makc666's Avatar
Makc666 Makc666 is offline
 
Join Date: Dec 2002
Location: MSK-RU
Posts: 392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If will be wonderfull if there will be one more option in this mod.
If user is not allowed to use say bbcode [ B ] , then user is not allowed to EDIT post.
This one will be very-very cool!
Reply With Quote
  #121  
Old 04-18-2007, 11:09 AM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Makc666 View Post
If will be wonderfull if there will be one more option in this mod.
If user is not allowed to use say bbcode [ B ] , then user is not allowed to EDIT post.
This one will be very-very cool!
Make your own add on. This feature really has nothing to do with this hack.
Reply With Quote
Reply

Thread Tools

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 09:31 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.05068 seconds
  • Memory Usage 2,373KB
  • Queries Executed 29 (?)
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_php
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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