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

Yes do not worry, I understand most French too, Im brought up French immersion so I get most without question, news as well on tv. I can watch full program ;) canadian., and staple in lingual education ~ Québec - do speak freely lol

$ip = getip();
$query = @unserialize(file_get_contents('http://ip-api.com/php/'.$ip));
if($query && $query['status'] == 'success') {
   $userlocation = "Signed in from <b>" . $query['city'].'</b>, <b>'.$query['region'].'</b>. <b>'.$query['country'].'</b><div>IP: <b>'.getip()."</b></div>";
}
echo $userlocation;


You can modify this, but do use the API. Its very helpful. This gives you everything you need for the user.
[USER=20338]@niki[/USER] what is the code you need to do what you want? if It’s “top seeders“ on torrents-details, thats very easy and a 3-4 lines of code, and you don’t even need a table. I use div nesting for tables. We can fetch rows of data from user/peer. This catalog mod I don’t think will do this I’m actually not sure what the catalog mod does. I’ve done most features by scratch already, so if you need help let me know.
I've developed a mod for my upcoming changes and my main site itself. So what this script does is it scans all
of the .torrent files in your /uploads/ dir and converts them all to database BLOB data. This is file-less bencoded/bdecoded data pulled from
your database and has several advantages, notably backups and database security.

With the days of internet censorship, among all else - I am in this direction.

[url='https://study.com/academy/lesson/sql-data-types-binary-large-object.html']Read about BLOB data and what it can do for you.[/url]

So I spent the day developing this tool to grab all your torrents, parse all their data and push that bencoded data to your database.
This is as easy as it gets and wasn't very easy for me but this cuts a lot of technicality and bs and just gets it done for you (and myself) at a click!

Just upload ZIP to root, and head to /migratev3.php

[ATTACH type="full" alt="migrate1.png"]5755[/ATTACH]

[ATTACH type="full" alt="migrate2.png"]5756[/ATTACH]

NOTE:
Be sure to make a full SQL backup immediately, before running this tool. This rehashes info_hash on ALL rows, as they are rehashed by bencode().

What can I do with the data?
Keep the BLOB data stored for now. It is safe. More will follow in a few days. What will come, is a change for torrents-details.php to feed all torrent-related data through the bdecode class instead of
how it pulls it right now. That will provide file info, sizes, info_hash, data, comment, announce etc

UPDATE: This is a perfect and safe update as to migrate all with NO interference of any sort. For those who want this in the future.


<?php
// Convert .torrent files => DB => BLOB data
// STorrents2020@TorrentTrader.xyz
require_once 'backend/functions.php';
require_once 'backend/classes/bencoding.class.php';
dbconn();
?>

<style>.migrator{box-shadow:inset 0 39px 0 -24px #e67a73;background:#e4685d;border-radius:4px;border:1px solid #fff;display:inline-block;cursor:pointer;color:#fff;font-family:Arial;font-size:15px;padding:6px 15px;text-decoration:none;text-shadow:0 1px 0 #e61d12}.migrator:hover{background-color:#f31717}.migrator:active{position:relative;top:1px}</style>

<?php
stdhead("Torrent BLOB Migrator");
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
   // Add missing data column if needed
   @SQL_Query_exec("ALTER TABLE torrents ADD COLUMN data MEDIUMBLOB NOT NULL");
   // Locate .torrent files
   $dir = new DirectoryIterator('uploads/');
   foreach ($dir as $fileinfo) {
       if (!$fileinfo->isDot()) {
           $getthelist = $fileinfo->getFilename();
           $fp         = fopen('uploads/' . $getthelist, 'rb');
           $data       = '';
           while (!feof($fp)) {
               $data .= fread($fp, 8192);
           }
           fclose($fp);
           $arr = bdecode($data);
           if ($arr === false) {
               //die('invalid torrent');
               continue;
           }
           if (!array_key_exists('info', $arr)) {
               //die('invalid torrent');
               continue;
           }
           //$arr['info']['private'] = 1;
           $infobc                 = bencode($arr['info']);
           if ($infobc === false) {
               die('bencoding error');
           }
           $info_hash  = sha1($infobc);
           $total_size = 0;
          if ($checktype['info']['private'] = 1) { // Added - Check if torrent is private - Sep 1, 2020
               if (array_key_exists('files', $arr['info'])) {
                   foreach ($arr['info']['files'] as $file) {
                       if (array_key_exists('length', $file)) {
                           $total_size += $file['length'];
                       }
                   }
               } else if (array_key_exists('length', $arr['info'])) {
                   $total_size += $arr['info']['length'];
               }
               $data = bencode($arr);
           } else {
               $data = bdecode($data); // Public torrent            
           }
           $fileid = str_replace('.torrent', '', $getthelist);
           $data   = bencode($arr);
           $db = new mysqli($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
           $db->set_charset("utf8mb4");
           $stmt = $db->prepare("UPDATE torrents SET data = ?, size = ? WHERE id = ?");
           $stmt->bind_param("sii", $data, $total_size, $fileid);
           $stmt->execute();
           $stmt->close();
       }
   }
   header("Location: " . $site_config['SITEURL'] . "/migratev3.php?complete");
   exit();
}

begin_frame("<h1>TTv4 Torrent => BLOB Database Migrator</h1>");
    $totaltorrents = new DirectoryIterator('uploads');
    $checkcolumn = true;
   if (!empty($checkcolumn)): echo '<div style="margin:0 0 10px 0;padding:10px;background:#242424;color:#FFF;border-radius:7px;text-align:left">BLOB database column: <span style="font-weight:500;color:orange">Found</span></div>'; else: echo '<div>Data column <b>not</b> found.</div>'; endif;
   printf('<form action="migratev3.php" method="post">');
   printf('<a href="#" class="migrator" onclick="submit();">Migrate Now</a> @credits to <span style="font-weight:500">STorrents2020</span>@TorrentTrader.xyz');
   printf('<div style="padding-top:10px">Found <span style="font-weight:500">' . iterator_count($totaltorrents) . '</span> torrent files in <span style="font-weight:500">/uploads/</span></div>');
   if (is_string($_GET['complete'])):
       echo '<div style="margin:10px 0 10px 0;padding:10px;background:#242424;color:#FFF;border-radius:7px;text-align:left"><span style="font-weight:600;background:#C0C0C0;color:#242424;padding:0 5px 0 5px;border-radius:4px;margin-right:8px">' . iterator_count($totaltorrents) . '</span> torrents successfully imported as BLOB data.</div>';
   endif;
   printf('</form>');
end_frame();
stdfoot();
?>
"m-jay, post: 69017, member: 20288":

I managed to do some more test and finish it off but the more test the better, github updated client & contact on bottom left in admin - i also noticed the usermenu (profile, messages etc)  switching -
i had given each controller a usermenu template each now there all use the same so that should be fixed - you will need the new sql attached

use the master branch mate & for [USER=20382]@STorrents2020[/USER] heres a comment i made for client ban in db  https://github.com/M-jay84/Torrent-Trader-MVC-PDO-OOP/commit/1506a42fe0977dcc398531973d65accf69162ea6

its the announce, sql & the client controller dont mind the html mess left it there before i move it to a template


thanks!!
Take my advice and kill the frames, that’s why I was going on about that a while back, once day chrome won’t be rendering frames and nothing will work,. It’s old HTML4 standards back in our KaZAa days. No need for it today, that’s why I recorded and mines solid.

AJAX isn’t even necessary if you don’t want cpu load, you can convert the existing php code of that mod and drop in place.
I can do a hundreds things to mine I just get tied up on files and no one really uses shoutbox that much there. They confuse it with search and it annoys everyone reading it, sometimes trolling.


if your ready to kick the thing, ill do it up for you and add your dB class in. But JS is needed for events / refresh / DOM load. Your class will accept it with open arms trust me.
"MicroMonkey, post: 69015, member: 311":

Looks good. I will try it later. I did see 2 instances of mysql which should be mysqli, so if it help anyone and they are using TTv3, those 2 edits will be
find
$id = mysql_insert_id();

replace with
$id = mysqli_insert_id($GLOBALS["DBconnector"]);


find
if (mysql_errno() == 1062)

replace with
if (mysqli_errno($GLOBALS["DBconnector"]) == 1062)

I will have to see about incorporating my heavily modded upload file with yours. Mine looks like this, so It would prolly take me some time to remake it, but thanks alot for this new stuff, its fantastic


No problem at all, and Thank you for that feedback that’s great! I just got tired of individually selection a single fil over and over again when I can batch upload so many at a single click, so I did some digging, and It made sense for the site. Enjoy
Its fairly simply to do, with more checking involved. Passing 3-4 hidden inputs will get everything you need. Here's a example i would pursue this.


if (!empty($_POST['reply']) && (intval($_POST['replied_id'])) {

$replyid = $_POST['replied_id'] ? intval($_POST['replied_id']) : 0;
$getreply = $_POST['message'];
$getuserid = $_POST['reply_userid'];
$senderid = $CURUSER['id'];
$recievername = $CURUSER['username'];

// Query (example code)
$data = ['msgid' => $replyid, 'user' => $recievername, 'message' => $getreply, 'date' => $db->now(), 'userid' => $getuserid];
$db->where('id', $senderid);
$db->insert('shoutbox', $data);
}
Great. I'll work at this one and figure out what the issue is. Unless you don't have GD, but I think its the columns (NULL / NOT NULL killed the upload process in its tracks). It took a while to figure that out.
I know you route through index.php , can i make subdir in my live server or will links be issue not being in root ?
Yes i wish I had another install, i'll do a subdir and see whats going on
What I did (for 5GB) is have them fill out a field for their profile, if enough chars are met (we ask 160 chars) they get the bonus 5GB on signup.


// 5GB Bonus - Fill out Bio (160 char) - Check
   if (strlen($bio) >= 160) {
       $uploaded = '5368709120'; // 5GB - 5368709120 bytes
       $bonus = 'yes';
       $bonustitle = '5GB Bonus Starter';
   }else{
       $uploaded = '0'; // 0GB - 0 bytes
       $bonus = 'no';
       $bonustitle = 'Regular';
   }


$uploaded => users.uploaded
$bonus     => users.bonus_enabled (VARCHAR(160) ALLOW NULL DEFAULT 'no'.)
$bonustitle => users.bonustitle TEXT(10) ALLOW NULL DEFAULT 'Regular'.

Those 2 last are custom columns I made. strlen checks if form field has text filled in or not. Then $bio = $_POST['profilebio'] and add input name="profilebio". Fits the job well.
I have ported the multi-uploader => MySQLi Edition. This includes torrent-rw class + imageresizer class. Someone tell me how it functions.

Open file > With cursor highlight several files at a time and upload as normal. Confirm all copies were uploaded. Tell me any errors if present.
I have ported the multi-uploader => PDO Edition. This includes torrent-rw class + imageresizer class. Someone tell me how it functions, I don't have a live copy of this TT. But should work.

Open file > With cursor highlight several files at a time and upload as normal. Confirm all copies were uploaded. Tell me any errors if present.

Possible issues: NON NULL columns. Needs testing outside of the original work.
"m-jay, post: 68991, member: 20288":

Need to test on more clients but heres screenshot so far


Thats a great idea! I never thought about that
Here I spent a fair amount of hours and caffeine tonight (thats overnight)  :coffee:  - finally tackled torrents-upload.php by the balls. So here it is.

It is a fresh start, completely rewritten and utilizes torrent-rw class. I rewrote this whole process 3 times to get it right. And finally its doing what the old one does, all accurate.

If you have V4 running as of the early BETA1, upload this to your root / and enjoy.

Replace torrents-upload.php with the ZIP, and copy parse.class.php to root /.

This will be included in BETA2 with improvements. This lets you access and upload with ease.

Next version: GD resize class for images

Any code tips or notes of improvement are strongly encouraged! :D
Tracker Timeout — 2020-08-10 11:24:07 in v3 Support
If you don't mind, and be a torrent that is of no concern, can you share the info_hash / announce url? i can do the rest from there and tell you whats going on.
"m-jay, post: 68961, member: 20288":

installed on live server php 7.4 editing mysql, config & .htaccess all seems to load fine

still having issue with paths Rewrite support required. Extension not enabled or installed!
cant find on host where to restart apache on cpanel is  :unsure:  is enabled for mvc and /signup /login are loading fine

in login i noticed line 22 header('Location: [url='http://codys-imac.local/);']http://codys-imac.local/');[/url] is this correct
All seems fine on few pages i load just cant link between the pages login justs keeps refreshing login page, same with signup


Yes edit that line to localhost instead, thank you will look into that, that should be user class I think
Your using a route through index.php on the SVN build, I wish I did that =(

Once you have rewrite figured out i have a bunch of updates to throw at you in a ZIP, to ease things even further. Im crunching page by page. Leaving the most difficult to the very end then its off to mysqli object class and mysql.php / config.php switch work. Prior to uploading BETA1, I merged every single database connection call to /backend/mysql.php so thats all that needs an edit.

Im just wrapping up news post page and that will be included too. its pretty brilliant. My class docs explain to me 'method chaining', so I'll be crunching the code down even more reducing the lines and increasing readability.

Torrent-details is completely chained now. i like it better as i can define the object clauses without defining $db all the time.
"niki, post: 68957, member: 20338":

can you put it in mysqli because mysql is at the end of its life and will become obsolete, thank you in advance.


We are converting page by page to convert away from mysql_ often rewriting its code entirely (I did with news last night). I prefer a full PDO implementation, but we will support both using a DB function configurable : mysqli, PDO_mysql

BETA2 will see many exciting changes and compatibility.
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