PDA

View Full Version : Cron to Delete UAEC users not activated in the past 30 days


induslady
01-10-2014, 03:58 AM
Hello,

Am using vb4.2.1

Looking for a cron script that could be set to run on 1st of every month to do the below -

Users with the below criteria -

UG = UAEC
Join date = 30 days or before
Posts < 1

are sent email as below -

"Dear Username, Since you haven't activated your account in 30-days, we have deleted your account. Please feel free to register again at <link here>

AND the user records are deleted.

Let me know how do I code this? Is there any resource articles / guides for coding cron scripts?
Thanks in advance.

kh99
01-10-2014, 02:32 PM
I couldn't find any articles on that by searching the titles. But there's not a lot that's special about a scheduled task - you could look at the existing scripts (in includes/cron).

You could also use a plugin on hook cron_script_cleanup_daily. Do a query of the user table for lastactivity > 30 days ago, find existing code to email a notice and delete a user, and you'd pretty much be there.