mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 02:46:30 +00:00
Empty commit
This commit is contained in:
parent
9c736fd946
commit
a14a9f0b59
@ -31,8 +31,9 @@ public static function get_thread_info($ThreadID, $Return = true, $SelectiveCach
|
||||
LEFT JOIN forums_polls AS p ON p.TopicID=t.ID
|
||||
WHERE t.ID = '$ThreadID'
|
||||
GROUP BY fp.TopicID");
|
||||
if (G::$DB->record_count() == 0) {
|
||||
error(404);
|
||||
if (!G::$DB->has_results()) {
|
||||
G::$DB->set_query_id($QueryID);
|
||||
return null;
|
||||
}
|
||||
$ThreadInfo = G::$DB->next_record(MYSQLI_ASSOC, false);
|
||||
if ($ThreadInfo['StickyPostID']) {
|
||||
@ -108,7 +109,7 @@ public static function get_forum_info($ForumID) {
|
||||
LEFT JOIN forums_topics ON forums_topics.ForumID=forums.ID
|
||||
WHERE forums.ID='$ForumID'
|
||||
GROUP BY ForumID");
|
||||
if (G::$DB->record_count() == 0) {
|
||||
if (!G::$DB->has_results()) {
|
||||
return false;
|
||||
}
|
||||
// Makes an array, with $Forum['Name'], etc.
|
||||
|
@ -1,5 +1,8 @@
|
||||
CHANGELOG
|
||||
|
||||
2013-10-01 by alderaan
|
||||
In the staff toolbox, reorganized tools into more useful categories
|
||||
|
||||
2013-09-30 by alderaan
|
||||
Refactored backend code for staff toolbox
|
||||
|
||||
|
@ -80,7 +80,7 @@
|
||||
$ForumName = display_str($Forums[$ForumID]['Name']);
|
||||
$JsonSpecificRules = array();
|
||||
foreach ($Forums[$ForumID]['SpecificRules'] as $ThreadIDs) {
|
||||
$Thread = get_thread_info($ThreadIDs);
|
||||
$Thread = Forums::get_thread_info($ThreadIDs);
|
||||
$JsonSpecificRules[] = array(
|
||||
'threadId' => (int) $ThreadIDs,
|
||||
'thread' => display_str($Thread['Title'])
|
||||
|
@ -6,62 +6,11 @@
|
||||
print json_encode(array('status' => 'failure'));
|
||||
die();
|
||||
} else {
|
||||
include(SERVER_ROOT.'/sections/forums/functions.php');
|
||||
// Replace the old hard-coded forum categories
|
||||
unset($ForumCats);
|
||||
$ForumCats = $Cache->get_value('forums_categories');
|
||||
if ($ForumCats === false) {
|
||||
$DB->query("
|
||||
SELECT ID, Name
|
||||
FROM forums_categories");
|
||||
$ForumCats = array();
|
||||
while (list($ID, $Name) = $DB->next_record()) {
|
||||
$ForumCats[$ID] = $Name;
|
||||
}
|
||||
$Cache->cache_value('forums_categories', $ForumCats, 0); //Inf cache.
|
||||
}
|
||||
$ForumCats = Forums::get_forum_categories();
|
||||
|
||||
//This variable contains all our lovely forum data
|
||||
if (!$Forums = $Cache->get_value('forums_list')) {
|
||||
$DB->query("
|
||||
SELECT
|
||||
f.ID,
|
||||
f.CategoryID,
|
||||
f.Name,
|
||||
f.Description,
|
||||
f.MinClassRead,
|
||||
f.MinClassWrite,
|
||||
f.MinClassCreate,
|
||||
f.NumTopics,
|
||||
f.NumPosts,
|
||||
f.LastPostID,
|
||||
f.LastPostAuthorID,
|
||||
f.LastPostTopicID,
|
||||
f.LastPostTime,
|
||||
COUNT(sr.ThreadID) AS SpecificRules,
|
||||
t.Title,
|
||||
t.IsLocked,
|
||||
t.IsSticky
|
||||
FROM forums AS f
|
||||
JOIN forums_categories AS fc ON fc.ID = f.CategoryID
|
||||
LEFT JOIN forums_topics as t ON t.ID = f.LastPostTopicID
|
||||
LEFT JOIN forums_specific_rules AS sr ON sr.ForumID = f.ID
|
||||
GROUP BY f.ID
|
||||
ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort");
|
||||
$Forums = $DB->to_array('ID', MYSQLI_ASSOC, false);
|
||||
foreach ($Forums as $ForumID => $Forum) {
|
||||
if (count($Forum['SpecificRules'])) {
|
||||
$DB->query("
|
||||
SELECT ThreadID
|
||||
FROM forums_specific_rules
|
||||
WHERE ForumID = $ForumID");
|
||||
$ThreadIDs = $DB->collect('ThreadID');
|
||||
$Forums[$ForumID]['SpecificRules'] = $ThreadIDs;
|
||||
}
|
||||
}
|
||||
unset($ForumID, $Forum);
|
||||
$Cache->cache_value('forums_list', $Forums, 0); //Inf cache.
|
||||
}
|
||||
$Forums = Forums::get_forums();
|
||||
|
||||
if (empty($_GET['type']) || $_GET['type'] == 'main') {
|
||||
include(SERVER_ROOT.'/sections/ajax/forum/main.php');
|
||||
@ -79,33 +28,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Function to get basic information on a forum
|
||||
// Uses class CACHE
|
||||
function get_forum_info($ForumID) {
|
||||
global $DB, $Cache;
|
||||
$Forum = $Cache->get_value("ForumInfo_$ForumID");
|
||||
if (!$Forum) {
|
||||
$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");
|
||||
if (!$DB->has_results()) {
|
||||
return false;
|
||||
}
|
||||
// Makes an array, with $Forum['Name'], etc.
|
||||
$Forum = $DB->next_record(MYSQLI_ASSOC);
|
||||
|
||||
$Cache->cache_value("ForumInfo_$ForumID", $Forum, 86400); // Cache for a day
|
||||
}
|
||||
return $Forum;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -51,14 +51,14 @@
|
||||
//---------- Get some data to start processing
|
||||
|
||||
// Thread information, constant across all pages
|
||||
$ThreadInfo = get_thread_info($ThreadID, true, true, true);
|
||||
if ($ThreadInfo == NULL) {
|
||||
$ThreadInfo = Forums::get_thread_info($ThreadID, true, true);
|
||||
if ($ThreadInfo === null) {
|
||||
json_die('failure', 'no such thread exists');
|
||||
}
|
||||
$ForumID = $ThreadInfo['ForumID'];
|
||||
|
||||
// Make sure they're allowed to look at the page
|
||||
if (!check_forumperm($ForumID)) {
|
||||
if (!Forums::check_forumperm($ForumID)) {
|
||||
print json_encode(array('status' => 'failure'));
|
||||
die();
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?
|
||||
|
||||
include(SERVER_ROOT . "/sections/forums/functions.php");
|
||||
|
||||
$PostID = (int)$_POST['postid'];
|
||||
|
||||
if (empty($PostID)) {
|
||||
@ -19,8 +17,7 @@
|
||||
}
|
||||
|
||||
list($ForumID, $Body) = $DB->next_record();
|
||||
$Forums = get_forums();
|
||||
if (!check_forumperm($ForumID)) {
|
||||
if (!Forums::check_forumperm($ForumID)) {
|
||||
json_die("error", "assholes");
|
||||
}
|
||||
|
||||
|
@ -136,6 +136,9 @@
|
||||
<strong>Forum Specific Rules</strong>
|
||||
<? foreach ($Forums[$ForumID]['SpecificRules'] as $ThreadIDs) {
|
||||
$Thread = Forums::get_thread_info($ThreadIDs);
|
||||
if ($Thread === null) {
|
||||
error(404);
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
<a href="forums.php?action=viewthread&threadid=<?=$ThreadIDs?>" class="brackets"><?=display_str($Thread['Title'])?></a>
|
||||
|
@ -1,141 +0,0 @@
|
||||
<?
|
||||
function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false, $ApiCall = false) {
|
||||
global $DB, $Cache;
|
||||
if ((!$ThreadInfo = $Cache->get_value('thread_'.$ThreadID.'_info')) || !isset($ThreadInfo['OP'])) {
|
||||
$DB->query("
|
||||
SELECT
|
||||
t.Title,
|
||||
t.ForumID,
|
||||
t.IsLocked,
|
||||
t.IsSticky,
|
||||
COUNT(fp.id) AS Posts,
|
||||
t.LastPostAuthorID,
|
||||
ISNULL(p.TopicID) AS NoPoll,
|
||||
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");
|
||||
if (!$DB->has_results()) {
|
||||
if (!$ApiCall) {
|
||||
error(404);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
$ThreadInfo = $DB->next_record(MYSQLI_ASSOC, false);
|
||||
if ($ThreadInfo['StickyPostID']) {
|
||||
$ThreadInfo['Posts']--;
|
||||
$DB->query("
|
||||
SELECT
|
||||
p.ID,
|
||||
p.AuthorID,
|
||||
p.AddedTime,
|
||||
p.Body,
|
||||
p.EditedUserID,
|
||||
p.EditedTime,
|
||||
ed.Username
|
||||
FROM forums_posts as p
|
||||
LEFT JOIN users_main AS ed ON ed.ID = p.EditedUserID
|
||||
WHERE p.TopicID = '$ThreadID'
|
||||
AND p.ID = '".$ThreadInfo['StickyPostID']."'");
|
||||
list($ThreadInfo['StickyPost']) = $DB->to_array(false, MYSQLI_ASSOC);
|
||||
}
|
||||
if (!$SelectiveCache || !$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) {
|
||||
$Cache->cache_value('thread_'.$ThreadID.'_info', $ThreadInfo, 0);
|
||||
}
|
||||
}
|
||||
if ($Return) {
|
||||
return $ThreadInfo;
|
||||
}
|
||||
}
|
||||
|
||||
function check_forumperm($ForumID, $Perm = 'Read') {
|
||||
global $LoggedUser, $Forums;
|
||||
if ($LoggedUser['CustomForums'][$ForumID] == 1) {
|
||||
return true;
|
||||
}
|
||||
if ($Forums[$ForumID]['MinClass'.$Perm] > $LoggedUser['Class'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) {
|
||||
return false;
|
||||
}
|
||||
if (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Function to get basic information on a forum
|
||||
// Uses class CACHE
|
||||
function get_forum_info($ForumID) {
|
||||
global $DB, $Cache;
|
||||
$Forum = $Cache->get_value('ForumInfo_'.$ForumID);
|
||||
if (!$Forum) {
|
||||
$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");
|
||||
if (!$DB->has_results()) {
|
||||
return false;
|
||||
}
|
||||
// Makes an array, with $Forum['Name'], etc.
|
||||
$Forum = $DB->next_record(MYSQLI_ASSOC);
|
||||
|
||||
$Cache->cache_value('ForumInfo_'.$ForumID, $Forum, 86400); // Cache for a day
|
||||
}
|
||||
return $Forum;
|
||||
}
|
||||
|
||||
function get_forums() {
|
||||
global $DB, $Cache;
|
||||
if (!$Forums = $Cache->get_value('forums_list')) {
|
||||
$DB->query('
|
||||
SELECT
|
||||
f.ID,
|
||||
f.CategoryID,
|
||||
f.Name,
|
||||
f.Description,
|
||||
f.MinClassRead,
|
||||
f.MinClassWrite,
|
||||
f.MinClassCreate,
|
||||
f.NumTopics,
|
||||
f.NumPosts,
|
||||
f.LastPostID,
|
||||
f.LastPostAuthorID,
|
||||
f.LastPostTopicID,
|
||||
f.LastPostTime,
|
||||
COUNT(sr.ThreadID) AS SpecificRules,
|
||||
t.Title,
|
||||
t.IsLocked,
|
||||
t.IsSticky
|
||||
FROM forums AS f
|
||||
JOIN forums_categories AS fc ON fc.ID = f.CategoryID
|
||||
LEFT JOIN forums_topics as t ON t.ID = f.LastPostTopicID
|
||||
LEFT JOIN forums_specific_rules AS sr ON sr.ForumID = f.ID
|
||||
GROUP BY f.ID
|
||||
ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort');
|
||||
$Forums = $DB->to_array('ID', MYSQLI_ASSOC, false);
|
||||
foreach ($Forums as $ForumID => $Forum) {
|
||||
if (count($Forum['SpecificRules'])) {
|
||||
$DB->query("
|
||||
SELECT ThreadID
|
||||
FROM forums_specific_rules
|
||||
WHERE ForumID = $ForumID");
|
||||
$ThreadIDs = $DB->collect('ThreadID');
|
||||
$Forums[$ForumID]['SpecificRules'] = $ThreadIDs;
|
||||
}
|
||||
}
|
||||
unset($ForumID, $Forum);
|
||||
$Cache->cache_value('forums_list', $Forums, 0); //Inf cache.
|
||||
}
|
||||
return $Forums;
|
||||
}
|
@ -48,6 +48,9 @@
|
||||
|
||||
$TopicID = $_POST['thread'];
|
||||
$ThreadInfo = Forums::get_thread_info($TopicID);
|
||||
if ($ThreadInfo === null) {
|
||||
error(404);
|
||||
}
|
||||
$ForumID = $ThreadInfo['ForumID'];
|
||||
$SQLTime = sqltime();
|
||||
|
||||
|
@ -88,6 +88,9 @@
|
||||
$Cache->commit_transaction(3600 * 24 * 5);
|
||||
}
|
||||
$ThreadInfo = Forums::get_thread_info($TopicID);
|
||||
if ($ThreadInfo === null) {
|
||||
error(404);
|
||||
}
|
||||
if ($ThreadInfo['StickyPostID'] == $PostID) {
|
||||
$ThreadInfo['StickyPost']['Body'] = $Body;
|
||||
$ThreadInfo['StickyPost']['EditedUserID'] = $LoggedUser['ID'];
|
||||
|
@ -104,6 +104,9 @@
|
||||
$Cache->commit_transaction(3600 * 24 * 5);
|
||||
}
|
||||
$ThreadInfo = Forums::get_thread_info($TopicID);
|
||||
if ($ThreadInfo === null) {
|
||||
error(404);
|
||||
}
|
||||
if ($ThreadInfo['StickyPostID'] == $PostID) {
|
||||
$ThreadInfo['StickyPost']['Body'] = $Body;
|
||||
$ThreadInfo['StickyPost']['EditedUserID'] = $LoggedUser['ID'];
|
||||
|
@ -49,6 +49,9 @@
|
||||
|
||||
// Thread information, constant across all pages
|
||||
$ThreadInfo = Forums::get_thread_info($ThreadID, true, true);
|
||||
if ($ThreadInfo === null) {
|
||||
error(404);
|
||||
}
|
||||
$ForumID = $ThreadInfo['ForumID'];
|
||||
|
||||
$IsDonorForum = $ForumID == DONOR_FORUM ? true : false;
|
||||
|
@ -303,8 +303,6 @@ function log_attempt($UserID) {
|
||||
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$DB->query("
|
||||
INSERT INTO users_sessions
|
||||
(UserID, SessionID, KeepLogged, Browser, OperatingSystem, IP, LastUpdate, FullUA)
|
||||
|
@ -80,6 +80,7 @@
|
||||
$UserIDs[] = $UserID;
|
||||
}
|
||||
NotificationsManager::notify_users($UserIDs, NotificationsManager::REQUESTALERTS, Format::get_size($Amount) . " of bounty has been added to a request you've voted on!", "requests.php?action=view&id=" . $RequestID);
|
||||
|
||||
} elseif ($LoggedUser['BytesUploaded'] < $Amount) {
|
||||
echo 'bankrupt';
|
||||
}
|
||||
|
@ -101,27 +101,27 @@
|
||||
bracket. The maximum and minimum required ratios are also referred to as the <strong>0% seeded</strong> and <strong>100% seeded</strong> required ratios, respectively.
|
||||
</li>
|
||||
<li><strong>2: Determine the actual required ratio.</strong> Your actual required ratio will be a number that falls between the maximum and minimum required ratio values determined in the
|
||||
previous step. To determine your actual required ratio, the system first uses the maximum required ratio (0% seeded) and multiplies it by the value [1 − (seeding / snatched)]. Formatted
|
||||
previous step. To determine your actual required ratio, the system first uses the maximum required ratio (0% seeded) and multiplies it by the value [1 − (<var>seeding</var> / <var>snatched</var>)]. Formatted
|
||||
differently, the calculation performed by the system looks like this:
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div style="text-align: center;"><img style="vertical-align: middle;" src="static/blank.gif"
|
||||
<div style="text-align: center;">
|
||||
<img style="vertical-align: middle;" src="static/blank.gif"
|
||||
onload="if (this.src.substr(this.src.length - 9, this.src.length) == 'blank.gif') { this.src = 'https://chart.googleapis.com/chart?cht=tx&chf=bg,s,FFFFFF00&chl=%5Ctextrm%7B%28maximum+required+ratio%29+%2A+%281-%5Cfrac%7Bseeding%7D%7Bsnatched%7D%29%7D&chco=' + hexify(getComputedStyle(this.parentNode, null).color); }" />
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<ul>
|
||||
<li>In this formula, <strong>snatched</strong> is the number of non-deleted unique snatches you have made. If you snatch a torrent twice, it only counts once. If a snatched torrent is
|
||||
<li>In this formula, <var>snatched</var> is the number of non-deleted unique snatches you have made. If you snatch a torrent twice, it only counts once. If a snatched torrent is
|
||||
deleted from the site, it is not counted at all.
|
||||
</li>
|
||||
<li>In this formula, <strong>seeding</strong> is the average number of torrents you've seeded over a 72 hour period within the last week. If you've seeded a torrent for less than
|
||||
<li>In this formula, <var>seeding</var> is the average number of torrents you've seeded over a 72 hour period within the last week. If you've seeded a torrent for less than
|
||||
72 hours within the last week, it will not raise your seeding total. Please note that while it is possible to seed more torrents than you have snatched, the system effectively caps the
|
||||
value at 100% of your snatched amount.
|
||||
</li>
|
||||
<li><strong>3: Round if necessary.</strong> The value determined in the previous step is rounded up to your minimum required ratio (100% seeded) if necessary. This step is required because
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>3: Round, if necessary.</strong> The value determined in the previous step is rounded up to your minimum required ratio (100% seeded) if necessary. This step is required because
|
||||
most amount downloaded brackets have a minimum required ratio (100% seeded) greater than zero, and the value returned by the above calculation is zero when seeding equals snatched.
|
||||
</li>
|
||||
</ul>
|
||||
@ -147,7 +147,7 @@
|
||||
<li>In this example, Rippy has downloaded 25 GB. Rippy falls into the 20–30 GB amount downloaded bracket in the table above. Rippy's maximum required ratio (0% seeded) is 0.30, and his minimum required ratio (100% seeded) is 0.05.
|
||||
</li>
|
||||
<li>In this example, Rippy has snatched 90 torrents, and is currently seeding 45 torrents.</li>
|
||||
<li>To calculate Rippy's actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 − (seeding / snatched)] (which is 0.50). Written out:
|
||||
<li>To calculate Rippy's actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 − (<var>seeding</var> / <var>snatched</var>)] (which is 0.50). Written out:
|
||||
<samp>0.3 * [1 − (45 / 90)] = 0.15</samp>
|
||||
</li>
|
||||
<li>The resulting required ratio is 0.15, which falls between the maximum required ratio of 0.30 and the minimum required ratio of 0.05 for his amount downloaded bracket.</li>
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?
|
||||
|
||||
include(SERVER_ROOT.'/sections/staffpm/functions.php');
|
||||
|
||||
View::show_header('Staff PMs', 'staffpm');
|
||||
|
||||
// Get messages
|
||||
|
@ -2,8 +2,8 @@
|
||||
if (!check_perms('admin_donor_log')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
View::show_header('Bitcoin donation balance');
|
||||
$Title = "Bitcoin Donation Balance";
|
||||
View::show_header($Title);
|
||||
|
||||
$Balance = DonationsBitcoin::get_balance() . ' BTC';
|
||||
$BitcoinAddresses = DonationsBitcoin::get_received();
|
||||
@ -16,6 +16,9 @@
|
||||
WHERE BitcoinAddress != ''
|
||||
ORDER BY m.Username ASC");
|
||||
?>
|
||||
<div class="header">
|
||||
<h2><?=$Title?></h2>
|
||||
</div>
|
||||
<div class="thin">
|
||||
<div class="header">
|
||||
<h3><?=$Balance?></h3>
|
||||
@ -23,7 +26,7 @@
|
||||
<table>
|
||||
<tr class="colhead">
|
||||
<th>Username</th>
|
||||
<th>Receiving Bitcoin address</th>
|
||||
<th>Receiving Bitcoin Address</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
<?
|
||||
|
@ -2,7 +2,8 @@
|
||||
if (!check_perms('users_mod')) {
|
||||
error(403);
|
||||
}
|
||||
View::show_header('Unprocessed Bitcoin donations');
|
||||
$Title = "Unprocessed Bitcoin Donations";
|
||||
View::show_header($Title);
|
||||
|
||||
// Find all donors
|
||||
$AllDonations = DonationsBitcoin::get_received();
|
||||
@ -13,12 +14,12 @@
|
||||
GROUP BY BitcoinAddress");
|
||||
$OldDonations = G::$DB->to_pair(0, 1, false);
|
||||
?>
|
||||
<div id="thin">
|
||||
<div class="thin">
|
||||
<div class="header">
|
||||
<h2>Unprocessed Bitcoin donations</h2>
|
||||
<h2><?=$Title?></h2>
|
||||
</div>
|
||||
<div class="box2">
|
||||
<div class="pad">Do not process these donations manually! The bitcoin parser <em>will</em> get them sooner or later (poke a developer if something seems broken).</div>
|
||||
<div class="pad"><strong>Do not process these donations manually!</strong> The Bitcoin parser <em>will</em> get them sooner or later (poke a developer if something seems broken).</div>
|
||||
</div>
|
||||
<?
|
||||
$NewDonations = array();
|
||||
@ -39,12 +40,12 @@
|
||||
?>
|
||||
<table class="border" width="100%">
|
||||
<tr class="colhead">
|
||||
<td>Bitcoin address</td>
|
||||
<td>Bitcoin Address</td>
|
||||
<td>User</td>
|
||||
<td>Unprocessed amount (<?=$TotalUnproc ?: '0'?>)</td>
|
||||
<td>Total amount</td>
|
||||
<td>Donor rank</td>
|
||||
<td>Special rank</td>
|
||||
<td>Unprocessed Amount (Total: <?=$TotalUnproc ?: '0'?>)</td>
|
||||
<td>Total Amount</td>
|
||||
<td>Donor Rank</td>
|
||||
<td>Special Rank</td>
|
||||
</tr>
|
||||
<?
|
||||
if (!empty($NewDonations)) {
|
||||
|
@ -1,147 +0,0 @@
|
||||
<?
|
||||
//TODO: Accelerator cache keys, removed scripts (stats here and a class to manage them (we'd probably never use it, but I like completeness))
|
||||
//INFO: http://bart.eaccelerator.net/doc/phpdoc/
|
||||
//INFO: http://bakery.cakephp.org/articles/view/eaccelerator-cache-engine - pertains to potential todo for eAccelerator cache class
|
||||
if (!check_perms('site_debug')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
if (!extension_loaded('eAccelerator')) {
|
||||
error('eAccelerator Extension not loaded.');
|
||||
}
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
if ($_POST['cache'] == 1) {
|
||||
authorize();
|
||||
|
||||
eaccelerator_caching(true);
|
||||
} else {
|
||||
eaccelerator_caching(false);
|
||||
}
|
||||
if (function_exists('eaccelerator_optimizer')) {
|
||||
if ($_POST['optimize'] == 1) {
|
||||
|
||||
authorize();
|
||||
|
||||
eaccelerator_optimizer(true);
|
||||
} else {
|
||||
eaccelerator_optimizer(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['clear'])) {
|
||||
authorize();
|
||||
eaccelerator_clear();
|
||||
}
|
||||
|
||||
if (isset($_POST['clean'])) {
|
||||
authorize();
|
||||
eaccelerator_clean();
|
||||
}
|
||||
|
||||
if (isset($_POST['purge'])) {
|
||||
authorize();
|
||||
eaccelerator_purge();
|
||||
}
|
||||
}
|
||||
$Opcode = eaccelerator_info();
|
||||
$CachedScripts = eaccelerator_cached_scripts();
|
||||
//$RemovedScripts = eaccelerator_removed_scripts();
|
||||
|
||||
|
||||
|
||||
View::show_header("Opcode Stats");
|
||||
?>
|
||||
<div class="thin">
|
||||
<div>
|
||||
<form class="manage_form" name="opcode_stats" action="" method="post">
|
||||
<div>
|
||||
<input type="hidden" name="action" value="opcode_stats" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
</div>
|
||||
<table cellpadding="6" cellspacing="1" border="0" class="layout border" width="100%">
|
||||
<tr>
|
||||
<td><strong>Enable:</strong></td>
|
||||
<td>
|
||||
<input type="checkbox" name="cache" value="1" id="cache"<?=($Opcode['cache']) ? ' checked="checked"' : '' ?> />
|
||||
<label for="cache">Cache</label>
|
||||
<? if (function_exists('eaccelerator_optimizer')) { ?>
|
||||
<input type="checkbox" name="optimize" value="1" id="optimize"<?=($Opcode['optimizer']) ? ' checked="checked"' : '' ?> />
|
||||
<label for="optimize">Optimize</label>
|
||||
<? } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Controls:</strong></td>
|
||||
<td>
|
||||
<input type="checkbox" name="clear" value="clear" id="clear" />
|
||||
<label for="clear">Clear</label>
|
||||
<input type="checkbox" name="clean" value="clean" id="clean" />
|
||||
<label for="clean">Clean</label>
|
||||
<input type="checkbox" name="purge" value="purge" id="purge" />
|
||||
<label for="purge">Purge</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="center">
|
||||
<input type="submit" name="submit" value="Update" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<br /><br />
|
||||
<table>
|
||||
<tr class="colhead">
|
||||
<td colspan="6">Status</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Storage:</td>
|
||||
<td><?=Format::get_size($Opcode['memorySize'])?></td>
|
||||
<td>Used Storage:</td>
|
||||
<td><?=Format::get_size($Opcode['memoryAllocated'])?> (<?=number_format(($Opcode['memoryAllocated'] / $Opcode['memorySize']) * 100, 3);?>%)</td>
|
||||
<td>Free Storage:</td>
|
||||
<td><?=Format::get_size($Opcode['memoryAvailable'])?> (<?=number_format(($Opcode['memoryAvailable'] / $Opcode['memorySize']) * 100, 3);?>%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cached Scripts:</td>
|
||||
<td><?=number_format($Opcode['cachedScripts'])?></td>
|
||||
<td>Removed Scripts:</td>
|
||||
<td><?=number_format($Opcode['removedScripts'])?></td>
|
||||
<td>Cached Keys:</td>
|
||||
<? if (function_exists('eaccelerator_get')) { ?>
|
||||
<td><?=number_format($Opcode['cachedKeys'])?></td>
|
||||
<? } else { ?>
|
||||
<td>N/A</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
</table>
|
||||
<br /><br />
|
||||
<table cellpadding="6" cellspacing="1" border="0" class="border" width="100%">
|
||||
<tr class="colhead">
|
||||
<td>File Path</td>
|
||||
<td>Age</td>
|
||||
<td>Size</td>
|
||||
<td>Hits</td>
|
||||
</tr>
|
||||
<?
|
||||
if (count($CachedScripts) === 0) { // Uh-oh, try again.
|
||||
echo '<tr><td colspan="5">No scripts cached.</td></tr>';
|
||||
}
|
||||
$Row = 'a'; // For the pretty colours
|
||||
foreach ($CachedScripts as $Script) {
|
||||
list($FilePath, $Modified, $Size, $Reloads, $Uses, $Hits) = array_values($Script);
|
||||
$Row = $Row === 'a' ? 'b' : 'a';
|
||||
?>
|
||||
<tr class="row<?=$Row?>">
|
||||
<td><?=$FilePath?></td>
|
||||
<td><?=time_diff($Modified)?></td>
|
||||
<td><?=Format::get_size($Size)?></td>
|
||||
<td><?=number_format($Hits)?></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<? View::show_footer(); ?>
|
@ -36,11 +36,15 @@
|
||||
AND BanReason = '2'");
|
||||
list($TotalDisabled) = $DB->next_record();
|
||||
$DB->set_query_id($RS);
|
||||
|
||||
?>
|
||||
<div class="header">
|
||||
<h2>Upscale Pool</h2>
|
||||
</div>
|
||||
<?
|
||||
if ($DB->has_results()) {
|
||||
?>
|
||||
<div class="box pad">
|
||||
<p>There are currently <?=number_format($Results)?> users queued by the system and <?=number_format($TotalDisabled)?> already disabled.</p>
|
||||
<div class="box pad thin">
|
||||
<p>There are currently <?=number_format($Results)?> enabled users on Ratio Watch and <?=number_format($TotalDisabled)?> already disabled.</p>
|
||||
</div>
|
||||
<div class="linkbox">
|
||||
<?
|
||||
@ -51,14 +55,14 @@
|
||||
<table width="100%">
|
||||
<tr class="colhead">
|
||||
<td>User</td>
|
||||
<td>Up</td>
|
||||
<td>Down</td>
|
||||
<td>Ratio</td>
|
||||
<td>Required Ratio</td>
|
||||
<td>Deficit</td>
|
||||
<td>Gamble</td>
|
||||
<td>Registered</td>
|
||||
<td>Remaining</td>
|
||||
<td class="number_column">Uploaded</td>
|
||||
<td class="number_column">Downloaded</td>
|
||||
<td class="number_column">Ratio</td>
|
||||
<td class="number_column">Required Ratio</td>
|
||||
<td class="number_column tooltip" title="How much the user needs to upload to meet his or her required ratio">Deficit</td>
|
||||
<td class="number_column tooltip" title="How much the user has downloaded on Ratio Watch">Gamble</td>
|
||||
<td>Registration Date</td>
|
||||
<td class="tooltip" title="If the time shown here ends in "ago", then this is how long the user has been on ratio watch and/or below his or her required ratio. If the time shown here does not end in "ago", then this is the time until the two week Ratio Watch period expires.">Ratio Watch Ended/Ends</td>
|
||||
<td>Lifespan</td>
|
||||
</tr>
|
||||
<?
|
||||
@ -68,12 +72,12 @@
|
||||
?>
|
||||
<tr class="row<?=$Row?>">
|
||||
<td><?=Users::format_username($UserID, true, true, true, true)?></td>
|
||||
<td><?=Format::get_size($Uploaded)?></td>
|
||||
<td><?=Format::get_size($Downloaded)?></td>
|
||||
<td><?=Format::get_ratio_html($Uploaded, $Downloaded)?></td>
|
||||
<td><?=number_format($RequiredRatio, 2)?></td>
|
||||
<td><? if (($Downloaded * $RequiredRatio) > $Uploaded) { echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);} ?></td>
|
||||
<td><?=Format::get_size($Downloaded - $RatioWatchDownload)?></td>
|
||||
<td class="number_column"><?=Format::get_size($Uploaded)?></td>
|
||||
<td class="number_column"><?=Format::get_size($Downloaded)?></td>
|
||||
<td class="number_column"><?=Format::get_ratio_html($Uploaded, $Downloaded)?></td>
|
||||
<td class="number_column"><?=number_format($RequiredRatio, 2)?></td>
|
||||
<td class="number_column"><? if (($Downloaded * $RequiredRatio) > $Uploaded) { echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);} ?></td>
|
||||
<td class="number_column"><?=Format::get_size($Downloaded - $RatioWatchDownload)?></td>
|
||||
<td><?=time_diff($Joined, 2)?></td>
|
||||
<td><?=time_diff($RatioWatchEnds)?></td>
|
||||
<td><?//time_diff(strtotime($Joined), strtotime($RatioWatchEnds))?></td>
|
||||
|
@ -10,11 +10,6 @@
|
||||
*****************************************************************/
|
||||
|
||||
if (isset($argv[1])) {
|
||||
if ($argv[1] == 'cli_sandbox') {
|
||||
include('misc/cli_sandbox.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$_REQUEST['action'] = $argv[1];
|
||||
} else {
|
||||
if (empty($_REQUEST['action']) || ($_REQUEST['action'] != 'public_sandbox' && $_REQUEST['action'] != 'ocelot')) {
|
||||
@ -45,7 +40,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
include(SERVER_ROOT."/classes/validate.class.php");
|
||||
include(SERVER_ROOT.'/classes/validate.class.php');
|
||||
$Val = new VALIDATE;
|
||||
|
||||
include(SERVER_ROOT.'/classes/feed.class.php');
|
||||
@ -60,71 +55,71 @@
|
||||
break;
|
||||
//Services
|
||||
case 'get_host':
|
||||
include('services/get_host.php');
|
||||
include(SERVER_ROOT.'/sections/tools/services/get_host.php');
|
||||
break;
|
||||
case 'get_cc':
|
||||
include('services/get_cc.php');
|
||||
include(SERVER_ROOT.'/sections/tools/services/get_cc.php');
|
||||
break;
|
||||
//Managers
|
||||
case 'forum':
|
||||
include('managers/forum_list.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/forum_list.php');
|
||||
break;
|
||||
|
||||
case 'forum_alter':
|
||||
include('managers/forum_alter.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/forum_alter.php');
|
||||
break;
|
||||
|
||||
case 'whitelist':
|
||||
include('managers/whitelist_list.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/whitelist_list.php');
|
||||
break;
|
||||
|
||||
case 'whitelist_alter':
|
||||
include('managers/whitelist_alter.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/whitelist_alter.php');
|
||||
break;
|
||||
|
||||
case 'login_watch':
|
||||
include('managers/login_watch.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/login_watch.php');
|
||||
break;
|
||||
|
||||
case 'recommend':
|
||||
include('managers/recommend_list.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/recommend_list.php');
|
||||
break;
|
||||
|
||||
case 'recommend_add':
|
||||
include('managers/recommend_add.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/recommend_add.php');
|
||||
break;
|
||||
|
||||
case 'recommend_alter':
|
||||
include('managers/recommend_alter.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/recommend_alter.php');
|
||||
break;
|
||||
|
||||
case 'recommend_restore':
|
||||
include('managers/recommend_restore.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/recommend_restore.php');
|
||||
break;
|
||||
|
||||
case 'email_blacklist':
|
||||
include('managers/email_blacklist.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/email_blacklist.php');
|
||||
break;
|
||||
|
||||
case 'email_blacklist_alter':
|
||||
include('managers/email_blacklist_alter.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/email_blacklist_alter.php');
|
||||
break;
|
||||
|
||||
case 'email_blacklist_search':
|
||||
include('managers/email_blacklist_search.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/email_blacklist_search.php');
|
||||
break;
|
||||
|
||||
case 'dnu':
|
||||
include('managers/dnu_list.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/dnu_list.php');
|
||||
break;
|
||||
|
||||
case 'dnu_alter':
|
||||
include('managers/dnu_alter.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/dnu_alter.php');
|
||||
break;
|
||||
|
||||
case 'editnews':
|
||||
case 'news':
|
||||
include('managers/news.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/news.php');
|
||||
break;
|
||||
|
||||
case 'takeeditnews':
|
||||
@ -183,29 +178,29 @@
|
||||
break;
|
||||
|
||||
case 'tokens':
|
||||
include('managers/tokens.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/tokens.php');
|
||||
break;
|
||||
case 'ocelot':
|
||||
include('managers/ocelot.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/ocelot.php');
|
||||
break;
|
||||
case 'official_tags':
|
||||
include('managers/official_tags.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/official_tags.php');
|
||||
break;
|
||||
|
||||
case 'tag_aliases':
|
||||
include('managers/tag_aliases.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/tag_aliases.php');
|
||||
break;
|
||||
case 'label_aliases':
|
||||
include('managers/label_aliases.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/label_aliases.php');
|
||||
break;
|
||||
case 'change_log':
|
||||
include('managers/change_log.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/change_log.php');
|
||||
break;
|
||||
case 'global_notification':
|
||||
include('managers/global_notification.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/global_notification.php');
|
||||
break;
|
||||
case 'take_global_notification':
|
||||
include('managers/take_global_notification.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/take_global_notification.php');
|
||||
break;
|
||||
case 'permissions':
|
||||
if (!check_perms('admin_manage_permissions')) {
|
||||
@ -299,7 +294,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
include('managers/permissions_alter.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/permissions_alter.php');
|
||||
|
||||
} else {
|
||||
if (!empty($_REQUEST['removeid'])) {
|
||||
@ -333,176 +328,172 @@
|
||||
$Cache->delete_value('classes');
|
||||
}
|
||||
|
||||
include('managers/permissions_list.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/permissions_list.php');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'ip_ban':
|
||||
//TODO: Clean up DB table ip_bans.
|
||||
include("managers/bans.php");
|
||||
include(SERVER_ROOT.'/sections/tools/managers/bans.php');
|
||||
break;
|
||||
case 'quick_ban':
|
||||
include("misc/quick_ban.php");
|
||||
include(SERVER_ROOT.'/sections/tools/misc/quick_ban.php');
|
||||
break;
|
||||
//Data
|
||||
case 'registration_log':
|
||||
include('data/registration_log.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/registration_log.php');
|
||||
break;
|
||||
|
||||
case 'donation_log':
|
||||
include('data/donation_log.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/donation_log.php');
|
||||
break;
|
||||
|
||||
case 'bitcoin_unproc':
|
||||
include('data/bitcoin_unproc.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/bitcoin_unproc.php');
|
||||
break;
|
||||
|
||||
case 'bitcoin_balance':
|
||||
include('data/bitcoin_balance.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/bitcoin_balance.php');
|
||||
break;
|
||||
|
||||
case 'donor_rewards':
|
||||
include('data/donor_rewards.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/donor_rewards.php');
|
||||
break;
|
||||
case 'upscale_pool':
|
||||
include('data/upscale_pool.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/upscale_pool.php');
|
||||
break;
|
||||
|
||||
case 'invite_pool':
|
||||
include('data/invite_pool.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/invite_pool.php');
|
||||
break;
|
||||
|
||||
case 'torrent_stats':
|
||||
include('data/torrent_stats.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/torrent_stats.php');
|
||||
break;
|
||||
|
||||
case 'user_flow':
|
||||
include('data/user_flow.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/user_flow.php');
|
||||
break;
|
||||
|
||||
case 'economic_stats':
|
||||
include('data/economic_stats.php');
|
||||
break;
|
||||
|
||||
case 'opcode_stats':
|
||||
include('data/opcode_stats.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/economic_stats.php');
|
||||
break;
|
||||
|
||||
case 'service_stats':
|
||||
include('data/service_stats.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/service_stats.php');
|
||||
break;
|
||||
|
||||
case 'database_specifics':
|
||||
include('data/database_specifics.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/database_specifics.php');
|
||||
break;
|
||||
|
||||
case 'special_users':
|
||||
include('data/special_users.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/special_users.php');
|
||||
break;
|
||||
|
||||
case 'browser_support':
|
||||
include('data/browser_support.php');
|
||||
include(SERVER_ROOT.'/sections/tools/data/browser_support.php');
|
||||
break;
|
||||
//END Data
|
||||
|
||||
//Misc
|
||||
case 'update_geoip':
|
||||
include('misc/update_geoip.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/update_geoip.php');
|
||||
break;
|
||||
|
||||
case 'dupe_ips':
|
||||
include('misc/dupe_ip.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/dupe_ip.php');
|
||||
break;
|
||||
|
||||
case 'clear_cache':
|
||||
include('misc/clear_cache.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/clear_cache.php');
|
||||
break;
|
||||
|
||||
case 'create_user':
|
||||
include('misc/create_user.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/create_user.php');
|
||||
break;
|
||||
|
||||
case 'manipulate_tree':
|
||||
include('misc/manipulate_tree.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/manipulate_tree.php');
|
||||
break;
|
||||
|
||||
case 'recommendations':
|
||||
include('misc/recommendations.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/recommendations.php');
|
||||
break;
|
||||
|
||||
case 'analysis':
|
||||
include('misc/analysis.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/analysis.php');
|
||||
break;
|
||||
|
||||
case 'process_info':
|
||||
include('misc/process_info.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/process_info.php');
|
||||
break;
|
||||
|
||||
case 'rerender_gallery':
|
||||
include('misc/rerender_gallery.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/rerender_gallery.php');
|
||||
break;
|
||||
|
||||
case 'sandbox1':
|
||||
include('misc/sandbox1.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox1.php');
|
||||
break;
|
||||
|
||||
case 'sandbox2':
|
||||
include('misc/sandbox2.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox2.php');
|
||||
break;
|
||||
|
||||
case 'sandbox3':
|
||||
include('misc/sandbox3.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox3.php');
|
||||
break;
|
||||
|
||||
case 'sandbox4':
|
||||
include('misc/sandbox4.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox4.php');
|
||||
break;
|
||||
|
||||
case 'sandbox5':
|
||||
include('misc/sandbox5.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox5.php');
|
||||
break;
|
||||
|
||||
case 'sandbox6':
|
||||
include('misc/sandbox6.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox6.php');
|
||||
break;
|
||||
|
||||
case 'sandbox7':
|
||||
include('misc/sandbox7.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox7.php');
|
||||
break;
|
||||
|
||||
case 'sandbox8':
|
||||
include('misc/sandbox8.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/sandbox8.php');
|
||||
break;
|
||||
|
||||
case 'public_sandbox':
|
||||
include('misc/public_sandbox.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/public_sandbox.php');
|
||||
break;
|
||||
|
||||
case 'mod_sandbox':
|
||||
if (check_perms('users_mod')) {
|
||||
include('misc/mod_sandbox.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/mod_sandbox.php');
|
||||
} else {
|
||||
error(403);
|
||||
}
|
||||
break;
|
||||
case 'bbcode_sandbox':
|
||||
include('misc/bbcode_sandbox.php');
|
||||
include(SERVER_ROOT.'/sections/tools/misc/bbcode_sandbox.php');
|
||||
break;
|
||||
case 'calendar':
|
||||
include('managers/calendar.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/calendar.php');
|
||||
break;
|
||||
case 'get_calendar_event':
|
||||
include('managers/ajax_get_calendar_event.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/ajax_get_calendar_event.php');
|
||||
break;
|
||||
case 'take_calendar_event':
|
||||
include('managers/ajax_take_calendar_event.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/ajax_take_calendar_event.php');
|
||||
break;
|
||||
case 'mass_pm':
|
||||
include('managers/mass_pm.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/mass_pm.php');
|
||||
break;
|
||||
case 'take_mass_pm':
|
||||
include('managers/take_mass_pm.php');
|
||||
include(SERVER_ROOT.'/sections/tools/managers/take_mass_pm.php');
|
||||
break;
|
||||
default:
|
||||
include(SERVER_ROOT.'/sections/tools/tools.php');
|
||||
|
@ -1,10 +1,23 @@
|
||||
<?
|
||||
/***********************************************
|
||||
* This file displays the list of available tools in the staff toolbox.
|
||||
*
|
||||
* Because there are various subcontainers and various permissions, it
|
||||
* is possible to have empty subcontainers. The $ToolsHTML variable is
|
||||
* used to display only non-empty subcontainers.
|
||||
*
|
||||
***********************************************
|
||||
*/
|
||||
|
||||
if (!check_perms('users_mod')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for rendering a single table row in the staff toolbox
|
||||
* Used for rendering a single table row in the staff toolbox. The
|
||||
* $ToolsHTML variable is incrementally expanded with each function call
|
||||
* in a given subcontainer and gets reset at the beginning of each new
|
||||
* subcontainer.
|
||||
*
|
||||
* @param string $Title - the displayed name of the tool
|
||||
* @param string $URL - the relative URL of the tool
|
||||
@ -13,10 +26,10 @@
|
||||
*
|
||||
*/
|
||||
function create_row($Title, $URL, $HasPermission = false, $Tooltip = false) {
|
||||
$TooltipHTML = $Tooltip !== false ? " class=\"tooltip\" title=\"$Tooltip\"" : "";
|
||||
|
||||
if ($HasPermission) {
|
||||
echo "\t\t\t\t<tr><td><a href=\"$URL\"$TooltipHTML>$Title</a></td></tr>\n";
|
||||
global $ToolsHTML;
|
||||
$TooltipHTML = $Tooltip !== false ? " class=\"tooltip\" title=\"$Tooltip\"" : "";
|
||||
$ToolsHTML .= "\t\t\t\t<tr><td><a href=\"$URL\"$TooltipHTML>$Title</a></td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,123 +38,116 @@ function create_row($Title, $URL, $HasPermission = false, $Tooltip = false) {
|
||||
<div class="permissions">
|
||||
<div class="permission_container">
|
||||
<!-- begin left column -->
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Announcements</td></tr>
|
||||
<?
|
||||
// begin Announcements category
|
||||
$ToolsHTML = "";
|
||||
create_row("Calendar", "tools.php?action=calendar", Calendar::can_view());
|
||||
create_row("Change log", "tools.php?action=change_log", check_perms("users_mod"));
|
||||
create_row("Global notification", "tools.php?action=global_notification", check_perms("users_mod"));
|
||||
create_row("Mass PM", "tools.php?action=mass_pm", check_perms("users_mod"));
|
||||
create_row("News post", "tools.php?action=news", check_perms("admin_manage_news"));
|
||||
create_row("Vanity House additions", "tools.php?action=recommend", check_perms("site_recommend_own") || check_perms("site_manage_recommendations"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Announcements</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<?
|
||||
}
|
||||
|
||||
// begin Community category
|
||||
$ToolsHTML = "";
|
||||
create_row("Forum manager", "tools.php?action=forum", check_perms("admin_manage_forums"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Community</td></tr>
|
||||
<?
|
||||
create_row("Forum manager", "tools.php?action=forum", check_perms("admin_manage_forums"));
|
||||
create_row("Permissions manager", "tools.php?action=permissions", check_perms("admin_manage_permissions"));
|
||||
create_row("Special users", "tools.php?action=special_users", check_perms("admin_manage_permissions"));
|
||||
?>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Finances</td></tr>
|
||||
<?
|
||||
}
|
||||
|
||||
// begin Finances category
|
||||
$ToolsHTML = "";
|
||||
create_row("Bitcoin donations (balance)", "tools.php?action=bitcoin_balance", check_perms("admin_donor_log"));
|
||||
create_row("Bitcoin donations (unprocessed)", "tools.php?action=bitcoin_unproc", check_perms("admin_donor_log"));
|
||||
create_row("Donation log", "tools.php?action=donation_log", check_perms("admin_donor_log"));
|
||||
create_row("Donor rewards", "tools.php?action=donor_rewards", check_perms("users_mod"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Finances</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Administration</td></tr>
|
||||
<?
|
||||
}
|
||||
|
||||
// begin Administration category
|
||||
$ToolsHTML = "";
|
||||
create_row("Client whitelist", "tools.php?action=whitelist", check_perms("admin_whitelist"));
|
||||
create_row("Create user", "tools.php?action=create_user", check_perms("admin_create_users"));
|
||||
create_row("Global notification", "tools.php?action=global_notification", check_perms("users_mod"));
|
||||
create_row("Mass PM", "tools.php?action=mass_pm", check_perms("users_mod"));
|
||||
create_row("Permissions manager", "tools.php?action=permissions", check_perms("admin_manage_permissions"));
|
||||
create_row("Special users", "tools.php?action=special_users", check_perms("admin_manage_permissions"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Administration</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<? } ?>
|
||||
<!-- end left column -->
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<!-- begin middle column -->
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<?
|
||||
// begin Queue category
|
||||
$ToolsHTML = "";
|
||||
create_row("Login watch", "tools.php?action=login_watch", check_perms("admin_login_watch"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Queue</td></tr>
|
||||
?>
|
||||
<? create_row("Login watch", "tools.php?action=login_watch", check_perms("admin_login_watch"));
|
||||
?>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<?
|
||||
<tr class="colhead"><td>Managers</td></tr>
|
||||
?>
|
||||
<? create_row("Email blacklist", "tools.php?action=email_blacklist", check_perms("users_view_email"));
|
||||
}
|
||||
|
||||
// begin Managers category
|
||||
$ToolsHTML = "";
|
||||
create_row("Email blacklist", "tools.php?action=email_blacklist", check_perms("users_view_email"));
|
||||
create_row("IP address bans", "tools.php?action=ip_ban", check_perms("admin_manage_ipbans"));
|
||||
create_row("Duplicate IP addresses", "tools.php?action=dupe_ips", check_perms("users_view_ips"));
|
||||
create_row("Manipulate invite tree", "tools.php?action=manipulate_tree", check_perms("users_mod"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Managers</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end middle column -->
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<!-- begin right column -->
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Site Information</td></tr>
|
||||
<?
|
||||
create_row("Economic stats", "tools.php?action=economic_stats", check_perms("site_view_flow"));
|
||||
create_row("Invite pool", "tools.php?action=invite_pool", check_perms("users_view_invites"));
|
||||
create_row("Registration log", "tools.php?action=registration_log", check_perms("users_view_ips") && check_perms("users_view_email"));
|
||||
create_row("Torrent stats", "tools.php?action=torrent_stats", check_perms("site_view_flow"));
|
||||
// create_row("Upscale pool", "tools.php?action=upscale_pool", check_perms("site_view_flow"));
|
||||
create_row("User flow", "tools.php?action=user_flow", check_perms("site_view_flow"));
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Torrents</td></tr>
|
||||
<?
|
||||
create_row("\"Do Not Upload\" list", "tools.php?action=dnu", check_perms("admin_dnu"));
|
||||
create_row("Manage freeleech tokens", "tools.php?action=tokens", check_perms("users_mod"));
|
||||
create_row("Label aliases", "tools.php?action=label_aliases", check_perms("users_mod"));
|
||||
create_row("Tag aliases", "tools.php?action=tag_aliases", check_perms("users_mod"));
|
||||
create_row("Batch tag editor", "tools.php?action=edit_tags", check_perms("users_mod"));
|
||||
create_row("Official tags manager", "tools.php?action=official_tags", check_perms("users_mod"));
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Development</td></tr>
|
||||
<?
|
||||
create_row("Clear/view a cache key", "tools.php?action=clear_cache", check_perms("users_mod"));
|
||||
create_row("Opcode stats", "tools.php?action=opcode_stats", check_perms("site_debug"));
|
||||
create_row("PHP processes", "tools.php?action=process_info", check_perms("site_debug"));
|
||||
create_row("Rerender stylesheet gallery images", "tools.php?action=rerender_gallery", check_perms("admin_clear_cache") || check_perms("users_mod"));
|
||||
create_row("Schedule", "schedule.php?auth=$LoggedUser[AuthKey]", check_perms("site_debug"));
|
||||
create_row("Service stats", "tools.php?action=service_stats", check_perms("site_debug"));
|
||||
create_row("Update GeoIP", "tools.php?action=update_geoip", check_perms("admin_update_geoip"));
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Developer Sandboxes</td></tr>
|
||||
<?
|
||||
}
|
||||
|
||||
// begin Developer Sandboxes category
|
||||
$ToolsHTML = "";
|
||||
create_row("Sandbox (1)", "tools.php?action=sandbox1", check_perms("site_debug"));
|
||||
create_row("Sandbox (2)", "tools.php?action=sandbox2", check_perms("site_debug"));
|
||||
create_row("Sandbox (3)", "tools.php?action=sandbox3", check_perms("site_debug"));
|
||||
@ -153,9 +159,79 @@ function create_row($Title, $URL, $HasPermission = false, $Tooltip = false) {
|
||||
create_row("BBCode sandbox", "tools.php?action=bbcode_sandbox", check_perms("users_mod"));
|
||||
create_row("Public sandbox", "tools.php?action=public_sandbox", check_perms("users_mod"), "Do not click this!");
|
||||
create_row("Mod-level sandbox", "tools.php?action=mod_sandbox", check_perms("users_mod"), "Do not click this!");
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Developer Sandboxes</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<? } ?>
|
||||
<!-- end middle column -->
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
<!-- begin right column -->
|
||||
<?
|
||||
// begin Site Information category
|
||||
$ToolsHTML = "";
|
||||
create_row("Economic stats", "tools.php?action=economic_stats", check_perms("site_view_flow"));
|
||||
create_row("Invite pool", "tools.php?action=invite_pool", check_perms("users_view_invites"));
|
||||
create_row("Registration log", "tools.php?action=registration_log", check_perms("users_view_ips") && check_perms("users_view_email"));
|
||||
create_row("Torrent stats", "tools.php?action=torrent_stats", check_perms("site_view_flow"));
|
||||
create_row("Upscale pool", "tools.php?action=upscale_pool", check_perms("site_view_flow"));
|
||||
create_row("User flow", "tools.php?action=user_flow", check_perms("site_view_flow"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Site Information</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
|
||||
// begin Torrents category
|
||||
$ToolsHTML = "";
|
||||
create_row("\"Do Not Upload\" list", "tools.php?action=dnu", check_perms("admin_dnu"));
|
||||
create_row("Manage freeleech tokens", "tools.php?action=tokens", check_perms("users_mod"));
|
||||
create_row("Label aliases", "tools.php?action=label_aliases", check_perms("users_mod"));
|
||||
create_row("Tag aliases", "tools.php?action=tag_aliases", check_perms("users_mod"));
|
||||
create_row("Batch tag editor", "tools.php?action=edit_tags", check_perms("users_mod"));
|
||||
create_row("Official tags manager", "tools.php?action=official_tags", check_perms("users_mod"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Torrents</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
|
||||
// begin Development category
|
||||
$ToolsHTML = "";
|
||||
create_row("Clear/view a cache key", "tools.php?action=clear_cache", check_perms("users_mod"));
|
||||
create_row("PHP processes", "tools.php?action=process_info", check_perms("site_debug"));
|
||||
create_row("Rerender stylesheet gallery images", "tools.php?action=rerender_gallery", check_perms("site_debug") || check_perms("users_mod"));
|
||||
create_row("Schedule", "schedule.php?auth=$LoggedUser[AuthKey]", check_perms("site_debug"));
|
||||
create_row("Service stats", "tools.php?action=service_stats", check_perms("site_debug"));
|
||||
create_row("Update GeoIP", "tools.php?action=update_geoip", check_perms("admin_update_geoip"));
|
||||
|
||||
if ($ToolsHTML) {
|
||||
?>
|
||||
<div class="permission_subcontainer">
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td>Development</td></tr>
|
||||
<?= $ToolsHTML ?>
|
||||
</table>
|
||||
</div>
|
||||
<? } ?>
|
||||
<!-- end right column -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -308,8 +308,6 @@
|
||||
$EditSummary[] = 'EAC v0.95 logs rescored to '.$Logs095;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Start building SQL query and edit summary
|
||||
if ($Classes[$Class]['Level'] != $Cur['Class']
|
||||
&& (
|
||||
|
@ -440,10 +440,7 @@ function check_paranoia_here($Setting) {
|
||||
?>
|
||||
<li>Passwords: <?=number_format($PasswordChanges)?> <a href="userhistory.php?action=passwords&userid=<?=$UserID?>" class="brackets">View</a></li>
|
||||
<li>Stats: N/A <a href="userhistory.php?action=stats&userid=<?=$UserID?>" class="brackets">View</a></li>
|
||||
<?
|
||||
|
||||
}
|
||||
?>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<? } ?>
|
||||
@ -1308,7 +1305,6 @@ function check_paranoia_here($Setting) {
|
||||
<td class="label">Log out:</td>
|
||||
<td><input type="checkbox" name="LogOut" id="LogOut" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<? } ?>
|
||||
<? if (check_perms("users_mod")) {
|
||||
|
@ -64,7 +64,6 @@
|
||||
case 'catchup_collages':
|
||||
require('catchup_collages.php');
|
||||
break;
|
||||
|
||||
case 'token_history':
|
||||
require('token_history.php');
|
||||
break;
|
||||
|
@ -55,7 +55,7 @@ a img {
|
||||
border-bottom: 1px solid #4f4f4f;
|
||||
}
|
||||
|
||||
#site_debug {
|
||||
#wrapper>#site_debug {
|
||||
padding: 20px 0 20px 0;
|
||||
color: #a5a5a5;
|
||||
text-align: left;
|
||||
@ -733,6 +733,17 @@ td.body {width:100%;}
|
||||
|
||||
strong.quoteheader{color: #878787;}
|
||||
|
||||
/* Toolbox */
|
||||
.permission_container {
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
width: 286px;
|
||||
}
|
||||
|
||||
.permission_container:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* TORRENTS */
|
||||
|
||||
#torrents input[value="Edit torrent"] {
|
||||
|
@ -602,3 +602,7 @@ tr.torrent .bookmark>a:after {
|
||||
list-style-type: decimal;
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.permission_subcontainer {
|
||||
margin-bottom: 10px;
|
||||
}
|
@ -571,3 +571,12 @@ tr.torrent .bookmark > a:after { content: ""; }
|
||||
.autocomplete-selected {
|
||||
background: #666;
|
||||
}
|
||||
|
||||
.permission_container {
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
width: 313px;
|
||||
}
|
||||
.permission_container:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
@ -1195,7 +1195,7 @@ div.permission_container:nth-child(2) {
|
||||
padding: 0px 2%;
|
||||
}
|
||||
|
||||
div.permission_container>table {
|
||||
div.permission_container table.layout {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
@ -1281,7 +1281,12 @@ tr.torrent .bookmark > a:after {
|
||||
/* Toolbox */
|
||||
.permission_container {
|
||||
float: left;
|
||||
width: 33.3%;
|
||||
margin-left: 20px;
|
||||
width: 286px;
|
||||
}
|
||||
|
||||
.permission_container:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* TORRENTS */
|
||||
|
@ -815,3 +815,13 @@ div[class~=tooltipster-base] {
|
||||
.user_options .label {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.permission_container {
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
width: 303px;
|
||||
}
|
||||
|
||||
.permission_container:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user