mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-02-20 20:29:03 +00:00
Empty commit
This commit is contained in:
parent
b222680ef1
commit
fd3f5e5dce
@ -44,6 +44,8 @@ public static function file_string($EscapeStr) {
|
||||
*/
|
||||
public static function send_pm($ToID,$FromID,$Subject,$Body,$ConvID='') {
|
||||
global $DB, $Cache, $Time;
|
||||
$Subject = db_string($Subject);
|
||||
$Body = db_string($Body);
|
||||
if ($ToID == 0 || $ToID == $FromID) {
|
||||
// Don't allow users to send messages to the system or themselves
|
||||
return;
|
||||
|
@ -215,8 +215,8 @@ public static function warn_user($UserID, $Duration, $Reason) {
|
||||
$NewExpDate = date('Y-m-d H:i:s', strtotime($OldDate) + $Duration);
|
||||
|
||||
Misc::send_pm($UserID, 0,
|
||||
db_string("You have received multiple warnings."),
|
||||
db_string("When you received your latest warning (Set to expire on ".date("Y-m-d", (time() + $Duration))."), you already had a different warning (Set to expire on ".date("Y-m-d", strtotime($OldDate)).").\n\n Due to this collision, your warning status will now expire at ".$NewExpDate."."));
|
||||
"You have received multiple warnings.",
|
||||
"When you received your latest warning (Set to expire on ".date("Y-m-d", (time() + $Duration))."), you already had a different warning (Set to expire on ".date("Y-m-d", strtotime($OldDate)).").\n\n Due to this collision, your warning status will now expire at ".$NewExpDate.".");
|
||||
|
||||
$AdminComment = date("Y-m-d").' - Warning (Clash) extended to expire at '.$NewExpDate.' by '.$LoggedUser['Username']."\nReason: $Reason\n\n";
|
||||
|
||||
|
@ -439,6 +439,5 @@ function authorize($Ajax = false) {
|
||||
|
||||
$Debug->set_flag('set headers and send to user');
|
||||
|
||||
|
||||
//Attribute profiling
|
||||
$Debug->profile();
|
||||
|
@ -50,7 +50,7 @@
|
||||
$Body = $Body . "\n\n". $Note;
|
||||
}
|
||||
|
||||
Misc::send_pm($FriendID, $LoggedUser['ID'], db_string($Subject), db_string($Body));
|
||||
Misc::send_pm($FriendID, $LoggedUser['ID'], $Subject, $Body);
|
||||
echo json_encode(array("status" => "success", "response" => "Sent!"));
|
||||
die();
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
}
|
||||
Misc::assert_isset_request($_POST, array('reason', 'privatemessage', 'body', 'length', 'artistid', 'postid', 'userid'));
|
||||
|
||||
$Reason = db_string($_POST['reason']);
|
||||
$PrivateMessage = db_string($_POST['privatemessage']);
|
||||
$Body = db_string($_POST['body']);
|
||||
$Reason = $_POST['reason'];
|
||||
$PrivateMessage = $_POST['privatemessage'];
|
||||
$Body = $_POST['body'];
|
||||
$Length = $_POST['length'];
|
||||
$ArtistID = (int)$_POST['artistid'];
|
||||
$PostID = (int)$_POST['postid'];
|
||||
@ -50,7 +50,7 @@
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE artist_comments SET
|
||||
Body = '$Body',
|
||||
Body = '" . db_string($Body) . "',
|
||||
EditedUserID = '" . db_string($LoggedUser['ID']) . "',
|
||||
EditedTime = '" . sqltime() . "'
|
||||
WHERE ID='$PostID'");
|
||||
@ -59,7 +59,7 @@
|
||||
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
|
||||
$Cache->begin_transaction('artist_comments_' . $ArtistID . '_catalogue_' . $CatalogueID);
|
||||
|
||||
$Cache->update_row($_POST['key'], array('ID' => $_POST['postid'], 'AuthorID' => $AuthorID, 'AddedTime' => $AddedTime, 'Body' => $_POST['body'], 'EditedUserID' => db_string($LoggedUser['ID']), 'EditedTime' => sqltime(), 'Username' => $LoggedUser['Username']));
|
||||
$Cache->update_row($_POST['key'], array('ID' => $_POST['postid'], 'AuthorID' => $AuthorID, 'AddedTime' => $AddedTime, 'Body' => $Body, 'EditedUserID' => db_string($LoggedUser['ID']), 'EditedTime' => sqltime(), 'Username' => $LoggedUser['Username']));
|
||||
$Cache->commit_transaction(0);
|
||||
|
||||
$DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
|
||||
|
@ -48,12 +48,15 @@
|
||||
list($Page,$Limit) = Format::page_limit($PerPage);
|
||||
|
||||
switch($action) {
|
||||
case 'artists':
|
||||
require (SERVER_ROOT.'/sections/comments/artistcomments.php');
|
||||
break;
|
||||
case 'torrents':
|
||||
case 'my_torrents':
|
||||
default:
|
||||
require(SERVER_ROOT.'/sections/comments/torrentcomments.php');
|
||||
break;
|
||||
case 'requests':
|
||||
require (SERVER_ROOT.'/sections/comments/requestcomments.php');
|
||||
break;
|
||||
case 'artists':
|
||||
require (SERVER_ROOT.'/sections/comments/artistcomments.php');
|
||||
break;
|
||||
case 'torrents':
|
||||
case 'my_torrents':
|
||||
default:
|
||||
require(SERVER_ROOT.'/sections/comments/torrentcomments.php');
|
||||
break;
|
||||
}
|
||||
|
104
sections/comments/requestcomments.php
Normal file
104
sections/comments/requestcomments.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
// using the requests functions.php because we need get_request_artists()
|
||||
// TODO: move that function to class_artists?
|
||||
include(SERVER_ROOT.'/sections/requests/functions.php');
|
||||
|
||||
/*
|
||||
* $_REQUEST['type']:
|
||||
* created = comments left on one's requests
|
||||
* voted = comments left on requests one voted on
|
||||
* * = one's request comments
|
||||
*/
|
||||
|
||||
$Mode = 'normal';
|
||||
|
||||
$ExtraJoin = '';
|
||||
if (!empty($_REQUEST['type'])) {
|
||||
if ($_REQUEST['type'] == 'created') {
|
||||
$Conditions = "WHERE r.UserID = $UserID AND rc.AuthorID != r.UserID";
|
||||
$Title = 'Comments left on requests ' . ($Self ? 'you' : $Username) . ' created';
|
||||
$Header = 'Comments left on requests ' . ($Self ? 'you' : Users::format_username($UserID, false, false, false)) . ' created';
|
||||
$Mode = 'created';
|
||||
} elseif ($_REQUEST['type'] == 'voted') {
|
||||
$Conditions = "WHERE rv.UserID = $UserID AND rc.AuthorID != $UserID";
|
||||
$ExtraJoin = 'JOIN requests_votes as rv ON rv.RequestID = r.ID';
|
||||
$Title = 'Comments left on requests ' . ($Self ? 'you\'ve' : $Username . ' has') . ' voted on';
|
||||
$Header = 'Comments left on requests ' . ($Self ? 'you\'ve' : Users::format_username($UserID, false, false, false).' has') . ' voted on';
|
||||
$Mode = 'voted';
|
||||
}
|
||||
}
|
||||
if (!isset($Title)) {
|
||||
$Conditions = "WHERE rc.AuthorID = $UserID";
|
||||
$Title = 'Request comments made by ' . ($Self ? 'you' : $Username);
|
||||
$Header = 'Request comments made by ' . ($Self ? 'you' : Users::format_username($UserID, false, false, false));
|
||||
}
|
||||
|
||||
$Comments = $DB->query("SELECT
|
||||
SQL_CALC_FOUND_ROWS
|
||||
rc.AuthorID,
|
||||
r.ID as RequestID,
|
||||
r.Title,
|
||||
rc.ID as PostID,
|
||||
rc.Body,
|
||||
rc.AddedTime,
|
||||
rc.EditedTime,
|
||||
rc.EditedUserID as EditorID
|
||||
FROM requests as r
|
||||
JOIN requests_comments as rc ON rc.RequestID = r.ID
|
||||
$ExtraJoin
|
||||
$Conditions
|
||||
GROUP BY rc.ID
|
||||
ORDER BY rc.AddedTime DESC
|
||||
LIMIT $Limit;");
|
||||
$Count = $DB->record_count();
|
||||
|
||||
$DB->query("SELECT FOUND_ROWS()");
|
||||
list($Results) = $DB->next_record();
|
||||
$Pages=Format::get_pages($Page,$Results,$PerPage, 11);
|
||||
|
||||
View::show_header($Title,'bbcode');
|
||||
$DB->set_query_id($Comments);
|
||||
|
||||
$Links = array();
|
||||
$BaseLink = 'comments.php?action=requests' . (!$Self ? '&id='.$UserID : '');
|
||||
if ($Mode != 'normal') {
|
||||
$Links[] = '<a href="' . $BaseLink . '" class="brackets">Display request comments you\'ve made</a>';
|
||||
}
|
||||
if ($Mode != 'created') {
|
||||
$Links[] = '<a href="' . $BaseLink . '&type=created" class="brackets">Display comments left on your requests</a>';
|
||||
}
|
||||
if ($Mode != 'voted') {
|
||||
$Links[] = '<a href="' . $BaseLink . '&type=voted" class="brackets">Display comments left on requests you\'ve voted on</a>';
|
||||
}
|
||||
$Links = implode(' ', $Links);
|
||||
|
||||
?><div class="thin">
|
||||
<div class="header">
|
||||
<h2><?=$Header?></h2>
|
||||
<? if ($Links !== '') { ?>
|
||||
<div class="linkbox">
|
||||
<?=$Links?>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<?
|
||||
if ($Count > 0) {
|
||||
while (list($UserID, $RequestID, $Title, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
|
||||
$Artists = get_request_artists($RequestID);
|
||||
$permalink = "requests.php?action=view&id=$RequestID&postid=$PostID#post$PostID";
|
||||
$postheader = " on " . Artists::display_artists($Artists) . " <a href=\"requests.php?action=view&id=$RequestID\">$Title</a>";
|
||||
comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime);
|
||||
$DB->set_query_id($Comments);
|
||||
}
|
||||
} else { ?>
|
||||
<div class="center">No results.</div>
|
||||
<? } ?>
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
View::show_footer();
|
@ -47,10 +47,10 @@
|
||||
$Cache->begin_transaction('user_info_heavy_'.$_POST['custom']);
|
||||
$Cache->update_row(false, array('Invites' => $Invites));
|
||||
$Cache->commit_transaction(0);
|
||||
Misc::send_pm($_POST['custom'],0,db_string('Thank you for your donation'),db_string('Your donation from '.$_POST['payer_email'].' of '.$_POST['mc_gross'].' '.PAYPAL_CURRENCY.' has been successfully processed. Because this is your first time donating, you have now been awarded Donor status as represented by the <3 found on your profile and next to your username where it appears. This has entitled you to a additional site features which you can now explore, and has granted you '.DONOR_INVITES.' invitations to share with others. Thank you for supporting '.SITE_NAME.'.'),'');
|
||||
Misc::send_pm($_POST['custom'], 0, 'Thank you for your donation', 'Your donation from '.$_POST['payer_email'].' of '.$_POST['mc_gross'].' '.PAYPAL_CURRENCY.' has been successfully processed. Because this is your first time donating, you have now been awarded Donor status as represented by the <3 found on your profile and next to your username where it appears. This has entitled you to a additional site features which you can now explore, and has granted you '.DONOR_INVITES.' invitations to share with others. Thank you for supporting '.SITE_NAME.'.');
|
||||
} else {
|
||||
//Repeat donor
|
||||
Misc::send_pm($_POST['custom'],0,db_string('Thank you for your donation'),db_string('Your donation from '.$_POST['payer_email'].' of '.$_POST['mc_gross'].' '.PAYPAL_CURRENCY.' has been successfully processed. Your continued support is highly appreciated and helps to make this place possible.'),'');
|
||||
Misc::send_pm($_POST['custom'], 0, 'Thank you for your donation', 'Your donation from '.$_POST['payer_email'].' of '.$_POST['mc_gross'].' '.PAYPAL_CURRENCY.' has been successfully processed. Your continued support is highly appreciated and helps to make this place possible.');
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
} else {
|
||||
if ($_POST['mc_gross'] > 0) {
|
||||
//Donation less than minimum
|
||||
Misc::send_pm($_POST['custom'],0,db_string('Thank you for your donation'),db_string('Your donation from '.$_POST['payer_email'].' of '.$_POST['mc_gross'].' '.PAYPAL_CURRENCY.' has been successfully processed. Unfortunately however this donation was less than the specified minimum donation of '.PAYPAL_MINIMUM.' '.PAYPAL_CURRENCY.' and while we are grateful, no special privileges have been awarded to you.'),'');
|
||||
Misc::send_pm($_POST['custom'], 0, 'Thank you for your donation', 'Your donation from '.$_POST['payer_email'].' of '.$_POST['mc_gross'].' '.PAYPAL_CURRENCY.' has been successfully processed. Unfortunately however this donation was less than the specified minimum donation of '.PAYPAL_MINIMUM.' '.PAYPAL_CURRENCY.' and while we are grateful, no special privileges have been awarded to you.');
|
||||
} else {
|
||||
//Failed pending donation
|
||||
$Message = "User http://".NONSSL_SITE_URL."/user.php?id=".$_POST['custom']." had donation of ".$TotalDonated." ".PAYPAL_CURRENCY." at ".$DonationTime." UTC from ".$_POST['payer_email']." returned.";
|
||||
@ -83,7 +83,7 @@
|
||||
$Cache->begin_transaction('user_info_heavy_'.$_POST['custom']);
|
||||
$Cache->update_row(false, array('Invites' => $Invites));
|
||||
$Cache->commit_transaction(0);
|
||||
Misc::send_pm($_POST['custom'],0,db_string('Notice of donation failure'),db_string('PapPal has just notified us that the donation you sent from '.$_POST['payer_email'].' of '.$TotalDonated.' '.PAYPAL_CURRENCY.' at '.$DonationTime.' UTC has been revoked. Because of this your special privileges have been revoked, and your invites removed.'),'');
|
||||
Misc::send_pm($_POST['custom'], 0, 'Notice of donation failure', 'PapPal has just notified us that the donation you sent from '.$_POST['payer_email'].' of '.$TotalDonated.' '.PAYPAL_CURRENCY.' at '.$DonationTime.' UTC has been revoked. Because of this your special privileges have been revoked, and your invites removed.');
|
||||
|
||||
|
||||
send_irc("PRIVMSG ".BOT_REPORT_CHAN." :".$Message);
|
||||
|
@ -4,9 +4,9 @@
|
||||
}
|
||||
Misc::assert_isset_request($_POST, array('reason', 'privatemessage', 'body', 'length', 'postid', 'userid'));
|
||||
|
||||
$Reason = db_string($_POST['reason']);
|
||||
$PrivateMessage = db_string($_POST['privatemessage']);
|
||||
$Body = db_string($_POST['body']);
|
||||
$Reason = $_POST['reason'];
|
||||
$PrivateMessage = $_POST['privatemessage'];
|
||||
$Body = $_POST['body'];
|
||||
$Length = $_POST['length'];
|
||||
$PostID = (int) $_POST['postid'];
|
||||
$UserID = (int) $_POST['userid'];
|
||||
@ -23,14 +23,14 @@
|
||||
$Time = ((int) $Length) * (7 * 24 * 60 * 60);
|
||||
Tools::warn_user($UserID, $Time, "$URL - " . $Reason);
|
||||
$Subject = "You have received a warning";
|
||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
|
||||
|
||||
$WarnTime = time_plus($Time);
|
||||
$AdminComment = date("Y-m-d") . ' - Warned until ' . $WarnTime . ' by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
|
||||
} else {
|
||||
$Subject = "You have received a verbal warning";
|
||||
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
||||
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
|
||||
$AdminComment = date("Y-m-d") . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
Tools::update_user_notes($UserID, $AdminComment);
|
||||
}
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE forums_posts SET
|
||||
Body = '$Body',
|
||||
Body = '" . db_string($Body) . "',
|
||||
EditedUserID = '$UserID',
|
||||
EditedTime = '" . $SQLTime . "'
|
||||
WHERE ID='$PostID'");
|
||||
@ -72,13 +72,13 @@
|
||||
//just clear the cache for would be cache-screwer-uppers
|
||||
} else {
|
||||
$Cache->update_row($Key, array('ID' => $Cache->MemcacheDBArray[$Key]['ID'], 'AuthorID' => $Cache->MemcacheDBArray[$Key]['AuthorID'], 'AddedTime' => $Cache->MemcacheDBArray[$Key]['AddedTime'],
|
||||
'Body' => $_POST['body'], //Don't url decode.
|
||||
'Body' => $Body, //Don't url decode.
|
||||
'EditedUserID' => $LoggedUser['ID'], 'EditedTime' => $SQLTime, 'Username' => $LoggedUser['Username']));
|
||||
$Cache->commit_transaction(3600 * 24 * 5);
|
||||
}
|
||||
$ThreadInfo = get_thread_info($TopicID);
|
||||
if ($ThreadInfo['StickyPostID'] == $PostID) {
|
||||
$ThreadInfo['StickyPost']['Body'] = $_POST['body'];
|
||||
$ThreadInfo['StickyPost']['Body'] = $Body;
|
||||
$ThreadInfo['StickyPost']['EditedUserID'] = $LoggedUser['ID'];
|
||||
$ThreadInfo['StickyPost']['EditedTime'] = $SQLTime;
|
||||
$Cache->cache_value('thread_' . $TopicID . '_info', $ThreadInfo, 0);
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
// Variables for database input
|
||||
$UserID = $LoggedUser['ID'];
|
||||
$Body = db_string($_POST['body']); //Don't URL Decode
|
||||
$Body = $_POST['body']; //Don't URL Decode
|
||||
$PostID = $_POST['post'];
|
||||
$Key = $_POST['key'];
|
||||
$SQLTime = sqltime();
|
||||
@ -72,12 +72,12 @@
|
||||
$PMurl = 'https://'.NONSSL_SITE_URL.'/forums.php?action=viewthread&postid='.$PostID.'#post'.$PostID;
|
||||
$ProfLink = '[url=https://'.NONSSL_SITE_URL.'/user.php?id='.$UserID.']'.$LoggedUser['Username'].'[/url]';
|
||||
$PMBody = 'One of your posts has been edited by '.$ProfLink.': [url]'.$PMurl.'[/url]';
|
||||
Misc::send_pm($AuthorID,0,$PMSubject,$PMBody,$ConvID='');
|
||||
Misc::send_pm($AuthorID, 0, $PMSubject, $PMBody);
|
||||
}
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE forums_posts SET
|
||||
Body = '$Body',
|
||||
Body = '" . db_string($Body) . "',
|
||||
EditedUserID = '$UserID',
|
||||
EditedTime = '".$SQLTime."'
|
||||
WHERE ID='$PostID'");
|
||||
@ -92,7 +92,7 @@
|
||||
'ID'=>$Cache->MemcacheDBArray[$Key]['ID'],
|
||||
'AuthorID'=>$Cache->MemcacheDBArray[$Key]['AuthorID'],
|
||||
'AddedTime'=>$Cache->MemcacheDBArray[$Key]['AddedTime'],
|
||||
'Body'=>$_POST['body'], //Don't url decode.
|
||||
'Body'=>$Body, //Don't url decode.
|
||||
'EditedUserID'=>$LoggedUser['ID'],
|
||||
'EditedTime'=>$SQLTime,
|
||||
'Username'=>$LoggedUser['Username']
|
||||
@ -101,7 +101,7 @@
|
||||
}
|
||||
$ThreadInfo = get_thread_info($TopicID);
|
||||
if($ThreadInfo['StickyPostID'] == $PostID) {
|
||||
$ThreadInfo['StickyPost']['Body'] = $_POST['body'];
|
||||
$ThreadInfo['StickyPost']['Body'] = $Body;
|
||||
$ThreadInfo['StickyPost']['EditedUserID'] = $LoggedUser['ID'];
|
||||
$ThreadInfo['StickyPost']['EditedTime'] = $SQLTime;
|
||||
$Cache->cache_value('thread_'.$TopicID.'_info', $ThreadInfo, 0);
|
||||
@ -111,6 +111,6 @@
|
||||
VALUES ('forums', ".$PostID.", ".$UserID.", '".$SQLTime."', '".db_string($OldBody)."')");
|
||||
$Cache->delete_value("forums_edits_$PostID");
|
||||
// This gets sent to the browser, which echoes it in place of the old body
|
||||
echo $Text->full_format($_POST['body']);
|
||||
echo $Text->full_format($Body);
|
||||
?>
|
||||
<br /><br />Last edited by <a href="user.php?id=<?=$LoggedUser['ID']?>"><?=$LoggedUser['Username']?></a> just now
|
||||
|
@ -48,7 +48,7 @@
|
||||
die();
|
||||
}
|
||||
|
||||
$ConvID = Misc::send_pm($ToID,$LoggedUser['ID'],db_string($Subject),db_string($Body),$ConvID);
|
||||
$ConvID = Misc::send_pm($ToID, $LoggedUser['ID'], $Subject, $Body, $ConvID);
|
||||
|
||||
header('Location: inbox.php');
|
||||
?>
|
||||
|
@ -48,7 +48,7 @@
|
||||
die();
|
||||
}
|
||||
|
||||
$ConvID = Misc::send_pm($ToID,$LoggedUser['ID'],db_string($Subject),db_string($Body),$ConvID);
|
||||
$ConvID = Misc::send_pm($ToID, $LoggedUser['ID'], $Subject, $Body, $ConvID);
|
||||
|
||||
header('Location: reports.php');
|
||||
?>
|
||||
|
@ -70,5 +70,5 @@
|
||||
if(isset($Err)) {
|
||||
echo $Err;
|
||||
} else {
|
||||
Misc::send_pm($ToID, $LoggedUser['ID'], db_string($Subject), db_string($Message));
|
||||
Misc::send_pm($ToID, $LoggedUser['ID'], $Subject, $Message);
|
||||
}
|
||||
|
@ -266,7 +266,7 @@
|
||||
|
||||
$PM .= "\n\nReport was handled by [user]".$LoggedUser['Username']."[/user].";
|
||||
|
||||
Misc::send_pm($UploaderID, 0, db_string($Escaped['raw_name']), db_string($PM));
|
||||
Misc::send_pm($UploaderID, 0, $Escaped['raw_name'], $PM);
|
||||
}
|
||||
|
||||
$Cache->delete_value('reports_torrent_'.$TorrentID);
|
||||
|
@ -474,7 +474,13 @@
|
||||
$Cache->cache_value('request_comments_'.$RequestID, $Results, 0);
|
||||
}
|
||||
|
||||
list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$Results);
|
||||
if(isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
|
||||
$DB->query("SELECT COUNT(ID) FROM requests_comments WHERE RequestID = $RequestID AND ID <= $_GET[postid]");
|
||||
list($PostNum) = $DB->next_record();
|
||||
list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum);
|
||||
} else {
|
||||
list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$Results);
|
||||
}
|
||||
|
||||
//Get the cache catalogue
|
||||
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
|
||||
|
@ -4,9 +4,9 @@
|
||||
}
|
||||
Misc::assert_isset_request($_POST, array('reason', 'privatemessage', 'body', 'length', 'groupid', 'postid', 'userid'));
|
||||
|
||||
$Reason = db_string($_POST['reason']);
|
||||
$PrivateMessage = db_string($_POST['privatemessage']);
|
||||
$Body = db_string($_POST['body']);
|
||||
$Reason = $_POST['reason'];
|
||||
$PrivateMessage = $_POST['privatemessage'];
|
||||
$Body = $_POST['body'];
|
||||
$Length = $_POST['length'];
|
||||
$GroupID = (int) $_POST['groupid'];
|
||||
$PostID = (int) $_POST['postid'];
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE requests_comments SET
|
||||
Body = '".$Body."',
|
||||
Body = '" . db_string($Body) . "',
|
||||
EditedUserID = '".$LoggedUser['ID']."',
|
||||
EditedTime = '".sqltime()."'
|
||||
WHERE ID='".$PostID."'");
|
||||
@ -66,7 +66,7 @@
|
||||
'ID'=>$PostID,
|
||||
'AuthorID'=>$AuthorID,
|
||||
'AddedTime'=>$AddedTime,
|
||||
'Body'=>$_POST['body'],
|
||||
'Body'=>$Body,
|
||||
'EditedUserID'=>db_string($LoggedUser['ID']),
|
||||
'EditedTime'=>sqltime(),
|
||||
'Username'=>$LoggedUser['Username']
|
||||
|
@ -46,7 +46,7 @@
|
||||
$DB->query("DELETE FROM requests_artists WHERE RequestID='$RequestID'");
|
||||
|
||||
if($UserID != $LoggedUser['ID']) {
|
||||
Misc::send_pm($UserID, 0, db_string("A request you created has been deleted"), db_string("The request '".$FullName."' was deleted by [url=https://".SSL_SITE_URL."/user.php?id=".$LoggedUser['ID']."]".$LoggedUser['Username']."[/url] for the reason: ".$_POST['reason']));
|
||||
Misc::send_pm($UserID, 0, "A request you created has been deleted", "The request '".$FullName."' was deleted by [url=https://".SSL_SITE_URL."/user.php?id=".$LoggedUser['ID']."]".$LoggedUser['Username']."[/url] for the reason: ".$_POST['reason']);
|
||||
}
|
||||
|
||||
Misc::write_log("Request $RequestID ($FullName) was deleted by user ".$LoggedUser['ID']." (".$LoggedUser['Username'].") for the reason: ".$_POST['reason']);
|
||||
|
@ -181,7 +181,7 @@
|
||||
$UserIDs = $DB->to_array();
|
||||
foreach ($UserIDs as $User) {
|
||||
list($VoterID) = $User;
|
||||
Misc::send_pm($VoterID, 0, db_string("The request '".$FullName."' has been filled"), db_string("One of your requests - [url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID."]".$FullName."[/url] - has been filled. You can view it at [url]https://".SSL_SITE_URL."/torrents.php?torrentid=".$TorrentID."[/url]"), '');
|
||||
Misc::send_pm($VoterID, 0, "The request '".$FullName."' has been filled", "One of your requests - [url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID."]".$FullName."[/url] - has been filled. You can view it at [url]https://".SSL_SITE_URL."/torrents.php?torrentid=".$TorrentID."[/url]");
|
||||
}
|
||||
|
||||
$RequestVotes = get_votes_array($RequestID);
|
||||
|
@ -52,12 +52,12 @@
|
||||
} else {
|
||||
$DB->query("UPDATE users_main SET Uploaded = Uploaded - ".$RequestVotes['TotalBounty']." WHERE ID = ".$FillerID);
|
||||
}
|
||||
Misc::send_pm($FillerID, 0, db_string("A request you filled has been unfilled"), db_string("The request '[url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID."]".$FullName."[/url]' was unfilled by [url=https://".SSL_SITE_URL."/user.php?id=".$LoggedUser['ID']."]".$LoggedUser['Username']."[/url] for the reason: ".$_POST['reason']));
|
||||
Misc::send_pm($FillerID, 0, "A request you filled has been unfilled", "The request '[url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID."]".$FullName."[/url]' was unfilled by [url=https://".SSL_SITE_URL."/user.php?id=".$LoggedUser['ID']."]".$LoggedUser['Username']."[/url] for the reason: ".$_POST['reason']);
|
||||
|
||||
$Cache->delete_value('user_stats_'.$FillerID);
|
||||
|
||||
if($UserID != $LoggedUser['ID']) {
|
||||
Misc::send_pm($UserID, 0, db_string("A request you created has been unfilled"), db_string("The request '[url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID."]".$FullName."[/url]' was unfilled by [url=https://".SSL_SITE_URL."/user.php?id=".$LoggedUser['ID']."]".$LoggedUser['Username']."[/url] for the reason: ".$_POST['reason']));
|
||||
Misc::send_pm($UserID, 0, "A request you created has been unfilled", "The request '[url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID."]".$FullName."[/url]' was unfilled by [url=https://".SSL_SITE_URL."/user.php?id=".$LoggedUser['ID']."]".$LoggedUser['Username']."[/url] for the reason: ".$_POST['reason']);
|
||||
}
|
||||
|
||||
Misc::write_log("Request $RequestID ($FullName), with a ".Format::get_size($RequestVotes['TotalBounty'])." bounty, was unfilled by user ".$LoggedUser['ID']." (".$LoggedUser['Username'].") for the reason: ".$_POST['reason']);
|
||||
|
@ -313,8 +313,8 @@ function next_hour() {
|
||||
$Subject = 'Leeching Disabled';
|
||||
$Message = 'You have downloaded more then 10 GiB while on Ratio Watch. Your leeching privileges have been disabled. Please reread the rules and refer to this guide on how to improve your ratio https://what.cd/wiki.php?action=article&id=110';
|
||||
foreach($UserIDs as $UserID) {
|
||||
Misc::send_pm($UserID,0,db_string($Subject),db_string($Message));
|
||||
send_irc("PRIVMSG #reports : !leechdisabled Downloaded 10 GB+ on Ratio Watch. https://".NONSSL_SITE_URL."/user.php?id=$UserID");
|
||||
Misc::send_pm($UserID, 0, $Subject, $Message);
|
||||
send_irc("PRIVMSG #reports :!leechdisabled Downloaded 10 GB+ on Ratio Watch. https://".NONSSL_SITE_URL."/user.php?id=$UserID");
|
||||
}
|
||||
|
||||
$DB->query("UPDATE users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
||||
@ -432,7 +432,7 @@ function next_hour() {
|
||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||
$Cache->update_row(false, array('RatioWatchEnds'=>'0000-00-00 00:00:00','RatioWatchDownload'=>'0','CanLeech'=>1));
|
||||
$Cache->commit_transaction(0);
|
||||
Misc::send_pm($UserID, 0, db_string("You have been taken off Ratio Watch"), db_string("Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n"), '');
|
||||
Misc::send_pm($UserID, 0, "You have been taken off Ratio Watch", "Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n");
|
||||
echo "Ratio watch off: $UserID\n";
|
||||
}
|
||||
$DB->set_query_id($UserQuery);
|
||||
@ -460,7 +460,7 @@ function next_hour() {
|
||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||
$Cache->update_row(false, array('RatioWatchEnds'=>'0000-00-00 00:00:00','RatioWatchDownload'=>'0','CanLeech'=>1));
|
||||
$Cache->commit_transaction(0);
|
||||
Misc::send_pm($UserID, 0, db_string("You have been taken off Ratio Watch"), db_string("Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n"), '');
|
||||
Misc::send_pm($UserID, 0, "You have been taken off Ratio Watch", "Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n");
|
||||
echo "Ratio watch off: $UserID\n";
|
||||
}
|
||||
$DB->set_query_id($UserQuery);
|
||||
@ -491,7 +491,7 @@ function next_hour() {
|
||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||
$Cache->update_row(false, array('RatioWatchEnds'=>time_plus(60*60*24*14),'RatioWatchDownload'=>0));
|
||||
$Cache->commit_transaction(0);
|
||||
Misc::send_pm($UserID, 0, db_string("You have been put on Ratio Watch"), db_string("This happens when your ratio falls below the requirements we have outlined in the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n For information about ratio watch, click the link above."), '');
|
||||
Misc::send_pm($UserID, 0, "You have been put on Ratio Watch", "This happens when your ratio falls below the requirements we have outlined in the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n For information about ratio watch, click the link above.");
|
||||
echo "Ratio watch on: $UserID\n";
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ function next_hour() {
|
||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||
$Cache->update_row(false, array('RatioWatchDownload'=>0, 'CanLeech'=>0));
|
||||
$Cache->commit_transaction(0);
|
||||
Misc::send_pm($UserID, 0, db_string("Your downloading rights have been disabled"), db_string("As you did not raise your ratio in time, your downloading rights have been revoked. You will not be able to download any torrents until your ratio is above your new required ratio."), '');
|
||||
Misc::send_pm($UserID, 0, "Your downloading rights have been disabled", "As you did not raise your ratio in time, your downloading rights have been revoked. You will not be able to download any torrents until your ratio is above your new required ratio.");
|
||||
echo "Ratio watch disabled: $UserID\n";
|
||||
}
|
||||
|
||||
@ -713,7 +713,7 @@ function next_hour() {
|
||||
|
||||
foreach($DeleteNotes as $UserID => $MessageInfo){
|
||||
$Singular = ($MessageInfo['Count'] == 1) ? true : false;
|
||||
Misc::send_pm($UserID,0,db_string($MessageInfo['Count'].' of your torrents '.($Singular?'has':'have').' been deleted for inactivity'), db_string(($Singular?'One':'Some').' of your uploads '.($Singular?'has':'have').' been deleted for being unseeded. Since '.($Singular?'it':'they').' didn\'t break any rules (we hope), please feel free to re-upload '.($Singular?'it':'them').".\n\nThe following torrent".($Singular?' was':'s were').' deleted:'.$MessageInfo['Msg']));
|
||||
Misc::send_pm($UserID, 0, $MessageInfo['Count'].' of your torrents '.($Singular?'has':'have').' been deleted for inactivity', ($Singular?'One':'Some').' of your uploads '.($Singular?'has':'have').' been deleted for being unseeded. Since '.($Singular?'it':'they').' didn\'t break any rules (we hope), please feel free to re-upload '.($Singular?'it':'them').".\n\nThe following torrent".($Singular?' was':'s were').' deleted:'.$MessageInfo['Msg']);
|
||||
}
|
||||
unset($DeleteNotes);
|
||||
|
||||
@ -941,7 +941,7 @@ function next_hour() {
|
||||
$TorrentAlerts[$UserID]['Count']++;
|
||||
}
|
||||
foreach($TorrentAlerts as $UserID => $MessageInfo){
|
||||
Misc::send_pm($UserID, 0, db_string('Unseeded torrent notification'), db_string($MessageInfo['Count']." of your uploads will be deleted for inactivity soon. Unseeded torrents are deleted after 4 weeks. If you still have the files, you can seed your uploads by ensuring the torrents are in your client and that they aren't stopped. You can view the time that a torrent has been unseeded by clicking on the torrent description line and looking for the \"Last active\" time. For more information, please go [url=https://what.cd/wiki.php?action=article&id=663]here[/url].\n\nThe following torrent".($MessageInfo['Count']>1?'s':'')." will be removed for inactivity:".$MessageInfo['Msg']."\n\nIf you no longer wish to receive these notifications, please disable them in your profile settings."));
|
||||
Misc::send_pm($UserID, 0, 'Unseeded torrent notification', $MessageInfo['Count']." of your uploads will be deleted for inactivity soon. Unseeded torrents are deleted after 4 weeks. If you still have the files, you can seed your uploads by ensuring the torrents are in your client and that they aren't stopped. You can view the time that a torrent has been unseeded by clicking on the torrent description line and looking for the \"Last active\" time. For more information, please go [url=https://what.cd/wiki.php?action=article&id=663]here[/url].\n\nThe following torrent".($MessageInfo['Count']>1?'s':'')." will be removed for inactivity:".$MessageInfo['Msg']."\n\nIf you no longer wish to receive these notifications, please disable them in your profile settings.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,19 +1,23 @@
|
||||
<?
|
||||
//Props to Leto of StC.
|
||||
if (
|
||||
!check_perms('users_view_invites') &&
|
||||
!check_perms('users_disable_users') &&
|
||||
!check_perms('users_edit_invites') &&
|
||||
!check_perms('users_disable_any')
|
||||
) { error(404); }
|
||||
// Props to Leto of StC.
|
||||
if (!check_perms('users_view_invites') && !check_perms('users_disable_users') && !check_perms('users_edit_invites') && !check_perms('users_disable_any')) {
|
||||
error(404);
|
||||
}
|
||||
View::show_header("Manipulate Invite Tree");
|
||||
|
||||
if($_POST['id']) {
|
||||
if ($_POST['id']) {
|
||||
authorize();
|
||||
|
||||
if(!is_number($_POST['id'])) { error(403); }
|
||||
if(!$_POST['comment']) { error('Please enter a comment to add to the users affected.');
|
||||
} else { $Comment = db_string($_POST['comment']); }
|
||||
if (!is_number($_POST['id'])) {
|
||||
error(403);
|
||||
}
|
||||
if (!$_POST['comment']) {
|
||||
error('Please enter a comment to add to the users affected.');
|
||||
}
|
||||
else {
|
||||
$Comment = db_string($_POST['comment']);
|
||||
$Comment .= "\n" . "Manipulate Tree used by " . $LoggedUser['Username'];
|
||||
}
|
||||
$UserID = $_POST['id'];
|
||||
$DB->query("SELECT
|
||||
t1.TreePosition,
|
||||
@ -26,10 +30,14 @@
|
||||
) AS MaxPosition
|
||||
FROM invite_tree AS t1
|
||||
WHERE t1.UserID=$UserID");
|
||||
list($TreePosition, $TreeID, $TreeLevel, $MaxPosition) = $DB->next_record();
|
||||
if(!$MaxPosition){ $MaxPosition = 1000000; } // $MaxPermission is null if the user is the last one in that tree on that level
|
||||
if(!$TreeID){ return; }
|
||||
$DB->query("
|
||||
list ($TreePosition, $TreeID, $TreeLevel, $MaxPosition) = $DB->next_record();
|
||||
if (!$MaxPosition) {
|
||||
$MaxPosition = 1000000;
|
||||
} // $MaxPermission is null if the user is the last one in that tree on that level
|
||||
if (!$TreeID) {
|
||||
return;
|
||||
}
|
||||
$DB->query("
|
||||
SELECT
|
||||
UserID
|
||||
FROM invite_tree
|
||||
@ -40,56 +48,28 @@
|
||||
ORDER BY TreePosition");
|
||||
$BanList = array();
|
||||
|
||||
while(list($Invitee) = $DB->next_record()) {
|
||||
$BanList[]=$Invitee;
|
||||
while (list ($Invitee) = $DB->next_record()) {
|
||||
$BanList[] = $Invitee;
|
||||
}
|
||||
|
||||
foreach ($BanList as $Key => $InviteeID) {
|
||||
if ($_POST['perform']=='nothing') {
|
||||
$DB->query("SELECT
|
||||
AdminComment
|
||||
FROM users_info
|
||||
WHERE UserID='".$InviteeID."'");
|
||||
list($AdminComment)=$DB->next_record();
|
||||
$DBComment = $Comment."\n\n".$AdminComment;
|
||||
$DB->query("UPDATE
|
||||
users_info
|
||||
SET AdminComment='".$DBComment."'
|
||||
WHERE UserID='".$InviteeID."'");
|
||||
if ($_POST['perform'] == 'nothing') {
|
||||
Tools::update_user_notes($InviteeID, $Comment . "\n\n");
|
||||
$Msg = "Successfully commented on entire invite tree!";
|
||||
} elseif ($_POST['perform']=='disable') {
|
||||
$DB->query("SELECT
|
||||
AdminComment
|
||||
FROM users_info
|
||||
WHERE UserID='".$InviteeID."'");
|
||||
list($AdminComment)=$DB->next_record();
|
||||
$DBComment = $Comment."\n\n".$AdminComment;
|
||||
$DB->query("UPDATE
|
||||
users_info
|
||||
SET AdminComment='".$DBComment."'
|
||||
WHERE UserID='".$InviteeID."'");
|
||||
$DB->query("UPDATE
|
||||
users_main
|
||||
SET Enabled='2'
|
||||
WHERE ID='".$InviteeID."'");
|
||||
}
|
||||
elseif ($_POST['perform'] == 'disable') {
|
||||
Tools::disable_users($InviteeID, $Comment);
|
||||
$Msg = "Successfully banned entire invite tree!";
|
||||
} elseif ($_POST['perform']=='inviteprivs') { //DisableInvites =1
|
||||
}
|
||||
elseif ($_POST['perform'] == 'inviteprivs') { // DisableInvites =1
|
||||
Tools::update_user_notes($InviteeID, $Comment . "\n\n");
|
||||
$DB->query("UPDATE
|
||||
users_info
|
||||
SET DisableInvites='1'
|
||||
WHERE UserID='".$InviteeID."'");
|
||||
$DB->query("SELECT
|
||||
AdminComment
|
||||
FROM users_info
|
||||
WHERE UserID='".$InviteeID."'");
|
||||
list($AdminComment)=$DB->next_record();
|
||||
$DBComment = $Comment."\n\n".$AdminComment;
|
||||
$DB->query("UPDATE
|
||||
users_info
|
||||
SET AdminComment='".$DBComment."'
|
||||
WHERE UserID='".$InviteeID."'");
|
||||
WHERE UserID='" . $InviteeID . "'");
|
||||
$Msg = "Successfully removed invite privileges from entire tree!";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
error(403);
|
||||
}
|
||||
}
|
||||
@ -99,7 +79,7 @@
|
||||
<div class="thin">
|
||||
<? if($Msg) { ?>
|
||||
<div class="center">
|
||||
<p style="color: red;text-align:center;"><?=$Msg?></p>
|
||||
<p style="color: red; text-align: center;"><?=$Msg?></p>
|
||||
</div>
|
||||
<? } ?>
|
||||
<form class="manage_form" name="user" action="" method="post">
|
||||
@ -108,25 +88,24 @@
|
||||
<table class="layout">
|
||||
<tr>
|
||||
<td class="label"><strong>UserID</strong></td>
|
||||
<td>
|
||||
<input type="text" size="10" name="id" id="id" />
|
||||
</td>
|
||||
<td><input type="text" size="10" name="id" id="id" /></td>
|
||||
<td class="label"><strong>Mandatory comment!</strong></td>
|
||||
<td>
|
||||
<input type="text" size="40" name="comment" id="comment" />
|
||||
</td>
|
||||
<td><input type="text" size="40" name="comment" id="comment" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><strong>Action: </strong></td>
|
||||
<td colspan="2">
|
||||
<select name="perform">
|
||||
<option value="nothing"<? if($_POST['perform']==='nothing'){echo ' selected="selected"';}?>>Do nothing</option>
|
||||
<option value="disable"<? if($_POST['perform']==='disable'){echo ' selected="selected"';}?>>Disable entire tree</option>
|
||||
<option value="inviteprivs"<? if($_POST['perform']==='inviteprivs'){echo ' selected="selected"';}?>>Disable invites privileges</option>
|
||||
</select>
|
||||
</td><td align="left">
|
||||
<input type="submit" value="Go" />
|
||||
</td>
|
||||
<td colspan="2"><select name="perform">
|
||||
<option value="nothing"
|
||||
<? if($_POST['perform']==='nothing'){echo ' selected="selected"';}?>>Do
|
||||
nothing</option>
|
||||
<option value="disable"
|
||||
<? if($_POST['perform']==='disable'){echo ' selected="selected"';}?>>Disable
|
||||
entire tree</option>
|
||||
<option value="inviteprivs"
|
||||
<? if($_POST['perform']==='inviteprivs'){echo ' selected="selected"';}?>>Disable
|
||||
invites privileges</option>
|
||||
</select></td>
|
||||
<td align="left"><input type="submit" value="Go" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
@ -20,7 +20,9 @@
|
||||
}
|
||||
$UserInfo = array($UserInfo);
|
||||
list($UserID,$DownloadAlt)=array_shift($UserInfo);
|
||||
if(!$UserID) { error(403); }
|
||||
if (!$UserID) {
|
||||
error(0);
|
||||
}
|
||||
$TorrentPass = $_REQUEST['torrent_pass'];
|
||||
$AuthKey = $_REQUEST['authkey'];
|
||||
}
|
||||
@ -29,7 +31,9 @@
|
||||
|
||||
|
||||
|
||||
if (!is_number($TorrentID)){ error(0); }
|
||||
if (!is_number($TorrentID)) {
|
||||
error(0);
|
||||
}
|
||||
|
||||
/* uTorrent remote redownloads .torrent files every fifteen minutes
|
||||
to prevent this retardation from blowing bandwidth etc., let's block it
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
Thanks!";
|
||||
|
||||
Misc::send_pm($UserID, 0, 'Re-seed request for torrent '.db_string($Name), db_string($Request));
|
||||
Misc::send_pm($UserID, 0, 'Re-seed request for torrent ' . $Name, $Request);
|
||||
}
|
||||
$NumUsers = count($Users);
|
||||
} else {
|
||||
@ -54,7 +54,7 @@
|
||||
The exact process for re-seeding a torrent is slightly different for each client, but the concept is the same. The idea is to download the .torrent file and open it in your client, and point your client to the location where the data files are, then initiate a hash check.
|
||||
|
||||
Thanks!";
|
||||
Misc::send_pm($UploaderID, 0, 'Re-seed request for torrent '.db_string($Name), db_string($Request));
|
||||
Misc::send_pm($UploaderID, 0, 'Re-seed request for torrent ' . $Name, $Request);
|
||||
|
||||
$NumUsers = 1;
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
}
|
||||
Misc::assert_isset_request($_POST, array('reason', 'privatemessage', 'body', 'length', 'groupid', 'postid', 'userid'));
|
||||
|
||||
$Reason = db_string($_POST['reason']);
|
||||
$PrivateMessage = db_string($_POST['privatemessage']);
|
||||
$Body = db_string($_POST['body']);
|
||||
$Reason = $_POST['reason'];
|
||||
$PrivateMessage = $_POST['privatemessage'];
|
||||
$Body = $_POST['body'];
|
||||
$Length = $_POST['length'];
|
||||
$GroupID = (int) $_POST['groupid'];
|
||||
$PostID = (int) $_POST['postid'];
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE torrents_comments SET
|
||||
Body = '$Body',
|
||||
Body = '" . db_string($Body) . "',
|
||||
EditedUserID = '" . db_string($LoggedUser['ID']) . "',
|
||||
EditedTime = '" . sqltime() . "'
|
||||
WHERE ID='$PostID'");
|
||||
@ -60,7 +60,7 @@
|
||||
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
|
||||
$Cache->begin_transaction('torrent_comments_' . $GroupID . '_catalogue_' . $CatalogueID);
|
||||
|
||||
$Cache->update_row($_POST['key'], array('ID' => $_POST['postid'], 'AuthorID' => $AuthorID, 'AddedTime' => $AddedTime, 'Body' => $_POST['body'],
|
||||
$Cache->update_row($_POST['key'], array('ID' => $_POST['postid'], 'AuthorID' => $AuthorID, 'AddedTime' => $AddedTime, 'Body' => $Body,
|
||||
'EditedUserID' => db_string($LoggedUser['ID']), 'EditedTime' => sqltime(), 'Username' => $LoggedUser['Username']));
|
||||
$Cache->commit_transaction(0);
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
// Save this because send_pm uses $DB to run its own query... Oops...
|
||||
$Snatchers = $DB->to_array();
|
||||
foreach ($Snatchers as $UserID) {
|
||||
Misc::send_pm($UserID[0],0,db_string($Subject),db_string($Message));
|
||||
Misc::send_pm($UserID[0], 0, $Subject, $Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
//**********************************************************************//
|
||||
|
||||
ini_set('max_file_uploads','100');
|
||||
View::show_header('Upload','upload,jquery,valid_tags,musicbrainz,multiformat_uploader');
|
||||
View::show_header('Upload','upload,jquery,validate_upload,valid_tags,musicbrainz,multiformat_uploader');
|
||||
|
||||
if(empty($Properties) && !empty($_GET['groupid']) && is_number($_GET['groupid'])) {
|
||||
$DB->query("SELECT
|
||||
|
@ -11,6 +11,9 @@
|
||||
$DB->query("SELECT COUNT(ID) FROM artist_comments WHERE AuthorID='$UserID'");
|
||||
list($NumArtistComments) = $DB->next_record();
|
||||
|
||||
$DB->query("SELECT COUNT(ID) FROM requests_comments WHERE AuthorID='$UserID'");
|
||||
list($NumRequestComments) = $DB->next_record();
|
||||
|
||||
$DB->query("SELECT COUNT(ID) FROM collages WHERE Deleted='0' AND UserID='$UserID'");
|
||||
list($NumCollages) = $DB->next_record();
|
||||
|
||||
@ -33,13 +36,16 @@
|
||||
<a href="comments.php?id=<?=$UserID?>" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? if (($Override=check_paranoia_here('torrentcomments+'))) { ?>
|
||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Artist comments: <?=number_format($NumArtistComments)?>
|
||||
<? if($Override=check_paranoia_here('torrentcomments')) { ?>
|
||||
<a href="comments.php?id=<?=$UserID?>&action=artists" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Request comments: <?=number_format($NumRequestComments)?>
|
||||
<? if($Override=check_paranoia_here('torrentcomments')) { ?>
|
||||
<a href="comments.php?id=<?=$UserID?>&action=requests" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? if (($Override=check_paranoia_here('collages+'))) { ?>
|
||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Collages started: <?=number_format($NumCollages)?>
|
||||
|
@ -365,7 +365,7 @@
|
||||
}
|
||||
|
||||
if ($Warned == 1 && $Cur['Warned']=='0000-00-00 00:00:00' && check_perms('users_warn')) {
|
||||
Misc::send_pm($UserID,0,db_string('You have received a warning'),db_string("You have been [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&id=218]warned for $WarnLength week(s)[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"));
|
||||
Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&id=218]warned for $WarnLength week(s)[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
|
||||
$UpdateSet[]="Warned='".sqltime()."' + INTERVAL $WarnLength WEEK";
|
||||
$Msg = "warned for $WarnLength week(s)";
|
||||
if ($WarnReason) { $Msg.=" for $WarnReason"; }
|
||||
@ -379,7 +379,7 @@
|
||||
|
||||
} elseif ($Warned == 1 && $ExtendWarning!='---' && check_perms('users_warn')) {
|
||||
|
||||
Misc::send_pm($UserID,0,db_string('Your warning has been extended'),db_string("Your warning has been extended by $ExtendWarning week(s) by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"));
|
||||
Misc::send_pm($UserID, 0, 'Your warning has been extended', "Your warning has been extended by $ExtendWarning week(s) by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
|
||||
|
||||
$UpdateSet[]="Warned=Warned + INTERVAL $ExtendWarning WEEK";
|
||||
$DB->query("SELECT Warned + INTERVAL $ExtendWarning WEEK FROM users_info WHERE UserID='$UserID'");
|
||||
@ -390,7 +390,7 @@
|
||||
$LightUpdates['Warned']=$WarnedUntil;
|
||||
} elseif ($Warned == 1 && $ExtendWarning=='---' && $ReduceWarning!='---' && check_perms('users_warn')) {
|
||||
|
||||
Misc::send_pm($UserID,0,db_string('Your warning has been reduced'),db_string("Your warning has been reduced by $ReduceWarning week(s) by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"));
|
||||
Misc::send_pm($UserID, 0, 'Your warning has been reduced', "Your warning has been reduced by $ReduceWarning week(s) by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
|
||||
|
||||
$UpdateSet[]="Warned=Warned - INTERVAL $ReduceWarning WEEK";
|
||||
$DB->query("SELECT Warned - INTERVAL $ReduceWarning WEEK FROM users_info WHERE UserID='$UserID'");
|
||||
@ -431,7 +431,7 @@
|
||||
$EditSummary[]="avatar status changed";
|
||||
$HeavyUpdates['DisableAvatar']=$DisableAvatar;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your avatar privileges have been disabled'),db_string("Your avatar privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your avatar privileges have been disabled', "Your avatar privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@
|
||||
$HeavyUpdates['DisableLeech']=$DisableLeech;
|
||||
$HeavyUpdates['CanLeech']=$DisableLeech;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your leeching privileges have been disabled'),db_string("Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your leeching privileges have been disabled', "Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => $DisableLeech));
|
||||
}
|
||||
@ -451,7 +451,7 @@
|
||||
if ($DisableInvites == 1) {
|
||||
//$UpdateSet[]="Invites='0'";
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your invite privileges have been disabled'),db_string("Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your invite privileges have been disabled', "Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
}
|
||||
$EditSummary[]="invites status changed";
|
||||
@ -463,7 +463,7 @@
|
||||
$EditSummary[]="posting status changed";
|
||||
$HeavyUpdates['DisablePosting']=$DisablePosting;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your forum posting privileges have been disabled'),db_string("Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your forum posting privileges have been disabled', "Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
}
|
||||
|
||||
@ -472,7 +472,7 @@
|
||||
$EditSummary[]="forums status changed";
|
||||
$HeavyUpdates['DisableForums']=$DisableForums;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your forum privileges have been disabled'),db_string("Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your forum privileges have been disabled', "Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
}
|
||||
|
||||
@ -481,7 +481,7 @@
|
||||
$EditSummary[]="tagging status changed";
|
||||
$HeavyUpdates['DisableTagging']=$DisableTagging;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your tagging privileges have been disabled'),db_string("Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your tagging privileges have been disabled', "Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
}
|
||||
|
||||
@ -490,7 +490,7 @@
|
||||
$EditSummary[]="upload status changed";
|
||||
$HeavyUpdates['DisableUpload']=$DisableUpload;
|
||||
if ($DisableUpload == 1) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your upload privileges have been disabled'),db_string("Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your upload privileges have been disabled', "Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
}
|
||||
|
||||
@ -500,7 +500,7 @@
|
||||
$HeavyUpdates['DisableWiki']=$DisableWiki;
|
||||
$HeavyUpdates['site_edit_wiki']=0;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your site editing privileges have been disabled'),db_string("Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your site editing privileges have been disabled', "Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
|
||||
}
|
||||
@ -510,7 +510,7 @@
|
||||
$EditSummary[]="PM status changed";
|
||||
$HeavyUpdates['DisablePM']=$DisablePM;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your PM privileges have been disabled'),db_string("Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, 'Your PM privileges have been disabled', "Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
}
|
||||
}
|
||||
|
||||
@ -519,7 +519,7 @@
|
||||
$EditSummary[]="IRC status changed";
|
||||
$HeavyUpdates['DisableIRC']=$DisableIRC;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your IRC privileges have been disabled'),db_string("Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
|
||||
Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -528,7 +528,7 @@
|
||||
$EditSummary[]="request status changed";
|
||||
$HeavyUpdates['DisableRequests']=$DisableRequests;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your request privileges have been disabled'),db_string("Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
|
||||
Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
|
29
static/functions/validate_upload.js
Normal file
29
static/functions/validate_upload.js
Normal file
@ -0,0 +1,29 @@
|
||||
(function ($) {
|
||||
$(document).ready(function () {
|
||||
// Upload button is clicked
|
||||
$("#post").click(function(e) {
|
||||
// Make sure "Music" category is selected.
|
||||
if($("#categories").find(":selected").val() == 0) {
|
||||
checkHasMainArtist(e);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Make sure a main artist is selected.
|
||||
*/
|
||||
function checkHasMainArtist(e) {
|
||||
var has_main = false;
|
||||
$("select[id^=importance]").each(function() {
|
||||
if($(this).find(":selected").val() == 1) {
|
||||
has_main = true;
|
||||
}
|
||||
});
|
||||
if(!has_main) {
|
||||
alert('A "Main" artist is required');
|
||||
// Don't POST the form.
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
Loading…
Reference in New Issue
Block a user