$title = 'Top Files'; $folder = []; $folder['name'] = 'Home'; $folder['use_icon'] = 0; $act = $ss->get_input('act', 1); include_once('./header.php'); include_once('./assets/ads/bcategory.php'); $options = ['order_by' => 'hits DESC', 'limit' => 20]; switch($act) { case '1': $verb ='Yesterday'; $date = date("dmY", TIME_NOW-86400); $query = $db->simple_select("download_history", "fid, hits", "date='{$date}'", $options); break; case '2': $verb ='Week'; $date = date("dmY", TIME_NOW-604800); $query = $db->simple_select("download_history", "fid, hits", "date>={$date}", $options); break; case '3': $verb = 'Month'; $date = date("dmY", TIME_NOW-2592000); $query = $db->simple_select("download_history", "fid, hits", "date>={$date}", $options); break; default: $verb =' Today '; $date = date("dmY", TIME_NOW); $query = $db->simple_select("download_history", "fid, hits", "date='{$date}'", $options); break; } // Category title echo '

'.$verb.' Top20 Files

'; include_once('./assets/ads/acategory.php'); $top_links = [['value' => '1', 'name' => 'Yesterday'], ['value' => '2', 'name' => 'Week'], ['value' => '3', 'name' => 'Month'], ['value' => 0, 'name' => 'Today']]; echo '
'; $bar = ''; foreach($top_links as $sort_link) { echo ''.$bar.''.$sort_link['name'].''; $bar = ' | '; } echo '
'; include_once('./assets/ads/bfilelist.php'); $total = $db->num_rows($query); if($total != 0) { while($top = $db->fetch_array($query)) { $query2 = $db->simple_select("files", "fid, name, size, path, pid", "fid='{$top['fid']}'"); $file = $db->fetch_array($query2); if($file['pid'] != 0) { $query2 = $db->simple_select("files", "fid, use_icon", "fid='{$file['pid']}'"); $folder = $db->fetch_array($query2); } echo '
'; if(file_exists(SS_ROOT.'/thumbs/'.$file['fid'].'.png')) { echo ''.escape($file['name']).''; } else if($folder['use_icon'] == 1 && file_exists(SS_ROOT.'/thumbs/'.$folder['fid'].'.png')) { echo ''.escape($file['name']).''; } else { echo ''.escape($file['name']).''; } echo '
'.escape($file['name']).'
['.convert_filesize($file['size']).']
'.$top['hits'].' Hits
'; } } else { echo '
No top file
'; } include_once('./assets/ads/afilelist.php'); echo '
Home » Top Files
'; include_once('./footer.php');