4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: SLL on January 18, 2007, 09:26:19 AM

Title: [req] delete inactive users
Post by: SLL on January 18, 2007, 09:26:19 AM
Something like used with most forums - delete users without any picture uploaded or comment posted. Any volunteers to create such mod?  :roll:
Title: Re: [req] delete inactive users
Post by: mawenzi on January 18, 2007, 09:37:44 AM
... here is a plugin : Delete all registered users with no action on website during the last xx days ...
... that you can modify to your (remaining) needs ...
... http://www.4homepages.de/forum/index.php?topic=10097.msg49306#msg49306 ...
Title: Re: [req] delete inactive users
Post by: SLL on January 18, 2007, 09:56:55 PM
... that you can modify to your (remaining) needs ...
thanks, this is almost what i wanted  :)

just one question: what variable should i use in sql query in order to keep user with an image assigned to this user?

in other words - i do not want to delete users if they have active images in a gallery
Title: Re: [req] delete inactive users
Post by: mawenzi on January 18, 2007, 11:14:43 PM
... try this ...
Code: [Select]
$sql_del_users = "DELETE FROM ".USERS_TABLE."
WHERE user_level = 2
AND user_t_images = 0
AND user_lastaction < ".(time()-$no_action*24*3600);
$result = $site_db->query($sql_del_users);
echo "Users deleted !";

... "user_t_images" is a additional_user_field ... "user_total_images" ... I think from [Mod] Keep Track Of Each action ...