if (!empty($_GET['filter']) && $_GET['filter'] == 'all') { $Join = ''; $All = true; } else { $Join = 'JOIN torrents AS t ON t.GroupID=tg.ID JOIN xbt_snatched AS x ON x.fid = t.ID AND x.uid = '.$LoggedUser['ID']; $All = false; } View::show_header('Torrent groups with no screenshots'); $DB->query(" SELECT SQL_CALC_FOUND_ROWS tg.ID FROM torrents_group AS tg $Join WHERE tg.ID NOT IN (SELECT DISTINCT GroupID FROM torrents_screenshots) AND NOT (tg.CategoryID = 5 AND tg.TagList LIKE \"%audio%\") ORDER BY RAND() LIMIT 20"); // TagList clause quintuples query time. Probably needs to be removed in future $Groups = $DB->to_array('ID', MYSQLI_ASSOC); $DB->query('SELECT FOUND_ROWS()'); list($NumResults) = $DB->next_record(); $Results = Torrents::get_groups(array_keys($Groups)); ?>
=$DisplayName?> |