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

Help with regex? — 2023-01-16 16:35:45 in v3 Support
I think I got it, but if anyone see something silly in that code, please tell. I ran in circles a few times for that. and regex is just a foreign language
preg_match_all('/\b(https?):\/\/(www).(imdb.com)[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', $bang2, $matches);
Help with regex? — 2023-01-16 14:03:50 in v3 Support
I spent a few days working this out, and here is what I have. It works, although it may be that there is a bit of redundancy in it since I started getting a headache trying different things lol. The main issue here is it will grab any URL in the string, and I cant do regex, so it would be best if it only grabbed links containing IMDB or variants. This code will check your DESCR and grab the link from it and put it in the DB under imdb when using that table, such as the OMDB mod
//Get any IMDB link from descr and load it into the DB under imdb
$timdb = SQL_Query_exec("SELECT descr FROM torrents WHERE id = $id");
$bang = mysqli_fetch_assoc($timdb);
$bang2 = implode(" ",$bang);
preg_match_all('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', $bang2, $matches);
$urls = $matches[0];

function array_map_callback($url)
{
 return mysqli_real_escape_string($GLOBALS["DBconnector"], $url);
}
array_map('array_map_callback', $urls);
foreach ($urls as $url) {
   SQL_Query_exec("UPDATE `torrents` SET `imdb`= '".$url."' WHERE id = $id");
}
I was working on something, but it needs some work. Was going to see if anyone else here can refine this, since it seems a bit convoluted. I'll post once something is fully working
New_Theme — 2023-01-14 03:48:12 in v3 Themes
Thats a really cool theme. Thanks
I believe this is it
CREATE TABLE `iplog` (
 `id` int(10) UNSIGNED NOT NULL,
 `ip` varchar(15) NOT NULL DEFAULT '',
 `userid` int(10) UNSIGNED NOT NULL DEFAULT 0,
 `added` datetime DEFAULT NULL,
 `lastused` datetime DEFAULT NULL,
 `timesused` int(10) NOT NULL DEFAULT 1
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


I use utf8mb4 collation. You can change that to latin_swedish if you want or whatever collation you use if it matters
https://torrenttrader.uk/post?id=4931
mysql_query

becomes
SQL_Query_exec
Announce Debugger — 2023-01-05 05:50:52 in v3 Support
I'll let ya know. Its fun to play
Announce Debugger — 2023-01-05 04:42:44 in v3 Support
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");
}
Welcome. Im east coast USA. We have some great skilled people here, like Storrents, m-jay, spritblue and others. Its mainly a hobby for all folks here, but we try to help when we are able
old topic, but in backend/URLencypt, find
authkey

replace with
authKey

misspelling error
Captcha TTv3 — 2023-01-02 19:06:17 in v3 Mods in Progress
yea, I looked that code over and I see what changed, like construct and removing globals. Its pretty neat for sure, but yea, you have to pay attention. I was just plugging code and noticed it didnt get all of it so I removed any line comments, and that seemed to make it a bit happier
Captcha TTv3 — 2023-01-02 18:47:14 in v3 Mods in Progress
I was having fun playing with openAI, so I just pasted in the captcha.php code and it said a few errors existed, so for fun, I asked if it could fix it, it said yes and here is what it did. Anyone can test this?
<?php

class Captcha
{
 const RECAPTCHA_API_URL = 'https://www.google.com/recaptcha/api/siteverify';
 private $key;
 private $secret;

 public function __construct($site_config)
 {
     $this->key = $site_config['CAPTCHA_KEY'];
     $this->secret = $site_config['CAPTCHA_SECRET'];
 }

 public function response($captcha)
 {
     if ($site_config['CAPTCHA_ON']) {
         if (!$captcha) {
             autolink(T_('<b>Please check the the captcha form.</b>'), "account-login.php");
         }
         $verifyResponse = file_get_contents(self::RECAPTCHA_API_URL . '?secret=' . $this->secret . '&response=' . $captcha);
         if ($verifyResponse === false) {
             // handle error
             return false;
         }
         $responseData = json_decode($verifyResponse);
         if ($responseData === null) {
             // handle error
             return false;
         }
         if ($responseData->success) {
             // it's successful, so let it go
             return true;
         } else {
             autolink(T_('<b>Please check the the captcha form.</b>'), "account-login.php");
             return false;
         }
     }
     // CAPTCHA not enabled, so return true
     return true;
 }

 public function html()
 {
     if ($site_config['CAPTCHA_ON']) {
         return print("<div class='g-recaptcha' data-theme='light' data-sitekey='" . $this->key . "'></div>");
     }
 }
}
I dont think Im wrong, But I think this line should be this way right? I dont use curly on those queries
SQL_Query_exec("UPDATE `torrents` SET `freeleech` = '1' WHERE `id` = '$row[id]'");


Cool idea @Spiritblue, thanks.
Health Status — 2022-12-30 20:04:29 in v3 Support
if you want, you can use a copy button to copy your announce to the clipboard. Better than clicking and dragging your mouse to highlight and copy. If this can be improved, let me know. In torrents-upload.php find
begin_frame(T_("UPLOAD"));
?>
<form name="upload" enctype="multipart/form-data" action="torrents-upload.php" method="post">
<input type="hidden" name="takeupload" value="yes" />
<table border="0" cellspacing="0" cellpadding="6" align="center">
<?php
print ("<tr><td align='right' valign='top'>" . T_("ANNOUNCE_URL") . ": </td><td align='left'>");

//while (list($key,$value) = thisEach($announce_urls)) {
foreach($announce_urls as $key => $value) {
echo "<b>$value</b><br />";
}


replace with
begin_frame(T_("UPLOAD"));
?>
<table border="0" cellspacing="0" cellpadding="6" align="center">
<?php
echo "<br />";
print ("<tr><td align='right' valign='top'>" . T_("ANNOUNCE_URL") . ": </td><td align='left'>");

foreach($announce_urls as $key => $value) {
echo ("<input type='text' id='myInput' size='30' value='" . $value . "' />");
}
?>

<!-- The button and styling used to copy the announce -->
<style>
.tooltip {
   position: relative;
   display: inline-block;
}

.tooltip .tooltiptext {
   visibility: hidden;
   width: 140px;
   background-color: #555;
   color: #fff;
   text-align: center;
   border-radius: 6px;
   padding: 5px;
   position: absolute;
   z-index: 1;
   bottom: 150%;
   left: 50%;
   margin-left: -75px;
   opacity: 0;
   transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
   content: "";
   position: absolute;
   top: 100%;
   left: 50%;
   margin-left: -5px;
   border-width: 5px;
   border-style: solid;
   border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
   visibility: visible;
   opacity: 1;
}
</style>

<div class="tooltip">
<button onclick="myFunction()" onmouseout="outFunc()">
 <span class="tooltiptext" id="myTooltip">Copy to clipboard</span>
 Copy Announce
 </button>
</div>
<script>
function myFunction() {
 var copyText = document.getElementById("myInput");
 copyText.select();
 document.execCommand("Copy");
 
 var tooltip = document.getElementById("myTooltip");
 tooltip.innerHTML = "Copied!";
}

function outFunc() {
 var tooltip = document.getElementById("myTooltip");
 tooltip.innerHTML = "Copy to clipboard";
}
</script>

<!--END copy button and styling-->


<form name="upload" enctype="multipart/form-data" action="torrents-upload.php" method="post">
<input type="hidden" name="takeupload" value="yes" />

<?php

Health Status — 2022-12-30 19:28:17 in v3 Support
backend/config.php
$site_config['ALLOWEXTERNAL'] = true;		//Enable Uploading of external tracked torrents

I assume thats what you are asking. Create a torrent with your own announce as per the upload page
Health Status — 2022-12-30 18:31:53 in v3 Support
make sure you have cURL installed, and also UDP torrents have always been an issue. As a test, go get a ubuntu torrent and upload it and try again https://ubuntu.com/download/server#downloads
take out the space at the beginning of each sql line
session time — 2022-12-21 19:48:21 in v3 Support
in account login, recover and signup, below dbconn() put
session_start();

github updated. That should have been there, not sure why its missing
Captcha TTv3 — 2022-12-18 19:39:19 in v3 Mods in Progress
perhaps post your login php file
session time — 2022-12-18 19:28:38 in v3 Support
that sounds like a browser issue. Try clearing cookies and data cache
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728