Empty commit

This commit is contained in:
Git 2013-03-21 08:00:33 +00:00
parent 49bc7496eb
commit 5110d65327
7 changed files with 66 additions and 33 deletions

View File

@ -180,17 +180,18 @@
//Quotes
if($LoggedUser['NotifyOnQuote']) {
$QuoteNotificationsCount = $Cache->get_value('forums_quotes_'.$LoggedUser['ID']);
$QuoteNotificationsCount = $Cache->get_value('notify_quoted_'.$LoggedUser['ID']);
if($QuoteNotificationsCount === FALSE) {
if ($LoggedUser['CustomForums']) {
unset($LoggedUser['CustomForums']['']);
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
$PermittedForums = implode("','", array_keys($LoggedUser['CustomForums'], 1));
}
$sql = "SELECT COUNT(UnRead) FROM users_notify_quoted AS q
LEFT JOIN forums AS f ON f.ID = q.ForumID
WHERE UserID='".$LoggedUser['ID']."'
AND UnRead = '1' AND ((f.MinClassRead <= '$LoggedUser[Class]'";
$sql = "SELECT COUNT(q.UnRead)
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
WHERE q.UserID='".$LoggedUser['ID']."' AND q.UnRead AND q.Page = 'forums' AND ((f.MinClassRead <= '$LoggedUser[Class]'";
if(!empty($RestrictedForums)) {
$sql.=' AND f.ID NOT IN (\''.$RestrictedForums.'\')';
}
@ -201,7 +202,7 @@
$sql .= ')';
$DB->query($sql);
list($QuoteNotificationsCount) = $DB->next_record();
$Cache->cache_value('forums_quotes_'.$LoggedUser['ID'], $QuoteNotificationsCount, 0);
$Cache->cache_value('notify_quoted_'.$LoggedUser['ID'], $QuoteNotificationsCount, 0);
}
if($QuoteNotificationsCount > 0) {
$Alerts[] = '<a href="userhistory.php?action=quote_notifications">'. 'New quote'. ($QuoteNotificationsCount > 1 ? 's' : '') . '</a>';

View File

@ -301,9 +301,7 @@ CREATE TABLE `forums_last_read_topics` (
`TopicID` int(10) NOT NULL,
`PostID` int(10) NOT NULL,
PRIMARY KEY (`UserID`,`TopicID`),
KEY `TopicID` (`TopicID`),
KEY `UserID` (`UserID`),
KEY `TopicID_2` (`TopicID`)
KEY `TopicID` (`TopicID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `forums_polls` (
@ -457,6 +455,13 @@ CREATE TABLE `login_attempts` (
KEY `IP` (`IP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `new_info_hashes` (
`TorrentID` int(11) NOT NULL,
`InfoHash` binary(20) DEFAULT NULL,
PRIMARY KEY (`TorrentID`),
KEY `InfoHash` (`InfoHash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `news` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`UserID` int(10) unsigned NOT NULL,
@ -1195,6 +1200,15 @@ CREATE TABLE `users_collage_subs` (
KEY `CollageID` (`CollageID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `users_comments_last_read` (
`UserID` int(10) NOT NULL,
`Page` enum('artist','collages','requests','torrents') COLLATE utf8_swedish_ci NOT NULL,
`PageID` int(10) NOT NULL,
`PostID` int(10) NOT NULL,
PRIMARY KEY (`UserID`,`Page`,`PageID`),
KEY `Page` (`Page`,`PageID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
CREATE TABLE `users_comments_subscriptions` (
`UserID` int(10) NOT NULL,
`GroupID` int(10) NOT NULL,
@ -1434,13 +1448,13 @@ CREATE TABLE `users_notify_filters` (
CREATE TABLE `users_notify_quoted` (
`UserID` int(10) NOT NULL,
`QuoterID` int(10) NOT NULL,
`ForumID` int(6) unsigned DEFAULT NULL,
`TopicID` int(10) NOT NULL,
`Page` enum('forums','artist','collages','requests','torrents') COLLATE utf8_swedish_ci NOT NULL,
`PageID` int(10) NOT NULL,
`PostID` int(10) NOT NULL,
`UnRead` enum('0','1') NOT NULL DEFAULT '1',
`UnRead` tinyint(1) NOT NULL DEFAULT '1',
`Date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`UserID`,`PostID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
PRIMARY KEY (`UserID`,`Page`,`PostID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
CREATE TABLE `users_notify_torrents` (
`UserID` int(10) NOT NULL,
@ -1500,6 +1514,13 @@ CREATE TABLE `users_subscriptions` (
PRIMARY KEY (`UserID`,`TopicID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `users_subscriptions_comments` (
`UserID` int(10) NOT NULL,
`Page` enum('artist','collages','requests','torrents') COLLATE utf8_swedish_ci NOT NULL,
`PageID` int(10) NOT NULL,
PRIMARY KEY (`UserID`,`Page`,`PageID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
CREATE TABLE `users_torrent_history` (
`UserID` int(10) unsigned NOT NULL,
`NumTorrents` int(6) unsigned NOT NULL,

View File

@ -246,9 +246,9 @@ function compare($X, $Y){
foreach ($TorrentList as $GroupID => $Group) {
// $Tags array is for the sidebar on the right.
// Skip compilations and soundtracks.
$Skip = $Group['ReleaseType'] != 7 && $Group['ReleaseType'] != 3;
$Merge = $Group['ReleaseType'] != 7 && $Group['ReleaseType'] != 3;
$TorrentTags = new Tags($Group['TagList'], !$Skip);
$TorrentTags = new Tags($Group['TagList'], $Merge);
foreach ($Group['Torrents'] as $TorrentID => $Torrent) {
$NumTorrents++;
@ -293,7 +293,7 @@ function compare($X, $Y){
$HideDiscog = '';
}
$TorrentTags = new Tags($TagList);
$TorrentTags = new Tags($TagList, false);
if($ReleaseType!=$LastReleaseType) {
switch($ReleaseTypes[$ReleaseType]) {

View File

@ -37,9 +37,9 @@
$TopicID = db_string($TopicID);
$PostID = db_string($PostID);
$DB->query("INSERT IGNORE INTO users_notify_quoted (UserID, QuoterID, ForumID, TopicID, PostID, Date)
VALUES ('$UserID', '$QuoterID', '$ForumID', '$TopicID', '$PostID', '" . sqltime() . "')");
$Cache->delete_value('forums_quotes_' . $UserID);
$DB->query("INSERT IGNORE INTO users_notify_quoted (UserID, QuoterID, Page, PageID, PostID, Date)
VALUES ('$UserID', '$QuoterID', 'forums', '$TopicID', '$PostID', '" . sqltime() . "')");
$Cache->delete_value('notify_quoted_' . $UserID);
}

View File

@ -139,14 +139,14 @@
}
$DB->query("UPDATE users_notify_quoted SET UnRead = '0' WHERE UserID = '$LoggedUser[ID]' AND TopicID = '$ThreadID'");
$Cache->delete_value('forums_quotes_' . $LoggedUser['ID']);
$DB->query("UPDATE users_notify_quoted SET UnRead = false WHERE UserID = '$LoggedUser[ID]' AND Page = 'forums' AND PageID = '$ThreadID'");
$Cache->delete_value('notify_quoted_' . $LoggedUser['ID']);
/*
$QuoteNotificationsCount = $Cache->get_value('forums_quotes_' . $LoggedUser['ID']);
$QuoteNotificationsCount = $Cache->get_value('notify_quoted_' . $LoggedUser['ID']);
if ($QuoteNotificationsCount > 0) {
$Cache->cache_value('forums_quotes_' . $LoggedUser['ID'], $QuoteNotificationsCount - 1, 0);
$Cache->cache_value('notify_quoted_' . $LoggedUser['ID'], $QuoteNotificationsCount - 1, 0);
} else {
$Cache->delete_value('forums_quotes_' . $LoggedUser['ID']);
$Cache->delete_value('notify_quoted_' . $LoggedUser['ID']);
}
*/

View File

@ -3,7 +3,7 @@
error(403);
}
$UnreadSQL = "AND q.UnRead = '1'";
$UnreadSQL = "AND q.UnRead";
if ($_GET['showall']) {
$UnreadSQL = "";
}
@ -19,9 +19,11 @@
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
$PermittedForums = implode("','", array_keys($LoggedUser['CustomForums'], 1));
}
$sql = "SELECT SQL_CALC_FOUND_ROWS f.ID as ForumID, f.Name as ForumName, t.Title, q.TopicID, q.PostID, q.QuoterID
FROM users_notify_quoted AS q LEFT JOIN forums_topics AS t ON t.ID = q.TopicID LEFT JOIN forums AS f ON f.ID = q.ForumID
WHERE q.UserID = $LoggedUser[ID] AND ((f.MinClassRead <= '$LoggedUser[Class]'";
$sql = "SELECT SQL_CALC_FOUND_ROWS f.ID as ForumID, f.Name as ForumName, t.Title, q.PageID, q.PostID, q.QuoterID
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
WHERE q.UserID = $LoggedUser[ID] AND q.Page = 'forums' AND ((f.MinClassRead <= '$LoggedUser[Class]'";
if (!empty($RestrictedForums)) {
$sql .= ' AND f.ID NOT IN (\'' . $RestrictedForums . '\')';
@ -65,7 +67,7 @@
<?
if (!$NumResults) {
?>
<div class="center">No new quotes.</div>
<div class="center">No<?=($UnreadSQL ? ' new' : '')?> quotes.</div>
<? } ?>
<br />
<?
@ -77,11 +79,11 @@
<span style="float: left;">
<a href="forums.php?action=viewforum&amp;forumid=<?=$Result['ForumID'] ?>"><?=$Result['ForumName'] ?></a>
&gt;
<a href="forums.php?action=viewthread&amp;threadid=<?=$Result['TopicID'] ?>" title="<?=display_str($Result['Title']) ?>"><?=Format::cut_string($Result['Title'], 75) ?></a>
<a href="forums.php?action=viewthread&amp;threadid=<?=$Result['PageID'] ?>" title="<?=display_str($Result['Title']) ?>"><?=Format::cut_string($Result['Title'], 75) ?></a>
&gt; Quoted by <?=Users::format_username($Result['QuoterID'], false, false, false, false) ?>
</span>
<span style="float: left;" class="last_read" title="Jump to last read">
<a href="forums.php?action=viewthread&amp;threadid=<?=$Result['TopicID'].($Result['PostID'] ? '&amp;postid=' . $Result['PostID'].'#post'.$Result['PostID'] : '') ?>"></a>
<span style="float: left;" class="last_read" title="Jump to quote">
<a href="forums.php?action=viewthread&amp;threadid=<?=$Result['PageID'].($Result['PostID'] ? '&amp;postid=' . $Result['PostID'].'#post'.$Result['PostID'] : '') ?>"></a>
</span>
<span id="bar<?=$Result['PostID'] ?>" style="float: right;">
<a href="#">&uarr;</a>

View File

@ -432,3 +432,12 @@ tr.torrent .bookmark>a:after {
.user_title {
font-weight: normal;
}
/* Fix Chrome overflowing long filename tables */
.filelist_table td {
word-break: normal;
}
.filelist_table td:first-child {
word-break: break-all;
}