REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Plugin] View Member Reported Posts
#1
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--

   
   
   

--Note--

Please alert me with any problems that you may have.


Thanks,
xerotic


Attached Files
.zip   ViewMemberReportedPosts.zip (Size: 2.38 KB / Downloads: 111)
Reply
#2
I'll check it out, thanks again!
Reply
#3
Thanks for this great plugin.
Reply
#4
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);
}
Reply
#5
My goodness, Jesse. You're amazing at PHP.
Reply
#6
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.
Reply
#7
I sure hope this gets implemented on a forum I'm thinking of Wink
Reply
#8
(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?


                
Reply
#9
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
Reply
#10
Thanks, well needed plugin
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Required Plugin for Googlesense AD dineshkummar 2 2,049 Sep 22, 2017, 02:25 PM
Last Post: bradandrews4
  [Plugin] RepFuck 1.0 SuperSpyXT 37 24,129 Aug 11, 2017, 06:27 PM
Last Post: kacsj
  [1.4 & 1.6] Donation Page Plugin 2.1 Zash 35 24,801 Dec 04, 2015, 09:47 PM
Last Post: Demoncious
  Looking for proxy ban plugin omfgomfg 0 1,957 Jun 16, 2015, 10:11 AM
Last Post: omfgomfg
  Tabbed Menu plugin Error Dredd 0 1,846 Dec 20, 2014, 12:05 PM
Last Post: Dredd

Forum Jump:


Users browsing this thread: 1 Guest(s)