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)

mawby 05-05-2011 04:24 PM

Quote:

Originally Posted by sticky (Post 2191990)
Is it possible to specify only certain usergroups can use the ban from thread feature? For example, I would like to allow my vendors to use this to keep fanboys out of certain threads.

On my forum my vendors have their own sections which they have mods rights over, so this product works for them already. Getting the creation time bans working with a user group list is trivial, but for the menu option I'd have to add a new item under the "Thread Tools" menu as the other two menus currently used won't be available to non-mods. Would this be OK?

Quote:

Originally Posted by sticky (Post 2191990)
Additionally, I take it mods and admins are exempt?

They can be added to the ban list but it won't ban them as the moderator permission check overrides the ban list check.

Quote:

Originally Posted by doopz (Post 2192156)
Do you have any plans to build in a feature that people get a PM when they are banned from a thread?

Leave it with me and I'll see what I can do.

Quote:

Originally Posted by GeorgeB85 (Post 2192255)
One suggestion in case someone makes a mistake, it to have an unban option!

People can be unbanned from the option on the Administrative Tools menu. Thinking about it, it wouldn't be difficult to add an unban option to the Moderation Tools menu too, so the owners of any selected posts can be unbanned quickly.

I've also had a request from a moderator on my site to allow bans at forum level too so I'll see if I can get that into the next version whilst I'm at it.

mawby 05-06-2011 01:29 PM

1 Attachment(s)
I've just updated the product. There is now an option to allow users to be banned from an entire forum using a new "Ban From Forum" option on the forum's Administrative menu. This is only available to users who have moderator rights over the forum.

There is now an option to unban from the Moderation Tools menu. This will unban users of the selected posts.

There is also a user groups setting which will allow non-moderators to access this product from a new menu item on the "Thread Tools" menu, plus it will restrict who can use the creation time bans - if enabled.

I didn't get time to look at the PM option.

https://vborg.vbsupport.ru/attachmen...1&d=1304692114

Upgrade Instructions

1) Install the new product file
2) 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>
                                       
After it add...
<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>

3) 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>
                                       
After it add...
<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="LAM_BanFromThread" tabindex="43" /> {vb:rawphrase LAM_BanFromThread_Title}</label></li>

After it add...
<li><label><input type="radio" name="do" value="LAM_BanFromThread_Undo" tabindex="44" /> {vb:rawphrase LAM_BanFromThread_UndoTitle}</label></li>


sticky 05-08-2011 03:07 AM

Quote:

Originally Posted by mawby (Post 2192321)
On my forum my vendors have their own sections which they have mods rights over, so this product works for them already. Getting the creation time bans working with a user group list is trivial, but for the menu option I'd have to add a new item under the "Thread Tools" menu as the other two menus currently used won't be available to non-mods. Would this be OK?

Absolutely, that would be fine.

I have a vendor section as well but I have premier sponsors who are allowed to create threads wherever they like. So, this ability would really come in handy for them.

Alan_SP 05-19-2011 05:01 PM

This mod is global and this is fine for moderators to ban users from threads.

But, for users to be able to ban other users, I would like it to be forum specific. Is it possible to leave it global for moderators and enable it for users only in certain forums? And would this work in this way with your dispute mod? If same forum is used for disputes and for this mod?

Not in the same thread, but in the same forum.

treefrog 05-23-2011 11:04 AM

Does this work in the mobile styles too? I changed the code as required for the main style that people use...but didn't see the code in the mobile one. Do I need to change the code in the original vBulletin style?

mawby 05-25-2011 11:36 AM

Quote:

Originally Posted by Alan_SP (Post 2197653)
This mod is global and this is fine for moderators to ban users from threads.

But, for users to be able to ban other users, I would like it to be forum specific. Is it possible to leave it global for moderators and enable it for users only in certain forums? And would this work in this way with your dispute mod? If same forum is used for disputes and for this mod?

Not in the same thread, but in the same forum.

OK I understand. That wont be too difficult. Leave it with me and I'll see what I can do.

The two mods should definitely work side by side even in the same forum.

Alan_SP 05-26-2011 02:57 AM

Thanks. Just to clarify, when users create thread in certain forums, they could ban unwanted users from their threads. If it's possible, include option that banning when creating threads be global too for those of us who use it this way.

I already have forum set for private threads where users can create their own private discussions. Now it would be a new type of private thread, where they can ban only certain users from their threads. :up:

sticky 05-30-2011 01:28 AM

Quote:

Originally Posted by Alan_SP (Post 2200061)
Thanks. Just to clarify, when users create thread in certain forums, they could ban unwanted users from their threads. If it's possible, include option that banning when creating threads be global too for those of us who use it this way.

I already have forum set for private threads where users can create their own private discussions. Now it would be a new type of private thread, where they can ban only certain users from their threads. :up:

Exactly, this is what I would want and it would be a great way to get people to subscribe to get this feature.

Thread creators could have control of their own thread. Enabling by usergroup would be great!

barmen_1982 05-30-2011 12:35 PM

Thank you master

Konkere 06-05-2011 07:23 PM

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();
    } 



All times are GMT. The time now is 09:00 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.01284 seconds
  • Memory Usage 1,819KB
  • 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
  • (4)bbcode_code_printable
  • (5)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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