/* LOAD CACHED PAGE */ $file = "cache/main-".(int)$_GET['sort']."-".(int)$_GET['day'].".html"; $timeout = 1; // 5 minutes $cache_age = @time() - @filemtime($file); // we refresh the content if (!file_exists($file) || (file_exists($file) && $cache_age > $timeout) ) { touch($file); $fp = @fopen($file, "w+b"); $sort = tsort ($_GET['sort']); ///////////////////////////////// $news = mysql_query("SELECT * FROM top5 ORDER BY date DESC LIMIT 5")or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($news) > 0) { $output .= '
Select you preferred Top5 by clicking on the category below
'; $output .='
All - Movies - Games - XXX - Music
'; ?>
'; $output .= ""; $cat_sorting = array("Movies" => 3, "XXX" => 1, "Games" => 1, "Music" =>1); foreach ($cat_sorting as $cat => $lim) { $news = mysql_query("SELECT * FROM top5 WHERE category = '".$cat."' ORDER BY date DESC LIMIT ".$lim."")or sqlerr(__FILE__, __LINE__); while ($row = mysql_fetch_array($news)) { extract($row); $output .= ""; } } $output .= "
\"$name
"; $output .= ""; } /////////////Mod to show torrents from today and the last five days selectable $j = date('Y'); $m = date('m'); $d = date('d'); $count = 0; $tage = 7; //$output .= ""; while ($count<$tage){ $tag = date('d.m.Y',mktime(0,0,0,$m,$d-$count,$j)); $output .= " 
$tag
"; $count++;} //$output .= "
"; $j = date('Y'); $m = date('m'); $d = date('d'); $morgen = date('Y-m-d',mktime(0,0,0,$m,$d+1,$j)); $heute = date('Ymd'); $heute = (isset($_GET['day']) && $_GET['day'] >= 1 && $_GET['day'] <= 4) ? date('Y-m-d', strtotime('-' . ($_GET['day']+0) . ' day')) : date('Y-m-d'); ?>
Torrents posted Today:".$number."
"; $output .= "Torrents vom: " .date_mysql2german($heute). "
\n"; $date=date("d.m.y - H:i", time()); ///////////////////////////////////////////////////// foreach ($catt as $catval) { $result = mysql_query("SELECT * FROM torrents LEFT JOIN filetype ON torrents.filetype = filetype.tid LEFT JOIN categories ON torrents.subcat = categories.subid WHERE maincat = '$catval' AND torrents.datum='$heute' $sort")or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($result) == 0) { } else { $output .= '

'.$catnamet[$catval].'

'; $output .= '