View Single Post
  #1  
Old 10th February 2010, 06:58
pwnage pwnage is offline
Senior Member
 
Join Date: Jan 2010
P2P
Posts: 45
Default Recent Block
PHP Code:
OpenTable("Recently Uploaded");
        
$sql "SELECT ".$db_prefix."_torrents.*, IF(".$db_prefix."_torrents.numratings < '".$minvotes."', NULL, ROUND(".$db_prefix."_torrents.ratingsum / ".$db_prefix."_torrents.numratings, 1)) AS rating, ".$db_prefix."_categories.name AS cat_name, ".$db_prefix."_categories.image AS cat_pic, U.username, IF(U.name IS NULL, U.username, U.name) as user_name, U.level as user_level FROM ".$db_prefix."_torrents LEFT JOIN ".$db_prefix."_categories ON category = ".$db_prefix."_categories.id LEFT JOIN ".$db_prefix."_users U ON ".$db_prefix."_torrents.owner = U.id WHERE banned = 'no' AND ".$db_prefix."_torrents.password IS NULL ORDER BY ".$db_prefix."_torrents.added DESC LIMIT 10;";
        
$res $db->sql_query($sql) or btsqlerror($sql);
        if (
$db->sql_numrows($res) > 0) {
                
torrenttable($res,"usertorrent");
        } else {
                
OpenTable2();
                echo 
"<h3>"._btnotorrents."</h3>";
                
CloseTable2();
        }
CloseTable(); 
Reply With Quote