Hey all, I would like to get just a few quick stats regarding doc team numbers. I want a total count of members, then a count of the number of doc team members that have created or edited a book page in the last year and the last 6 months. This is just a one time run for now, so no patch to the d.o module is needed. I just want the numbers to assess the docs team and add to the mix for several things I am considering with regards to it.
This query may not be the best (my SQL fu is weak) but I think it does what I'm looking for on the "in the last year" one (assuming the correct role ID is inserted):
SELECT COUNT(DISTINCT nr.uid)
FROM users_roles ur
INNER JOIN node_revisions nr ON ur.uid = nr.uid
INNER JOIN node n ON nr.nid = n.nid
WHERE n.type = 'book'
AND ur.rid = <doc team ID>
AND nr.timestamp > (UNIX_TIMESTAMP() - 31556926)
6 months - timestamp would be 15778458
and then just a quick query on the total number of doc team members:
SELECT COUNT(*)
FROM users_roles
WHERE rid = <doc team ID>
Comments
Comment #1
add1sun commentedAny chance of getting this run? Pretty, pretty please. :-)
Comment #2
gerhard killesreiter commented224
183
326
Comment #3
add1sun commentedwoot! thanks killes. :-)
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.