vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Ban User from Specific BBCodes / Stop URL Spamming (https://vborg.vbsupport.ru/showthread.php?t=67645)

Michael Morris 07-25-2004 10:00 PM

Ban User from Specific BBCodes / Stop URL Spamming
 
Let's face it - some users are jerks when it comes to posting. They'll use 30 point fonts for the whole darn post or colors that are hard to read and when you ask them to please stop it, you get a cornball response equivalenting to a two-year-old's "I don't wanna, you can't make me!!"

Actually, with this hack you can.

As hacks go, this is one of the simplest that you may ever install but it has a lot of potential flexiability. Instead of holding hands and telling you to replace X with Y at each step, I'm going to tell you how to modify this hack to suit your needs depending on what you want. I promise to do my best at keeping the instructions clear even to those with no coding experience.

This hack can also be used in combination with vbulletin's inbuilt promotions feature to stop new users from using certain bbcodes - most prominently the URL code that spammers are prone to abuse.

This hack was tested on RC4 and gold (3.0.0)

Datenpapst 07-26-2004 01:16 PM

Quote:

Originally Posted by Michael_Morris
Let's face it - some users are jerks when it comes to posting. They'll use 30 point fonts for the whole darn post or colors that are hard to read and when you ask them to please stop it, you get a cornball response equivalenting to a two-year-old's "I don't wanna, you can't make me!!"

Actually, with this hack you can.

As hacks go, this is one of the simplest that you may ever install but it has a lot of potential flexiability. Instead of holding hands and telling you to replace X with Y at each step, I'm going to tell you how to modify this hack to suit your needs depending on what you want. I promise to do my best at keeping the instructions clear even to those with no coding experience.

This hack can also be used in combination with vbulletin's inbuilt promotions feature to stop new users from using certain bbcodes - most prominently the URL code that spammers are prone to abuse.

This hack was tested on RC4 and gold (3.0.0)

hmm turning it off by usergroup is nothing for me. Because creating a new group for some jerks? :(

Johnny 07-27-2004 12:42 PM

it seeems like a really cool hack that i wouldnt expected to be released, but this might come handy for me. thx

Keyser S?ze 09-04-2004 04:42 AM

yea, a definition of each would be great, like where the ilactic is, or bold

i got this one guy and hes for the most part fine, but he uses ilactic in every post, annoys me, id love to turn that off for him

thanks

-edit-

anyway to make it so they cant use ANY caps?

Computer Mutt 10-15-2004 01:02 AM

Whoo. Nice. I'll be using this a lot. Some... lots of people really ask for it.

http://www.uploadyourimages.com/img/666868tcmoff.png

Michael Morris 11-05-2004 09:00 AM

Quote:

Originally Posted by Me!
Only one problem I have. Could you please tell me where the img code is located? It doesn't seem to have it listed by itself. I tried disabling each code one-by-one to test (via admin panel) and I have just had no luck.

Thank you

Image Code can't be turned off this simply... But I think there's a way. Try this (Note I haven't tested this)...

Create a usergroup to ban from images and note the #

In /includes/functions_bbcodeparse.php search for this code:

PHP Code:

// ###################### Start bbcodeparse #######################
function parse_bbcode($bbcode$forumid 0$allowsmilie 1$isimgcheck 0$parsedtext ''$parsedhasimages 0$iswysiwyg 0)
{
    
// $parsedtext contains text that has already been turned into HTML and just needs images checking
    // $parsedhasimages specifies if the text has images in that need parsing

    
global $vboptions$parsed_postcache

Replace the last line (global $vboptions, $parsed_postcache;) with

PHP Code:

global $vboptions$parsed_postchace$bbuserinfo

Directly underneath add this code:

PHP Code:

$bannedfromimg 

X is the usergroup id you want banned from img code.

Search for this code

PHP Code:

    switch($forumid)
    {
        
// parse private message
        
case 'privatemessage':
            
$dohtml $vboptions['privallowhtml'];
            
$dobbcode $vboptions['privallowbbcode'];
            
$dobbimagecode $vboptions['privallowbbimagecode'];
            
$dosmilies $vboptions['privallowsmilies'];
            break;

        
// parse user note
        
case 'usernote':
            
$dohtml $vboptions['unallowhtml'];
            
$dobbcode $vboptions['unallowvbcode'];
            
$dobbimagecode $vboptions['unallowimg'];
            
$dosmilies $vboptions['unallowsmilies'];
            break;

        
// parse non-forum item
        
case 'nonforum':
            
$dohtml $vboptions['allowhtml'];
            
$dobbcode $vboptions['allowbbcode'];
            
$dobbimagecode $vboptions['allowbbimagecode'];
            
$dosmilies $vboptions['allowsmilies'];
            if (
$allowsmilie != 1)
            {
                
$dosmilies $allowsmilie;
            }
            break;

        case 
'announcement':
            global 
$post;
            
$dohtml $post['allowhtml'];
            if (
$dohtml)
            {
                
$donl2br 0;
            }
            
$dobbcode $post['allowbbcode'];
            
$dobbimagecode $post['allowbbcode'];
            
$dosmilies $allowsmilie;
            break;

        
// parse forum item
        
default:
            
$forum fetch_foruminfo($forumid);
            
$dohtml $forum['allowhtml'];
            
$dobbimagecode $forum['allowimages'];
            
$dosmilies $forum['allowsmilies'];
            if (
$allowsmilie != 1)
            {
                
$dosmilies $allowsmilie;
            }
            
$dobbcode $forum['allowbbcode'];
            break;
    } 

Replace with

PHP Code:


    
switch($forumid)
    {
        
// parse private message
        
case 'privatemessage':
            
$dohtml $vboptions['privallowhtml'];
            
$dobbcode $vboptions['privallowbbcode'];
            if (!
is_member_of($bbuserinfo$bannedfromimg))
            {
            
$dobbimagecode $vboptions['privallowbbimagecode'];
            }
            
$dosmilies $vboptions['privallowsmilies'];
            break;

        
// parse user note
        
case 'usernote':
            
$dohtml $vboptions['unallowhtml'];
            
$dobbcode $vboptions['unallowvbcode'];
            if (!
is_member_of($bbuserinfo$bannedfromimg))
            {
            
$dobbimagecode $vboptions['unallowimg'];
            }
            
$dosmilies $vboptions['unallowsmilies'];
            break;

        
// parse non-forum item
        
case 'nonforum':
            
$dohtml $vboptions['allowhtml'];
            
$dobbcode $vboptions['allowbbcode'];
            if (!
is_member_of($bbuserinfo$bannedfromimg))
            {
            
$dobbimagecode $vboptions['allowbbimagecode'];
            }
            
$dosmilies $vboptions['allowsmilies'];
            if (
$allowsmilie != 1)
            {
                
$dosmilies $allowsmilie;
            }
            break;

        case 
'announcement':
            global 
$post;
            
$dohtml $post['allowhtml'];
            if (
$dohtml)
            {
                
$donl2br 0;
            }
            
$dobbcode $post['allowbbcode'];
            
$dobbimagecode $post['allowbbcode'];
            
$dosmilies $allowsmilie;
            break;

        
// parse forum item
        
default:
            
$forum fetch_foruminfo($forumid);
            
$dohtml $forum['allowhtml'];
            if (!
is_member_of($bbuserinfo$bannedfromimg))
            {
            
$dobbimagecode $forum['allowimages'];
            }
            
$dosmilies $forum['allowsmilies'];
            if (
$allowsmilie != 1)
            {
                
$dosmilies $allowsmilie;
            }
            
$dobbcode $forum['allowbbcode'];
            break;
    } 

Backup your /includes/functions_bbcodeparse.php file before applying these changes as they are untested. They don't involve any queries so they can't cause any long term harm to your boards. Let me know if they work (they should unless I've missed something causing a parse error.

Jenta 05-08-2005 11:20 PM

i installed this but unless im misunderstanding something it only stops them from viewing bbcode
i ran a test account posted some bbcode. it didnt display for me under the test account
logged in normally and the bb code was parsed

tomshawk 07-04-2005 04:21 PM

Can someone update this for 3.0.7

It appears from the last couple of posts there are problems.

I dont want to disable bbcodes all together.

I just want a couple of user groups to not be able to post links in certain forums

YabbaDabba 08-07-2005 11:19 PM

vB 3.0.7

This would be brilliant of it would allow me to prevent a certain group from using certain BB codes. Most specifically, I would like to prevent new forum members from using the [url] and [img] tags.

Is this going to be updated?

TIA,

LEAD_WEIGHT 08-09-2005 07:34 PM

Well this would be great if I can use it for SWF. I would like it only the Admin. to be the only one to control this.


All times are GMT. The time now is 07:33 AM.

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.01215 seconds
  • Memory Usage 1,803KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete