• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

how to see groups last login

abnvet

Active member
#1
Hi, I would like to be able to run a query and it show the last login time of members in a group and how many posts and etc...

Basically, my community has been running itself for quite some time as I have been away for training. I have a group thats listed as "Clan Members" and the overall goal is for me to be able to at a glance see what members in this group are active or inactive so that I can remove dead weight. There are like 40 members in this group so going through each one to see last login time and last post would be tedious. Any help or suggestions would be greatly appreciated.
 

Jake Bunce

XenForo moderator
Staff member
#2
Code:
SELECT username, message_count, FROM_UNIXTIME(last_activity, '%Y-%m-%d') AS date
FROM xf_user
WHERE user_group_id = 2 OR FIND_IN_SET(2, secondary_group_ids)
ORDER BY last_activity
DESC;
That will show you all members of group 2, their usernames, post count, and last active date.
 

oloman

Active member
#4
Hi

I'd like to do the same thing. I'd like to select the lastvisit after a date.
For example, lastvisit after January 2010

SELECT username, FROM_UNIXTIME(lastvisit, '%Y-%m-%d') AS date
FROM xf_user
WHERE date>2010-01-01;

It works fine?

Thanx a lot