Empty commit

This commit is contained in:
Git 2012-09-12 08:00:27 +00:00
parent a94991091e
commit 015a8bd351
9 changed files with 71 additions and 34 deletions

View File

@ -100,6 +100,16 @@
<br />
</div>
</div>
<?
if(check_perms('users_mod')) {
$DB->query("SELECT ForumID from subscribed_forums WHERE ForumID='$ForumID' AND SubscriberID='$LoggedUser[ID]'");
if($DB->record_count() == 0) { ?>
[<a href="forums.php?action=forum_subscribe&amp;perform=add&amp;forumid=<?=$ForumID?>&amp;auth=<?=$LoggedUser['AuthKey']?>">Subscribe to Forum</a>]
<? } else { ?>
[<a href="forums.php?action=forum_subscribe&amp;perform=remove&amp;forumid=<?=$ForumID?>&amp;auth=<?=$LoggedUser['AuthKey']?>">Unsubscribe from Forum</a>]
<? }
}?>
</div>
<? if(check_perms('site_moderate_forums')) { ?>
<div class="linkbox">

View File

@ -136,11 +136,12 @@
case 'edit_rules':
require(SERVER_ROOT.'/sections/forums/edit_rules.php');
break;
case 'thread_subscribe':
break;
case 'warn':
require(SERVER_ROOT.'/sections/forums/warn.php');
break;
case 'forum_subscribe':
include('subscribe.php');
break;
default:
error(404);
}

View File

@ -0,0 +1,14 @@
<?php
ini_set('display_errors', '1');authorize();
$ForumID = db_string($_GET['forumid']);
if($_GET['perform'] == 'add') {
$DB->query("INSERT IGNORE INTO subscribed_forums (ForumID, SubscriberID) VALUES ('$ForumID', '$LoggedUser[ID]')");
}
elseif($_GET['perform'] == 'remove') {
$DB->query("DELETE FROM subscribed_forums WHERE ForumID = '$ForumID' AND SubscriberID = '$LoggedUser[ID]'");
}
header('Location: forums.php?action=viewforum&forumid=' . $ForumID);
?>

View File

@ -87,6 +87,20 @@
$Cache->delete_value('subscriptions_user_'.$LoggedUser['ID']);
}
//auto subscribe
if(check_perms('users_mod')) {
$DB->query("SELECT SubscriberID FROM subscribed_forums WHERE ForumID = '$ForumID' AND SubscriberID <> '$LoggedUser[ID]'");
while(list($SubscriberID) = $DB->next_record()) {
$DB->query("INSERT INTO users_subscriptions VALUES ($SubscriberID, $TopicID)");
// $DB->query("INSERT INTO forums_last_read_topics
// (UserID, TopicID, PostID) VALUES
// ('$SubscriberID', '".$TopicID ."', '".db_string($PostID)."')
// ON DUPLICATE KEY UPDATE PostID='$LastPost'");
$Cache->delete_value('subscriptions_user_'.$SubscriberID);
}
}
if (empty($_POST['question']) || empty($_POST['answers']) || !check_perms('forums_polls_create')) {
$NoPoll = 1;
} else {

View File

@ -60,11 +60,7 @@
</tr>
</table>
<? } else { ?>
<<<<<<< HEAD
An email has been sent to the address that you provided. After you confirm your email address you will be able to log into your account.
=======
An email has been sent to the address that you provided. After you confirm your email address, you will be able to log into your account.
>>>>>>> 3631ffa... Fixes a bunch of XHTML errors (e.g. unencoded ampersands) and other typos
<? if($NewInstall) { echo "Since this is a new installation, you can log in directly without having to confirm your account."; }
} ?>

View File

@ -618,24 +618,8 @@
}
// Use this section to control freeleeches
/*if($HasLog == "'4'" && $LogScoreAverage== 100){
$T['FreeLeech']="'1'";
$T['FreeLeechType']="'1'";
$DB->query("INSERT IGNORE INTO users_points (UserID, GroupID, Points) VALUES ('$LoggedUser[ID]', '$GroupID', '1')");
*/
/*if($T['Format'] == "'FLAC'") {
$T['FreeLeech'] = "'1'";
$T['FreeLeechType'] = "'1'";
} else {
$T['FreeLeech']="'0'";
$T['FreeLeechType']="'0'";
}*/
$T['FreeLeech']="'0'";
$T['FreeLeechType']="'0'";
$T['FreeLeech'] = 0;
$T['FreeLeechType'] = 0;
// Torrent
$DB->query("
@ -648,12 +632,12 @@
(".$GroupID.", ".$LoggedUser['ID'].", ".$T['Media'].", ".$T['Format'].", ".$T['Encoding'].",
".$T['Remastered'].", ".$T['RemasterYear'].", ".$T['RemasterTitle'].", ".$T['RemasterRecordLabel'].", ".$T['RemasterCatalogueNumber'].",
".$T['Scene'].", ".$HasLog.", ".$HasCue.", '".db_string($InfoHash)."', ".$NumFiles.", ".$FileString.", '".$FilePath."', ".$TotalSize.", '".sqltime()."',
".$T['TorrentDescription'].", '".(($HasLog == "'1'") ? $LogScoreAverage : 0)."', ".$T['FreeLeech'].", ".$T['FreeLeechType'].")");
".$T['TorrentDescription'].", '".(($HasLog == "'1'") ? $LogScoreAverage : 0)."', '".$T['FreeLeech']."', '".$T['FreeLeechType']."')");
$Cache->increment('stats_torrent_count');
$TorrentID = $DB->inserted_id();
update_tracker('add_torrent', array('id' => $TorrentID, 'info_hash' => rawurlencode($InfoHash), 'freetorrent' => (int)$Properties['FreeLeech']));
update_tracker('add_torrent', array('id' => $TorrentID, 'info_hash' => rawurlencode($InfoHash), 'freetorrent' => $T['FreeLeech']));
@ -727,7 +711,7 @@
if ($HasCue == "'1'") { $Announce .= " / Cue"; }
$Announce .= " / ".trim($Properties['Media']);
if ($Properties['Scene'] == "1") { $Announce .= " / Scene"; }
if ($Properties['FreeLeech'] == "1") { $Announce .= " / Freeleech!"; }
if ($T['FreeLeech'] == "1") { $Announce .= " / Freeleech!"; }
}
$Title = $Announce;

View File

@ -88,6 +88,9 @@
$Cache->delete_value('notifications_new_'.$UserID);
$Cache->delete_value('collage_subs_user_new_'.$UserID);
// no break, load the profile
case 'user_subscribe':
include('subscribe.php');
break;
default:
if (isset($_REQUEST['id'])) {
include(SERVER_ROOT.'/sections/user/user.php');

View File

@ -0,0 +1,13 @@
<?php
ini_set('display_errors', '1');authorize();
$UserID = db_string($_GET['userid']);
if($_GET['perform'] == 'add') {
$DB->query("INSERT IGNORE INTO subscribed_users (UserID, SubscriberID) VALUES ('$UserID', '$LoggedUser[ID]')");
}
elseif($_GET['perform'] == 'remove') {
$DB->query("DELETE FROM subscribed_users WHERE UserID = '$UserID' AND SubscriberID = '$LoggedUser[ID]'");
}
header('Location: user.php?id=' . $UserID);
?>

View File

@ -30,13 +30,14 @@
$sql = 'SELECT
SQL_CALC_FOUND_ROWS
MAX(p.ID) AS ID
FROM forums_posts AS p
LEFT JOIN forums_topics AS t ON t.ID = p.TopicID
JOIN users_subscriptions AS s ON s.TopicID = t.ID
LEFT JOIN forums AS f ON f.ID = t.ForumID
LEFT JOIN forums_last_read_topics AS l ON p.TopicID = l.TopicID AND l.UserID = s.UserID
WHERE s.UserID = '.$LoggedUser['ID'].'
AND p.ID <= IFNULL(l.PostID,t.LastPostID)
FROM (SELECT TopicID
FROM users_subscriptions
WHERE UserID = '.$LoggedUser['ID'].') AS s
LEFT JOIN forums_last_read_topics AS l ON s.TopicID = l.TopicID AND l.UserID = '.$LoggedUser['ID'].'
JOIN forums_topics AS t ON t.ID = s.TopicID
JOIN forums_posts AS p ON t.ID = p.TopicID
JOIN forums AS f ON f.ID = t.ForumID
WHERE p.ID <= IFNULL(l.PostID,t.LastPostID)
AND ((f.MinClassRead <= '.$LoggedUser['Class'];
if(!empty($RestrictedForums)) {
$sql.=' AND f.ID NOT IN (\''.$RestrictedForums.'\')';
@ -51,6 +52,7 @@
$sql .= '
AND IF(l.PostID IS NULL OR (t.IsLocked = \'1\' && t.IsSticky = \'0\'), t.LastPostID, l.PostID) < t.LastPostID';
$sql .= ' OR (t.AuthorID != '.$LoggedUser['ID'].' AND l.PostID IS NULL)';
}
$sql .= '