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

Reply
 
Thread Tools
LAM - Ban From Thread Details »»
LAM - Ban From Thread
Version: 4.1.3.1, by mawby mawby is offline
Developer Last Online: Jul 2020 Show Printable Version Email this Page

Category: Moderators Functions - Version: 4.1.2 Rating:
Released: 05-03-2011 Last Update: 05-05-2011 Installs: 115
DB Changes Uses Plugins Template Edits
Re-useable Code Translations  
No support by the author.

This product will allow you to ban someone from a thread so they cannot reply to it or, depending on the configuration, they cannot even view its contents.

On my site we have some people who like to stir things up when they see threads about a certain subject. Their replies aren't worthy of an outright ban but they can be very annoying and disrupt the flow of the thread. Rather than leaving up to the moderators to keep deleting the posts and warning the poster, this product puts a stop to the problem by allowing moderators to lock people out of a thread as needed.

As of version 4.1.3.1 it is now possible to specify user groups that can use this product even if they don't have moderator rights over the forum the thread is in. It is also possible to quickly unban people who have already posted to the thread. And there is a new option to allow bans to be set at the forum level.

Tapatalk Users - Please see this important note about Tapatalk support.


Installation
  1. Download the attached .xml file
    product-LAM_BanFromThread.xml
  2. Install the product
    AdminCP -> Plugins & Products -> Add/Import Product -> Import Product
  3. Edit the "FORUMDISPLAY" template
    Code:
    Find...
    					<vb:if condition="$show['post_new_announcement']">
    					<li><a href="moderator.php?{vb:raw session.sessionurl}do=postannouncement&amp;f={vb:raw foruminfo.forumid}" rel="nofollow">{vb:rawphrase post_new_announcement}&hellip;</a></li>
    					</vb:if>
    
    Add below it...
    <vb:if condition="$vboptions['LAM_BanFromThread_ForumBans']">
    <li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}postings.php?{vb:raw session.sessionurl}do=LAM_BanFromThread_Forum&amp;f={vb:raw foruminfo.forumid}">{vb:rawphrase LAM_BanFromThread_ForumTitle}&hellip;</a></li>
    </vb:if>
  4. Edit the "SHOWTHREAD" template
    Code:
    Find...
    					<vb:if condition="$show['addpoll']">
    						<li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}poll.php?{vb:raw session.sessionurl}do=newpoll&amp;t={vb:raw threadid}">{vb:rawphrase add_a_poll_to_this_thread}&hellip;</a></li>
    					</vb:if>
    
    Add below it...
    <vb:if condition="!empty($vboptions['LAM_BanFromThread_UserGroups']) AND in_array($bbuserinfo['usergroupid'], array($vboptions['LAM_BanFromThread_UserGroups']))">
    <li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}postings.php?{vb:raw session.sessionurl}do=LAM_BanFromThread&amp;t={vb:raw threadid}">{vb:rawphrase LAM_BanFromThread_Title}&hellip;</a></li></vb:if>
    
    Find...
    <li><label><input type="radio" name="do" value="removeredirect" tabindex="9" /> {vb:rawphrase remove_redirects}</label></li>
    
    Add below it...
    <li><label><input type="radio" name="do" value="LAM_BanFromThread" tabindex="10" /> {vb:rawphrase LAM_BanFromThread_Title}&hellip;</label></li>
    
    Find...
    <li><label><input type="radio" name="do" value="clearpost" tabindex="42" /> {vb:raw vbphrase.clear_post_list}</label></li>
    
    Add below it...
    <li><label><input type="radio" name="do" value="LAM_BanFromThread" tabindex="43" /> {vb:rawphrase LAM_BanFromThread_Title}</label></li>
    <li><label><input type="radio" name="do" value="LAM_BanFromThread_Undo" tabindex="44" /> {vb:rawphrase LAM_BanFromThread_UndoTitle}</label></li>


Configuration

There are various configuration settings that allow you to customise how this product works...



Thread Creation Bans Enabling this allows the thread creator to specify a list of banned users as the thread is being created. This is the only time a non-moderator is able to ban someone from a thread and the following option will appear if enabled...



Show Banned Users Enabling this will display a banner at the top of the thread listing all of the users who are banned from that thread, for example...



Show Banned Users (Mods Only) Enabling this will display the same banner as above but only if the person viewing the thread is a moderator of the forum the thread is in.

Prevent Viewing Enabling this will attempt to stop the person who is banned from a thread from being able to view the contents of that thread. If they attempt to open the thread, or view the preview text, they will get...




Logout Protection This works in conjunction with the "Prevent Viewing" option, and enabling this will prevent users not logged into your forums from being able to view the thread if anyone is banned from it. This is to stop someone who is banned from a thread simply logging out of your forums to bypass the ban by viewing the thread as a guest.

Allow Forums Bans This allows users to be banned from a forum. Once ban they cannot reply to (or view if "Prevent Viewing" is enabled) any thread in that forum. They will also be prevented from creating new threads in that forum. This setting wont propagate down to sub-forums. There is no forum banner showing who is banned at forum level, however all forum level bans will appear in the thread banner (if enabled) when viewing a thread in that forum.

User Groups Optional comma separated list of user group IDs who will have access to this products functionality even if they don't have moderator permissions over the thread. This option will also restrict which users can use the "Thread Creation Bans" feature.


Example

If a moderator wants to ban someone from a thread then they have two options...



The option under the "Moderators Tools" menu will ban the users of any selected posts. This allows quick banning of people who have already replied to the thread.

The option under the "Administrative" menu will bring up the following screen which will allow the moderator to enter the names of users they want banned, allowing pre-emptive banning of people you know are going to cause trouble in a thread! This screen is also the only way people can be unbanned from a thread.




Version History

4.1.3.1 - Forum level bans, unban and user group settings (2011/05/04)
4.1.3.0 - Initial release (2011/05/04)

German Translation: http://www.vbulletin-germany.org/sho...Forenbans-quot

Download Now

File Type: xml product-LAM_BanFromThread.xml (33.7 KB, 408 views)

Screenshots

File Type: png AdminCP.png (55.4 KB, 0 views)
File Type: png BanNotice.png (7.8 KB, 0 views)
File Type: png ModOptions.png (22.2 KB, 0 views)
File Type: png NewThread.png (7.6 KB, 0 views)
File Type: png NotAllowed.png (3.2 KB, 0 views)
File Type: png PreviewText.png (3.3 KB, 0 views)
File Type: png ModBan.png (7.2 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
nacaruncr

Comments
  #22  
Old 06-06-2011, 12:02 AM
sticky sticky is offline
 
Join Date: Sep 2003
Posts: 934
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Konkere View Post
mawby maybe it will be interesting to you.
If user has participated in the topic but then was banned, he still has the ability to edit your post in topic.
To avoid this, I added a new plugin.

Product: LAM - Ban From Thread
Hook Location: editpost_start
Title: LAM - No Permission Message (Edit Post)
Execution Order: 5
Plugin is Active: Yes
Plugin PHP Code:
PHP Code:
if (!can_moderate($threadinfo['forumid']) AND (($threadinfo['LAM_BanFromThread'] AND in_array($vbulletin->userinfo['userid'], preg_split('#\s*,\s*#s'$threadinfo['LAM_BanFromThread'], -1PREG_SPLIT_NO_EMPTY))) OR ($vbulletin->options['LAM_BanFromThread_ForumBans'] AND $foruminfo['LAM_BanFromThread'] AND in_array($vbulletin->userinfo['userid'], preg_split('#\s*,\s*#s'$foruminfo['LAM_BanFromThread'], -1PREG_SPLIT_NO_EMPTY))))) {
        eval(
standard_error(fetch_error('LAM_BanFromThread_NoPermission')));

Another small improvement.
To enable topicstarter edit banlist.
Edit the SHOWTHREAD template...
Find:
Code:
<vb:if condition="!empty($vboptions['LAM_BanFromThread_UserGroups']) AND in_array($bbuserinfo['usergroupid'], array($vboptions['LAM_BanFromThread_UserGroups']))">
and replace:
Code:
<vb:if condition="(!empty($vboptions['LAM_BanFromThread_UserGroups']) AND in_array($bbuserinfo['usergroupid'], array($vboptions['LAM_BanFromThread_UserGroups']))) OR ($threadinfo['postuserid'] == $bbuserinfo['userid'])">
In plugin "LAM - Perform Thread Manage Actions"
find:
PHP Code:
if ($_REQUEST['do'] == 'LAM_BanFromThread') {

    if (!
can_moderate($threadinfo['forumid'], 'canmanagethreads') AND (empty($vbulletin->options['LAM_BanFromThread_UserGroups']) OR !in_array($vbulletin->userinfo['usergroupid'], preg_split('#\s*,\s*#s'$vbulletin->options['LAM_BanFromThread_UserGroups'], -1PREG_SPLIT_NO_EMPTY)))) {
        
print_no_permission();
    } 
and replace:
PHP Code:
if ($_REQUEST['do'] == 'LAM_BanFromThread') {

    if ((!
can_moderate($threadinfo['forumid'], 'canmanagethreads') AND (empty($vbulletin->options['LAM_BanFromThread_UserGroups']) OR !in_array($vbulletin->userinfo['usergroupid'], preg_split('#\s*,\s*#s'$vbulletin->options['LAM_BanFromThread_UserGroups'], -1PREG_SPLIT_NO_EMPTY)))) AND ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'])) {
        
print_no_permission();
    } 
find:
PHP Code:
} elseif ($_POST['do'] == 'LAM_BanFromThread_Update') {

    if (!
can_moderate($threadinfo['forumid'], 'canmanagethreads') AND (empty($vbulletin->options['LAM_BanFromThread_UserGroups']) OR !in_array($vbulletin->userinfo['usergroupid'], preg_split('#\s*,\s*#s'$vbulletin->options['LAM_BanFromThread_UserGroups'], -1PREG_SPLIT_NO_EMPTY)))) {
        
print_no_permission();
    } 
and replace:
PHP Code:
} elseif ($_POST['do'] == 'LAM_BanFromThread_Update') {

    if ((!
can_moderate($threadinfo['forumid'], 'canmanagethreads') AND (empty($vbulletin->options['LAM_BanFromThread_UserGroups']) OR !in_array($vbulletin->userinfo['usergroupid'], preg_split('#\s*,\s*#s'$vbulletin->options['LAM_BanFromThread_UserGroups'], -1PREG_SPLIT_NO_EMPTY)))) AND ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'])) {
        
print_no_permission();
    } 
Very nice.
Reply With Quote
  #23  
Old 06-12-2011, 04:18 AM
rasp187 rasp187 is offline
 
Join Date: Dec 2005
Location: Ohio
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason when I try to create a thread, it doesn't give me a box to ban specific users from it. I have to create the thread THEN ban them via the inline moderation dropdown. Any ideas?
Reply With Quote
  #24  
Old 06-12-2011, 10:02 AM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Probably you didn't set it up properly? Check your settings, did you enable user banning when thread is started and how did you setup usergroups able to do this?
Reply With Quote
  #25  
Old 06-12-2011, 02:03 PM
rasp187 rasp187 is offline
 
Join Date: Dec 2005
Location: Ohio
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Alan_SP View Post
Probably you didn't set it up properly? Check your settings, did you enable user banning when thread is started and how did you setup usergroups able to do this?
lol you're right, I didn't have it selected at the top
Reply With Quote
  #26  
Old 06-12-2011, 06:49 PM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Konkere View Post
mawby maybe it will be interesting to you.
It does indeed. I'll get these added into the next release. :up:
Reply With Quote
  #27  
Old 06-13-2011, 09:59 PM
Prisoner Prisoner is offline
 
Join Date: Aug 2005
Location: Central Texas
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to make it so that the banned user cannot see the thread in the thread listing?

There will be fewer problems for me if the banned user doesn't even know it exists.
Reply With Quote
  #28  
Old 06-14-2011, 12:53 PM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look at the image of admincp options. You'll see there an option called prevent viewing. Read its description, this is your answer.
Reply With Quote
  #29  
Old 06-14-2011, 10:19 PM
S3Ponline S3Ponline is offline
 
Join Date: May 2010
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mawby View Post
It does indeed. I'll get these added into the next release. :up:
This is looking very good.

Can you make it so that members can ban users from their own threads that they have started? This would be an excellent feature to give subscribers.
Reply With Quote
  #30  
Old 06-15-2011, 07:27 AM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Users already can do that when they are starting thread. After that only moderators can do that.
Reply With Quote
  #31  
Old 06-16-2011, 01:24 PM
S3Ponline S3Ponline is offline
 
Join Date: May 2010
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Alan_SP View Post
Users already can do that when they are starting thread. After that only moderators can do that.
Wait, what?

Users can already ban members from their threads? You sure this is a default vbulletin option?
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:33 PM.


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.05473 seconds
  • Memory Usage 2,393KB
  • 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_code
  • (5)bbcode_php
  • (5)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
  • (11)post_thanks_box
  • (1)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
  • (8)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