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
User Posts

Go to Profile

I found a few errors in the announce and fixed them. If you are using the stock TTv3 announce. go to github and replace that file with the new one. This only pertains to people using the github version. If you made custom edits, just compare the files and make any needed changes. https://github.com/MicrosoulV3/TorrentTrader-v3
TorrentTrader 3.0 — 2024-08-09 15:37:21 in v3 Download
Always check github for updates. I found an error in the announce and fixed it on github. If your files are untouched, you can replace them directly, or if you have altered your file, you can compare the files on github to yours and make the appropriate changes
Hello TT Community — 2024-07-19 23:44:58 in General Chat
yea, still around. Hello
This mod was on here I think, but I cant find it. If you have this, try this. I think its better. It will use ajax to search users so you wont be sending upload credits into the netherworld or not send them at all. Let me know what you think. I tested it, seems to work well.
you can add this to your account.php. Edit as needed
<a href="uptransfer.php"><b><?php echo T_("DONATE_UPLOAD_CREDITS"); ?></b></a><br />

then add this file to your root directory. name it uptransfer.php, or whatever you want, just link it as a new php file
<?php
require_once("backend/functions.php");
dbconn();
loggedinonly();
$action = $_REQUEST["action"];

if ($action == "searchuser") {
   $query = $_GET['query'];

   $stmt = $GLOBALS["DBconnector"]->prepare("SELECT username FROM users WHERE username LIKE ?");
   $searchTerm = $query . "%"; // match starting characters
   $stmt->bind_param("s", $searchTerm);
   $stmt->execute();
   $result = $stmt->get_result();

   $usernames = [];
   while ($row = $result->fetch_assoc()) {
       $usernames[] = $row['username'];
   }

   echo json_encode($usernames);
   die();
}


if ($action == "taketransfer") {
   $username = trim($_POST["username"]);
   $credit = (int)$_POST["credit"];
   $unit = trim($_POST["unit"]);
   $anonym = isset($_POST["anonym"]) ? $_POST["anonym"] : '';

   if (empty($username)) {
       autolink("uptransfer.php", "No recipient was added...");
   }

   if ($credit < 1 || !$CURUSER) {
       autolink("uptransfer.php", "Transfer is too small...");
   }

   // Define size units
   define('KB', 1024);
   define('MB', 1024 * KB);
   define('GB', 1024 * MB);
   define('TB', 1024 * GB);

   // Convert credit to bytes
   switch ($unit) {
       case 'kb':
           $credit *= KB;
           break;
       case 'mb':
           $credit *= MB;
           break;
       case 'gb':
           $credit *= GB;
           break;
       case 'tb':
           $credit *= TB;
           break;
       default:
           autolink("uptransfer.php", "Invalid unit specified...");
   }

   if ($CURUSER["uploaded"] < $credit) {
       autolink("uptransfer.php", "You are trying to donate upload credits while you currently have insufficient credits...");
   }

   $stmt = $GLOBALS["DBconnector"]->prepare("SELECT id, uploaded, modcomment FROM users WHERE username = ?");
   $stmt->bind_param("s", $username);
   $stmt->execute();
   $res = $stmt->get_result()->fetch_assoc();

   if (!$res) {
       autolink("uptransfer.php", T_("USER_NOT_FOUND"));
   }

   $receiver = $res["id"];
   $sender = $CURUSER["id"];
   $modcomment1 = $res["modcomment"];
   $modcomment2 = $CURUSER["modcomment"];

   // Prepare modcomments
   $date = gmdate("Y-m-d");
   $modcomment1 = "$date - Credit upload: $username obtained " . mksize($credit) . " from " . $CURUSER['username'] . ".\n" . $modcomment1;
   $modcomment2 = "$date - Credit upload: " . $CURUSER['username'] . " donated " . mksize($credit) . " to $username.\n" . $modcomment2;

   // Update receiver's uploaded credits and modcomment
   $stmt = $GLOBALS["DBconnector"]->prepare("UPDATE users SET uploaded = uploaded + ?, modcomment = ? WHERE id = ?");
   $stmt->bind_param("isi", $credit, $modcomment1, $receiver);
   $stmt->execute();

   // Update sender's uploaded credits and modcomment
   $stmt = $GLOBALS["DBconnector"]->prepare("UPDATE users SET uploaded = uploaded - ?, modcomment = ? WHERE id = ?");
   $stmt->bind_param("isi", $credit, $modcomment2, $sender);
   $stmt->execute();

   // Send notification
   $subject = "You got an upload credit!";
   if ($anonym != 'anonym') {
       $msg = "Your account has been credited " . mksize($credit) . " compliments of " . $CURUSER['username'] . ".";
       $stmt = $GLOBALS["DBconnector"]->prepare("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES (?, ?, NOW(), ?, 0, ?)");
       $stmt->bind_param("iiss", $sender, $receiver, $msg, $subject);
   } else {
       $msg = "Your account has been credited " . mksize($credit) . " compliments of an anonymous user.";
       $stmt = $GLOBALS["DBconnector"]->prepare("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES (0, ?, NOW(), ?, 0, ?)");
       $stmt->bind_param("iss", $receiver, $msg, $subject);
   }
   $stmt->execute();

   // Log the transfer
   write_log("<font color=lime size=2>Credit Upload:</font><a href=account-details.php?id=$sender target=_blank>" . $CURUSER['username'] . "</a> donated " . mksize($credit) . " to <a href=account-details.php?id=$receiver target=_blank>$username</a>");

   autolink("uptransfer.php", "You have given " . mksize($credit) . " in upload credit to " . $username);
   die();
}

/* Start Page Output */
stdhead("Donate Uploads");

begin_frame(T_('Q&A'));
?>
<b><?php echo T_("WHY_SHOULD_DONATE"); ?></b><br />
<?php echo T_("CREDIT_UP_TEXT1"); ?>
<?php
end_frame();

begin_frame(T_('TRANSFER_UPLOAD'));
?>
<center>
   <form name="transfer" method="post" action="uptransfer.php?action=taketransfer">
       <table width="500" cellpadding="5">
           <tr>
               <td width="100"><b><?php echo T_("DONATE_TO"); ?>:</b></td>
               <td>
                   <input type="text" id="username" name="username" size="20" onkeyup="searchUser(this.value)" autocomplete="off">
                   <input type="checkbox" name="anonym" value="anonym"> <?php echo T_("ANONYMOUS_TRANSFER"); ?>
                   <div id="suggestions" style="border: 1px solid #ccc; display: none; max-height: 100px; overflow-y: auto;"></div>
               </td>
           </tr>
           <tr>
               <td width="100"><b><?php echo T_("AMOUNT_CREDIT"); ?>:</b></td>
               <td>
                   <input type="text" autocomplete="off" name="credit" size="20" value="1" pattern="\d*" title="Only numbers are allowed.">
                   <select name="unit">
                       <option value="kb">KB</option>
                       <option value="mb">MB</option>
                       <option value="gb">GB</option>
                       <option value="tb">TB</option>
                   </select>
               </td>
           </tr>
           <tr>
               <td colspan="2">
                   <center><input name="submit" type="submit" value="Transfer!"></center>
               </td>
           </tr>
       </table>
   </form>
</center>
<?php
end_frame();
stdfoot();
?>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
function searchUser(query) {
   if (query.length > 0) { // Adjusted to start with the first character
       $.ajax({
           url: 'uptransfer.php?action=searchuser',
           type: 'GET',
           data: { query: query },
           success: function(data) {
               var suggestions = JSON.parse(data);
               var suggestionsList = '';
               if (suggestions.length > 0) {
                   suggestions.forEach(function(username) {
                       suggestionsList += '<div class="suggestion-item" onclick="selectUsername(\'' + username + '\')">' + username + '</div>';
                   });
               } else {
                   suggestionsList = '<div class="suggestion-item">No suggestions found</div>';
               }
               $('#suggestions').html(suggestionsList).show();
           }
       });
   } else {
       $('#suggestions').hide();
   }
}

function selectUsername(username) {
   $('#username').val(username);
   $('#suggestions').hide();
}
</script>

<style>
.suggestion-item {
   padding: 10px;
   cursor: pointer;
}

.suggestion-item:hover {
   background-color: #f0f0f0;
}
</style>
Hello — 2024-07-13 21:30:43 in General Chat
hope everyone is doing great. Have a wonderful day  😊
thanks for sharing. I assume this is for users who make forum posts anonymously?
in shoutbox.php find and replace these 2 functions with this code.
function therooms()
{
   $data = '<select name="room" class="bb_icon" onchange="if(this.options[this.selectedIndex].value != -1){ window.location = this.options[this.selectedIndex].value; }">
       <option value="shoutbox.php?room=0" ' . ($GLOBALS['room'] == 0 ? 'selected="selected"' : '') . '>Public</option>
       <option value="shoutbox.php?room=1" ' . ($GLOBALS['room'] == 1 ? 'selected="selected"' : '') . '>VIP</option>';

   if (get_user_class() >= 5) {
       $data .= '<option value="shoutbox.php?room=2" ' . ($GLOBALS['room'] == 2 ? 'selected="selected"' : '') . '>Staff</option>';
   }

   $data .= '</select>';

   return $data;
}

and
function theroomsh()
{
   $data = '<select name="room" class="bb_icon" onchange="if(this.options[this.selectedIndex].value != -1){ window.location = this.options[this.selectedIndex].value; }">
       <option value="shoutbox.php?history=0&room=0" ' . ($GLOBALS['room'] == 0 ? 'selected="selected"' : '') . '>Public</option>
       <option value="shoutbox.php?history=0&room=1" ' . ($GLOBALS['room'] == 1 ? 'selected="selected"' : '') . '>VIP</option>';

   if (get_user_class() >= 5) {
       $data .= '<option value="shoutbox.php?history=1&room=2" ' . ($GLOBALS['room'] == 2 ? 'selected="selected"' : '') . '>Staff</option>';
   }

   $data .= '</select>';

   return $data;
}
@Botanicar 😂
I assume everything should be working now
you need NO_ENGINE_SUBSTITUTION as the sql mode, yours is blank, thats not good. https://www.linode.com/community/questions/17070/how-can-i-disable-mysql-strict-mode
OK, now go and disable strict mode for your server. Just google how to do that if you dont know how
I stopped editing that version several years ago, but it did work AS-IS on php 5.6. Remember to turn off mysql strict mode for it to work completely. You can use my checkOLD file to see what SQL mode you are in. Some of my check file is for php7.4, so only pay attention to the top of the file where it shows SQL MODE. You only want NO_ENGINE_SUBSTITUTION. Upload that file and visit yoursite.com/checkOLD.php
should also post the actual error. That looks to me like a code block. Having the error itself would help
remove id if you have mysql strict mode on. I was going through some code for fun to fix any strict mode errors, and found this one. I think this is the only fix needed for this mod. id is auto_increment, so its not needed here and will cause an error
SQL_Query_exec("INSERT INTO commonpot (userid, points, added) VALUES($CURUSER[id], $_POST[seedbonus], '" . get_date_time() . "')");
Here is my file if it helps
Ajax Shoutbox V3 — 2024-04-20 14:36:22 in v3 Mods in Progress
ajShoutHistory.php, find
   if (isset($_GET['del'])){

       if (is_numeric($_GET['del'])){
               $query = "SELECT * FROM ajshoutbox WHERE id=".$_GET['del'];
               $result = SQL_Query_exec($query);
       }else{
               echo "invalid msg id STOP TRYING TO INJECT SQL";
               exit;
       }

       $row = mysqli_fetch_row($result);
             
       if ((get_user_class() >= 4) || ($CURUSER['username'] == $row[1]) ){  
               $query = "DELETE FROM ajshoutbox WHERE id=".$_GET['del'];
               //write_log("<B>".SHOUTBOX_DEL."   ".$CURUSER['username']."</b>");
               SQL_Query_exec($query);  
       }
}


Replace with
if (isset($_GET['del'])) {
  if (is_numeric($_GET['del'])) {
      $delId = intval($_GET['del']); // Convert to integer for security

      // Check if the message ID exists in the database
      $query = "SELECT * FROM ajshoutbox WHERE id=$delId";
      $result = SQL_Query_exec($query);

      if (mysqli_num_rows($result) == 0) {
          echo "Message with ID $delId not found.";
          exit;
      }

      $row = mysqli_fetch_row($result);

      // Perform further actions only if the user has sufficient privileges or owns the message
      if (get_user_class() >= 4 || $CURUSER['username'] == $row[1]) {
          // Check if the delete confirmation
          if (isset($_POST['confirm_delete'])) {
              $query = "DELETE FROM ajshoutbox WHERE id=$delId";
              SQL_Query_exec($query);
              echo "Message with ID $delId deleted successfully.";
          } else {
              // Display confirmation
              echo "<form method='post' style='font-size: 16px; color: #333; text-align: center;'>
                      <p style='font-size: 18px; color: #f00;'>Are you sure you want to delete this message?</p>
                      <input type='submit' name='confirm_delete' value='Yes' style='font-size: 16px; color: #fff; background-color: #007bff; border: none; padding: 8px 16px; cursor: pointer;'>
                      <button type='button' onclick='window.history.back()' style='font-size: 16px; color: #fff; background-color: #6c757d; border: none; padding: 8px 16px; cursor: pointer;'>No</button>
                    </form>";
          }
      } else {
          echo "You do not have permission to delete this message.";
      }
  } else {
      echo "Invalid message ID. STOP TRYING TO INJECT SQL!";
      exit;
  }
}
AJAX shoutbox changes — 2024-04-14 17:05:51 in General Chat
I posted a new update for this mod at the link above. I like this new code better than what I posted before
Ajax Shoutbox V3 — 2024-04-14 17:04:21 in v3 Mods in Progress
found a better way instead of the delete button opening a new window for no reason, here is an ajax version. Has a confirmation box after deletion, you can change that if you want.
function delup(id) {
 if (confirm("Are you sure you want to delete this message?")) {
     var xhr = new XMLHttpRequest();
     xhr.open("GET", "chatedit.php?del=" + id, true);
     xhr.onreadystatechange = function() {
         if (xhr.readyState === 4 && xhr.status === 200) {
             alert("Message deleted successfully");
         } else if (xhr.readyState === 4 && xhr.status !== 200) {
             alert("Failed to delete message");
         }
     };
     xhr.send();
 }
}
this maybe has potential. Its not complete, but thats why I post it here, for help making it better or working. From what i can work out, you need what is in the SRC folder. Unpack those files to your backend/ folder.  You can see the path in the first few lines of code. Then you have to get OAUTH2 shit from google. You will have to google that if you dont know what I mean. Here is the phpmailer https://github.com/PHPMailer/PHPMailer
and here is what I was trying to do. Maybe community help will work to make this work.
BACKUP all files before testing anything. It would be fun to get this working, but I havent had time to play.
backend/mail.php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\OAuth;


$GLOBALS["TTMail"] = new TTMail;

class TTMail {
   var $type;

   var $smtp_host;
   var $smtp_port = 465; // Update to Gmail's SMTP port for TLS
   var $smtp_ssl = false;
   var $smtp_auth = true;
   var $smtp_user;
   var $smtp_pass;
   var $oauth2_client_id; // Add OAuth2 client ID
   var $oauth2_client_secret; // Add OAuth2 client secret
   var $oauth2_refresh_token; // Add OAuth2 refresh token

   function __construct() {
       GLOBAL $site_config;

       switch (strtolower($site_config["mail_type"])) {
           case "phpmailer":
               $this->type = "phpmailer";
               $this->smtp_host = 'smtp.gmail.com';
               $this->smtp_port = 465;
               $this->smtp_auth = true;
               $this->smtp_user = $site_config["mail_smtp_user"];
               $this->smtp_pass = $site_config["mail_smtp_pass"];

               // Add OAuth2 settings
               $this->oauth2_client_id = $site_config["oauth2_client_id"];
               $this->oauth2_client_secret = $site_config["oauth2_client_secret"];
               $this->oauth2_refresh_token = $site_config["oauth2_refresh_token"];

               // Enable TLS
               $this->smtp_ssl = 'tls';
               break;

           case "pear":
               $this->type = "pear";
               $this->smtp_ssl = $site_config["mail_smtp_ssl"];

               if ($this->smtp_ssl) {
                   $this->smtp_host = "ssl://" . $site_config["mail_smtp_host"];
               } else {
                   $this->smtp_host = $site_config["mail_smtp_host"];
               }

               $this->smtp_port = $site_config["mail_smtp_port"];
               $this->smtp_auth = $site_config["mail_smtp_auth"];
               $this->smtp_user = $site_config["mail_smtp_user"];
               $this->smtp_pass = $site_config["mail_smtp_pass"];

               if (!@include_once("Mail.php")) {
                   trigger_error("Config is set to use PEAR Mail but it is not installed (or include_path is wrong).", E_USER_WARNING);
                   $this->type = "php";
               }
               break;

           case "php":
           default:
               $this->type = "php";
       }
   }

   function Send($to, $subject, $message, $additional_headers = "", $additional_parameters = "") {
       GLOBAL $site_config;

       if (preg_match("!^From:(.*)!m", $additional_headers, $matches)) {
           $from = trim($matches[1]);
       } else {
           $from = "$site_config[SITEEMAIL]";
       }

       $additional_headers = preg_replace("!^From:(.*)!m", "", $additional_headers);
       $additional_headers .= "\nFrom: $from\nReturn-Path: $from";
       $additional_headers = trim($additional_headers);
       $additional_headers = preg_replace("!\n+!", "\n", $additional_headers);

       switch ($this->type) {
           case "phpmailer":
               $mail = new PHPMailer(true);
               $mail->isSMTP();
               $mail->Host = $this->smtp_host;
               $mail->Port = $this->smtp_port;
               $mail->SMTPAuth = $this->smtp_auth;
               $mail->Username = $this->smtp_user;
               $mail->Password = $this->smtp_pass;

               // Add OAuth2 settings
               $mail->OAuth2ClientId = $this->oauth2_client_id;
               $mail->OAuth2ClientSecret = $this->oauth2_client_secret;
               $mail->OAuth2RefreshToken = $this->oauth2_refresh_token;

               $mail->SMTPSecure = $this->smtp_ssl;

               $mail->setFrom($from);
               $mail->addAddress($to);
               $mail->Subject = $subject;
               $mail->Body = $message;

               try {
                   $mail->send();
               } catch (Exception $e) {
                   echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
               }
               break;

           case "pear":
               $headers = array("From" => $from, "Return-Path" => $from, "To" => $to, "Subject" => $subject);
               $params = array("host" => $this->smtp_host, "port" => $this->smtp_port, "auth" => $this->smtp_auth, "username" => $this->smtp_user, "password" => $this->smtp_pass);
               $smtp = Mail::Factory("smtp", $params);

               $mail = $smtp->send($to, $headers, $message);
               break;

           case "php":
           default:
               @mail($to, $subject, $message, $additional_headers, $additional_parameters);
               break;
       }
   }
}

function sendmail($to, $subject, $message, $additional_headers = "", $additional_parameters = "") {
   GLOBAL $TTMail;
   $TTMail->Send($to, $subject, $message, $additional_headers, $additional_parameters);
}
?>

config would be
// BELOW IS SETTINGS FOR OAUTH2 GMAIL. NEED OAUTH2 KEY (see code in mail.php)
// $site_config["mail_type"] = "phpmailer";
// $site_config["mail_smtp_host"] = "smtp.gmail.com"; // SMTP server hostname
// $site_config["mail_smtp_port"] = "465"; // SMTP server port
// $site_config["mail_smtp_ssl"] = true; // true to use SSL (ONLY USED WITH PEAR. Is not used with phpmailer)
// $site_config["mail_smtp_auth"] = true; // MUST BE true to use auth for SMTP (JUST LEAVE SET TO TRUE)
// $site_config["mail_smtp_user"] = "person@gmail.com"; // SMTP username
// $site_config["mail_smtp_pass"] = "Password"; // SMTP password
// $site_config["oauth2_client_id"] = "CLIENT ID HERE"; // OAUTH2 keys from google to use gmail shit
// $site_config["oauth2_client_secret"] = "SECRET KEY HERE";
// $site_config["oauth2_refresh_token"] = ""; //Im not sure how to get this yet.
AJAX shoutbox changes — 2024-03-31 13:59:48 in General Chat
I made a change to this mod. If you use this, you now have a sanity check on the delete. That drove me nuts for a long time, but im lazy. Thats all https://torrenttrader.uk/post/9739
Ajax Shoutbox V3 — 2024-03-31 12:38:19 in v3 Mods in Progress
sanity check for the delete feature. Im sure if you use this you know that if you hit the X to delete a shout, it just deletes and if you made a mistake, you cannot go back. This is a check for that
In ajshoutbox.js find
function delup(id) {
        newWin=window.open('chatedit.php?del='+id,'delete','height=500,width=490,resizable=yes,scrollbars=yes');
        if (window.focus) {newWin.focus()}
}

replace with
function delup(id) {
 if (confirm("Are you sure you want to delete this message?")) {
     newWin = window.open('chatedit.php?del=' + id, 'delete', 'height=500,width=490,resizable=yes,scrollbars=yes');
     if (window.focus) {
         newWin.focus();
     }
 }
}
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728