vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Moderators Functions - LAM - Ban From Thread (https://vborg.vbsupport.ru/showthread.php?t=263142)

sticky 06-06-2011 12:02 AM

Quote:

Originally Posted by Konkere (Post 2203956)
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.

rasp187 06-12-2011 04:18 AM

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?

Alan_SP 06-12-2011 10:02 AM

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?

rasp187 06-12-2011 02:03 PM

Quote:

Originally Posted by Alan_SP (Post 2206568)
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 :o

mawby 06-12-2011 06:49 PM

Quote:

Originally Posted by Konkere (Post 2203956)
mawby maybe it will be interesting to you.

It does indeed. I'll get these added into the next release. :up:

Prisoner 06-13-2011 09:59 PM

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.

Alan_SP 06-14-2011 12:53 PM

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.

S3Ponline 06-14-2011 10:19 PM

Quote:

Originally Posted by mawby (Post 2206774)
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.

Alan_SP 06-15-2011 07:27 AM

Users already can do that when they are starting thread. After that only moderators can do that.

S3Ponline 06-16-2011 01:24 PM

Quote:

Originally Posted by Alan_SP (Post 2207964)
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?


All times are GMT. The time now is 05:08 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.01527 seconds
  • Memory Usage 1,771KB
  • 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_code_printable
  • (5)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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