Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Automatically Manage Inactive Accounts
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2013-09-27 16:42:46
This mod actually works properly to my tracker. My VPS runs PHP 5.2 but I think that will not be problems with the 5.3 and 5.4 versions.
The members that are inactive for over 90 days will be disabled, but before that happen they will receive 3 warning emails at 7 days interval.
These values can easily be changed in the Config section to fit your needs.

Run into database:

ALTER TABLE `users` ADD `averted1` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `averted2` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `averted3` enum('yes','no') NOT NULL default 'no';

Add into backend/cleanup.php the next code:
    //===| Start Disable Inactive Accounts |===//
   //===| Config
   $dw1 = 69; //===| Days until the first warning: three weeks to finish
   $dw2 = 76; //===| Days until the second warning: two weeks to finish
   $dw3 = 83; //===| Days until the third warning: one week to finish
   $dtd = 90; //===| Days until the inactive accounts are disabled
   
   $warning1 = sqlesc(get_date_time(gmtime() - ($dw1 * 86400)));
   $warning2 = sqlesc(get_date_time(gmtime() - ($dw2 * 86400)));
   $warning3 = sqlesc(get_date_time(gmtime() - ($dw3 * 86400)));
   $disabled = sqlesc(get_date_time(gmtime() - ($dtd * 86400)));
   
   //===| Reset emails averted if the user has been logged
   $res0 = SQL_Query_exec("SELECT id, averted1, averted2, averted3 FROM users WHERE enabled = 'yes' AND averted1 = 'yes' || averted2 = 'yes' || averted3 = 'yes' AND last_access > $warning1");
   while ($arr0 = mysql_fetch_assoc($res0))
   {
       SQL_Query_exec("UPDATE users SET averted1 = 'no', averted2 = 'no', averted3 = 'no' WHERE id = $arr0[id]");
   }
   
   //===| First warning
   $res1 = SQL_Query_exec("SELECT id, username, email, averted1 FROM users WHERE enabled = 'yes' AND averted1 = 'no' AND last_access > $warning2 AND last_access < $warning1");
   while ($arr1 = mysql_fetch_assoc($res1))
   {
       // Send first email
       $subject = "Warning for inactivity";
       $body = "You have received this email for the following reason:n------------------------------nYour account '".$arr1["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
       sendmail($arr1["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
       
       SQL_Query_exec("UPDATE users SET averted1 = 'yes' WHERE id = $arr1[id]");
   }
   
   //===| Second warning
   $res2 = SQL_Query_exec("SELECT id, username, email, averted2 FROM users WHERE enabled = 'yes' AND averted2 = 'no' AND last_access > $warning3 AND last_access < $warning2");
   while ($arr2 = mysql_fetch_assoc($res2))
   {
       // Send second email
       $subject = "Warning for inactivity";
       $body = "You have received this email for the following reason:n------------------------------nYour account '".$arr2["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
       sendmail($arr2["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
   
       SQL_Query_exec("UPDATE users SET averted2 = 'yes' WHERE id = $arr2[id]");
   }
   
   //===| Third Warning
   $res3 = SQL_Query_exec("SELECT id, username, email, averted3 FROM users WHERE enabled = 'yes' AND averted3 = 'no' AND last_access > $disabled AND last_access < $warning3");
   while ($arr3 = mysql_fetch_assoc($res3))
   {
       // Send third email
       $subject = "Warning for inactivity";
       $body = "You have received this email for the following reason:n------------------------------nYour account '".$arr3["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
       sendmail($arr3["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
   
       SQL_Query_exec("UPDATE users SET averted3 = 'yes' WHERE id = $arr3[id]");
   }
   
   //===| Disable accounts
   $res4 = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE enabled = 'yes' AND last_access != '0000-00-00 00:00:00' AND last_access < $disabled");
   while ($arr4 = mysql_fetch_assoc($res4))
   {
       $modcomment = htmlspecialchars($arr4["modcomment"]);
       $modcomment = gmdate("d-M-Y") . " - Disabled for inactivity by Systemn". $modcomment;
       $modcom = sqlesc($modcomment);
       SQL_Query_exec("UPDATE users SET enabled = 'no', modcomment = $modcom WHERE id = $arr4[id]");
       write_log("<a href=account-details.php?id=$arr4[id]><b>$arr4[username]</b></a> account has been disabled for inactivity by System");
   }
   //===| End Disable Inactive Accounts |===//
2013-09-27 21:16:20
Thanks a lot @BigMax1!   :P This mod, I just have to test. I have PHP Version: 5.3.27
Unknown User
2013-09-27 21:31:58
This looks cool
Unknown User
2014-05-27 13:30:58
ive just run this on my site with over 35k members site was slow for about 10mins while it did its trick but the only thing is its disabled a load of users including a few vips

how do i modifiy to ignore VIP userclass
Unknown User
2014-05-27 14:45:28
add

AND `class` < 3
after all the

enabled = 'yes'
in the $res1,$res2,$res3 querys like

enabled = 'yes' AND `class` < 3
changing 3 to what ever max class you want to be immune.
Unknown User
2014-05-27 15:13:55
"ArcticWolf, post: 92517":

add

AND `class` < 3
after all the

enabled = 'yes'
in the $res1,$res2,$res3 querys like

enabled = 'yes' AND `class` < 3
changing 3 to what ever max class you want to be immune.

cheers pal wish i would have spotted this before i run the cleanup lol

disabled about 200 odd vips

all sorted now though lol
Unknown User
2014-05-27 15:37:15
one from here [url="http://torrenttrader.org/topic/17587-auto-disable-accounts/?p=92507"]http://torrenttrader.org/topic/17587-auto-disable-accounts/?p=92507[/url] is an little better on load, it dont send 3 pms thought lol

you could also use

AND parked='no'
if have that on your site to help the people the might go vacations..

I cant run either on on my site lol, gmail has an email limit per day and once hit it have to verify account again, if you dont NO emails sent from your site!
Unknown User
2014-05-27 15:52:50
my servers / domains been banned from free services like gmail, hotmail etc etc

i run a email marketing program now to send massmail out..

ill have a look at adding parked account be useful instead of users pming me asking me to leave there account online
2014-05-27 23:14:31
cool!!! Big  thanks BigMax1  :D
Unknown User
2014-05-28 12:29:13
lol movie-torrentz ur site still sending 7 e-mails matey lol
2014-05-28 15:37:32
256 email de mes membres a  eu et le code ralentie  mon site.
solution? avant  je le retir??  :unsure:
*******************************
256 members of my email and had slowed my site code.
solution? before I withdrawn?  :unsure:
Unknown User
2014-05-28 16:12:09
this addon can be extremely slowing down your site cause its prob ran every like 15 minutes or when ever your cleanup is run.. Best bet is to move it to an cron so it can be run like daily or something LOL

[url="http://torrenttrader.org/topic/16995-automated-cron"]http://torrenttrader.org/topic/16995-automated-cron[/url] has very basic cron.. I personally just copy  cron[color=rgb(102,102,0)].[/color]php to cron_24[color=rgb(102,102,0)].[/color]php then add the stuff I want to run every 24 hours.

Other then that it might be the code messed up and why its sending the same emails over and over.. I remember something like this before great xenfore fail.... But it was prob lost in the transfers around.. I dont use it myself so cant help fix it.  I find it pointless to send 3 emails when 1 can do it and give people 10 days to respond lol
Unknown User
2014-05-28 20:32:38
sorry mate ill take a look

"Mancino, post: 92523":

lol movie-torrentz ur site still sending 7 e-mails matey lol
Unknown User
2014-05-28 22:06:56
its been disabled but it still likes sending them emails.. Ill go clear my mailqueue.. Lol
2014-05-28 22:46:39
"ArcticWolf, post: 92528":

this addon can be extremely slowing down your site cause its prob ran every like 15 minutes or when ever your cleanup is run.. Best bet is to move it to an cron so it can be run like daily or something LOL

[url="http://torrenttrader.org/topic/16995-automated-cron"]http://torrenttrader.org/topic/16995-automated-cron[/url] has very basic cron.. I personally just copy  cron[color=rgb(102,102,0)].[/color]php to cron_24[color=rgb(102,102,0)].[/color]php then add the stuff I want to run every 24 hours.

Other then that it might be the code messed up and why its sending the same emails over and over.. I remember something like this before great xenfore fail.... But it was prob lost in the transfers around.. I dont use it myself so cant help fix it.  I find it pointless to send 3 emails when 1 can do it and give people 10 days to respond lol
 exactement ArcticWolf, je pense comme vous sur sa!

****************************&************************

ArcticWolf exactly, I agree with you on her!

Désolé ami BigMax1, je les retirer

~~~~~~~~~~~~~~~~~~~~~~~~~

Sorry BigMax1 friend, I withdraw
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728