PDA

View Full Version : Mass Changing User Group for Older Users


ShannonA
05-06-2015, 01:27 AM
I'm trying to clean up our site's mailing database, so that we can better mail to people who remain active on the site. The best idea I've come up with is to move old, unused accounts out of the Registered user group ... say to the "Users Awaiting Email Confirmation" group, which I presume would make them reverify their email address before they could log back in.

Any problems with that methodology?

More importantly, is there an easy way to flip all users who haven't logged in, for, say 3 years to "Users Awaiting Email Confirmation" as their primary group?

MarkFL
05-06-2015, 03:18 AM
...More importantly, is there an easy way to flip all users who haven't logged in, for, say 3 years to "Users Awaiting Email Confirmation" as their primary group?

You could follow;

AdminCP ► Maintenance ► Execute SQL Query

And run the manual query:

UPDATE user set usergroupid = 3 where (usergroupid = 2 AND ((UNIX_TIMESTAMP() - lastactivity)/(86400*365) >= 3))

Note: Before running any manual queries, make sure you have a backup of your database in case things do not go as expected.