if(!defined('DATALIFEENGINE')){die("Hacking attempt!");} $limit = intval( $config['torrent_number'] ); $count_all = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_torrents as torrents, ".PREFIX."_post as post WHERE torrents.news_id=post.id AND post.approve=1"); $posts = $count_all['count']; if($posts){ $page = intval( $_REQUEST['cstart'] ); $total = intval( ( ( $posts - 1 ) / $limit ) + 1 ); if( $page <= 0 ) $page = 1; if( $page > $total ) $page = $total; $start = $page * $limit - $limit; $i = $start; $result = $db->query("SELECT torrents.news_id, torrents.ctime, torrents.leechers, torrents.seeders, torrents.completed, torrents.size, post.category, post.alt_name, post.title FROM ".PREFIX."_torrents as torrents, ".PREFIX."_post as post WHERE torrents.news_id=post.id AND post.approve=1 ORDER BY post.date DESC LIMIT " . $start . "," . $limit); while($row = $db->get_row($result)){ $i ++; $cat = "".$cat_info[$row['category']]['name'].""; $news_link = "".$row['title'].""; $top_table .= "