<?php
#================================#
# TorrentTrader 2.08 #
# http://www.torrenttrader.org #
#--------------------------------#
# Modified by BigMax #
#================================#
require_once("backend/functions.php");
dbconn(false);
loggedinonly();
stdhead("Your Bookmarks");
begin_frame("<center><b>::: Mes Torrents mis en favoris et en attente du download :::</b></center>");
$page = (int) $_GET['page'];
$perpage = 25;
$res = SQL_Query_exec("SELECT COUNT(*) FROM bookmarks WHERE userid = " . $CURUSER["id"] ."");
$row = mysqli_fetch_array($res);
$count = $row[0];
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "bookmark.php?");
$where = "WHERE bookmarks.userid = " . $CURUSER["id"] ."";
$orderby = "ORDER BY added DESC";
$query = SQL_Query_exec("SELECT bookmarks.id as bookmarkid,
torrents.size,
torrents.freeleech,
torrents.external,
torrents.id,
torrents.category,
torrents.name,
torrents.filename,
torrents.added,
torrents.banned,
torrents.comments,
torrents.seeders,
torrents.leechers,
torrents.times_completed,
categories.name AS cat_name,
categories.parent_cat AS cat_parent,
categories.image AS cat_pic
FROM bookmarks
LEFT JOIN torrents ON bookmarks.torrentid = torrents.id
LEFT JOIN categories ON category = categories.id
$where $orderby $limit");
print("<div style='margin-top:5px; margin-bottom:15px' align='center'><font size='2'>Vous avez mis en favoris <font color='#0080FF'><b>".$count."</b></font> torrent".($count != 1 ? "s" : "")."</font></div>");
$allcats = mysqli_num_rows($query);
if($allcats == 0) {
echo '<table class="f-border" width="90%" cellpadding="10" align="center"><tr><td class="f-border comment" align="center"><b>Votre liste de Torrents favoris est vide!</b></td></tr></table><br />';
} else {
If ($count > $perpage) { print($pagertop); }
?>
<table align="center" cellpadding="4" cellspacing="0" class="table_table" width="90%">
<tr>
<th class="table_head">Type</th>
<th class="table_head" align="left">Torrent Name</th>
<th class="table_head" align="left">Size</th>
<th class="table_head">Added</th>
<th class="table_head"><img src="images/bookmark/down.png" border="0" title="Download"></th>
<th class="table_head"><img src="images/bookmark/comment.png" border="0" title="Comments"></th>
<th class="table_head"><img src="images/bookmark/seed.gif" border="0" title="Seeders"></th>
<th class="table_head"><img src="images/bookmark/leech.gif" border="0" title="Leechers"></th>
<th class="table_head"><img src="images/bookmark/check.png" border="0" title="Completed"></th>
<th class="table_head"><img src="images/bookmark/trash.png" title="Delete Bookmarks" border="0"></th>
</tr>
<?php
while($row = mysqli_fetch_assoc($query))
{
$length = 40; //===| Cut name length
$smallname = htmlspecialchars(CutName($row["name"], $length));
$dispname = "<b>".$smallname."</b>
<br><br>
-- <b>Genre : </b>
<span style='color:#FF4400'><b>" . $row["cat_name"] . "</b>
--[ <span style='color:#3b8299'><b>
" . mksize($row["size"]) ."
</b> ] <img border=\"0\" src=\"images/seed.png
\" width='20' height='20' title=\"".T_("SEEDERS")."!\"></a>(<font color=#31B404><b>".$row['seeders']."</b></font>) - <img border=\"0\" src=\"images/leech.png\" width='20' height='20' title=\"".T_("LEECHERS")."!\"></a>(<font color=red><b>
".$row['leechers']."</b></font>)</b> ";
if ($row["freeleech"] == 1)
{
$freeleech = "<img src='images/free.gif' border='0' title='Free Leech'>";
} else {
$freeleech = "";
}
echo "<tr>";
print ("<td class='table_col1' width='1%' align='center' valign='middle'>");
if (!empty($row["cat_name"])) {
print("<a href=\"torrents.php?cat=".$row["category"]."\">");
if (!empty($row["cat_pic"]) && $row["cat_pic"] != "")
print("<img border=\"0\" src=\"".$site_config['SITEURL']."/images/categories/".$row["cat_pic"]."\" title=\"".$row["cat_parent"].": ".$row["cat_name"]."\" />");
else
print($row["cat_parent"].": ".$row["cat_name"]);
print("</a>");
} else
print("---");
print("</td>\n");
echo "<td class='table_col2' nowrap='nowrap'>".(is_countable($expandrows) && count($expandrows)?"<a href=\"javascript: klappe_torrent('t".$row['id']."')\"><img border=\"0\" src=\"".$site_config["SITEURL"]."/images/bookmark/plus.gif\" id=\"pict".$row['id']."\" alt=\"Show/Hide\" class=\"showthecross\" /></a>":"")." <a title=\"".$row["name"]."\" href=\"torrents-details.php?id=$row[id]&hit=1\">$dispname</a> $freeleech</td>
<td class='table_col1'>".mksize($row["size"])."</td>
<td class='table_col2' align='center'>".date("j.M.Y<\\B\\R>H:i", utc_to_tz_time($row["added"]))."</td>
<td class='table_col1' align='center'><a href=\"download.php?id=".$row["id"]."&name=".rawurlencode($row["filename"])."\"><img src='images/bookmark/icon_down.png' border='0' title=\"Download Torrent\" /></a></td>
<td class='table_col2' align='center'><a href='comments.php?type=torrent&id=$row[id]'>".number_format($row["comments"])."</a></td>
<td class='table_col1' align='center'><font color='limegreen'>".number_format($row["seeders"])."</font></td>
<td class='table_col2' align='center'><font color='red'>".number_format($row["leechers"])."</font></td>
<td class='table_col1' align='center'><font color='darkorange'>".number_format($row["times_completed"])."</font></td>\n";
if ($site_config["ALLOWEXTERNAL"]){
if ($row["external"]=='yes')
print("<td class='table_col2' align='center'><img src='images/bookmark/t_extern.png' border='0' title='External Torrent'></td>\n");
else
print("<td class='table_col2' align='center'><img src='images/bookmark/t_local.png' border='0' title='Local Torrent'></td>\n");
}
echo "<td class='table_col1' align='center'><a href=\"takedelbookmark.php?bookmarkid=".$row['id']."\"><img src=\"images/bookmark/delete.png\" title=\"Delete\" border=\"0\"></a></td>\n";
echo "</tr>\n";
}
echo "</table>";
If ($count > $perpage) { print($pagerbottom); } else { print("<br />"); }
}
end_frame();
stdfoot();
?>
<?php
//
// TorrentTrader v2.x
// $LastChangedDate: 2011-11-01 00:57:44 +0000 (Tue, 01 Nov 2011) $
// $LastChangedBy: dj-howarth1 $
//
// http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();
if ($CURUSER["view_torrents"] == "no")
show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
$id = (int) $_GET["id"];
if (isset($_COOKIE["reseed$id"]))
show_error_msg(T_("ERROR"), "Vous avez recemment fait une demande pour cette semence, veuillez attendre plus longtemps pour une autre demande..", 1);
$res = SQL_Query_exec("SELECT `owner`, `banned`, `external` FROM `torrents` WHERE `id` = $id");
$row = mysqli_fetch_assoc($res);
if (!$row || $row["banned"] == "yes" || $row["external"] == "yes")
show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);
$res2 = SQL_Query_exec("SELECT users.id FROM completed LEFT JOIN users ON completed.userid = users.id WHERE users.enabled = 'yes' AND users.status = 'confirmed' AND completed.torrentid = $id");
$message = $CURUSER['Bonjour,'] . " :: Bonjour, Pouvez-vous remettre en seed le torrent ci-dessous pour le partager SVP car il n'y a actuellement pas ou peu de Seeder ::\n\n" . $site_config["SITEURL"] . "/torrents-details.php?id=$id \n
Thank You!";
while ( $row2 = mysqli_fetch_assoc($res2) )
{
SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row2['id']."', '".get_date_time()."', ".sqlesc($message).")");
}
if ($row["owner"] && $row["owner"] != $CURUSER["id"])
SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row['owner']."', '".get_date_time()."', ".sqlesc($message).")");
setcookie("reseed$id", $id, time() + 86400, '/');
show_error_msg("Complete", "Votre demande de reseed est envoyée.", 1);
?>


