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)

Wonksta 08-12-2011 10:00 PM

Unapprove Reported Posts (Based on No. of Reports & Usergroups)
 
1 Attachment(s)
This modification has been based on the following Mod found here: https://vborg.vbsupport.ru/showthread.php?t=231622 - I have been given permission by that author to release this modified version of his original Mod.

This modification adds much needed features such as:

- Number of Reports required to send a post in Moderation Queue
- Usergroups which can bypass min. reports required.

Anyone who makes changes to this modification to better it in anyway, I only ask you share it with the rest of us in this thread! :)

Enjoy!

0ptima 08-13-2011 12:36 PM

Will check this out soon!

Manoel J?nior 08-13-2011 01:31 PM

Tagged

inciarco 08-13-2011 02:25 PM

Very Interesting Mod, Thank You For Sharing It. :up:

The Code Alters the "post" Table adding the Field "reports", You Should Add the "DB Changes" in the Mod's Specifications. :confused:

Code:

ALTER TABLE " . TABLE_PREFIX . "post ADD reports INT(10) UNSIGNED NOT NULL DEFAULT '0'
My Best Regards.

:)

BirdOPrey5 08-13-2011 04:39 PM

Quote:

Originally Posted by inciarco (Post 2233020)
Very Interesting Mod, Thank You For Sharing It. :up:

The Code Alters the "post" Table adding the Field "reports", You Should Add the "DB Changes" in the Mod's Specifications. :confused:

Code:

ALTER TABLE " . TABLE_PREFIX . "post ADD reports INT(10) UNSIGNED NOT NULL DEFAULT '0'
My Best Regards.

:)

Good catch. I made the change.

MoMan 08-13-2011 05:48 PM

Very nice and elegant mod!

Ramsesx 08-13-2011 08:38 PM

Cool, that's what I need, thanks.

MoMan 08-13-2011 09:15 PM

Not that this really matters, but technically a redundant query is made once a post has enough reports and gets unapproved.

I've updated my plugin code to the following:

PHP Code:

if ($_POST['do'] == 'sendemail' 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']);
    }



paul1972 08-17-2011 01:36 AM

who has this on their website? I'd like to see it in action....please list your website

Wonksta 08-17-2011 02:03 AM

1 Attachment(s)
Quote:

Originally Posted by paul1972 (Post 2234322)
who has this on their website? I'd like to see it in action....please list your website

You can't see it in action unless you're a Moderator/Admin on the board it is installed on.

This modification works extremely well with the "Quick Moderation" Module with vBAdanced.

Here's a screeny:


All times are GMT. The time now is 03:35 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.01473 seconds
  • Memory Usage 1,753KB
  • 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
  • (1)bbcode_php_printable
  • (2)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