MyBB Community Forums

Full Version: Variable showing number of reported posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm looking for variable that returns the number of currently reported posts. Where can I find it?

Thanks!
I do not think this exists. You could create one by adding the code below to the appropriate php script (depending where you want to use it) before the relevant template is evaluated:


$query = $db->simple_select("reportedcontent", "COUNT(rid) AS reports", "type = 'post');
$repcount = $db->fetch_field($query, "reports");


The variable $repcount is then what you are looking for, I presume.
(2015-08-16, 08:27 AM)Ad Bakker Wrote: [ -> ]I do not think this exists. You could create one by adding the code below to the appropriate php script (depending where you want to use it) before the relevant template is evaluated:


$query = $db->simple_select("reportedcontent", "COUNT(rid) AS reports", "type = 'post');
$repcount = $db->fetch_field($query, "reports");


The variable $repcount is then what you are looking for, I presume.

Seems this is what im looking for but I can't seem to get it to work?

I want it to be included on the members_profile template, that's it so I''ve tried adding the above code to members.php but it stops the entire board from loading.