mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-02-21 20:59:02 +00:00
Empty commit
This commit is contained in:
parent
a94991091e
commit
015a8bd351
@ -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&perform=add&forumid=<?=$ForumID?>&auth=<?=$LoggedUser['AuthKey']?>">Subscribe to Forum</a>]
|
||||
<? } else { ?>
|
||||
[<a href="forums.php?action=forum_subscribe&perform=remove&forumid=<?=$ForumID?>&auth=<?=$LoggedUser['AuthKey']?>">Unsubscribe from Forum</a>]
|
||||
<? }
|
||||
}?>
|
||||
|
||||
</div>
|
||||
<? if(check_perms('site_moderate_forums')) { ?>
|
||||
<div class="linkbox">
|
||||
|
@ -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);
|
||||
}
|
||||
|
14
sections/forums/subscribe.php
Normal file
14
sections/forums/subscribe.php
Normal 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);
|
||||
?>
|
||||
|
@ -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 {
|
||||
|
@ -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."; }
|
||||
} ?>
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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');
|
||||
|
13
sections/user/subscribe.php
Normal file
13
sections/user/subscribe.php
Normal 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);
|
||||
?>
|
@ -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 .= '
|
||||
|
Loading…
Reference in New Issue
Block a user