get_value('users_tokens_'.$UserID); if (empty($TokenTorrents)) { $DB->query("SELECT TorrentID FROM users_freeleeches WHERE UserID=$UserID AND Expired=FALSE"); $TokenTorrents = $DB->collect('TorrentID'); $Cache->cache_value('users_tokens_'.$UserID, $TokenTorrents); } $Results = $DB->query("SELECT SQL_CALC_FOUND_ROWS t.ID, g.ID, g.Name, g.CategoryID, g.TagList, t.Size, t.FileCount, t.Format, t.Encoding, t.Media, t.Scene, t.RemasterYear, g.Year, t.RemasterYear, t.RemasterTitle, t.Snatched, t.Seeders, t.Leechers, t.Time, t.HasLog, t.HasCue, t.LogScore, t.FreeTorrent, tln.TorrentID AS LogInDB, unt.UnRead, unt.FilterID, unf.Label, g.ReleaseType FROM users_notify_torrents AS unt JOIN torrents AS t ON t.ID=unt.TorrentID JOIN torrents_group AS g ON g.ID = t.GroupID LEFT JOIN users_notify_filters AS unf ON unf.ID=unt.FilterID LEFT JOIN torrents_logs_new AS tln ON tln.TorrentID=t.ID WHERE unt.UserID='$LoggedUser[ID]' GROUP BY t.ID ORDER BY t.ID DESC LIMIT $Limit"); $DB->query('SELECT FOUND_ROWS()'); list($TorrentCount) = $DB->next_record(); //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']); show_header('My notifications','notifications'); $DB->set_query_id($Results); $Pages=get_pages($Page,$TorrentCount,NOTIFICATIONS_PER_PAGE,9); ?>

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

record_count()==0) { ?>
No new notifications found! Edit notification filters
next_record()) { if(!$Result['FilterID']) { $Result['FilterID'] = 0; } if(!isset($FilterGroups[$Result['FilterID']])) { $FilterGroups[$Result['FilterID']] = array(); $FilterGroups[$Result['FilterID']]['FilterLabel'] = ($Result['FilterID'] && !empty($Result['Label']) ? $Result['Label'] : 'unknown filter'.($Result['FilterID']?' ['.$Result['FilterID'].']':'')); } array_push($FilterGroups[$Result['FilterID']], $Result); } unset($Result); foreach($FilterGroups as $ID => $FilterResults) { ?>

Matches for (clear) (clear selected)

".$GroupName.""; if($GroupCategoryID==1 && $GroupYear>0) { $DisplayName.= " [$GroupYear]"; } if($GroupCategoryID==1 && $ReleaseType>0) { $DisplayName.= " [".$ReleaseTypes[$ReleaseType]."]"; } // append extra info to torrent title $ExtraInfo=''; $AddExtra=''; if($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; } if($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; } if($HasLog) { $ExtraInfo.=$AddExtra.'Log'; $AddExtra=' / '; } if($HasLog && $LogInDB) { $ExtraInfo.=' ('.(int) $LogScore.'%)'; } if($HasCue) { $ExtraInfo.=$AddExtra.'Cue'; $AddExtra=' / '; } if($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; } if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; } if($RemasterYear) { $ExtraInfo.=$AddExtra.$RemasterYear; $AddExtra=' '; } if($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; } if($ExtraInfo!='') { $ExtraInfo = "- [$ExtraInfo]"; } $TagLinks=array(); if($TorrentTags!='') { $TorrentTags=explode(' ',$TorrentTags); $MainTag = $TorrentTags[0]; foreach ($TorrentTags as $TagKey => $TagName) { $TagName = str_replace('_','.',$TagName); $TagLinks[]=''.$TagName.''; } $TagLinks = implode(', ', $TagLinks); $TorrentTags='
'.$TagLinks.'
'; } else { $MainTag = $Categories[$GroupCategoryID-1]; } // print row ?>
Name Files Time Size Snatches Seeders Leechers
[DL 0) && ($Size < 1073741824) && !in_array($TorrentID, $TokenTorrents) && empty($FreeTorrent) && ($LoggedUser['CanLeech'] == '1')) { ?> | FL | CL] New!'; } ?>