<?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();
}<?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);
}
}
} 

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)
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");
}
}public function browse()public function index()Quote:The http://localhost/peer/uploaded is saying that the user did not upload anything, even if I try seeding it?
$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.');
}
// TMDB
define('_TMDBAPIKEY', 'Place_Api_Key_Here'); // Place Key Here ////////
define('_TMDBLANG', 'en'); // TMDB Language
define('_TMDBDEBUG', false);
define('MovieCats', array('Movies')); // movie cats eg array('Movies','MoviesHD')
define('SerieCats', array('Apps')); // serie cat eg array('Anime','tv')
// TMDB
// Can edit Settings
define('_OWNERS', array('M-jay')); define('URLROOT', 'http://localhost/M-BiTsy');<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> $a ="SELECT class, donated, warned, enabled FROM `users` WHERE username ='".$name."'";$a ="SELECT id, class, donated, warned, enabled, uploaded, downloaded, avatar FROM `users` WHERE username ='".$name."'";return unesc("<font color='".$col."'>".$name."".$star."".$warn."".$disabled."</font>");
}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>"); if (($i + 1) == $count) {
$fname = $file["path"][$i] . $dir ;
} else {
$dir .= "/" . $file["path"][$i];
}<?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);
}
}