PDA

View Full Version : [MiniHack] Suspended/pending monitor on AdminCP home


Jawelin
28 Jan 2002, 13:44
This is my first (mini)hack published - even wrote many customizations -, so please don't shoot against the player ! :pirate:

It's an Admin-purpose Swiss army knife to have the runtime status of your board pendings all at once on the AdminCP home.
Simply, along with user under moderation (coppa or not), it checks for Board active or closed for maintenance ?
New members allowed ?
Existing posts awaiting moderation
Existing attachments awaiting moderation
... if you have more ideas ... :china:
Each of the counters links to the appropriate page to manage its own value.
Is very very simple even to remove, so don't fear to try it.
No SS needed, of course.

Any test/tip should be very appreciated.

Let's go. Open the admin/index.php and find :if ($moderatenewmembers==1 or $usecoppa==1) {
Then, just above, below or around the whole if-clause (beware the ending '}' ), add the following pieces of code:
//HACK: Show BB NotActive on AdminCP homepage - begin
if (!$bbactive) {
echo "<p><b>Remember: VB board is currently <a href=\"options.php?t=0&s=$session[sessionhash]#settinggroup1\">INACTIVE</a>&nbsp;!</b></p>";
}
//HACK: Show BB NotActive on AdminCP homepage - end

//HACK: Show NoNewUsers on AdminCP homepage - begin
if (!$allowregistration) {
echo "<p><b>Remember: currently <a href=\"options.php?t=0&s=$session[sessionhash]#settinggroup6\">NO NEW USERS</a> are allowed !</b></p>";
}
//HACK: Show NoNewUsers on AdminCP homepage - end

//HACK: Show pending posts if any - begin
if (1==1) { // flag to activate counter
$pending=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE visible=0");
if ($pending[posts]>0) {
echo "<p><b><a href=\"../mod/moderate.php?action=posts&s=$session[sessionhash]\">There are currently $pending[posts] post(s) awaiting moderation</a>.</b></p>";
}
}
//HACK: Show pending attachments if any - begin
if (1==1) { // flag to activate counter
$pending=$DB_site->query_first("SELECT COUNT(*) AS attachments FROM attachment WHERE visible=0");
if ($pending[attachments]>0) {
echo "<p><b><a href=\"../mod/moderate.php?action=attachments&s=$session[sessionhash]\">There are currently $pending[attachments] attachment(s) awaiting moderation</a>.</b></p>";
}
}
//HACK: Show pending(s) if any - end


That's all folks!
Am I a dummy hacker ? :surprised

Thanks

Natch
04 Jan 2003, 23:10
I've found that a more useful place for this is in the Welcome Box - using the Dynamic Templates hack - to show that moderation actions are required of Mod's / Admins :)

Thansk for the work tho ;) Excellent :D

Dean C
06 Jan 2003, 11:13
Thanks for releasing this - you might want to post this up in a text file so that unlicensed users can't have access to this hack :)

- miSt

EchoHype.com
18 Jan 2003, 00:50
Good idea there mist ;)