vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Moderators Functions - Ban Users from a Thread (https://vborg.vbsupport.ru/showthread.php?t=260080)

MoMan 07-24-2011 01:19 PM

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!

MoMan 07-24-2011 01:25 PM

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']);
        }
        }
    } 


MajorFm.com 07-25-2011 06:46 AM

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?

Konstantinos 07-25-2011 07:26 PM

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

MoMan 07-25-2011 08:27 PM

Quote:

Originally Posted by Konstantinos (Post 2224898)
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.

cstreater 07-30-2011 03:50 AM

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 :)

Hornstar 08-23-2011 06:58 AM

How do I make it so only admins can ban users from a thread?

MoMan 08-30-2011 12:31 AM

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

    } 


viper357 07-04-2013 07:27 AM

Quote:

Originally Posted by MoMan (Post 2224303)
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.

Donkey11 08-04-2013 08:32 PM

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


All times are GMT. The time now is 04:42 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.01181 seconds
  • Memory Usage 1,773KB
  • 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_php_printable
  • (2)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