[PMBT 2.x]automated User purging
This is a update to the release By Revan for PMBT 1.X
This well delete inactive users from your site in 2 stages First stage it well check users to see who has not been in for a set period of time it well mark there account warned for inactivity and send them a E-mail notice telling them that they have not been active and that they have a set amount of time in which to return to the site in order not to be removed. Second it well check to see who has been set inactive read the date set as inactive if the user has not returned in such time it well remove the account from both forum and tracker. I had to do a lot of clean up on this as when I first tested Revans release it would always send out a notice to new user on sign up confirmation which was not very good. then I noticed that the notices where empty of the e-mail body so I had to fix this to I also noted that the query's used to mark accounts as active and inactive would be ran for every user wich would cause a very high load on the data base so I had to move them in the code so that it would only run one time for every page load. I am going to make a admin page to allow you to set your warning dates and delete dates and so that you can turn it on and off with out going threw data base. so here it is let me know what you think first is the sql you well need this one is the configs of your prune system set it to what you want Code:
CREATE TABLE IF NOT EXISTS `torrent_userautodel` ( then below this Code:
if (!$row = $db->sql_fetchrow($configquery)) die("phpMyBitTorrent not correctly installed! Ensure you have run setup.php or config_default.sql!!"); Code:
$sql = "SELECT * FROM ".$db_prefix."_userautodel LIMIT 1;"; Code:
$version = $row["version"]; Code:
$inactwarning_time = $row3["inactwarning_time"]*86400; first find Code:
$db->sql_query("UPDATE ".$db_prefix."_torrents SET visible = 'no' WHERE type != 'link' AND tot_peer <= '".$down_limit."' AND UNIX_TIMESTAMP(last_action) < UNIX_TIMESTAMP(NOW()) - ".intval($dead_torrent_interval)." AND evidence != 1 AND (TRACKER IS NULL OR ".intval($autoscrape).");"); [code]#prune users if ($autodel_users) { $userwarninactivesub = Array(); $userwarninactivesub[english] = "".$sitename." Warning"; $userwarninactivesub[german] = "".$sitename." Achtung"; $userwarninactivesub[spanish] = "Advertencia ".$sitename.""; $userwarninactivesub[brazilian] = "".$sitename." adverte"; $userwarninactivesub[portuguese] = "".$sitename." adverte"; $userwarninactivetext = Array(); $warntexten1 = "Hi, we would like to warn you that you have not been active on **siteurl** for more than **inactwarning_time** days, if you do not want to have your account deleted please login to it. "; if ($autodel_users_time != 0) { $warntexten2 = "You have **autodel_users_time** days to log in from now. Otherwise we will delete your account permanently."; } else $warntexten2 = ""; $warntexten3 = " Thanks **sitename** Admin **siteurl**"; $userwarninactivetext[english] = "".$warntexten1.$warntexten2.$warntexten3.""; $warntextger1 = "Wir m |
All times are GMT +2. The time now is 03:48. |
Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.