Help with switches for moderators & if open modertor reports

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
-ds-
Registered User
Posts: 554
Joined: Wed Sep 14, 2005 7:12 pm

Help with switches for moderators & if open modertor reports

Post by -ds- » Tue Dec 15, 2009 8:11 am

Hi,

I want to create a custom block on the index.php that only shows up if there are unread or open Reported Posts or PMs.
How do I go about creating a switch on that checks if there are any open reported items?

I presume i have to declare something like this in the index.php file?

Code: Select all

$template->assign_vars(array(
    'MCP_REPORTS' =>  ... function to check that returns true,
)); 
Then to show the block to moderators in the template file:

Code: Select all

<!-- IF MCP_REPORTS and  U_IN_MCP -->
<div class="mcp_alert">There are new Reported Files</div>
<-- ENDIF -->

and use something like the code in the mcp.php file to get the data, or is there a faster way to check if there are any unread or open reported items?

Code: Select all

/**
* Get simple post data
*/
function get_post_data($post_ids, $acl_list = false, $read_tracking = false) {
...
}

Any help would b

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20794
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Help with switches for moderators & if open modertor reports

Post by RMcGirr83 » Tue Dec 15, 2009 12:01 pm

In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
-ds-
Registered User
Posts: 554
Joined: Wed Sep 14, 2005 7:12 pm

Re: Help with switches for moderators & if open modertor reports

Post by -ds- » Tue Dec 15, 2009 1:03 pm

Excellent! Thank you. I wonder how I missed that.

I will probably not install the whole mod, but maybe just take bits away from it, but I shall reply here again if I with my results.

Thanks for your help again. :D

Locked

Return to “[3.0.x] MOD Writers Discussion”

Who is online

Users browsing this forum: No registered users and 12 guests