MyBB Central
[Plugin] View Member Reported Posts - Printable Version

+- MyBB Central (http://www.mybbcentral.com)
+-- Forum: Mybb 1.6x Series Topics (http://www.mybbcentral.com/forum-34.html)
+--- Forum: MyBB 1.6x Member Release Plugins (http://www.mybbcentral.com/forum-38.html)
+--- Thread: [Plugin] View Member Reported Posts (/thread-7587.html)

Pages: 1 2


[Plugin] View Member Reported Posts - Xerotic - Nov 21, 2011

Plugin Name: View Member Reported Posts
Plugin Author: xerotic
Plugin Version: 1.0
Plugin Updates: 0
Plugin Description: This plugin lets users view any member's reported posts. Accessed from the member's profile page.

Specifics:
-Creates a new field under 'Reputation' on profiles that links to the page. Link is the number of reports that member has
-You can specify which groups have access to this plugin
-You can easily allow all usergroups access
-Default only admins have access (Usergroup 4)
-Displays post name with link
-Displays reported reason
-Displays moderation status
-Displays date reported

Installation:

1. Upload the file from the ZIP to your plugin directory.

2. Login to AdminCP and activate the plugin via the Plugin Manager (View Member Reported Posts)

3. Utilize plugin.

--Previews--

[attachment=2070]
[attachment=2069]
[attachment=2071]

--Note--

Please alert me with any problems that you may have.


Thanks,
xerotic



RE: [Plugin] View Member Reported Posts - Madness - Nov 21, 2011

I'll check it out, thanks again!


RE: [Plugin] View Member Reported Posts - WakBlack - Nov 23, 2011

Thanks for this great plugin.


RE: [Plugin] View Member Reported Posts - labrocca - Nov 23, 2011

Not bad. I like your settings input array setup. I might use it for large plugins with many settings.

I'd change your $_GET to $mybb->input. It will work fine and in case MyBB adds sanitizing or other functions to input() you will be built in.

This query seems wrong too.

$query = $db->query("
SELECT ".TABLE_PREFIX."reportedposts.pid, ".TABLE_PREFIX."reportedposts.reportstatus, ".TABLE_PREFIX."reportedposts.reason, ".TABLE_PREFIX."reportedposts.dateline, ".TABLE_PREFIX."posts.subject
FROM ".TABLE_PREFIX."reportedposts INNER JOIN ".TABLE_PREFIX."posts ON ".TABLE_PREFIX."reportedposts.pid = ".TABLE_PREFIX."posts.pid
WHERE ".TABLE_PREFIX."reportedposts.uid='".$uid."'
ORDER BY dateline DESC
");

At least it's long winded.


This should use simple_select().

$query = $db->query("
SELECT uid
FROM ".TABLE_PREFIX."reportedposts
WHERE uid='".$uid."'
");


$query = $db->simple_select("reportedposts", "uid", "uid='{$uid}'");

which btw reviewing it..it doesn't make sense. It's only grabbing the uid but it already knows the uid.

Function needs a rewrite:

function your_reported_posts_profile()
{
global $numReportsPosts,$uid,$db;
$query = $db->simple_select("reportedposts", "uid", "uid='{$uid}'");
$numReportsPosts = $db->num_rows($query);
}


RE: [Plugin] View Member Reported Posts - F4T4L 3RR0R - Nov 23, 2011

My goodness, Jesse. You're amazing at PHP.


RE: [Plugin] View Member Reported Posts - Xerotic - Nov 25, 2011

Updated plugin. Now you can allow users to only view their own posts, plus a setting to allow certain usergroups (like admins/super mods) to bypass the above setting.

--

@labrocca
Do you mind if I use some of that code in the next version update? Just now noticed your post as I was updating for version 1.1.

As for the first query.. I used full table names. Probably should condense them to simpler names. Such as 'reportedposts' to 'r'.

For the input, definitely, didn't think of that.

For the second query, I just count all of the rows with that UID so I can get a count of how many reported posts to display on their profile. Should change to a simple_select though.

Thanks for taking the time to write such a response though, I really appreciate it.


RE: [Plugin] View Member Reported Posts - alabama - Nov 26, 2011

I sure hope this gets implemented on a forum I'm thinking of Wink


RE: [Plugin] View Member Reported Posts - F4T4L 3RR0R - Nov 26, 2011

(Nov 26, 2011, 07:20 PM)alabama Wrote: I sure hope this gets implemented on a forum I'm thinking of Wink

Let me guess....HF?


                


RE: [Plugin] View Member Reported Posts - uzi - Nov 29, 2011

Thank you xerotic, you're always releasing great scripts and plugins.
This one is going to go to good use, reputation has been given. Smile



RE: [Plugin] View Member Reported Posts - Ristone3 - Apr 01, 2012

Thanks, well needed plugin