query("SELECT SQL_CALC_FOUND_ROWS unt.TorrentID, unt.UnRead, unt.FilterID, unf.Label, t.GroupID FROM users_notify_torrents AS unt JOIN torrents AS t ON t.ID = unt.TorrentID LEFT JOIN users_notify_filters AS unf ON unf.ID = unt.FilterID WHERE unt.UserID=$UserID". ((!empty($_GET['filterid']) && is_number($_GET['filterid'])) ? " AND unf.ID='$_GET[filterid]'" : "")." ORDER BY TorrentID DESC LIMIT $Limit"); $GroupIDs = array_unique($DB->collect('GroupID')); $DB->query('SELECT FOUND_ROWS()'); list($TorrentCount) = $DB->next_record(); $Debug->log_var($TorrentCount, 'Torrent count'); $Pages = Format::get_pages($Page, $TorrentCount, NOTIFICATIONS_PER_PAGE, 9); if(count($GroupIDs)) { $TorrentGroups = Torrents::get_groups($GroupIDs); $TorrentGroups = $TorrentGroups['matches']; // Need some extra info that Torrents::get_groups() doesn't return $DB->query("SELECT ID, CategoryID FROM torrents_group WHERE ID IN (".implode(',', $GroupIDs).")"); $GroupCategoryIDs = $DB->to_array('ID', MYSQLI_ASSOC, false); //Clear before header but after query so as to not have the alert bar on this page load $DB->query("UPDATE users_notify_torrents SET UnRead='0' WHERE UserID=".$LoggedUser['ID']); $Cache->delete_value('notifications_new_'.$LoggedUser['ID']); } View::show_header('My notifications', 'notifications'); $DB->set_query_id($Results); ?>

Latest notifications (clear all) (clear selected) (edit filters)

record_count()) { ?>
No new notifications found! Edit notification filters
next_record(MYSQLI_ASSOC)) { if(!$Result['FilterID']) { $Result['FilterID'] = 0; } if(!isset($FilterGroups[$Result['FilterID']])) { $FilterGroups[$Result['FilterID']] = array(); $FilterGroups[$Result['FilterID']]['FilterLabel'] = $Result['Label'] ? $Result['Label'] : false; } array_push($FilterGroups[$Result['FilterID']], $Result); } unset($Result); $Debug->log_var($FilterGroups, 'Filter groups'); foreach($FilterGroups as $FilterID => $FilterResults) { ?>

Matches for '.$FilterResults['FilterLabel'].'' : 'unknown filter['.$FilterID.']'?> (clear) (clear selected)

".$GroupInfo['Name'].""; $GroupCategoryID = $GroupCategoryIDs[$GroupID]['CategoryID']; if($GroupCategoryID == 1) { if($GroupInfo['Year'] > 0) { $DisplayName .= " [$GroupInfo[Year]]"; } if($GroupInfo['ReleaseType'] > 0) { $DisplayName.= " [".$ReleaseTypes[$GroupInfo['ReleaseType']]."]"; } } // append extra info to torrent title $ExtraInfo = Torrents::torrent_info($TorrentInfo, true, true); $Debug->log_var($ExtraInfo, "Extra torrent info ($TorrentID)"); $TagLinks = array(); if($GroupInfo['TagList'] != '') { $TorrentTags = explode(' ', $GroupInfo['TagList']); $MainTag = $TorrentTags[0]; foreach ($TorrentTags as $TagKey => $TagName) { $TagName = str_replace('_', '.', $TagName); $TagLinks[] = ''.$TagName.''; } $TagLinks = implode(', ', $TagLinks); $TorrentTags = '
'.$TagLinks.'
'; } else { $TorrentTags = ''; $MainTag = $Categories[$GroupCategoryID-1]; } // print row ?>
Name Files Time Size Snatches Seeders Leechers
[ DL 0) && ($TorrentInfo['Size'] < 1073741824) && !$TorrentInfo['PersonalFL'] && empty($TorrentInfo['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?> | FL | CL ] New!'; } ?>