Empty commit

This commit is contained in:
Git 2013-10-29 08:01:29 +00:00
parent c1b5e99afc
commit b2a8f94274
18 changed files with 303 additions and 158 deletions

View File

@ -1 +1,27 @@
TODO fill me out
# Gazelle
Gazelle is a web framework geared towards private BitTorrent trackers. Although naturally focusing on music, it can be modified for most needs. Gazelle is written in PHP, JavaScript, and MySQL.
## Gazelle Dependencies
* [Git](http://git-scm.com/) (required)
* [NGINX](http://wiki.nginx.org/Main) (recommended)
* [PHP 5.4 or later](http://us.php.net/) (required)
* [Memcached](http://memcached.org/) (required)
* [Sphinx](http://sphinxsearch.com/) (required)
## Changelog
You may have noticed that commits in the repository do not have have descriptive messages. If you are looking for a change log of Gazelle it can be [viewed here](https://raw.github.com/WhatCD/Gazelle/master/docs/CHANGES.txt). The change log is generated daily and includes new additions or modifications to Gazelle's source.
## Coding Standards
Gazelle's code adheres to a set of coding standards that can be found [here](https://github.com/WhatCD/Gazelle/wiki/Coding-Standards). If you plan on sending pull requests, these standards must be followed.
## Installation
[This guide](https://github.com/WhatCD/Gazelle/wiki/Gazelle-installation) will walk you through setting up Gazelle on a machine running Gentoo Linux. Although installing Gazelle is relatively straightforward, we recommend a working knowledge of PHP if you plan to modify the source code.
## Gazelle development using Vagrant
[VagrantGazelle](https://github.com/dr4g0nnn/VagrantGazelle) allows for convenient development of Gazelle, without going to the trouble of setting it all up for yourself.
Vagrant uses virtual machines to allow for easy development in consistent environments. The setup linked above allows for development on your local machine and the Gazelle setup to run without altering your system.
Once set up, the Gazelle source files will be present in `src/`, which is shared to `/var/www/` on the machine. A port forward from port 80 on the guest to 8080 on the host will also be established.

View File

@ -451,6 +451,7 @@ public static function gen_crypt_salt() {
* @param boolean $IsEnabled -- TODO: Why the fuck do we need this?
* @param boolean $Class whether or not to show the class
* @param boolean $Title whether or not to show the title
* @param boolean $IsDonorForum for displaying donor forum honorific prefixes and suffixes
* @return HTML formatted username
*/
public static function format_username($UserID, $Badges = false, $IsWarned = true, $IsEnabled = true, $Class = false, $Title = false, $IsDonorForum = false) {
@ -474,7 +475,7 @@ public static function format_username($UserID, $Badges = false, $IsWarned = tru
$Username = $UserInfo['Username'];
$Paranoia = $UserInfo['Paranoia'];
$ShowDonorIcon = !in_array('hide_donor_heart', $Paranoia);
$ShowDonorIcon = (!in_array('hide_donor_heart', $Paranoia) || check_perms('users_override_paranoia', $UserInfo['Class']));
if ($IsDonorForum) {
list($Prefix, $Suffix, $HasComma) = Donations::get_titles($UserID);

View File

@ -54,6 +54,41 @@ function assert_numbers(&$Base, $Keys, $Error = 0) {
}
}
/**
* Return true, false or null, depending on the input value's "truthiness" or "non-truthiness"
*
* @param $Value the input value to check for truthiness
* @return true if $Value is "truthy", false if it is "non-truthy" or null if $Value was not
* a bool-like value
*/
function is_bool_value($Value) {
if (is_bool($Value)) {
return $Value;
}
if (is_string($Value)) {
switch (strtolower($Value)) {
case 'true':
case 'yes':
case 'on':
case '1':
return true;
case 'false':
case 'no':
case 'off':
case '0':
return false;
}
}
if (is_numeric($Value)) {
if ($Value == 1) {
return true;
} elseif ($Value == 0) {
return false;
}
}
return null;
}
/**
* HTML-escape a string for output.
* This is preferable to htmlspecialchars because it doesn't screw up upon a double escape.

View File

@ -1,5 +1,11 @@
CHANGE LOG
2013-10-28 by alderaan
Collage API now returns subscriberCount and torrentGroupIDList
2013-10-28 by alderaan
Reports v1 stats page revamped. Now, looks very similar to the Reports v2 "Views" page.
2013-10-26 by alderaan
Added tooltip class to many HTML elements that were missing it

View File

@ -1398,7 +1398,8 @@ CREATE TABLE `users_freeleeches` (
`Downloaded` bigint(20) NOT NULL DEFAULT '0',
`Uses` int(10) NOT NULL DEFAULT '1',
PRIMARY KEY (`UserID`,`TorrentID`),
KEY `Time` (`Time`)
KEY `Time` (`Time`),
KEY `Expired_Time` (`Expired`,`Time`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `users_geodistribution` (

View File

@ -1,5 +1,4 @@
<?
include(SERVER_ROOT.'/sections/torrents/functions.php');
/** Start default parameters and validation **/
@ -757,8 +756,10 @@
}
}
json_die("success", array(
'currentPage' => intval($Page),
'pages' => ceil($NumResults / TORRENTS_PER_PAGE),
'results' => $JsonGroups
));
echo json_encode(
array(
'status' => 'success',
'response' => array(
'currentPage' => intval($Page),
'pages' => ceil($NumResults / TORRENTS_PER_PAGE),
'results' => $JsonGroups)));

View File

@ -15,9 +15,9 @@
$CacheKey = "collage_$CollageID";
$Data = $Cache->get_value($CacheKey);
if ($Data) {
list($K, list($Name, $Description, , , , $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)) = each($Data);
list($K, list($Name, $Description,, $Subscribers, $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated)) = each($Data);
} else {
$sql = "
$DB->query("
SELECT
Name,
Description,
@ -29,14 +29,29 @@
MaxGroupsPerUser,
Subscribers
FROM collages
WHERE ID = '$CollageID'";
$DB->query($sql);
WHERE ID = '$CollageID'");
if (!$DB->has_results()) {
json_die("failure");
}
list($Name, $Description, $CreatorID, $Deleted, $CollageCategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser) = $DB->next_record();
list($Name, $Description, $CreatorID, $Deleted, $CollageCategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Subscribers) = $DB->next_record();
}
// Populate data that wasn't included in the cache
if (is_null($TorrentGroups) || is_number($TorrentGroups)) {
$DB->query("
SELECT GroupID
FROM collages_torrents
WHERE CollageID = $CollageID");
$TorrentGroups = $DB->collect('GroupID');
}
if (is_null($Subscribers)) {
$DB->query("
SELECT Subscribers
FROM collages
WHERE ID = $CollageID");
list($Subscribers) = $DB->next_record();
}
$JSON = array(
@ -50,7 +65,9 @@
'locked' => (bool)$Locked,
'maxGroups' => (int)$MaxGroups,
'maxGroupsPerUser' => (int)$MaxGroupsPerUser,
'hasBookmarked' => Bookmarks::has_bookmarked('collage', $CollageID)
'hasBookmarked' => Bookmarks::has_bookmarked('collage', $CollageID),
'subscriberCount' => (int)$Subscribers,
'torrentGroupIDList' => $TorrentGroups
);
if ($CollageCategoryID != array_search(ARTIST_COLLAGE, $CollageCats)) {
@ -148,6 +165,6 @@
$JSON['artists'] = $Artists;
}
$Cache->cache_value($CacheKey, array(array($Name, $Description, array(), array(), array(), $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)), 3600);
$Cache->cache_value($CacheKey, array(array($Name, $Description, null, $Subscribers, $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)), 3600);
json_die("success", $JSON);

View File

@ -13,7 +13,6 @@
WHERE ca.CollageID='$CollageID'
ORDER BY ca.Sort");
$Artists = $DB->to_array('ArtistID', MYSQLI_ASSOC);
// Loop through the result set, building up $Collage and $TorrentTable
@ -202,7 +201,7 @@
<? } ?>
<h3>Comments</h3>
<?
if (empty($CommentList)) {
if ($CommentList === null) {
$DB->query("
SELECT
c.ID,
@ -300,6 +299,4 @@
</div>
<?
View::show_footer();
$Cache->cache_value("collage_$CollageID", array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
?>

View File

@ -18,19 +18,29 @@ function compare($X, $Y) {
error(0);
}
$Data = $Cache->get_value("collage_$CollageID");
$CacheKey = "collage_$CollageID";
$Data = $Cache->get_value($CacheKey);
if ($Data) {
list($K, list($Name, $Description, , , $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)) = each($Data);
list($K, list($Name, $Description, $NumGroups, , $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)) = each($Data);
} else {
$DB->query("
SELECT Name, Description, UserID, Deleted, CategoryID, Locked, MaxGroups, MaxGroupsPerUser, Updated, Subscribers
SELECT
Name,
Description,
UserID,
Deleted,
CategoryID,
Locked,
MaxGroups,
MaxGroupsPerUser,
Updated,
Subscribers
FROM collages
WHERE ID = '$CollageID'");
if ($DB->has_results()) {
list($Name, $Description, $CreatorID, $Deleted, $CollageCategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers) = $DB->next_record();
$TorrentList = '';
$CollageList = '';
$NumGroups = null;
} else {
$Deleted = '1';
}
@ -76,3 +86,19 @@ function compare($X, $Y) {
include(SERVER_ROOT.'/sections/collages/torrent_collage.php');
}
$Cache->cache_value($CacheKey, array(array(
$Name,
$Description,
(int)$NumGroups,
null,
$CommentList,
(bool)$Deleted,
(int)$CollageCategoryID,
(int)$CreatorID,
(bool)$Locked,
(int)$MaxGroups,
(int)$MaxGroupsPerUser,
(int)$Subscribers
)), 3600);

View File

@ -482,7 +482,7 @@
<? } ?>
<h3>Comments</h3>
<?
if (empty($CommentList)) {
if ($CommentList === null) {
$DB->query("
SELECT
c.ID,
@ -586,6 +586,4 @@
</div>
<?
View::show_footer();
$Cache->cache_value("collage_$CollageID", array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
?>

View File

@ -14,8 +14,8 @@
<a href="reports.php?action=stats">Stats</a>
</div>
</div>
<div class="box pad thin" style="padding: 0px 0px 0px 20px; margin-left: auto; margin-right: auto;">
<table class="layout">
<div class="thin float_clear">
<div class="two_columns pad">
<?
if (check_perms('admin_reports')) {
$DB->query("
@ -29,13 +29,11 @@
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<tr>
<td class="label"><strong>Reports resolved in the last 24 hours</strong></td>
<td>
<table style="width: 50%; margin-left: auto; margin-right: auto;" class="border">
<tr>
<td class="head colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td>
<h3><strong>Reports resolved in the last 24 hours</strong></h3>
<table class="box border">
<tr class="colhead">
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<?
foreach ($Results as $Result) {
@ -52,9 +50,6 @@
</tr>
<? } ?>
</table>
</td>
</tr>
<tr>
<?
$DB->query("
SELECT um.Username,
@ -67,12 +62,11 @@
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<td class="label"><strong>Reports resolved in the last week</strong></td>
<td>
<table style="width: 50%; margin-left: auto; margin-right: auto;" class="border">
<tr>
<td class="head colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td>
<h3><strong>Reports resolved in the last week</strong></h3>
<table class="box border">
<tr class="colhead">
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<?
foreach ($Results as $Result) {
@ -89,9 +83,6 @@
</tr>
<? } ?>
</table>
</td>
</tr>
<tr>
<?
$DB->query("
SELECT um.Username,
@ -104,12 +95,11 @@
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<td class="label"><strong>Reports resolved in the last month</strong></td>
<td>
<table style="width: 50%; margin-left: auto; margin-right: auto;" class="border">
<tr>
<td class="head colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td>
<h3><strong>Reports resolved in the last month</strong></h3>
<table class="box border">
<tr class="colhead">
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<?
foreach ($Results as $Result) {
@ -126,9 +116,6 @@
</tr>
<? } ?>
</table>
</td>
</tr>
<tr>
<?
$DB->query("
SELECT um.Username,
@ -139,12 +126,11 @@
ORDER BY Reports DESC");
$Results = $DB->to_array();
?>
<td class="label"><strong>Reports resolved since "other" reports (2009-08-21)</strong></td>
<td>
<table style="width: 50%; margin-left: auto; margin-right: auto;" class="border">
<tr>
<td class="head colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td>
<h3><strong>Reports resolved since "other" reports (2009-08-21)</strong></h3>
<table class="box border">
<tr class="colhead">
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<?
foreach ($Results as $Result) {
@ -161,11 +147,10 @@
</tr>
<? } ?>
</table>
</td>
</tr>
<?
} //if (check_perms('admin_reports')) ?>
<tr>
</div>
<div class="two_columns pad">
<?
$DB->query("
SELECT u.Username,
@ -178,14 +163,13 @@
LIMIT 30");
$Results = $DB->to_array();
?>
<td class="label"><strong>Threads trashed since the beginning of time</strong></td>
<td>
<table style="width: 50%; margin-left: auto; margin-right: auto;" class="border">
<tr>
<td class="head colhead_dark">Place</td>
<td class="head colhead_dark">Username</td>
<td class="head colhead_dark">Trashed</td>
</tr>
<h3><strong>Threads trashed since the beginning of time</strong></h3>
<table class="box border">
<tr class="colhead">
<td class="colhead_dark number_column">Place</td>
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Trashed</td>
</tr>
<?
$i = 1;
foreach ($Results as $Result) {
@ -196,19 +180,17 @@
$RowClass = '';
}
?>
<tr<?=$RowClass?>>
<td><?=$i?></td>
<td><?=$Username?></td>
<td class="number_column"><?=number_format($Trashed)?></td>
</tr>
<tr<?=$RowClass?>>
<td class="number_column"><?=$i?></td>
<td><?=$Username?></td>
<td class="number_column"><?=number_format($Trashed)?></td>
</tr>
<?
$i++;
}
?>
</table>
</td>
</tr>
</table>
</table>
</div>
</div>
<?
View::show_footer();

View File

@ -35,7 +35,7 @@
um.Username,
COUNT(r.ID) AS Reports
FROM reportsv2 AS r
JOIN users_main AS um ON um.ID=r.ResolverID
JOIN users_main AS um ON um.ID = r.ResolverID
WHERE r.LastChangeTime > NOW() - INTERVAL 24 HOUR
GROUP BY r.ResolverID
ORDER BY Reports DESC");
@ -47,14 +47,22 @@
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<? foreach ($Results as $Result) {
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr>
<tr<?=$RowClass?>>
<td><a href="reportsv2.php?view=resolver&amp;id=<?=$UserID?>"><?=$Username?></a></td>
<td class="number_column"><?=number_format($Reports)?></td>
</tr>
<? } ?>
<?
}
?>
</table>
<?
$DB->query("
@ -63,7 +71,7 @@
um.Username,
COUNT(r.ID) AS Reports
FROM reportsv2 AS r
JOIN users_main AS um ON um.ID=r.ResolverID
JOIN users_main AS um ON um.ID = r.ResolverID
WHERE r.LastChangeTime > NOW() - INTERVAL 1 WEEK
GROUP BY r.ResolverID
ORDER BY Reports DESC");
@ -75,14 +83,22 @@
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<? foreach ($Results as $Result) {
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr>
<tr<?=$RowClass?>>
<td><a href="reportsv2.php?view=resolver&amp;id=<?=$UserID?>"><?=$Username?></a></td>
<td class="number_column"><?=number_format($Reports)?></td>
</tr>
<? } ?>
<?
}
?>
</table>
<?
$DB->query("
@ -91,7 +107,7 @@
um.Username,
COUNT(r.ID) AS Reports
FROM reportsv2 AS r
JOIN users_main AS um ON um.ID=r.ResolverID
JOIN users_main AS um ON um.ID = r.ResolverID
WHERE r.LastChangeTime > NOW() - INTERVAL 1 MONTH
GROUP BY r.ResolverID
ORDER BY Reports DESC");
@ -103,14 +119,22 @@
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<? foreach ($Results as $Result) {
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr>
<tr<?=$RowClass?>>
<td><a href="reportsv2.php?view=resolver&amp;id=<?=$UserID?>"><?=$Username?></a></td>
<td class="number_column"><?=number_format($Reports)?></td>
</tr>
<? } ?>
<?
}
?>
</table>
<?
$DB->query("
@ -119,7 +143,7 @@
um.Username,
COUNT(r.ID) AS Reports
FROM reportsv2 AS r
JOIN users_main AS um ON um.ID=r.ResolverID
JOIN users_main AS um ON um.ID = r.ResolverID
GROUP BY r.ResolverID
ORDER BY Reports DESC");
$Results = $DB->to_array();
@ -130,14 +154,22 @@
<td class="colhead_dark">Username</td>
<td class="colhead_dark number_column">Reports</td>
</tr>
<? foreach ($Results as $Result) {
<?
foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result;
if ($Username == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr>
<tr<?=$RowClass?>>
<td><a href="reportsv2.php?view=resolver&amp;id=<?=$UserID?>"><?=$Username?></a></td>
<td class="number_column"><?=number_format($Reports)?></td>
</tr>
<? } ?>
<?
}
?>
</table>
<h3>Different view modes by person</h3>
<div class="box pad">
@ -206,7 +238,7 @@
um.Username,
COUNT(r.ID) AS Count
FROM reportsv2 AS r
LEFT JOIN users_main AS um ON r.ResolverID=um.ID
LEFT JOIN users_main AS um ON r.ResolverID = um.ID
WHERE r.Status = 'InProgress'
GROUP BY r.ResolverID");
@ -219,15 +251,20 @@
<td class="colhead_dark number_column">Current Count</td>
</tr>
<?
foreach ($Staff as $Array) { ?>
<tr>
foreach ($Staff as $Array) {
if ($Array['Username'] == $LoggedUser['Username']) {
$RowClass = ' class="rowa"';
} else {
$RowClass = '';
}
?>
<tr<?=$RowClass?>>
<td>
<a href="reportsv2.php?view=staff&amp;id=<?=$Array['ResolverID']?>"><?=display_str($Array['Username'])?>'s reports</a>
</td>
<td class="number_column"><?=number_format($Array['Count'])?></td>
</tr>
<?
} ?>
<? } ?>
</table>
<h3>Different view modes by report type</h3>
<?
@ -236,7 +273,7 @@
r.Type,
COUNT(r.ID) AS Count
FROM reportsv2 AS r
WHERE r.Status='New'
WHERE r.Status = 'New'
GROUP BY r.Type");
$Current = $DB->to_array();
if (!empty($Current)) {

View File

@ -8,7 +8,8 @@
</div>
<div class="box pad rule_summary">
<br />
<strong>Ratio System Overview:</strong><br />
<strong>Ratio System Overview:</strong>
<br />
<ul>
<li>Your <strong>ratio</strong> is calculated by dividing the amount of data you&apos;ve uploaded by the amount of data you&apos;ve downloaded. You can view your ratio in the site header or in the &quot;stats&quot; section of your user profile.
</li>
@ -20,7 +21,8 @@
</ul>
<br />
<br />
<strong>Required Ratio Overview:</strong><br />
<strong>Required Ratio Overview:</strong>
<br />
<ul>
<li>Your required ratio represents the minimum ratio you must maintain to avoid ratio watch. You can view your required ratio in the site header after the word &quot;required&quot; or in the &quot;stats&quot; section of your user profile.
</li>
@ -32,11 +34,13 @@
</ul>
<br />
<br />
<div style="text-align: center;"><strong>Required Ratio Table</strong><br /><br />
<div style="text-align: center;">
<strong>Required Ratio Table</strong>
<br />
<br />
<table class="ratio_table">
<tr class="colhead">
<td class="tooltip" title="These units are actually in base 2, not base 10. For example, there are 1,024 MB in 1 GB.">Amount Downloaded</span></td>
<td class="tooltip" title="These units are actually in base 2, not base 10. For example, there are 1,024 MB in 1 GB.">Amount Downloaded</td>
<td>Required Ratio (0% seeded)</td>
<td>Required Ratio (100% seeded)</td>
</tr>
@ -94,19 +98,22 @@
</div>
<br />
<br />
<strong>Required Ratio Calculation:</strong><br />
<strong>Required Ratio Calculation:</strong>
<br />
<ul>
<li><strong>1: Determine the maximum and minimum possible values of your required ratio.</strong> Using the table above, determine your amount downloaded bracket from the first column.
<li>
<strong>1: Determine the maximum and minimum possible values of your required ratio.</strong> Using the table above, determine your amount downloaded bracket from the first column.
Next, locate the values in the adjacent columns. The second column lists the maximum required ratio for each bracket, and the third column lists the minimum required ratio for each
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
<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 &minus; (<var>seeding</var> / <var>snatched</var>)]. Formatted
differently, the calculation performed by the system looks like this:
<br />
<br />
<div style="text-align: center;">
<img style="vertical-align: middle;" src="static/blank.gif"
<img style="vertical-align: middle;" src="static/blank.gif" alt="required ratio = (maximum required ratio) * (1 - (seeding / snatched))"
onload="if (this.src.substr(this.src.length - 9, this.src.length) == 'blank.gif') { this.src = 'https://chart.googleapis.com/chart?cht=tx&amp;chf=bg,s,FFFFFF00&amp;chl=%5Ctextrm%7B%28maximum+required+ratio%29+%2A+%281-%5Cfrac%7Bseeding%7D%7Bsnatched%7D%29%7D&amp;chco=' + hexify(getComputedStyle(this.parentNode, null).color); }" />
</div>
<br />
@ -127,7 +134,8 @@
</ul>
<br />
<br />
<strong>Required Ratio Details:</strong><br />
<strong>Required Ratio Details:</strong>
<br />
<ul>
<li>If you stop seeding for one week, your required ratio will become the maximum required ratio (0% seeded) for your amount downloaded bracket. Once you have resumed seeding for a 72 hour
period, your required ratio will decrease according to the above calculations.
@ -142,7 +150,8 @@
</ul>
<br />
<br />
<strong>Required Ratio Example:</strong><br />
<strong>Required Ratio Example:</strong>
<br />
<ul>
<li>In this example, Rippy has downloaded 25 GB. Rippy falls into the 20&ndash;30 GB amount downloaded bracket in the table above. Rippy&apos;s maximum required ratio (0% seeded) is 0.30, and his minimum required ratio (100% seeded) is 0.05.
</li>
@ -157,7 +166,8 @@
</ul>
<br />
<br />
<strong>Ratio Watch Overview:</strong><br />
<strong>Ratio Watch Overview:</strong>
<br />
<ul>
<li>Everyone gets to download their first 5 GB before ratio watch eligibility begins.</li>
<li>If you&apos;ve downloaded more than 5 GB and your ratio does not meet or surpass your required ratio, you will be put on ratio watch and have <strong>two weeks</strong> to raise your
@ -171,7 +181,8 @@
</ul>
<br />
<br />
<strong>Leaving Ratio Watch:</strong><br />
<strong>Leaving Ratio Watch:</strong>
<br />
<ul>
<li>To leave ratio watch, you must either raise your ratio by uploading more, or lower your required ratio by seeding more. Your ratio must be equal to or above your required ratio in
order for ratio watch to end.
@ -187,8 +198,7 @@
<br />
</div>
<? include('jump.php'); ?>
</div>
</div>
</div>
<?
View::show_footer();
?>

View File

@ -117,7 +117,8 @@ function next_hour() {
//------------- Delete unpopular tags -----------------------------------//
$DB->query("
DELETE FROM torrents_tags
WHERE NegativeVotes > PositiveVotes");
WHERE NegativeVotes > 1
AND NegativeVotes > PositiveVotes");
//------------- Expire old FL Tokens and clear cache where needed ------//
$sqltime = sqltime();
@ -126,23 +127,26 @@ function next_hour() {
FROM users_freeleeches
WHERE Expired = FALSE
AND Time < '$sqltime' - INTERVAL 4 DAY");
while (list($UserID) = $DB->next_record()) {
$Cache->delete_value('users_tokens_'.$UserID[0]);
}
if ($DB->has_results()) {
while (list($UserID) = $DB->next_record()) {
$Cache->delete_value('users_tokens_'.$UserID[0]);
}
$DB->query("
SELECT uf.UserID, t.info_hash
FROM users_freeleeches AS uf
JOIN torrents AS t ON uf.TorrentID = t.ID
WHERE uf.Expired = FALSE
AND uf.Time < '$sqltime' - INTERVAL 4 DAY");
while (list($UserID, $InfoHash) = $DB->next_record(MYSQLI_NUM, false)) {
Tracker::update_tracker('remove_token', array('info_hash' => rawurlencode($InfoHash), 'userid' => $UserID));
$DB->query("
SELECT uf.UserID, t.info_hash
FROM users_freeleeches AS uf
JOIN torrents AS t ON uf.TorrentID = t.ID
WHERE uf.Expired = FALSE
AND uf.Time < '$sqltime' - INTERVAL 4 DAY");
while (list($UserID, $InfoHash) = $DB->next_record(MYSQLI_NUM, false)) {
Tracker::update_tracker('remove_token', array('info_hash' => rawurlencode($InfoHash), 'userid' => $UserID));
}
$DB->query("
UPDATE users_freeleeches
SET Expired = TRUE
WHERE Time < '$sqltime' - INTERVAL 4 DAY
AND Expired = FALSE");
}
$DB->query("
UPDATE users_freeleeches
SET Expired = True
WHERE Time < '$sqltime' - INTERVAL 4 DAY");

View File

@ -194,7 +194,7 @@ input[type="submit"]:active, input[type="button"]:active {
input[value="Upload torrent"], input[value="Upload torrents"] {
margin: 15px 0 0 0;
background-color: #2e2e2e;
color: a5cce9;
color: #a5cce9;
background-image: url('images/button.png');
border-top: 1px solid #323232;
border-left: 1px solid #323232;
@ -2049,12 +2049,14 @@ div[class~=tooltipster-content] > a {
Consistent .box and .pad
TODO: Make these rules apply globally and add exceptions where needed
*/
#reportsv2 .box {
#reportsv2 .box,
#reports .box {
background-color: #212121;
border: 1px solid #1a1a1a;
margin: 0 0 20px 0;
}
#reportsv2 .pad {
#reportsv2 .pad,
#reports .pad {
padding: 10px !important;
}

View File

@ -351,7 +351,7 @@ ul.thin li {
}
#searchbars ul li ul li {
margin: 0
margin: 0;
padding: 0;
display: block;
width: 100%;

View File

@ -300,26 +300,26 @@ button:active,input[type="button"]:active,input[type="submit"]:active,#userinfo_
#userinfo_username .brackets a {
-webkit-border-top-right-radius: 0;
-moz-border-radius-topright: 0;
border-radius-topright: 0;
border-top-right-radius: 0;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomright: 0;
border-radius-bottomright: 0;
border-bottom-right-radius: 0;
}
#userinfo_username .brackets:last-child a {
border-left: none;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
-webkit-border-top-left-radius: 0;
-moz-border-radius-topleft: 0;
border-radius-topleft: 0;
border-top-left-radius: 0;
-webkit-border-bottom-left-radius: 0;
-moz-border-radius-bottomleft: 0;
border-radius-bottomleft: 0;
border-bottom-left-radius: 0;
}
input[type="submit"]:active {
@ -442,7 +442,7 @@ textarea {
#menu ul li:last-child {
margin-right: 0;
padding-right: none;
padding-right: 0;
border-right: none;
}
@ -768,7 +768,7 @@ body#index #recommended #vanityhouse {
td.unread,td.read,td.read_locked,td.unread_sticky,td.read_locked_sticky,td.unread_locked_sticky,td.read_sticky {
width: 3.5%;
background-repeat: none;
background-repeat: no-repeat;
background-position: center center;
}
@ -996,19 +996,19 @@ ul#artistcomplete {
#artistcomplete li:first-child {
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-radius-topleft: 4px;
border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-radius-topright: 4px;
border-top-right-radius: 4px;
}
#artistcomplete li:last-child {
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
}
#artistcomplete li {
@ -1381,5 +1381,5 @@ table[width="100%"].user_options {
Consistent .box and .pad
TODO: Make these rules apply globally and add exceptions where needed
*/
#reportsv2 .pad { padding: 10px !important; }
#reportsv2 .box { margin-bottom: 10px; background-color: rgb(255,255,255); border: 1px solid #aaa; color: #777; }
#reportsv2 .pad, #reports .pad { padding: 10px !important; }
#reportsv2 .box, #reports .box { margin-bottom: 10px; background-color: rgb(255,255,255); border: 1px solid #aaa; color: #777; }

View File

@ -764,7 +764,7 @@ table {
-moz-box-shadow: -4px 1px 8px rgba(187, 215, 235, 0.8);
box-shadow: -4px 1px 8px rgba(187, 215, 235, 0.8);
background-color: #F5F5F5;
word-break: break-word;
word-wrap: break-word;
}
.forum_post .body div {
@ -2070,7 +2070,8 @@ div[class~=tooltipster-base] {
Consistent .box and .pad
TODO: Make these rules apply globally and add exceptions where needed
*/
#reportsv2 .box {
#reportsv2 .box,
#reports .box {
background-color: #f5f5f5;
border: 1px solid #dcdcdc;
margin: 0 0 20px 0;
@ -2079,6 +2080,7 @@ TODO: Make these rules apply globally and add exceptions where needed
border-radius: 4px;
}
#reportsv2 .pad {
#reportsv2 .pad,
#reports .pad {
padding: 10px !important;
}