mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 04:01:35 +00:00
Empty commit
This commit is contained in:
parent
cfe5ffcd50
commit
fd6c63ab67
@ -14,8 +14,8 @@ class Forums {
|
||||
public static function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false) {
|
||||
if ((!$ThreadInfo = G::$Cache->get_value('thread_' . $ThreadID . '_info')) || !isset($ThreadInfo['Ranking'])) {
|
||||
$QueryID = G::$DB->get_query_id();
|
||||
G::$DB->query(
|
||||
"SELECT
|
||||
G::$DB->query("
|
||||
SELECT
|
||||
t.Title,
|
||||
t.ForumID,
|
||||
t.IsLocked,
|
||||
@ -26,11 +26,11 @@ public static function get_thread_info($ThreadID, $Return = true, $SelectiveCach
|
||||
t.StickyPostID,
|
||||
t.AuthorID as OP,
|
||||
t.Ranking
|
||||
FROM forums_topics AS t
|
||||
JOIN forums_posts AS fp ON fp.TopicID = t.ID
|
||||
LEFT JOIN forums_polls AS p ON p.TopicID=t.ID
|
||||
WHERE t.ID = '$ThreadID'
|
||||
GROUP BY fp.TopicID");
|
||||
FROM forums_topics AS t
|
||||
JOIN forums_posts AS fp ON fp.TopicID = t.ID
|
||||
LEFT JOIN forums_polls AS p ON p.TopicID = t.ID
|
||||
WHERE t.ID = '$ThreadID'
|
||||
GROUP BY fp.TopicID");
|
||||
if (!G::$DB->has_results()) {
|
||||
G::$DB->set_query_id($QueryID);
|
||||
return null;
|
||||
@ -96,19 +96,20 @@ public static function check_forumperm($ForumID, $Perm = 'Read') {
|
||||
* the forum ID.
|
||||
*/
|
||||
public static function get_forum_info($ForumID) {
|
||||
$Forum = G::$Cache->get_value('ForumInfo_' . $ForumID);
|
||||
$Forum = G::$Cache->get_value("ForumInfo_$ForumID");
|
||||
if (!$Forum) {
|
||||
$QueryID = G::$DB->get_query_id();
|
||||
G::$DB->query("SELECT
|
||||
G::$DB->query("
|
||||
SELECT
|
||||
Name,
|
||||
MinClassRead,
|
||||
MinClassWrite,
|
||||
MinClassCreate,
|
||||
COUNT(forums_topics.ID) AS Topics
|
||||
FROM forums
|
||||
LEFT JOIN forums_topics ON forums_topics.ForumID=forums.ID
|
||||
WHERE forums.ID='$ForumID'
|
||||
GROUP BY ForumID");
|
||||
FROM forums
|
||||
LEFT JOIN forums_topics ON forums_topics.ForumID = forums.ID
|
||||
WHERE forums.ID = '$ForumID'
|
||||
GROUP BY ForumID");
|
||||
if (!G::$DB->has_results()) {
|
||||
return false;
|
||||
}
|
||||
@ -117,7 +118,7 @@ public static function get_forum_info($ForumID) {
|
||||
|
||||
G::$DB->set_query_id($QueryID);
|
||||
|
||||
G::$Cache->cache_value('ForumInfo_' . $ForumID, $Forum, 86400);
|
||||
G::$Cache->cache_value("ForumInfo_$ForumID", $Forum, 86400);
|
||||
}
|
||||
return $Forum;
|
||||
}
|
||||
@ -130,7 +131,9 @@ public static function get_forum_categories() {
|
||||
$ForumCats = G::$Cache->get_value('forums_categories');
|
||||
if ($ForumCats === false) {
|
||||
$QueryID = G::$DB->get_query_id();
|
||||
G::$DB->query("SELECT ID, Name FROM forums_categories");
|
||||
G::$DB->query("
|
||||
SELECT ID, Name
|
||||
FROM forums_categories");
|
||||
$ForumCats = array();
|
||||
while (list ($ID, $Name) = G::$DB->next_record()) {
|
||||
$ForumCats[$ID] = $Name;
|
||||
@ -174,7 +177,9 @@ public static function get_forums() {
|
||||
ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort");
|
||||
$Forums = G::$DB->to_array('ID', MYSQLI_ASSOC, false);
|
||||
|
||||
G::$DB->query("SELECT ForumID, ThreadID FROM forums_specific_rules");
|
||||
G::$DB->query("
|
||||
SELECT ForumID, ThreadID
|
||||
FROM forums_specific_rules");
|
||||
$SpecificRules = array();
|
||||
while (list($ForumID, $ThreadID) = G::$DB->next_record(MYSQLI_NUM, false)) {
|
||||
$SpecificRules[$ForumID][] = $ThreadID;
|
||||
@ -238,11 +243,11 @@ public static function get_last_read($Forums) {
|
||||
FROM forums_posts AS p
|
||||
WHERE p.TopicID = l.TopicID
|
||||
AND p.ID <= l.PostID
|
||||
)/$PerPage
|
||||
) / $PerPage
|
||||
) AS Page
|
||||
FROM forums_last_read_topics AS l
|
||||
WHERE l.TopicID IN(" . implode(',', $TopicIDs) . ") AND
|
||||
l.UserID='" . G::$LoggedUser['ID'] . "'");
|
||||
l.UserID = '" . G::$LoggedUser['ID'] . "'");
|
||||
$LastRead = G::$DB->to_array('TopicID', MYSQLI_ASSOC);
|
||||
G::$DB->set_query_id($QueryID);
|
||||
} else {
|
||||
@ -263,7 +268,11 @@ public static function add_topic_note($TopicID, $Note, $UserID = null) {
|
||||
$UserID = G::$LoggedUser['ID'];
|
||||
}
|
||||
$QueryID = G::$DB->get_query_id();
|
||||
G::$DB->query("INSERT INTO forums_topic_notes (TopicID, AuthorID, AddedTime, Body) VALUES ($TopicID, $UserID, '" . sqltime() . "', '" . db_string($Note) . "')");
|
||||
G::$DB->query("
|
||||
INSERT INTO forums_topic_notes
|
||||
(TopicID, AuthorID, AddedTime, Body)
|
||||
VALUES
|
||||
($TopicID, $UserID, '" . sqltime() . "', '" . db_string($Note) . "')");
|
||||
G::$DB->set_query_id($QueryID);
|
||||
return (bool)G::$DB->affected_rows();
|
||||
}
|
||||
|
@ -22,17 +22,17 @@ public static function check_perms($PermissionName, $MinClass = 0) {
|
||||
* @return array permissions
|
||||
*/
|
||||
public static function get_permissions($PermissionID) {
|
||||
$Permission = G::$Cache->get_value('perm_'.$PermissionID);
|
||||
$Permission = G::$Cache->get_value("perm_$PermissionID");
|
||||
if (empty($Permission)) {
|
||||
$QueryID = G::$DB->get_query_id();
|
||||
G::$DB->query("
|
||||
SELECT Level AS Class, `Values` AS Permissions, Secondary, PermittedForums
|
||||
FROM permissions
|
||||
WHERE ID='$PermissionID'");
|
||||
WHERE ID = '$PermissionID'");
|
||||
$Permission = G::$DB->next_record(MYSQLI_ASSOC, array('Permissions'));
|
||||
G::$DB->set_query_id($QueryID);
|
||||
$Permission['Permissions'] = unserialize($Permission['Permissions']);
|
||||
G::$Cache->cache_value('perm_'.$PermissionID, $Permission, 2592000);
|
||||
G::$Cache->cache_value("perm_$PermissionID", $Permission, 2592000);
|
||||
}
|
||||
return $Permission;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
) AS Page
|
||||
FROM forums_last_read_topics AS l
|
||||
WHERE l.TopicID IN(".implode(',', $TopicIDs).")
|
||||
AND l.UserID='$LoggedUser[ID]'");
|
||||
AND l.UserID = '$LoggedUser[ID]'");
|
||||
$LastRead = $DB->to_array('TopicID', MYSQLI_ASSOC);
|
||||
} else {
|
||||
$LastRead = array();
|
||||
@ -50,7 +50,7 @@
|
||||
foreach ($Forums as $Forum) {
|
||||
list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
|
||||
if ($LoggedUser['CustomForums'][$ForumID] != 1
|
||||
&& ($MinRead>$LoggedUser['Class']
|
||||
&& ($MinRead > $LoggedUser['Class']
|
||||
|| array_search($ForumID, $RestrictedForums) !== false)
|
||||
) {
|
||||
continue;
|
||||
|
@ -24,9 +24,9 @@
|
||||
error(403);
|
||||
}
|
||||
|
||||
$URL = 'https://' . SSL_SITE_URL . '/' . Comments::get_url_query($PostID);
|
||||
if ($Length != 'verbal') {
|
||||
$Time = ((int)$Length) * (7 * 24 * 60 * 60);
|
||||
$URL = site_url() . Comments::get_url_query($PostID);
|
||||
if ($Length !== 'verbal') {
|
||||
$Time = (int)$Length * (7 * 24 * 60 * 60);
|
||||
Tools::warn_user($AuthorID, $Time, "$URL - $Reason");
|
||||
$Subject = 'You have received a warning';
|
||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this comment.[/url]\n\n$PrivateMessage";
|
||||
@ -35,7 +35,7 @@
|
||||
} else {
|
||||
$Subject = 'You have received a verbal warning';
|
||||
$PrivateMessage = "You have received a verbal warning for [url=$URL]this comment.[/url]\n\n$PrivateMessage";
|
||||
$AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
$AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL\nReason: $Reason\n\n";
|
||||
Tools::update_user_notes($AuthorID, $AdminComment);
|
||||
}
|
||||
$DB->query("
|
||||
|
@ -26,7 +26,7 @@
|
||||
t.ForumID
|
||||
FROM forums_posts AS p
|
||||
JOIN forums_topics AS t ON p.TopicID = t.ID
|
||||
WHERE p.ID='$PostID'");
|
||||
WHERE p.ID = '$PostID'");
|
||||
list($Body, $ForumID) = $DB->next_record(MYSQLI_NUM);
|
||||
|
||||
// Is the user allowed to view the post?
|
||||
|
@ -21,12 +21,11 @@
|
||||
|
||||
// Message is selected providing the user quoting is one of the two people in the thread
|
||||
$DB->query("
|
||||
SELECT
|
||||
m.Body
|
||||
SELECT m.Body
|
||||
FROM pm_messages AS m
|
||||
JOIN pm_conversations_users AS u ON m.ConvID=u.ConvID
|
||||
WHERE m.ID='$PostID'
|
||||
AND u.UserID=".$LoggedUser['ID']);
|
||||
JOIN pm_conversations_users AS u ON m.ConvID = u.ConvID
|
||||
WHERE m.ID = '$PostID'
|
||||
AND u.UserID = ".$LoggedUser['ID']);
|
||||
list($Body) = $DB->next_record(MYSQLI_NUM);
|
||||
|
||||
// This gets sent to the browser, which echoes it wherever
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
$ReportID = $_GET['reportid'];
|
||||
$Type = $_GET['type'];
|
||||
$ThingID= $_GET['thingid'];
|
||||
$ThingID = $_GET['thingid'];
|
||||
|
||||
if (!$ReportID || !is_number($ReportID) || !$ThingID || !is_number($ThingID) || !$Type) {
|
||||
error(403);
|
||||
@ -30,7 +30,7 @@
|
||||
$DB->query("
|
||||
SELECT Username
|
||||
FROM users_main
|
||||
WHERE ID='$ToID'");
|
||||
WHERE ID = '$ToID'");
|
||||
list($ComposeToUsername) = $DB->next_record();
|
||||
if (!$ComposeToUsername) {
|
||||
error(404);
|
||||
@ -43,7 +43,7 @@
|
||||
$DB->query("
|
||||
SELECT Username
|
||||
FROM users_main
|
||||
WHERE ID=$ThingID");
|
||||
WHERE ID = $ThingID");
|
||||
if (!$DB->has_results()) {
|
||||
$Error = 'No user with the reported ID found';
|
||||
} else {
|
||||
@ -57,12 +57,12 @@
|
||||
$DB->query("
|
||||
SELECT Title
|
||||
FROM requests
|
||||
WHERE ID=$ThingID");
|
||||
WHERE ID = $ThingID");
|
||||
if (!$DB->has_results()) {
|
||||
$Error = 'No request with the reported ID found';
|
||||
} else {
|
||||
list($Name) = $DB->next_record();
|
||||
$TypeLink = 'the request [url=https://'.SSL_SITE_URL."/requests.php?action=view&id=$ThingID]".display_str($Name).'[/url]';
|
||||
$TypeLink = 'the request [url='.site_url()."requests.php?action=view&id=$ThingID]".display_str($Name).'[/url]';
|
||||
$Subject = 'Request Report: '.display_str($Name);
|
||||
}
|
||||
break;
|
||||
@ -70,12 +70,12 @@
|
||||
$DB->query("
|
||||
SELECT Name
|
||||
FROM collages
|
||||
WHERE ID=$ThingID");
|
||||
WHERE ID = $ThingID");
|
||||
if (!$DB->has_results()) {
|
||||
$Error = 'No collage with the reported ID found';
|
||||
} else {
|
||||
list($Name) = $DB->next_record();
|
||||
$TypeLink = 'the collage [url=https://'.SSL_SITE_URL."/collage.php?id=$ThingID]".display_str($Name).'[/url]';
|
||||
$TypeLink = 'the collage [url='.site_url()."collage.php?id=$ThingID]".display_str($Name).'[/url]';
|
||||
$Subject = 'Collage Report: '.display_str($Name);
|
||||
}
|
||||
break;
|
||||
@ -83,12 +83,12 @@
|
||||
$DB->query("
|
||||
SELECT Title
|
||||
FROM forums_topics
|
||||
WHERE ID=$ThingID");
|
||||
WHERE ID = $ThingID");
|
||||
if (!$DB->has_results()) {
|
||||
$Error = 'No forum thread with the reported ID found';
|
||||
} else {
|
||||
list($Title) = $DB->next_record();
|
||||
$TypeLink = 'the forum thread [url=https://'.SSL_SITE_URL."/forums.php?action=viewthread&threadid=$ThingID]".display_str($Title).'[/url]';
|
||||
$TypeLink = 'the forum thread [url='.site_url()."forums.php?action=viewthread&threadid=$ThingID]".display_str($Title).'[/url]';
|
||||
$Subject = 'Forum Thread Report: '.display_str($Title);
|
||||
}
|
||||
break;
|
||||
@ -103,7 +103,8 @@
|
||||
p.ID,
|
||||
p.Body,
|
||||
p.TopicID,
|
||||
( SELECT COUNT(p2.ID)
|
||||
(
|
||||
SELECT COUNT(p2.ID)
|
||||
FROM forums_posts AS p2
|
||||
WHERE p2.TopicID = p.TopicID
|
||||
AND p2.ID <= p.ID
|
||||
@ -114,7 +115,7 @@
|
||||
$Error = 'No forum post with the reported ID found';
|
||||
} else {
|
||||
list($PostID, $Body, $TopicID, $PostNum) = $DB->next_record();
|
||||
$TypeLink = 'this [url=https://'.SSL_SITE_URL."/forums.php?action=viewthread&threadid=$TopicID&post=$PostNum#post$PostID]forum post[/url]";
|
||||
$TypeLink = 'this [url='.site_url()."forums.php?action=viewthread&threadid=$TopicID&post=$PostNum#post$PostID]forum post[/url]";
|
||||
$Subject = 'Forum Post Report: Post ID #'.display_str($PostID);
|
||||
}
|
||||
break;
|
||||
@ -126,7 +127,7 @@
|
||||
if (!$DB->has_results()) {
|
||||
$Error = 'No comment with the reported ID found';
|
||||
} else {
|
||||
$TypeLink = '[url=https://'.SSL_SITE_URL."/comments.php?action=jump&postid=$ThingID]this comment[/url]";
|
||||
$TypeLink = '[url='.site_url()."comments.php?action=jump&postid=$ThingID]this comment[/url]";
|
||||
$Subject = 'Comment Report: ID #'.display_str($ThingID);
|
||||
}
|
||||
break;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?
|
||||
authorize();
|
||||
|
||||
if (empty($_POST['id']) || !is_number($_POST['id']) || empty($_POST['type']) || ($_POST['type'] != 'request_update' && empty($_POST['reason']))) {
|
||||
if (empty($_POST['id']) || !is_number($_POST['id']) || empty($_POST['type']) || ($_POST['type'] !== 'request_update' && empty($_POST['reason']))) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
$Short = $_POST['type'];
|
||||
$Type = $Types[$Short];
|
||||
$ID = $_POST['id'];
|
||||
if ($Short == 'request_update') {
|
||||
if ($Short === 'request_update') {
|
||||
if (empty($_POST['year']) || !is_number($_POST['year'])) {
|
||||
error('Year must be specified.');
|
||||
header("Location: reports.php?action=report&type=request_update&id=$ID");
|
||||
@ -21,7 +21,7 @@
|
||||
}
|
||||
$Reason = '[b]Year[/b]: '.$_POST['year'].".\n\n";
|
||||
// If the release type is somehow invalid, return "Not given"; otherwise, return the release type.
|
||||
$Reason .= '[b]Release type[/b]: '.((empty($_POST['releasetype']) || !is_number($_POST['releasetype']) || $_POST['releasetype'] == 0) ? 'Not given' : $ReleaseTypes[$_POST['releasetype']]).". \n\n";
|
||||
$Reason .= '[b]Release type[/b]: '.((empty($_POST['releasetype']) || !is_number($_POST['releasetype']) || $_POST['releasetype'] === '0') ? 'Not given' : $ReleaseTypes[$_POST['releasetype']]).". \n\n";
|
||||
$Reason .= '[b]Additional comments[/b]: '.$_POST['comment'];
|
||||
} else {
|
||||
$Reason = $_POST['reason'];
|
||||
@ -46,7 +46,8 @@
|
||||
SELECT
|
||||
p.ID,
|
||||
p.TopicID,
|
||||
( SELECT COUNT(p2.ID)
|
||||
(
|
||||
SELECT COUNT(p2.ID)
|
||||
FROM forums_posts AS p2
|
||||
WHERE p2.TopicID = p.TopicID
|
||||
AND p2.ID <= p.ID
|
||||
@ -65,12 +66,12 @@
|
||||
INSERT INTO reports
|
||||
(UserID, ThingID, Type, ReportedTime, Reason)
|
||||
VALUES
|
||||
('.db_string($LoggedUser['ID']).", $ID , '$Short', '".sqltime()."', '".db_string($Reason)."')");
|
||||
('.db_string($LoggedUser['ID']).", $ID, '$Short', '".sqltime()."', '".db_string($Reason)."')");
|
||||
$ReportID = $DB->inserted_id();
|
||||
|
||||
$Channels = array();
|
||||
|
||||
if ($Short == 'request_update') {
|
||||
if ($Short === 'request_update') {
|
||||
$Channels[] = '#requestedits';
|
||||
$Cache->increment('num_update_reports');
|
||||
}
|
||||
@ -80,7 +81,7 @@
|
||||
}
|
||||
|
||||
foreach ($Channels as $Channel) {
|
||||
send_irc("PRIVMSG $Channel :$ReportID - ".$LoggedUser['Username']." just reported a $Short: https://".SSL_SITE_URL."/$Link : ".strtr($Reason, "\n", ' '));
|
||||
send_irc("PRIVMSG $Channel :$ReportID - ".$LoggedUser['Username']." just reported a $Short: ".site_url()."$Link : ".strtr($Reason, "\n", ' '));
|
||||
}
|
||||
|
||||
$Cache->delete_value('num_other_reports');
|
||||
|
@ -824,7 +824,7 @@ function next_hour() {
|
||||
AND ul.UserID IS NULL
|
||||
GROUP BY um.ID");
|
||||
while (list($Username, $Email) = $DB->next_record()) {
|
||||
$Body = "Hi $Username, \n\nIt has been almost 4 months since you used your account at https://".SSL_SITE_URL.". This is an automated email to inform you that your account will be disabled in 10 days if you do not sign in. ";
|
||||
$Body = "Hi $Username,\n\nIt has been almost 4 months since you used your account at ".site_url().". This is an automated email to inform you that your account will be disabled in 10 days if you do not sign in.";
|
||||
Misc::send_email($Email, 'Your '.SITE_NAME.' account is about to be disabled', $Body);
|
||||
}
|
||||
$DB->query("
|
||||
@ -877,7 +877,7 @@ function next_hour() {
|
||||
$Cache->begin_transaction("user_info_$UserID");
|
||||
$Cache->update_row(false, array('PermissionID' => MEMBER));
|
||||
$Cache->commit_transaction(2592000);
|
||||
Misc::send_pm($UserID, 0, 'You have been demoted to '.Users::make_class_string(MEMBER), "You now only meet the requirements for the \"".Users::make_class_string(MEMBER)."\" user class.\n\nTo read more about ".SITE_NAME."'s user classes, read [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=userclasses]this wiki article[/url].");
|
||||
Misc::send_pm($UserID, 0, 'You have been demoted to '.Users::make_class_string(MEMBER), "You now only meet the requirements for the \"".Users::make_class_string(MEMBER)."\" user class.\n\nTo read more about ".SITE_NAME."'s user classes, read [url=".site_url()."wiki.php?action=article&name=userclasses]this wiki article[/url].");
|
||||
}
|
||||
$DB->query('
|
||||
UPDATE users_main
|
||||
@ -898,7 +898,7 @@ function next_hour() {
|
||||
$Cache->begin_transaction("user_info_$UserID");
|
||||
$Cache->update_row(false, array('PermissionID' => USER));
|
||||
$Cache->commit_transaction(2592000);
|
||||
Misc::send_pm($UserID, 0, 'You have been demoted to '.Users::make_class_string(USER), "You now only meet the requirements for the \"".Users::make_class_string(USER)."\" user class.\n\nTo read more about ".SITE_NAME."'s user classes, read [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=userclasses]this wiki article[/url].");
|
||||
Misc::send_pm($UserID, 0, 'You have been demoted to '.Users::make_class_string(USER), "You now only meet the requirements for the \"".Users::make_class_string(USER)."\" user class.\n\nTo read more about ".SITE_NAME."'s user classes, read [url=".site_url()."wiki.php?action=article&name=userclasses]this wiki article[/url].");
|
||||
}
|
||||
$DB->query('
|
||||
UPDATE users_main
|
||||
@ -924,7 +924,8 @@ function next_hour() {
|
||||
$LockIDs = implode(',', $IDs);
|
||||
$DB->query("
|
||||
UPDATE forums_topics
|
||||
SET IsLocked = '1' WHERE ID IN($LockIDs)");
|
||||
SET IsLocked = '1'
|
||||
WHERE ID IN($LockIDs)");
|
||||
sleep(2);
|
||||
$DB->query("
|
||||
DELETE FROM forums_last_read_topics
|
||||
@ -1039,7 +1040,6 @@ function next_hour() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Daily top 10 history.
|
||||
$DB->query("
|
||||
INSERT INTO top10_history (Date, Type)
|
||||
|
@ -6,15 +6,15 @@
|
||||
|
||||
View::show_header($Title, 'jquery-ui,dnu_list');
|
||||
$DB->query("
|
||||
SELECT
|
||||
d.ID,
|
||||
d.Name,
|
||||
d.Comment,
|
||||
d.UserID,
|
||||
d.Time
|
||||
FROM do_not_upload AS d
|
||||
LEFT JOIN users_main AS um ON um.ID=d.UserID
|
||||
ORDER BY d.Sequence");
|
||||
SELECT
|
||||
d.ID,
|
||||
d.Name,
|
||||
d.Comment,
|
||||
d.UserID,
|
||||
d.Time
|
||||
FROM do_not_upload AS d
|
||||
LEFT JOIN users_main AS um ON um.ID = d.UserID
|
||||
ORDER BY d.Sequence");
|
||||
?>
|
||||
<div class="header">
|
||||
<h2><?=($Title)?></h2>
|
||||
@ -46,7 +46,7 @@
|
||||
<td>Submit</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
<? while (list($ID, $Name, $Comment, $UserID, $DNUTime) = $DB->next_record()) { ?>
|
||||
<? while (list($ID, $Name, $Comment, $UserID, $DNUTime) = $DB->next_record()) { ?>
|
||||
<tr id="item_<?=$ID?>">
|
||||
<form class="manage_form dnu" action="tools.php" method="post">
|
||||
<td>
|
||||
@ -68,7 +68,7 @@
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<? View::show_footer(); ?>
|
||||
<? View::show_footer(); ?>
|
||||
|
@ -24,7 +24,8 @@
|
||||
t1.TreePosition,
|
||||
t1.TreeID,
|
||||
t1.TreeLevel,
|
||||
( SELECT
|
||||
(
|
||||
SELECT
|
||||
t2.TreePosition
|
||||
FROM invite_tree AS t2
|
||||
WHERE t2.TreeID = t1.TreeID
|
||||
@ -46,10 +47,10 @@
|
||||
SELECT
|
||||
UserID
|
||||
FROM invite_tree
|
||||
WHERE TreeID=$TreeID
|
||||
AND TreePosition>$TreePosition
|
||||
AND TreePosition<$MaxPosition
|
||||
AND TreeLevel>$TreeLevel
|
||||
WHERE TreeID = $TreeID
|
||||
AND TreePosition > $TreePosition
|
||||
AND TreePosition < $MaxPosition
|
||||
AND TreeLevel > $TreeLevel
|
||||
ORDER BY TreePosition");
|
||||
$BanList = array();
|
||||
|
||||
@ -58,20 +59,18 @@
|
||||
}
|
||||
|
||||
foreach ($BanList as $Key => $InviteeID) {
|
||||
if ($_POST['perform'] == 'nothing') {
|
||||
if ($_POST['perform'] === 'nothing') {
|
||||
Tools::update_user_notes($InviteeID, $Comment . "\n\n");
|
||||
$Msg = "Successfully commented on entire invite tree!";
|
||||
}
|
||||
elseif ($_POST['perform'] == 'disable') {
|
||||
} 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("
|
||||
UPDATE users_info
|
||||
SET DisableInvites = '1'
|
||||
WHERE UserID = '$InviteeID'");
|
||||
$Msg = "Successfully removed invite privileges from entire tree!";
|
||||
}
|
||||
else {
|
||||
|
@ -23,21 +23,26 @@
|
||||
if (!check_paranoia('uploads', $User['Paranoia'], $UserClass, $UserID)) {
|
||||
error(403);
|
||||
}
|
||||
$SQL = "WHERE t.UserID='$UserID'";
|
||||
$SQL = "WHERE t.UserID = '$UserID'";
|
||||
$Month = "t.Time";
|
||||
break;
|
||||
case 'snatches':
|
||||
if (!check_paranoia('snatched', $User['Paranoia'], $UserClass, $UserID)) {
|
||||
error(403);
|
||||
}
|
||||
$SQL = "JOIN xbt_snatched AS x ON t.ID=x.fid WHERE x.uid='$UserID'";
|
||||
$SQL = "
|
||||
JOIN xbt_snatched AS x ON t.ID = x.fid
|
||||
WHERE x.uid = '$UserID'";
|
||||
$Month = "FROM_UNIXTIME(x.tstamp)";
|
||||
break;
|
||||
case 'seeding':
|
||||
if (!check_paranoia('seeding', $User['Paranoia'], $UserClass, $UserID)) {
|
||||
error(403);
|
||||
}
|
||||
$SQL = "JOIN xbt_files_users AS xfu ON t.ID = xfu.fid WHERE xfu.uid='$UserID' AND xfu.remaining = 0";
|
||||
$SQL = "
|
||||
JOIN xbt_files_users AS xfu ON t.ID = xfu.fid
|
||||
WHERE xfu.uid = '$UserID'
|
||||
AND xfu.remaining = 0";
|
||||
$Month = "FROM_UNIXTIME(xfu.mtime)";
|
||||
break;
|
||||
default:
|
||||
@ -48,16 +53,16 @@
|
||||
$DownloadsQ = $DB->query("
|
||||
SELECT
|
||||
t.ID AS TorrentID,
|
||||
DATE_FORMAT($Month,'%Y - %m') AS Month,
|
||||
DATE_FORMAT($Month, '%Y - %m') AS Month,
|
||||
t.GroupID,
|
||||
t.Media,
|
||||
t.Format,
|
||||
t.Encoding,
|
||||
IF(t.RemasterYear=0,tg.Year,t.RemasterYear) AS Year,
|
||||
IF(t.RemasterYear = 0, tg.Year, t.RemasterYear) AS Year,
|
||||
tg.Name,
|
||||
t.Size
|
||||
FROM torrents AS t
|
||||
JOIN torrents_group AS tg ON t.GroupID=tg.ID
|
||||
JOIN torrents_group AS tg ON t.GroupID = tg.ID
|
||||
$SQL
|
||||
GROUP BY TorrentID");
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
$DB->query("
|
||||
SELECT InviterID
|
||||
FROM invites
|
||||
WHERE InviteKey='$InviteKey'");
|
||||
WHERE InviteKey = '$InviteKey'");
|
||||
list($UserID) = $DB->next_record();
|
||||
if (!$DB->has_results() || $UserID != $LoggedUser['ID']) {
|
||||
error(404);
|
||||
@ -27,11 +27,10 @@
|
||||
UPDATE users_main
|
||||
SET Invites = Invites + 1
|
||||
WHERE ID = '$UserID'");
|
||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||
$Cache->update_row(false, array('Invites'=>'+1'));
|
||||
$Cache->begin_transaction("user_info_heavy_$UserID");
|
||||
$Cache->update_row(false, array('Invites' => '+1'));
|
||||
$Cache->commit_transaction(0);
|
||||
}
|
||||
}
|
||||
header('Location: user.php?action=invite');
|
||||
|
||||
?>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?
|
||||
//TODO: Redo html
|
||||
//TODO: Redo HTML
|
||||
if (!check_perms('admin_manage_permissions')) {
|
||||
error(403);
|
||||
}
|
||||
@ -14,20 +14,20 @@
|
||||
$DB->query("
|
||||
SELECT CustomPermissions
|
||||
FROM users_main
|
||||
WHERE ID='$UserID'");
|
||||
WHERE ID = '$UserID'");
|
||||
|
||||
list($Customs)=$DB->next_record(MYSQLI_NUM, false);
|
||||
list($Customs) = $DB->next_record(MYSQLI_NUM, false);
|
||||
|
||||
|
||||
$Defaults = Permissions::get_permissions_for_user($UserID, array());
|
||||
|
||||
$Delta=array();
|
||||
$Delta = array();
|
||||
if (isset($_POST['action'])) {
|
||||
authorize();
|
||||
|
||||
foreach ($PermissionsArray as $Perm => $Explaination) {
|
||||
$Setting = (isset($_POST['perm_'.$Perm])) ? 1 : 0;
|
||||
$Default = (isset($Defaults[$Perm])) ? 1 : 0;
|
||||
$Setting = isset($_POST["perm_$Perm"]) ? 1 : 0;
|
||||
$Default = isset($Defaults[$Perm]) ? 1 : 0;
|
||||
if ($Setting != $Default) {
|
||||
$Delta[$Perm] = $Setting;
|
||||
}
|
||||
@ -48,7 +48,7 @@
|
||||
$Delta = unserialize($Customs);
|
||||
}
|
||||
|
||||
$Permissions = array_merge($Defaults,$Delta);
|
||||
$Permissions = array_merge($Defaults, $Delta);
|
||||
$MaxCollages = $Customs['MaxCollages'] + $Delta['MaxCollages'];
|
||||
|
||||
function display_perm($Key, $Title) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
$Permissions = Permissions::get_permissions($U['PermissionID']);
|
||||
if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Permissions['Class'])) {
|
||||
send_irc('PRIVMSG '.ADMIN_CHAN.' :User '.$LoggedUser['Username'].' (https://'.SSL_SITE_URL.'/user.php?id='.$LoggedUser['ID'].') just tried to edit the profile of https://'.SSL_SITE_URL.'/user.php?id='.$_REQUEST['userid']);
|
||||
send_irc('PRIVMSG '.ADMIN_CHAN.' :User '.$LoggedUser['Username'].' ('.site_url().'user.php?id='.$LoggedUser['ID'].') just tried to edit the profile of '.site_url().'user.php?id='.$_REQUEST['userid']);
|
||||
error(403);
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@
|
||||
|
||||
|
||||
}
|
||||
//End Email change
|
||||
//End email change
|
||||
|
||||
if (!$Err && ($_POST['cur_pass'] || $_POST['new_pass_1'] || $_POST['new_pass_2'])) {
|
||||
$DB->query("
|
||||
@ -314,7 +314,6 @@
|
||||
$Cache->commit_transaction(0);
|
||||
|
||||
|
||||
|
||||
$SQL = "
|
||||
UPDATE users_main AS m
|
||||
JOIN users_info AS i ON m.ID = i.UserID
|
||||
|
@ -37,7 +37,7 @@
|
||||
$Email = $_POST['email'];
|
||||
$Username = $LoggedUser['Username'];
|
||||
$SiteName = SITE_NAME;
|
||||
$SiteURL = SSL_SITE_URL;
|
||||
$SiteURL = site_url();
|
||||
$InviteExpires = time_plus(60 * 60 * 24 * 3); // 3 days
|
||||
|
||||
//MultiInvite
|
||||
|
Loading…
Reference in New Issue
Block a user