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 - Unapprove Reported Posts (Based on No. of Reports & Usergroups) (https://vborg.vbsupport.ru/showthread.php?t=268460)

paul1972 08-17-2011 02:38 AM

so if a post get a certain number of complaints then it will be forwarded to a moderators section?

or how does this work?

is there a button to click on to report the violation to the moderators?

Wonksta 08-17-2011 03:00 AM

Quote:

Originally Posted by paul1972 (Post 2234352)
so if a post get a certain number of complaints then it will be forwarded to a moderators section?

or how does this work?

is there a button to click on to report the violation to the moderators?

Click on a post and select 'Disapprove' that's all it does to a post/thread.

MoMan 08-18-2011 09:31 PM

FYI with this mod you get a database error if you try to report a PM/VM/picture comment.

In order to fix this, change the plugin code to the following:

PHP Code:

if ($_POST['do'] == 'sendemail' AND isset($postinfo['postid']) AND !empty($_POST['reason']))
{
    
$reports $vbulletin->db->query_first("SELECT reports FROM " TABLE_PREFIX "post WHERE postid = " $postinfo['postid']);
    if (
$reports['reports'] + >= $vbulletin->options['unapprove_reported_posts_num_reports'] OR is_member_of($vbulletin->userinfounserialize($vbulletin->options['unapprove_reported_posts_bypass_usergroups'])))
    {
        
$modinfo fetch_userinfo($postinfo['userid']);
        
$uglist $modinfo['usergroupid'] . iif(trim($modinfo['membergroupids']), ",$modinfo[membergroupids]");
        if (!
can_moderate(0''$modinfo['userid'], $uglist) OR ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']))
        {
            require_once(
DIR'/includes/functions_databuild.php');
            
unapprove_post($postinfo['postid'], ($foruminfo['countposts'] AND !$postinfo['skippostcount']), true$postinfo$threadinfofalse);
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "post SET reports = 0 WHERE postid = " $postinfo['postid']);
        }
        else
        {
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "post SET reports = reports + 1 WHERE postid = " $postinfo['postid']);
        }
    }
    else
    {
        
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "post SET reports = reports + 1 WHERE postid = " $postinfo['postid']);
    }


Essentially you are adding isset($postinfo['postid']) to the main conditional.

SnakeV 08-18-2011 11:15 PM

Good catch.

One question, did you use this mod directly with it's default install code?

Code:

ALTER TABLE " . TABLE_PREFIX . "post ADD reports INT(10) UNSIGNED NOT NULL DEFAULT '0'
Because i have also have more than 1.5M of posts like your forum and i think that it could take some time to execute that query.

Quote:

Originally Posted by MoMan (Post 2235102)
FYI with this mod you get a database error if you try to report a PM/VM/picture comment.

In order to fix this, change the plugin code to the following:

PHP Code:

if ($_POST['do'] == 'sendemail' AND isset($postinfo['postid']) AND !empty($_POST['reason']))
{
    
$reports $vbulletin->db->query_first("SELECT reports FROM " TABLE_PREFIX "post WHERE postid = " $postinfo['postid']);
    if (
$reports['reports'] + >= $vbulletin->options['unapprove_reported_posts_num_reports'] OR is_member_of($vbulletin->userinfounserialize($vbulletin->options['unapprove_reported_posts_bypass_usergroups'])))
    {
        
$modinfo fetch_userinfo($postinfo['userid']);
        
$uglist $modinfo['usergroupid'] . iif(trim($modinfo['membergroupids']), ",$modinfo[membergroupids]");
        if (!
can_moderate(0''$modinfo['userid'], $uglist) OR ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']))
        {
            require_once(
DIR'/includes/functions_databuild.php');
            
unapprove_post($postinfo['postid'], ($foruminfo['countposts'] AND !$postinfo['skippostcount']), true$postinfo$threadinfofalse);
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "post SET reports = 0 WHERE postid = " $postinfo['postid']);
        }
        else
        {
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "post SET reports = reports + 1 WHERE postid = " $postinfo['postid']);
        }
    }
    else
    {
        
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "post SET reports = reports + 1 WHERE postid = " $postinfo['postid']);
    }


Essentially you are adding isset($postinfo['postid']) to the main conditional.


home9000 08-20-2011 11:09 AM

MoMan or anymone

we need this hack updated anyone can help

MoMan 08-25-2011 12:46 AM

Quote:

Originally Posted by SnakeV (Post 2235127)
Good catch.

One question, did you use this mod directly with it's default install code?

Code:

ALTER TABLE " . TABLE_PREFIX . "post ADD reports INT(10) UNSIGNED NOT NULL DEFAULT '0'
Because i have also have more than 1.5M of posts like your forum and i think that it could take some time to execute that query.

Yes, it will take several seconds - ideally you should close your board, but I decided not to and got no crashes.

JesterP 09-12-2011 12:37 PM

I can even imagine why this isn't already in vBulletin. Fantastic addition and thank you to the others for the improvements.

Nominated. :)

hpidriver 09-14-2011 04:11 AM

^^ What version of vb are you running?

marked as tagged

JesterP 10-23-2011 12:33 AM

I have multiple sites running this, 3.8.x and a couple 4.1.7 forums.

lm3a.net 10-24-2011 10:33 AM

It's good but after installing it the sending via email for the reported post is not working also after uninstalling the product :(


All times are GMT. The time now is 08:15 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.01229 seconds
  • Memory Usage 1,778KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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