query("UPDATE users_notify_quoted SET UnRead = '0' WHERE UserID = '$LoggedUser[ID]'"); $Cache->delete_value('notify_quoted_' . $LoggedUser['ID']); header('Location: userhistory.php?action=quote_notifications'); die(); } if (isset($LoggedUser['PostsPerPage'])) { $PerPage = $LoggedUser['PostsPerPage']; } else { $PerPage = POSTS_PER_PAGE; } list($Page, $Limit) = Format::page_limit($PerPage); // Get $Limit last quote notifications // We deal with the information about torrents and requests later on... $sql = " SELECT SQL_CALC_FOUND_ROWS q.Page, q.PageID, q.PostID, q.QuoterID, q.Date, q.UnRead, f.ID as ForumID, f.Name as ForumName, t.Title as ForumTitle, a.Name as ArtistName, c.Name as CollageName FROM users_notify_quoted AS q LEFT JOIN forums_topics AS t ON t.ID = q.PageID LEFT JOIN forums AS f ON f.ID = t.ForumID LEFT JOIN artists_group AS a ON a.ArtistID = q.PageID LEFT JOIN collages AS c ON c.ID = q.PageID WHERE q.UserID = $LoggedUser[ID] AND (q.Page != 'forums' OR " . Forums::user_forums_sql() . ") AND (q.Page != 'collages' OR c.Deleted = '0') $UnreadSQL ORDER BY q.Date DESC LIMIT $Limit"; $DB->query($sql); $Results = $DB->to_array(false, MYSQLI_ASSOC, false); $DB->query('SELECT FOUND_ROWS()'); list($NumResults) = $DB->next_record(); $TorrentGroups = $Requests = []; foreach ($Results as $Result) { if ($Result['Page'] == 'torrents') { $TorrentGroups[] = $Result['PageID']; } elseif ($Result['Page'] == 'requests') { $Requests[] = $Result['PageID']; } } $TorrentGroups = Torrents::get_groups($TorrentGroups, true, true, false); $Requests = Requests::get_requests($Requests); //Start printing page View::show_header('Quote Notifications'); ?>
=$Links?> =($Result['UnRead'] ? ' (New!)' : '')?> | Quoted by =Users::format_username($Result['QuoterID'], false, false, false, false) . ' ' . time_diff($Result['Date']) ?> |