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

updated 13/03/22

Played around with rss and you can try this - i noticed guests where not allowed to view so that may have stopped it so the download file might as well let me know
there was a couple of small errors in the rss but seems to be working now you can check your rss feed
here

replace apps/views/blocks/rss_block.php
<?php
if ($_SESSION['loggedin'] == true) {
   // Enter Rss Feed Url eg $feedUrl = "http://localhost/M-BiTsy/rss?dllink=1";
   $feedUrl = "";

   Style::block_begin(Lang::T("RSS"));
   if (!$feedUrl) { ?>
       <p class="text-center"><small>This would need editing with an rss feed of your choice.</small></p> <?php
   } else {
       $domOBJ = new DOMDocument();
       $domOBJ->load($feedUrl);
       $content = $domOBJ->getElementsByTagName("item");
       foreach ($content as $data) {
           $title = $data->getElementsByTagName("title")->item(0)->nodeValue;
           $link = $data->getElementsByTagName("link")->item(0)->nodeValue;
           echo "<small>".CutName($title, 20)." <br> <a href='$link'>".CutName($link, 20)."</a></small><br><br>";
       }
   }

   Style::block_end();
}


replace app/controller.rss.php
<?php
class Rss
{

   public function __construct()
   {
       Auth::user(0, 0);
   }

   public function index()
   {
       $cat = $_GET["cat"];
       $dllink = (int) $_GET["dllink"];
       $passkey = $_GET["passkey"];
       $incldead = $_GET["incldead"];

       if (!get_row_count("users", "WHERE passkey=" . sqlesc($passkey))) {
           $passkey = "";
       }
       $where = "";
       $wherea = array();
       if (!$incldead) {
           $wherea[] = "visible='yes'";
       }
       if ($cat) {
           $cats = implode(", ", array_unique(array_map("intval", explode(",", (string) $cat))));
           $wherea[] = "category in ($cats)";
       }
       if (Validate::Id($_GET["user"])) {
           $wherea[] = "owner=$_GET[user]";
       }
       if ($wherea) {
           $where = "WHERE " . implode(" AND ", $wherea);
       }
       $limit = "LIMIT 50";
       
       header( "Content-type: text/xml");
       echo ('<?xml version="1.0" encoding="UTF-8" ?>
       <rss version="2.0">');
       
       echo ('
       <channel>
       <title>' . Config::get('SITENAME') . '</title>
       <link>' . URLROOT . '</link>
       <description>' . htmlspecialchars(Config::get('SITENAME')) . ' RSS Feed</description>');

       $res = DB::run("SELECT torrents.id, torrents.name, torrents.size, torrents.category, torrents.added, torrents.leechers, torrents.seeders, categories.parent_cat as cat_parent, categories.name AS cat_name FROM torrents LEFT JOIN categories ON category = categories.id $where ORDER BY added DESC $limit");
       while ($row = $res->fetch(PDO::FETCH_LAZY)) {
           list($id, $name, $size, $category, $added, $leechers, $seeders, $catname) = $row;
           //$guid = "".URLROOT . "/torrent?id=$id&hit=1";
           if ($dllink) {
               if ($passkey) {
                   $link = "".URLROOT."/download?id=$id&passkey=$passkey";
               } else {
                   $link = "".URLROOT."/download?id=$id";
               }
           } else {
               $link = "".URLROOT . "/torrent?id=$id&hit=1";
           }
           $pubdate = date("r", TimeDate::sql_timestamp_to_unix_timestamp($added));
           echo ("
           <item>
           <title>" . htmlspecialchars($name) . "</title>
           <guid>" . htmlspecialchars($link) . "</guid>
           <link>" . htmlspecialchars($link) . "</link>
           <pubDate>" . $pubdate . "</pubDate> <category> " . $row["cat_parent"] . ": " . $row["cat_name"] . "</category>
           <description>Category: " . $row["cat_parent"] . ": " . $row["cat_name"] . "  Size: " . mksize($size) . " Added: " . $added . " Seeders: " . $seeders . " Leechers: " . $leechers . "</description>
           </item>");
       }
       
       echo ('
       </channel>
       </rss>');
   }

   public function custom()
   {
       $resqn = DB::raw('categories', 'id, name, parent_cat', '', 'ORDER BY parent_cat ASC, sort_index ASC');
       $data = [
           'title' => Lang::T("CUSTOM_RSS_XML_FEED"),
           'resqn' => $resqn
       ];
       View::render('rss/custom', $data, 'user');
   }

   
   public function submit()
   {
       if ($_POST) {
           $params = array();
           if ($cats = $_POST["cats"]) {
               $catlist = array();
               foreach ($cats as $cat) {
                   if (is_numeric($cat)) {
                       $catlist[] = $cat;
                   }
               }
               if ($catlist) {
                   $params[] = "cat=" . implode(",", $catlist);
               }
           }
           if ($_POST["incldead"]) {
               $params[] = "incldead=1";
           }
           if ($_POST["dllink"]) {
               $params[] = "dllink=1";
           }
           if (!$_POST["cookies"] && $_SESSION['loggedin'] == true) {
               $params[] = "passkey=".Users::get('passkey')."";
           }
           if ($params) {
               $param = "?" . implode("&", $params);
           } else {
               $param = "";
           }
           $mss = "Your RSS link is: <a href=\"".URLROOT."/rss$param\">".URLROOT."/rss$param</a><br/><br/>";
           Redirect::autolink(URLROOT, $mss);
       }
   }
}
Proposal — 2022-03-11 12:30:21 in General Chat
added admin bit as well - ill mess around this weekend - going well so far just a matter of joining tables now


a quick start on building pages as well ill keep adding examples https://torrenttrader.uk/docs/controllers

updated
added search for tags as well


ill update github tomorrow & and ill re-write mod into one controller to add to wiki for another example   👍
Proposal — 2022-03-11 07:15:42 in General Chat
something like this https://torrenttrader.uk/atest  🤓  seems to be pretty simple - maybe you could add file type, bit-rate, quality etc just playing around with database interaction at minute
Proposal — 2022-03-10 18:54:03 in General Chat
Botanicar:
My first suggestion I got from my uploaders was that you can choose more than just one movie / TV Show categories.Instead of select, we can implement radio buttons (or similar) so that they can select categories the file has regardless of what iMDB or TMDB says.
I myself would prefer to avoid their direct contact to my tracker (in addition to some services rating or trailer but it can be fixed with YT trailer anyway)


ideally this would be tags i like this idea so ill see if i can find some examples hopefully where you type- having loads of buttons could get pretty big
TMDB can be turned off in admin settings
Suggestions — 2022-03-10 18:40:17 in M-BiTsy Support
shoutbox is ajax related or js the old TT one is too old and bulky ill see if i can find any ajax examples online

shoutcast is difficult because its sever based, and i can not test. From what i remember its just a radio that can show listeners and current song its difficult to get other information or manage shoutcast account

i have played with a radio recently where i can scrape a radio url and get all the info with a json maybe that would work on a shoutcast url - there is a post somewhere ill find it and ill see if its possible
Proposal — 2022-03-04 17:28:34 in General Chat
Made a start on docs, I'll see if I can find files and post this weekend
to remove search completely try change search bar from search/browse to search

in app/controller/user/search remove
    public function index()
   {
       $this->check();

       $search = search(); // torrent function to help search

       $count = DB::run("SELECT COUNT(*) FROM torrents " . $search['where'], $search['params'])->fetchcolumn();
       if ($count) {
           list($pagerbuttons, $limit) = Pagination::pager(25, $count, URLROOT . "/search?$search[url]$search[pagerlink]");
           $res = Torrents::search($search['where'], $search['orderby'], $limit, $search['params']);

           if (!$search['keyword'] == '') {
               $title = Lang::T("SEARCH_RESULTS_FOR") . " \"" . htmlspecialchars($search['keyword']) . "\"";
           } else {
               $title = Lang::T("SEARCH");
           }

           $data = [
               'title' => $title,
               'res' => $res,
               'pagerbuttons' => $pagerbuttons,
               'keyword' => $search['keyword'],
               'url' => $search['url'],
           ];
           View::render('search/search', $data, 'user');
       } else {
           Redirect::autolink(URLROOT."/search", "Nothing Found Try Again");
       }
   }


then replace
public function browse()


with
public function index()


Quote:
The http://localhost/peer/uploaded is saying that the user did not upload anything, even if I try seeding it?

this is for list of torrents uploaded by user http://localhost/peer/uploaded
this is for list of torrent seeded by user http://localhost/peer/seeded

PASSKEY — 2022-03-02 05:57:24 in v3 Support
Looking at the example you give are you changing Web address
Because that would be something like htaccess this would be for all
make these changes to just the app/controller/torrents.php bits https://github.com/M-jay84/M-BiTsy/commit/f97fda9c1eb9530e8903ba852f0bcab9fec236c6

Your welcome,  any problems let us know, all testing is finished but might need odd tweek  👍
Delete the row from the table because you tried uploading without api key the data will be empty and the cache


Or try new upload
AJAX Polls v1 — 2022-02-18 05:52:00 in v3 Mods Completed
You would just need to change this query work

$poll = $stmt->fetch(PDO::FETCH_ASSOC);
if ($poll) {
  $stmt = $conn->prepare('SELECT * FROM poll_answers');
  $stmt->execute();
  $poll_answers = $stmt->fetchAll(PDO::FETCH_ASSOC);
} else {
  die('Poll does not exist.');
}


I'd search "FROM polls" in editor get example and just play with it prepare would be the v3 exec function, fetch would be sqli_fetch_assoc etc just make new test.php file you would need to include functions.php and dbconn function at top but once you have the query everything else should work - not used this myself
Have you changed settings in app/config/config.php

// TMDB
define('_TMDBAPIKEY', 'Place_Api_Key_Here'); // Place Key Here ////////
define('_TMDBLANG', 'en'); // TMDB Language
define('_TMDBDEBUG', false);


Do you have tmdb account, you find key in settings/api
https://www.themoviedb.org/settings/api

You need to check cat name eg Movies
define('MovieCats', array('Movies')); // movie cats eg array('Movies','MoviesHD')
define('SerieCats', array('Apps')); // serie cat eg array('Anime','tv')
// TMDB
try replace app/libraries/parse.php with https://github.com/M-jay84/M-BiTsy/blob/main/M-BiTsy/app/libraries/Parse.php

are you using qbit ?
Force Login [TTv3] — 2022-02-16 05:49:05 in v3 Mods Completed
Go to staff cp - settings change member only to true

you need to add your username to app/config/config.php to be able to view
// Can edit Settings
define('_OWNERS', array('M-jay'));
Passkey is assigned on download only
http://localhost

normally has name on end
http://localhost/nameorfolder

Are you using xampp?
that url in config does not look right
define('URLROOT', 'http://localhost/M-BiTsy');


in html/htaccess try
<IfModule mod_rewrite.c>
Options -Multiviews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule  ^(.+)$ index.php?url=$1 [QSA,L]
</IfModule>
ballon user TTV3 — 2022-02-15 06:10:37 in v3 Mods Requests
ok lets see what we can do  🤓 this assumes you have balloon mod installed

first we need information from user db table this is what we change ip, uploaded, downloaded etc have a look at user account and see what you want
for now add id, upload & download also lets make all names links replace
$a ="SELECT class, donated, warned, enabled FROM `users` WHERE username ='".$name."'";


with
$a ="SELECT id, class, donated, warned, enabled, uploaded, downloaded, avatar FROM `users` WHERE username ='".$name."'";


replace
return unesc("<font color='".$col."'>".$name."".$star."".$warn."".$disabled."</font>");
}


with - this must be 1 line any gaps & it breaks
return unesc("<a href='".$site_config['SITEURL']."/account-details.php?id=".$classy['id']."'  onMouseover=\"return overlib('<table class=ballooncolor border=1 width=300px align=center><tr valign=top><td class=ballooncolor align=center><img border=0 height=200 width=120 src=$avatar></td><td width=80%  class=ballooncolor><div align=left><b>Class: </b><font color=" . $col . ">" . $classy["class"] . "</font><br /><b>Donated: </b>" . $classy["donated"] . "<br /><b>Downloaded: </b><font color=red>" . mksize($classy["downloaded"]) . "</font><br /><b> Uploaded: </b>" . mksize($classy['uploaded']) . "</div></td></tr></table>', CENTER, HEIGHT, 200, WIDTH, 300)\"; onMouseout=\"return nd()\"><font color='" . $col . "'>" . $name . "" . $star . "" . $warn . "" . $disabled . "</font></a>");

BT v1/v2 parser Work — 2022-02-14 16:51:58 in M-BiTsy Support
my final code blocking hybrid - they seem pointless but we need v1, finally got the class displaying all return parse info array the same - nice work adding scraper

needs some fine tuning but running perfectly - the only other thing i edited except the parse function was this line on torrents-upload
this was because i switched the values to get subfolders so just changed order before db insert
                        if (($i + 1) == $count) {
                           $fname = $file["path"][$i] . $dir ;
                       } else {
                           $dir .= "/" . $file["path"][$i];
                       }


parse function with correct results https://torrenttrader.uk/atest
<?php

class Parse
{

   public function torr($filename = "")
   {
       // First Check File Is Torrent
       $torrent = explode(".", $filename);
       $fileend = strtolower(end($torrent));
       if ($fileend != "torrent") {
           die('this is not a torrent');
       }

       // Set Arrays
       $torrentInfo = array();
       $array = array();

       // Read The File
       $parse = file_get_contents("$filename");
       if (!isset($parse)) {
           die("Error Getting Torrent file");
       }

       // Decode File Array
       $array = Bencode::decode($parse);

       // If Array Lets Read It
       if ($array === false) {
           die("Unable to decode file.");
       }

       // Check Info Is There
       if (array_key_exists("info", $array) === false) {
           die("Error opening torrent.<br>");
       }

       // Read info
       $info = $array["info"];
       if (isset($info["file tree"]) && isset($info["files"])) {
           die('We do not allow hybrid, we except v1 while others catch up but use v2 when possible');
       }

       // Get Announce URL
       $torrentInfo['announce'] = $array["announce"];

       // Get Announce List Array
       if (isset($array["announce-list"])) {
           $torrentInfo["announce-list"] = $array["announce-list"];
       }

       // Calculates date from UNIX Epoch
       $torrentInfo["creation date"] = date('r', $array["creation date"]);

       // Get torrents comment
       if (isset($array['comment'])) {
           $torrentInfo['comment'] = $array['comment'];
       }

       // The name of the torrents is different to the file name
       $torrentInfo['name'] = $info['name'];

       // Calculate Size/Count
       $filecount = 0;
       $torrentsize = 0;

       // Get The Hash
       if (isset($info["file tree"])) {
           // Calculates SHA256 Hash
           $hash = hash('sha256', Bencode::encode($info));
           $torrentInfo['hash'] = substr($hash, 0, 40);
           // Return Marker To identify as v2
           $torrentInfo['type'] = '2';
       } else {
           // Calculates SHA1 Hash
           $torrentInfo['hash'] = hash('sha1', Bencode::encode($info));
           // Return Marker To identify as v1
           $torrentInfo['type'] = '1';
       }

       // V2 Get file list
       if (isset($info["file tree"]) && is_array($info["file tree"])) {
           // For Now Dont Allow V2
           //unlink("$filename");
           //die("We Dont Except V2 Torrents Just Yet.");

           $Iterator = new RecursiveIteratorIterator(
               new RecursiveArrayIterator($info["file tree"]),
               RecursiveIteratorIterator::SELF_FIRST
           );
           foreach ($Iterator as $key => $val) {
               if ($key != 'pieces root' && $key != 'length' && !empty($key)) {
                   $subfolder = substr($key, -4, 1);
                   if($subfolder === '.') {
                       $keys[0] = $key;
                       $filecount = ++$filecount;
                   } else {
                       $keys[1] = $key;
                   }
               }
               if ($val > 1 && is_int($val)) {
                   $vals = $val;
                   $torrentsize += $val;
               }
               if ($val > 1 && is_int($val)) {
                   $paths[] = [
                       'length' => $vals,
                       'path' => $keys,
                   ];
               }
           }
   
           $torrentInfo['files'] = $paths;
           $torrentInfo['length'] = $torrentsize;
           $torrentInfo['ttfilecount'] = $filecount;

       } elseif (isset($info["files"]) && is_array($info["files"])) {

           // V1 Get file list
           foreach ($info["files"] as $file) {
               $filecount = ++$filecount;
               $torrentsize += $file['length'];

               $path[0] = $file['path'][1] ?? $file['path'][0];
               if ($file['path'][1] ===  $path[0]) {
                   $path[1] = $file['path'][0];
               }
               
               $length = $file['length'];
               $paths[] = [
                   'length' => $length,
                   'path' => $path
               ];
           }

           $torrentInfo['files'] = $paths;
           $torrentInfo['length'] = $torrentsize;
           $torrentInfo['ttfilecount'] = $filecount;
       } else {
           // Single File Torrent
           $torrentInfo['name'] = $info['name'];
           $torrentInfo['length'] = $info['length'];
           $torrentInfo['ttfilecount'] = 1;
       }

       return $torrentInfo;
       //var_dump($torrentInfo);
   }
}


although im not sure if clients can do v2 except qbit at least we have the ground work  😂 its a bit shocking how little there is to interacting with torrent - get data from file & a announce array for the client - thanks for helping out dont get many members helping out playing with this kind of stuff  👍
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