Tuesday, December 5. 2006PHPBB Inactive Member Removal Cron JobTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
I too am suffering from the current plague of forum spammers. I like the idea of automating the removal of the forever inactivated accounts. I've modified your query a bit in order to remove the user from the phpbb_user_group table and the corresponding group from phpbb_groups as well (to avoid orphaned data).
This should work in MySQL versions 4 and upwards: DELETE phpbb_users u, phpbb_user_group ug, phpbb_groups AS g FROM phpbb_users u, phpbb_user_group ug, phpbb_groups g WHERE u.user_active=0 AND u.user_id>0 AND u.user_id = ug.user_id AND ug.group_id = g.group_id AND g.group_single_user = 1 AND FROM_UNIXTIME(u.user_regdate)<DATE_SUB(NOW(),INTERVAL 2 DAY); The 'g.group_single_user = 1' check is to avoid any potential problems with deleting a shared group entry if an account we're trying to delete was somehow assigned a group. Hope this is useful to someone. (convert the < and > to less-than and greater-than signs in the SQL)
Thanks for the updated query...I finally got a chance to give it a try and it works for me. I replaced the query in my code above with it.
You know, I couldn't be more upset about the state of the Internet and how it shows when someone tries to run a PHPBB. I'm a one man software shop who recently converted over from Yahoo! Groups to my own PHPBB. I'm in charge of software development, marketing, everything. I'm going to have to take down the board now simply because I don't have time to babysit it. After only two weeks I started getting hit with spam. Viruses and worms don't make me as mad because they are easier to prevent. However it seems there is no "end all" patch for PHPBB. It would be an endless battle.
I guess I'm getting old but I miss my old BBS days.
when i try running the cron i keep gettting this error
#!/usr/bin/php -q No database selected
Make sure in your code that the mysql_select_db line has your particular database listed, not mine.
Hello
I do not see from you script how this action is perfomed periodically ( wich is the goal of a cron ) ? Also do we need to install something on our servers to use unix commands ? thanks bye
If you are running Windows, you can try to use the Windows Task Scheduler, but I have not tried it, so I don't know exactly how you would do it.
Hi Mike,
I have a friend who's trying to change the set default time for inactivate users, thus making it longer before the account goes inactivated. How do you do this on PHPBB? Many thanks in advance!
If they are using the script above, they need to change the INTERVAL 2 DAY to something like INTERVAL 5 DAY.
I don't think PHPBB 2.x itself has any built-in deactivation of inactive users.
Hi Guys,
Here's the fixes to cleanup inactive users in phpBB3. FIND: "u.user_active=0 AND u.user_id>0 AND " . REPLACE WITH: "u.user_inactive_reason=1 AND u.user_id>0 AND " . FIND: "u.user_id=ug.user_id AND ug.group_id=g.group_id" . REPLACE WITH: "u.user_id=ug.user_id AND ug.group_id=g.group_id AND " . FIND & DELETE: "AND g.group_single_user=1 AND " . It scans the user_inactive_reason row as phpBB3 dropped user_active and I removed Russ's g.group_single_user check as phpBB3 doesn't require that table row any longer. Tested throughly. Cheers
I tried the edits for phpBB3 and I get the following error.
/web/cgi-bin/php5: Symbol `client_errors' has different size in shared object, consider re-linking Content-type: text/html Parse error: syntax error, unexpected T_DNUMBER in /home/content/s/d/g/sdgrs/html/cron/inact.php on line 4 I am not a programmer and not sure what the malfunction is. Any help is greatly appreciated. |
CategoriesQuicksearchArchives |