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.
|
CategoriesQuicksearchArchives |