Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Now Available => Topic started by: Tony Reid on April 15, 2006, 07:05:26 PM

Title: Moderator activity report
Post by: Tony Reid on April 15, 2006, 07:05:26 PM
This has been converted into a Mod!
(http://mods.simplemachines.org/index.php?mod=345)

Screenshots
http://www.simplemachines.org/community/index.php?topic=82230.msg571761#msg571761

SQL code left here for the curious  




If my moderators are off for more than a week then I want to know. So I thought of a quick way to generate info on my moderator activity.

The report needed to tell me

1) Moderators Name
2) How many modification actions they have done
3) How many days they have been inactive
4) Their Member Group

I dont use a db prefix so here is the SQL to generate the report....


SELECT
  `members`.`memberName` AS `Member Name`,
  COUNT(`members`.`memberName`) AS `Total Mod Actions`,
  TO_DAYS(now()) - TO_DAYS(from_unixtime(`members`.`lastLogin`)) AS `Days Missing`,
  `membergroups`.`groupName` AS `Member Group`
FROM
  `log_actions`
  RIGHT OUTER JOIN `members` ON (`log_actions`.`ID_MEMBER` = `members`.`ID_MEMBER`)
  INNER JOIN `membergroups` ON (`members`.`ID_GROUP` = `membergroups`.`ID_GROUP`)
WHERE
  (`members`.`ID_group` = 1|| `members`.`ID_group` = 102 || `members`.`ID_group` = 2)
GROUP BY
  `members`.`memberName`,
  `membergroups`.`groupName`
ORDER BY
  `membergroups`.`ID_GROUP`


This is the output....


MemberNameTotal Mod ActionsDays MissingMemberGroup
Tony12320Administrator
David432Global Moderator
Julie6788Global Moderator

The ID_GROUP values in the above sql are the different membergroup ID's. If you dont know what your membergroup ID's are then this query will output them for you..

SELECT ID_GROUP,groupName FROM `membergroups`

if you have a prefix use

SELECT ID_GROUP,groupName FROM `{db_prefix}membergroups`

It should give you something like...


GROUP_ID groupName
 
    1 Administrator
    2 Global Moderator
    4 Un-Ranked
    5 Jr. Member
    6 Full Member
    7 Sr. Member
    8 Gold Member
    91 Banned
    102 Site Moderator
 






If you use a db prefix then you will need to modify the {db_prefix} to be whatever you have chosen - although I havent tested it here it is.....


SELECT
  `{db_prefix}members`.`memberName` AS `Member Name`,
  COUNT(`{db_prefix}members`.`memberName`) AS `Total Mod Actions`,
  TO_DAYS(now()) - TO_DAYS(from_unixtime(`{db_prefix}members`.`lastLogin`)) AS `Days Missing`,
  `{db_prefix}membergroups`.`groupName` AS `Member Group`
FROM
  `log_actions`
  RIGHT OUTER JOIN `{db_prefix}members` ON (`{db_prefix}log_actions`.`ID_MEMBER` = `{db_prefix}members`.`ID_MEMBER`)
  INNER JOIN `membergroups` ON (`{db_prefix}members`.`ID_GROUP` = `{db_prefix}membergroups`.`ID_GROUP`)
WHERE
  (`{db_prefix}members`.`ID_group` = 1|| `{db_prefix}members`.`ID_group` = 102 || `{db_prefix}members`.`ID_group` = 2)
GROUP BY
  `{db_prefix}members`.`memberName`,
  `{db_prefix}membergroups`.`groupName`
ORDER BY
  `{db_prefix}membergroups`.`ID_GROUP`



If any mod writers are reading this I think It would be nice to see a pretty version of this in the report section of the admin area :)

*note to moderator  - Not sure if this is of use to anyone - but it might be worth putting in Tips & Tricks
Title: Re: Moderator activity report
Post by: Tony Reid on April 16, 2006, 04:19:38 AM
Update this today to fix a bug :)

If anyone finds this useful then please let me know.

Tony
Title: Re: Moderator activity report
Post by: rosoner on April 21, 2006, 05:50:25 AM
this would be great mod!
Title: Re: Moderator activity report
Post by: Surfy on April 28, 2006, 05:38:18 AM


Wow, this would be usefull.. But i have no idea, how to use it, or how i made an entry in my Admin section for it.. My skill is noobie  :'(  -  i hope someone could made a mod  :)
Title: Re: Moderator activity report
Post by: Vinspire^ on May 05, 2006, 05:41:27 AM
Which file should we edit and is there any screenshot preview of this mod ?
Title: Re: Moderator activity report
Post by: Anakin_holland on May 05, 2006, 06:09:06 AM
Quote from: Vinspire^ on May 05, 2006, 05:41:27 AM
Which file should we edit and is there any screenshot preview of this mod ?

This isn't a mod, but a query to be executed in PHPMyAdmin directly. Inside PHPMyAdmin click on the database to acces it, then click on the button "SQL" and copy/paste your edited query. Next, click on "Go" and watch the result.

It could become a mod one thay though. Maybe as an extra report inside Admin CP/Generate reports?

Thanks for this one! Might come in handy one day!

Note: If you want to use this query, you have to stop clearing out the Moderation Log! ;) And by default it shows me a value of '1' if no moderation-action have been done?
Title: Re: Moderator activity report
Post by: Vinspire^ on May 05, 2006, 06:18:51 AM
Oh ... Query is PHPMyAdmin. Okie. I got it :P
Title: Re: Moderator activity report
Post by: Tony Reid on May 05, 2006, 09:41:23 AM
Ive just made this into a mod ;)


Tony
Title: Re: Moderator activity report [Preview]
Post by: Tony Reid on May 05, 2006, 04:16:20 PM
I've still got a few things to do - add a link to the mod report in admin cp and also some other tidying up - but for now - Here is a screenshot of the mod.

(http://www.absolutebreeze.co.uk/stars/modreport.png)

I may bring in Karma stats also and make the Names link to profiles.

Then all I have to do is work out how to package it :)

Hopefully this will be finished in a couple of days.

Tony
Title: Re: Moderator activity report
Post by: Surfy on May 05, 2006, 09:15:05 PM

sweeeet, this is a must have  :-* :-*
Title: Re: Moderator activity report
Post by: Tony Reid on May 06, 2006, 06:08:37 AM
I Now have it showing Karma and its linked to profiles.

Will upload screenshots later.

I have other ideas for improvement too :)

Tony
Title: Re: Moderator activity report
Post by: Trekkie101 on May 06, 2006, 06:48:50 AM
Very nice!

Can't wait to see a packaged mod :)
Title: Re: Moderator activity report
Post by: Aaron on May 06, 2006, 06:49:34 AM
Very cool! I'm looking forward to this one. :)
Title: Re: Moderator activity report
Post by: mindvsmind on May 06, 2006, 02:55:15 PM
is there a file to install it or we have to do it manually
Title: Re: Moderator activity report
Post by: Tony Reid on May 06, 2006, 03:47:31 PM
Quote from: mindvsmind on May 06, 2006, 02:55:15 PM
is there a file to install it or we have to do it manually

It will be installable via package manager :)
Title: Re: Moderator activity report
Post by: codenaught on May 06, 2006, 03:54:04 PM
Looking nice. Good luck. :)
Title: Re: Moderator activity report
Post by: mindvsmind on May 07, 2006, 01:08:03 PM
Quote from: Tony on May 06, 2006, 03:47:31 PM
Quote from: mindvsmind on May 06, 2006, 02:55:15 PM
is there a file to install it or we have to do it manually

It will be installable via package manager :)

when r u releasing this mod ?
Title: Re: Moderator activity report
Post by: Tony Reid on May 07, 2006, 05:01:38 PM
Version 1.0 of this mod is finished - all thats left to do is package it up, its just that I haven't had time to learn how to do packaging today so will do that tomorrow night sometime.

The mod was originally designed as a quick way for me to find out how many days each moderator had been inactive but it has been enhanced to provide:

1) Moderators Name (linked to profile)
2) How many modification actions they have done (Drill down link to view their moderator actions)
3) How many days they have been inactive (since last logged in)
4) Karma points - both good and bad
4) Their Member Group

Overview Screenshot
(http://www.absolutebreeze.co.uk/stars/modreportsub.png)

Full screenshot
(http://www.absolutebreeze.co.uk/stars/moreport.gif)

Title: Re: Moderator activity report
Post by: Harzem on May 07, 2006, 05:10:43 PM
Why are you adding karma functionality? Most of the boards don't even use karma, and most of the rest don't bother the karma of the moderators.

Instead, having a link to "moderator specific" actions would be great. I click on a link for a mod and see what he/she has done.

I can help you in coding it also.
Title: Re: Moderator activity report
Post by: Tony Reid on May 07, 2006, 05:25:15 PM
It has a link to moderator spefic actions already which can be accessed by clicking the moderator actions link ;)

Title: Re: Moderator activity report
Post by: Harzem on May 07, 2006, 05:50:42 PM
Yes, I see now :P By the search box.
Title: Re: Moderator activity report
Post by: Anakin_holland on May 08, 2006, 02:06:59 AM
Nice! Looking forward to this one!
Title: Re: Moderator activity report
Post by: Ryan on May 10, 2006, 07:49:42 PM
Yea ive been asking for such mod for a long time...
Title: Re: Moderator activity report
Post by: Vinspire on May 10, 2006, 11:44:34 PM
Wow ... this mod is so kewl .... is it fully working yet ?
Title: Re: Moderator activity report
Post by: Tony Reid on May 11, 2006, 05:33:31 AM
Its working - I just havent had time to package it up.

Hopefully will get round to it tonight :)

Tony
Title: Re: Moderator activity report
Post by: Vinspire on May 14, 2006, 06:41:57 PM
Quote from: Tony on May 07, 2006, 05:01:38 PM
Version 1.0 of this mod is finished - all thats left to do is package it up, its just that I haven't had time to learn how to do packaging today so will do that tomorrow night sometime.

The mod was originally designed as a quick way for me to find out how many days each moderator had been inactive but it has been enhanced to provide:

1) Moderators Name (linked to profile)
2) How many modification actions they have done (Drill down link to view their moderator actions)
3) How many days they have been inactive (since last logged in)
4) Karma points - both good and bad
4) Their Member Group

Overview Screenshot
(http://www.absolutebreeze.co.uk/stars/modreportsub.png)

Full screenshot
(http://www.absolutebreeze.co.uk/stars/moreport.gif)
This look so kewl ... I am really excited and looking forward for this mods :)
Title: Re: Moderator activity report
Post by: Tony Reid on May 16, 2006, 06:59:16 PM
The mod team have yet to approve it, so usual disclaimer and back up before applying! - but here it is when they have OK'd it... (hopefully)

http://mods.simplemachines.org/index.php?mod=345
Title: Re: Moderator activity report
Post by: Vinspire on May 17, 2006, 11:03:58 AM
Quote from: Tony on May 16, 2006, 06:59:16 PM
The mod team have yet to approve it, so usual disclaimer and back up before applying! - but here it is when they have OK'd it... (hopefully)

http://mods.simplemachines.org/index.php?mod=345

Okie  ;D ;D ;D
Title: Re: Moderator activity report
Post by: Skipdawg on May 17, 2006, 11:59:10 AM
Will this work with custom ranks? Like if I have created a status rank of Super Moderator between the Administrator and Global Moderator.
Title: Re: Moderator activity report
Post by: Tony Reid on May 17, 2006, 12:29:08 PM
Quote from: Skipdawg on May 17, 2006, 11:59:10 AM
Will this work with custom ranks? Like if I have created a status rank of Super Moderator between the Administrator and Global Moderator.

Yeah.. in fact I have a similar thing and use memberroup '102' you just need to open up modreport.php and change the where clause from...



({$db_prefix}members.ID_group = '1' || {$db_prefix}members.ID_group = '2')




to



({$db_prefix}members.ID_group = '1' || {$db_prefix} members.ID_group = '2'
|| {$db_prefix}members.ID_group = 'NEWGROUPID' )



You can add as many groups as you want that way.

NEWGROUPID obvisouly being the id number of the additional group.

Tony
Title: Re: Moderator activity report
Post by: Skipdawg on May 17, 2006, 10:00:39 PM
kewl thanks. This just may come in handy then soon.  ;D
Title: Re: Moderator activity report
Post by: Miyagi on May 20, 2006, 01:17:21 PM
Not sure why.. (unless you cannot d/l unauthorised mods) but when i go to the mod page (http://mods.simplemachines.org/index.php?mod=345) and click on the file to d/l it just times out... help! This sounds like a great mod, i just cant get it :)

Cheers,
Miyagi
Title: Re: Moderator activity report
Post by: Vinspire on May 20, 2006, 10:02:02 PM
Cause the mod havent been authorized by SMF Staff ?
Title: Re: Moderator activity report
Post by: wimvincken on February 07, 2008, 07:08:14 PM
Quote from: Tony on May 16, 2006, 06:59:16 PM
The mod team have yet to approve it, so usual disclaimer and back up before applying! - but here it is when they have OK'd it... (hopefully)

http://mods.simplemachines.org/index.php?mod=345
And it works like a train for the 1.1.4. Thanks for this mod.

I have special groups, which are not really mods, but close. And suddenly I can monitor their activity. Thanks, very useful mod.
Title: Re: Moderator activity report
Post by: AlenNS on October 24, 2008, 09:58:57 AM
This mod should be made for SMF 2.X SMF. It's very interesting.
Title: Re: Moderator activity report
Post by: MsAdvantageous on December 08, 2010, 06:47:07 PM
I love this idea, thank you.
Title: Re: Moderator activity report
Post by: Realinfo on August 16, 2012, 05:59:47 AM
When we can get this for 2.0.2
Title: Re: Moderator activity report
Post by: TheListener on August 16, 2012, 07:01:03 PM
Quote from: Realinfo on August 16, 2012, 05:59:47 AM
When we can get this for 2.0.2

This is already built into 2.0.2 I believe.

:)
Title: Re: Moderator activity report
Post by: Realinfo on August 16, 2012, 08:57:16 PM
1.    Execute Modification    ./index.php    Test failed
      1.    Add Before    ./index.php    Test failed
*    2.    Execute Modification    ./Sources/Subs.php    Test failed
      1.    Replace    ./Sources/Subs.php    Test failed
*    3.    Execute Modification    ./Sources/ManageMembergroups.php    Test failed
      1.    Replace    ./Sources/ManageMembergroups.php    Test failed
      2.    Add After    ./Sources/ManageMembergroups.php    Test successful
      3.    Replace    ./Sources/ManageMembergroups.php    Test failed
      4.    Add After    ./Sources/ManageMembergroups.php    Test successful
*    4.    Execute Modification    ./Themes/default/ManageMembergroups.template.php    Test failed
      1.    Replace    ./Themes/default/ManageMembergroups.template.php    Test failed
*    5.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
   6.    Extract File    ./Themes/default/ModReporting.template.php    
   7.    Extract File    ./Sources/ModReport.php    
   8.    Execute Code    addsql.php
Title: Re: Moderator activity report
Post by: Tony Reid on August 17, 2012, 04:05:58 AM
@RealInfo - your installing a mod made for 1.x and not SMF 2 - that's why you have errors.

To get this working on 2 - the underlying code is different.

I do have it running on 2.0.2, but haven't got around to packaging it up.

Title: Re: Moderator activity report
Post by: Realinfo on August 17, 2012, 10:16:47 PM
try to packaging it up............. we are waiting...........

also tell where we can see Moderator activity report after installing it...............
Title: Re: Moderator activity report
Post by: Crozz on August 26, 2012, 03:58:44 AM
Quote from: Tony Reid on August 17, 2012, 04:05:58 AM
@RealInfo - your installing a mod made for 1.x and not SMF 2 - that's why you have errors.

To get this working on 2 - the underlying code is different.

I do have it running on 2.0.2, but haven't got around to packaging it up.
Will you be giving the mod for 2.0.2 out to the public?
Title: Re: Moderator activity report
Post by: sturmkatze on September 25, 2013, 07:54:59 PM
Ja, it's been over a year...