function screen_stats($id) { if (isset($_POST['clear_stats']) && check_admin_referer('drainhole-clear_stats')) { DH_Access::delete_by_file($id); } global $wpdb; $pager = new DH_Pager($_GET, $_SERVER['REQUEST_URI'], 'created_at', 'DESC', 'drain-hole-downloads', array('users' => $wpdb->users . '.ID')); $files = DH_Access::get_by_file($id, $pager); $file = DH_File::get($id); $hole = DH_Hole::get($file->hole_id); $this->render_admin('downloads', array('stats' => $files, 'file' => $file, 'pager' => $pager, 'hole' => $hole)); }