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
Announce Debugger
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2023-01-04 23:24:09
Open announce.php and find:


function err($msg) {
   return benc_resp_raw("d".benc_str("failure reason").benc_str($msg)."e");
}


Replace with


function err($msg) {
   SQL_Query_exec("INSERT INTO announce_log (message, added) VALUES ('$msg', NOW())");
   return benc_resp_raw("d".benc_str("failure reason").benc_str($msg)."e");
}


Execute SQL


CREATE TABLE `announce_log` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`message` VARCHAR(255) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
`added` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
);


Now just monitor that table. It will fill up fast, but at least you know whats going on now. I assume the error reports are consistent with common problems, but its a old file so it will require some long term observation.
Last edited by STorrents2020 on 2023-01-04 23:28:57
2023-01-05 04:42:44
cool, I will try it. For fun (again) I used that AI, and it said this lol. I did edit it for v3, but its neat what it came up with, I dont think the sanitize was needed, but meh..... I love the line comments. My old instructor used to give me hell when I would write code assignments and not comment them, he hated me for it. I completely understand why lol. I used utf8mb4_unicode collation, but all the same. Thanks for this. I'll check it from time to time and see what happens
function err($msg) {
   // Sanitize user input to prevent SQL injection attacks
   $safe_msg = mysqli_real_escape_string($GLOBALS["DBconnector"], $msg);

   // Execute the query and check for errors
   $result = mysqli_query($GLOBALS["DBconnector"], "INSERT INTO announce_log (message, added) VALUES ('$safe_msg', NOW())");
   if (!$result) {
       return benc_resp_raw("d".benc_str("failure reason").benc_str("Error executing query: " . mysqli_error($GLOBALS["DBconnector"]))."e");
   }

   // Return success response if the insert was successful
   return benc_resp_raw("d".benc_str("success").benc_str("")."e");
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2023-01-05 04:50:59
2023-01-05 05:15:27
I got vouchers coming to TorrentTrader. Wrapping up now. Works beautifully! Full write from scratch. Secure as heck. Generate thousands of voucher codes. Redeem for data, features or more. AI helped speed up the function with a do/while and array checks, so its super fast!

Do let me know how that announce report goes, I've had it running for 2 weeks and tells me exactly what is going on with my announce file at all times. I dont even need to debug anymore lol

The AI code there is recommending good code, but is overriding the DB function so its really up you. Does it still work? I guess you wont know just yet lol..

2023-01-05 05:50:52
I'll let ya know. Its fun to play
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
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: 5
  • Members: 0
  • Guests online: 5
  • Comments: 3
  • Messages: 1,728