-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtorrents-today.php
52 lines (40 loc) · 1.85 KB
/
torrents-today.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
//
// TorrentTrader v2.x
// $LastChangedDate: 2011-11-19 09:29:54 +0000 (Sat, 19 Nov 2011) $
// $LastChangedBy: dj-howarth1 $
//
// http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn(false);
//check permissions
if ($site_config["MEMBERSONLY"]){
loggedinonly();
if($CURUSER["view_torrents"]=="no")
show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
}
stdhead(T_("TODAYS_TORRENTS"));
begin_frame(T_("TODAYS_TORRENTS"));
$date_time=get_date_time(gmtime()-(3600*24)); // the 24 is the hours you want listed
$catresult = SQL_Query_exec("SELECT id, name FROM categories ORDER BY sort_index");
while($cat = mysql_fetch_assoc($catresult))
{
$orderby = "ORDER BY torrents.id DESC"; //Order
$where = "WHERE banned = 'no' AND category='$cat[id]' AND visible='yes'";
$limit = "LIMIT 10"; //Limit
$query = "SELECT torrents.id, torrents.anon, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where AND torrents.added>='$date_time' $orderby $limit";
$res = SQL_Query_exec($query);
$numtor = mysql_num_rows($res);
if ($numtor != 0) {
echo "<b><a href='torrents.php?cat=".$cat["id"]."'>$cat[name]</a></b>";
# Got to think of a nice way to display this.
#list($pagertop, $pagerbottom, $limit) = pager(1000, $count, "torrents.php"); //adjust pager to match LIMIT
torrenttable($res);
echo "<br />";
}
}
end_frame();
stdfoot();
?>