Just a place to compile changes and release to "completed mods".
What this does:
It utilizes /backend/cleanup.php to trigger message events to the Shoutbox. While cleanup performs the same, it pushes updates to the Shoutbox too, such as:
- Total seeders today (private torrents)
- We have 27 comments on 33 torrents today
- Cleaning peers. Stale for 15 minutes.
- Auto Leech has been warned for Username
- Auto Leech ban has been lifted for Username
- There are 16 peers on the tracker today
Thats what I have so far, keeping in mind this is important so your shoutbox doesn't become bombed:
Seems to be "okay", but still too often. Adjust this config to reduce the hammering of tracker updates. Set to 5 minutes. Use google to calculate minutes to seconds.
So I assigned the "user" of shout to be a Bot account made and restricted for just this. Works well. Another UNIT3D rip.
I'm surprised this wasn't default functionality. Seems to be the way on modern sites.
Open /backend/cleanup.php
Find:
Add under:
Find:
Add under:
Find:
Add under:
Find:
Add under:
I believe SQL escape is in order - advise?
Now you need to make an account dedicated for this, use the username you want and modify the INSERT statements --- or just register with NerbBot as username.
What this does:
It utilizes /backend/cleanup.php to trigger message events to the Shoutbox. While cleanup performs the same, it pushes updates to the Shoutbox too, such as:
- Total seeders today (private torrents)
- We have 27 comments on 33 torrents today
- Cleaning peers. Stale for 15 minutes.
- Auto Leech has been warned for Username
- Auto Leech ban has been lifted for Username
- There are 16 peers on the tracker today
Thats what I have so far, keeping in mind this is important so your shoutbox doesn't become bombed:
$site_config['autoclean_interval'] = '300'; // 300 = 5 minutes (seconds)Seems to be "okay", but still too often. Adjust this config to reduce the hammering of tracker updates. Set to 5 minutes. Use google to calculate minutes to seconds.
So I assigned the "user" of shout to be a Bot account made and restricted for just this. Works well. Another UNIT3D rip.
I'm surprised this wasn't default functionality. Seems to be the way on modern sites.
Open /backend/cleanup.php
Find:
$res = SQL_Query_exec("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder");
Add under:
// Send to Shoutbox - Total seeders today
$getcount = mysql_fetch_assoc($res);
$seeders = $getcount["c"];
$event = "There are $seeders Private Seeders Today!";
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, 'NerbBot', '$event', NOW(), 0)");
Find:
$res = SQL_Query_exec("SELECT torrent, COUNT(torrent) as c FROM comments WHERE torrent > 0 GROUP BY torrent");
Add under:
// Send to Shoutbox - Total comments posted
$getcount = SQL_Query_exec("SELECT COUNT(torrent) as c FROM comments");
$restotal = mysql_fetch_assoc($getcount);
$commcount = $restotal["c"];
$event = "Currently there are $commcount comments posted";
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, 'NerbBot', '$event', NOW(), 0)");
Find:
SQL_Query_exec("UPDATE torrents SET visible='no' WHERE visible='yes' AND last_action < FROM_UNIXTIME($deadtime) AND seeders = '0' AND leechers = '0' AND external !='yes'");
Add under:
// Send to Shoutbox Bot - May 15, 2020
$thedate = time_ago($site_config["max_dead_torrent_time"]);
$logged = str_replace('ago', '', $thedate);
$event = "Torrent dead for $logged Sending to graveyard.";
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, 'NerbBot', '$event', NOW(), 0)");
Find:
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES ('0', '".$arr["id"]."', '".$timenow."', '".$reason."', '0', 'Warning: Poor Ratio')");
Add under:
// Send to Shoutbox - Low ratio warning
$warneduser = $arr["username"];
$event = "Auto Leech warning has been added for $warneduser";
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, 'NerbBot', '$event', NOW(), 0)");
I believe SQL escape is in order - advise?
Now you need to make an account dedicated for this, use the username you want and modify the INSERT statements --- or just register with NerbBot as username.
