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
Ban Users from a Thread Details »»
Ban Users from a Thread
Version: 1.10, by MoMan MoMan is offline
Developer Last Online: Oct 2022 Show Printable Version Email this Page

Category: Moderators Functions - Version: 3.8.x Rating:
Released: 03-08-2011 Last Update: 04-04-2011 Installs: 64
DB Changes Uses Plugins Template Edits
Re-useable Code  
No support by the author.

This is a modification of AcidX's original "Ban Threads User" plugin for vBulletin 3.7. It has been for the most part rewritten with a focus on performance. Major changes include:

### VERSION HISTORY ###

1.0 (Initial Release)
1.1 (Added mod log actions, now fully phrased)

### FEATURES ###

This plugin allows moderators to ban users from individual threads. To ban a user, the appropriate option should be selected from the dropdown menu within the post. To unban, either clear all thread bans from the moderation tools menu, unban the user through the dropdown, or click on the username at the top of the thread.

Whenever you're viewing a thread from which users have been banned, a list of usernames will be shown at the top of the thread.

This plugin supports permanent bans as well as n-day bans. Valid durations for temporary bans are between 0 and 364 days. The default duration may be set in the "User Banning Options" page, but you can assign custom values by editing the actual ban url and pasting it in your browser.

Moderators will ONLY be able to use this feature in forums for which they can_moderate(). Super mods and admins will be able to use it in all forums.

### HOW THIS DIFFERS FROM THE ORIGINAL ###

*Big-board friendly: does not add any additional queries to showthread, doesn't do unnecessary computation, and stores ban data individually for each thread instead of globally in the datastore. Queries are only made when a user is being banned or unbanned; unserialization is only done if there are any bans within the thread.
*Support for expiring bans: you can choose to ban users permanently or for n days (default # of days is configurable via User Banning Options)
*Easy to oversee: banned usernames are shown at the top of the thread to moderators
*Flexible permissions: any moderator with permissions in a particular forum can use this facility. Not limited to admins or super mods.
*Removed the ability to clear all bans from all threads. If you really need to do this, simply uninstall and reinstall the plugin.
*Removed: global view of all thread bans. Not needed.

### INSTALLATION ###

-Import one product file
-Make 3 template edits

Tested on vBulletin 3.8.7, likely compatible with 3.6.x+, or 4.x with slight code changes.

Installation instructions are attached. Enjoy!

Download Now

File Type: zip ban_users_from_thread_BigBoard.zip (4.1 KB, 251 views)
File Type: zip Ban_Users_From_Thread_BigBoard_1.1.zip (4.7 KB, 522 views)

Screenshots

File Type: jpg ss1.jpg (63.1 KB, 0 views)
File Type: jpg ss2.jpg (40.9 KB, 0 views)
File Type: jpg ss3.jpg (49.2 KB, 0 views)

Show Your Support

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

Comments
  #32  
Old 07-24-2011, 01:19 PM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess you will have to open the php file in tapatalk responsible for adding new posts, and add a call to the newreply_start hook.

I knew that tapatalk was insecure, despite their claims that they go through the vb framework!
Reply With Quote
2 благодарности(ей) от:
AyCooper, cstreater
  #33  
Old 07-24-2011, 01:25 PM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just checked reply_post.php in tapatalk and they conveniently have the hook commented out on line 190...

Add this code if you want thread bans to work:

PHP Code:
    if (!empty($threadinfo['threadbans']))
    {
        
$btu unserialize($threadinfo['threadbans']);
        if (isset(
$btu[$vbulletin->userinfo['userid']]))
        {
        if (
$btu[$vbulletin->userinfo['userid']][1] == 0)
        {
            
$return = array(6,'invalid thread id');

            return 
return_fault($return);
        }
        elseif (
$btu[$vbulletin->userinfo['userid']][1] > TIMENOW)
        {
            
$return = array(6,'invalid thread id');

            return 
return_fault($return);
        }
        else
        {
            unset(
$btu[$vbulletin->userinfo['userid']]);
            
$vbulletin->db->query_write('UPDATE ' TABLE_PREFIX 'thread SET threadbans = \'' $vbulletin->db->escape_string(serialize($btu)) . '\' WHERE threadid = ' $threadinfo['threadid']);
        }
        }
    } 
Reply With Quote
  #34  
Old 07-25-2011, 06:46 AM
MajorFm.com MajorFm.com is offline
 
Join Date: Dec 2004
Location: UK
Posts: 402
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want something similar to this... but

I need a mod that:

1. Doesn't allow any members from usergroup x to see any threads on the forum accept ones from x forum

2. I want a mod that allows an admin to add users to specific threads through thread tools, only then can those users view those threads.

I know in edit permissions or permission masks, you can edit permissions on specific forums but i want this done through the forum and on threads, not forums.

Can someone help with this?
Reply With Quote
  #35  
Old 07-25-2011, 07:26 PM
Konstantinos Konstantinos is offline
 
Join Date: Apr 2006
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice but a global list of all users who have been banned from all threads is usefull, not the way the original mod used to display them.

but maybe in the Admin CP -> View Banned Thread Users or something similar
Reply With Quote
  #36  
Old 07-25-2011, 08:27 PM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Konstantinos View Post
nice but a global list of all users who have been banned from all threads is usefull, not the way the original mod used to dispay them.

but maybe in the Admin CP -> View Banned Thread Users or something similar
It's not a feature that's part of this mod, but there's a relatively efficient way of doing it- just use a query like this:

SELECT threadid, title, threadbans FROM " . TABLE_PREFIX . "thread WHERE threadbans != ''"

And then unserialize threadbans.
Reply With Quote
Благодарность от:
Konstantinos
  #37  
Old 07-30-2011, 03:50 AM
cstreater cstreater is offline
 
Join Date: May 2010
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MoMan -- thanks so much!! My mods were so excited when I installed this and were so upset when I uninstalled it. Now all will be good again
Reply With Quote
  #38  
Old 08-23-2011, 06:58 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I make it so only admins can ban users from a thread?
Reply With Quote
  #39  
Old 08-30-2011, 12:31 AM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the threadmanage_start hook, change

PHP Code:
if (!can_moderate($forumid))

    { 

        
print_no_permission();

    } 
to

PHP Code:
if (!is_member_of($vbulletin->userinfo6))

    { 

        
print_no_permission();

    } 
Reply With Quote
  #40  
Old 07-04-2013, 07:27 AM
viper357's Avatar
viper357 viper357 is offline
 
Join Date: Dec 2006
Location: Worthing, UK
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoMan View Post
I just checked reply_post.php in tapatalk and they conveniently have the hook commented out on line 190...

Add this code if you want thread bans to work:

PHP Code:
    if (!empty($threadinfo['threadbans']))
    {
        
$btu unserialize($threadinfo['threadbans']);
        if (isset(
$btu[$vbulletin->userinfo['userid']]))
        {
        if (
$btu[$vbulletin->userinfo['userid']][1] == 0)
        {
            
$return = array(6,'invalid thread id');

            return 
return_fault($return);
        }
        elseif (
$btu[$vbulletin->userinfo['userid']][1] > TIMENOW)
        {
            
$return = array(6,'invalid thread id');

            return 
return_fault($return);
        }
        else
        {
            unset(
$btu[$vbulletin->userinfo['userid']]);
            
$vbulletin->db->query_write('UPDATE ' TABLE_PREFIX 'thread SET threadbans = \'' $vbulletin->db->escape_string(serialize($btu)) . '\' WHERE threadid = ' $threadinfo['threadid']);
        }
        }
    } 
Thanks for this. Where must this code be placed? Anywhere in the file? Thanks.
Reply With Quote
  #41  
Old 08-04-2013, 08:32 PM
Donkey11 Donkey11 is offline
 
Join Date: Apr 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And how can you make a lock to be able to read this topic, but could not write with the withdrawal of the notification banning.???

Help
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 09:27 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.11956 seconds
  • Memory Usage 2,388KB
  • Queries Executed 26 (?)
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
  • (4)bbcode_php
  • (2)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (7)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (5)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