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)

thincom2000 04-05-2007 05:26 AM

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') . '";');
        }
    } 


Tralala 04-05-2007 03:11 PM

Quote:

Originally Posted by thincom2000 (Post 1220164)
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:
https://vborg.vbsupport.ru/external/2007/04/25.jpg
Any way to get rid of that?

thincom2000 04-07-2007 03:36 PM

Quote:

Originally Posted by Tralala (Post 1220435)
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.

Tralala 04-07-2007 06:45 PM

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!

Tulsa 04-14-2007 02:27 AM

Quote:

Originally Posted by johnstires (Post 1170050)
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?

thincom2000 04-14-2007 03:24 PM

Quote:

Originally Posted by Tralala (Post 1222091)
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.

Tralala 04-14-2007 04:31 PM

Quote:

Originally Posted by thincom2000 (Post 1227516)
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.

thincom2000 04-14-2007 07:34 PM

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.

Makc666 04-18-2007 11:07 AM

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!

Abe1 04-18-2007 11:09 AM

Quote:

Originally Posted by Makc666 (Post 1230344)
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.


All times are GMT. The time now is 06:43 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.01437 seconds
  • Memory Usage 1,784KB
  • 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_php_printable
  • (6)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