Customizing SMF > Now Available

Moderator activity report

(1/9) > >>

Tony Reid:
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....


--- Code: ---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`

--- End code ---

This is the output....

MemberNameTotal Mod ActionsDays MissingMemberGroupTony12320AdministratorDavid432Global ModeratorJulie6788Global 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..


--- Code: ---SELECT ID_GROUP,groupName FROM `membergroups`
--- End code ---

if you have a prefix use


--- Code: ---SELECT ID_GROUP,groupName FROM `{db_prefix}membergroups`
--- End code ---

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.....


--- Code: ---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`

--- End code ---


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

Tony Reid:
Update this today to fix a bug :)

If anyone finds this useful then please let me know.

Tony

rosoner:
this would be great mod!

Surfy:


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  :)

Vinspire^:
Which file should we edit and is there any screenshot preview of this mod ?

Navigation

[0] Message Index

[#] Next page

Go to full version