- =display_str($Key)?>
+ =display_str($Key)?>
|
=display_str(print_r($Cache->get_value($Key, true), true))?>
@@ -497,7 +497,7 @@ public function error_table($Errors = false) {
?>
- View =number_format(count($Errors))?> Errors: |
+ View =number_format(count($Errors))?> Errors: |
@@ -536,7 +536,7 @@ public function query_table($Queries=false) {
?>
@@ -571,7 +571,7 @@ public function sphinx_table($Queries = false) {
?>
@@ -603,7 +603,7 @@ public function vars_table($Vars = false) {
?>
@@ -614,7 +614,7 @@ public function vars_table($Vars = false) {
?>
- =display_str($Key)?> (=$Size . ($Size == 1 ? ' element' : ' elements')?>)
+ =display_str($Key)?> (=$Size . ($Size == 1 ? ' element' : ' elements')?>)
=$Data['bt']['path'].':'.$Data['bt']['line'];?>
|
diff --git a/classes/rules.class.php b/classes/rules.class.php
index b5c3b03f..304669cb 100644
--- a/classes/rules.class.php
+++ b/classes/rules.class.php
@@ -1,5 +1,33 @@
+
+ - All staff decisions must be respected. If you take issue with a decision, you must do so privately with the staff member who issued the decision or with an administrator of the site. Complaining about staff decisions in public or otherwise disrespecting staff members will not be taken lightly.
+ - Access to this web site is a privilege, not a right, and it can be taken away from you for any reason.
+ - One account per person per lifetime. Anyone creating additional accounts will be banned. Additionally, unless your account is immune to inactivity pruning, accounts are automatically disabled if one page load is not made at least once every four months.
+ - Avatars must not exceed 256 kB or be vertically longer than 400 pixels. Avatars must be safe for work, be entirely unoffensive, and cannot contain any nudity or religious imagery. Use common sense.
+ - Do not post our .torrent files on other sites. Every .torrent file has your personal passkey embedded in it. The tracker will automatically disable your account if you share your torrent files with others. You will not get your account back. This doesn't prohibit you from sharing the content on other sites, but does prohibit you from sharing the .torrent file.
+ - Any torrent you are seeding to this tracker must only have our tracker's URL in it. Adding another tracker's URL will cause incorrect data to be sent to our tracker, and will lead to your getting disabled for cheating. Similarly, your client must have DHT and PEX (peer exchange) disabled for all =SITE_NAME?> torrents.
+ - This is a torrent site which promotes sharing amongst the community. If you are not willing to give back to the community what you take from it, this site is not for you. In other words, we expect you to have an acceptable share ratio. If you download a torrent, please, seed the copy you have until there are sufficient people seeding the torrent data before you stop.
+ - Do not browse the site using proxies or Tor. The site will automatically alert us. This includes VPNs with dynamic IP addresses.
+ - Asking for invites to any site is not allowed anywhere on =SITE_NAME?> or our IRC network. Invites may be offered in the Invites forum, and nowhere else.
+ - Trading and selling invites is strictly prohibited, as is offering them in public - this includes on any forum which is not a class-restricted section on an invitation-only torrent site. Responding to public requests for invites may also jeopardize your account and those whom you invite from a public request.
+ - Trading, selling, sharing, or giving away your account is prohibited. If you no longer want your account, send a staff PM requesting that it be disabled.
+ - You're completely responsible for the people you invite. If your invitees are caught cheating or trading/selling invites, not only will they be banned, so will you. Be careful who you invite. Invites are a precious commodity.
+ - Be careful when sharing an IP address or a computer with a friend if they have (or have had) an account. From then on your accounts will be inherently linked and if one of you violates the rules, both accounts will be disabled along with any other accounts linked by IP address. This rule applies to logging into the site.
+ - Attempting to find or exploit a bug in the site code is the worst possible offense you can commit. We have automatic systems in place for monitoring these activities, and committing them will result in the banning of you, your inviter, and your inviter's entire invite tree.
+ - We're a community. Working together is what makes this place what it is. There are well over a thousand new torrents uploaded every day and sadly the staff aren't psychic. If you come across something that violates a rule, report it and help us better organize the site for you.
+ - We respect the wishes of other sites here, as we wish for them to do the same. Please refrain from posting links to or full names for sites that do not want to be mentioned.
+
+
+ }
+
/**
* Displays the site's rules for tags.
*
diff --git a/classes/tools.class.php b/classes/tools.class.php
index 469cd8b4..7ff0d8f3 100644
--- a/classes/tools.class.php
+++ b/classes/tools.class.php
@@ -98,7 +98,7 @@ public static function get_host_by_ip($IP) {
* Gets an hostname using AJAX
*
* @param $IP the IP to fetch
- * @return a span with javascript code
+ * @return a span with JavaScript code
*/
public static function get_host_by_ajax($IP) {
static $ID = 0;
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 5e39bc75..a0d6308e 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -1,7 +1,10 @@
CHANGELOG
+2013-06-16 by porkpie
+Require a click and an ajax call to view some of the stats on profile pages
+
2013-06-15 by Ajax
-Adding &artistreleases=1 to artist api url will display only releases by the current artist
+Adding &artistreleases=1 to artist api url will display only releases by the current artist
2013-06-15 by Ajax
Added artist and extended artist information to torrent groups in artist json output
diff --git a/sections/ajax/artist.php b/sections/ajax/artist.php
index 44a8e046..65e99972 100644
--- a/sections/ajax/artist.php
+++ b/sections/ajax/artist.php
@@ -154,16 +154,16 @@ function compare($X, $Y) {
}
if (!empty($GuestAlbums)) {
- $ReleaseTypes[1024] = "Guest Appearance";
+ $ReleaseTypes[1024] = 'Guest Appearance';
}
if (!empty($RemixerAlbums)) {
- $ReleaseTypes[1023] = "Remixed By";
+ $ReleaseTypes[1023] = 'Remixed By';
}
if (!empty($ComposerAlbums)) {
- $ReleaseTypes[1022] = "Composition";
+ $ReleaseTypes[1022] = 'Composition';
}
if (!empty($ProducerAlbums)) {
- $ReleaseTypes[1021] = "Produced By";
+ $ReleaseTypes[1021] = 'Produced By';
}
reset($TorrentList);
@@ -173,13 +173,13 @@ function compare($X, $Y) {
foreach ($TorrentList as $GroupID => $Group) {
extract(Torrents::array_group($Group));
- foreach($Artists as &$Artist) {
+ foreach ($Artists as &$Artist) {
$Artist['id'] = (int) $Artist['id'];
$Artist['aliasid'] = (int) $Artist['aliasid'];
}
- foreach($ExtendedArtists as &$ArtistGroup) {
- foreach($ArtistGroup as &$Artist) {
+ foreach ($ExtendedArtists as &$ArtistGroup) {
+ foreach ($ArtistGroup as &$Artist) {
$Artist['id'] = (int) $Artist['id'];
$Artist['aliasid'] = (int) $Artist['aliasid'];
diff --git a/sections/ajax/community_stats.php b/sections/ajax/community_stats.php
new file mode 100644
index 00000000..b8bbe8bc
--- /dev/null
+++ b/sections/ajax/community_stats.php
@@ -0,0 +1,74 @@
+
+if (!isset($_GET['userid']) || !is_number($_GET['userid'])) {
+ json_die('failure');
+}
+
+$UserID = $_GET['userid'];
+$CommStats = array(
+ 'leeching' => false,
+ 'seeding' => false,
+ 'snatched' => false,
+ 'usnatched' => false,
+ 'downloaded' => false,
+ 'udownloaded' => false,
+ 'seedingperc' => false,
+);
+
+$User = Users::user_info($UserID);
+
+function check_paranoia_here($Setting) {
+ global $User;
+ return check_paranoia($Setting, $User['Paranoia'], $User['Class'], $User['ID']);
+}
+
+if (check_paranoia_here('seeding+') || check_paranoia_here('leeching+')) {
+ $DB->query("
+ SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(x.uid)
+ FROM xbt_files_users AS x
+ INNER JOIN torrents AS t ON t.ID=x.fid
+ WHERE x.uid='$UserID'
+ AND x.active=1
+ GROUP BY Type");
+ $PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
+ if (check_paranoia('seeding+')) {
+ $CommStats['seeding'] = isset($PeerCount['Seeding']) ? $PeerCount['Seeding'][1] : 0;
+ }
+ if (check_paranoia('leeching+')) {
+ $CommStats['leeching'] = isset($PeerCount['Leeching']) ? $PeerCount['Leeching'][1] : 0;
+ }
+}
+if (check_paranoia_here('snatched+')) {
+ $DB->query("
+ SELECT COUNT(x.uid), COUNT(DISTINCT x.fid)
+ FROM xbt_snatched AS x
+ INNER JOIN torrents AS t ON t.ID=x.fid
+ WHERE x.uid = '$UserID'");
+ list($Snatched, $UniqueSnatched) = $DB->next_record(MYSQLI_NUM, false);
+ $CommStats['snatched'] = $Snatched;
+ if (check_perms('site_view_torrent_snatchlist', $User['Class'])) {
+ $CommStats['usnatched'] = $UniqueSnatched;
+ }
+ if (check_paranoia_here('seeding') && check_paranoia_here('snatched')) {
+ $CommStats['seedingperc'] = $UniqueSnatched > 0 ? 100 * min(1, round($CommStats['seeding'] / $UniqueSnatched, 2)) : -1;
+ }
+}
+if (check_perms('site_view_torrent_snatchlist', $Class)) {
+ $DB->query("
+ SELECT COUNT(ud.UserID), COUNT(DISTINCT ud.TorrentID)
+ FROM users_downloads AS ud
+ JOIN torrents AS t ON t.ID=ud.TorrentID
+ WHERE ud.UserID='$UserID'");
+ list($NumDownloads, $UniqueDownloads) = $DB->next_record(MYSQLI_NUM, false);
+ $CommStats['downloaded'] = $NumDownloads;
+ $CommStats['udownloaded'] = $UniqueDownloads;
+}
+
+$CommStats['leeching'] = number_format($CommStats['leeching']);
+$CommStats['seeding'] = number_format($CommStats['seeding']);
+$CommStats['snatched'] = number_format($CommStats['snatched']);
+$CommStats['usnatched'] = number_format($CommStats['usnatched']);
+$CommStats['downloaded'] = number_format($CommStats['downloaded']);
+$CommStats['udownloaded'] = number_format($CommStats['udownloaded']);
+$CommStats['seedingperc'] = number_format($CommStats['seedingperc']);
+
+json_die('success', $CommStats);
diff --git a/sections/ajax/index.php b/sections/ajax/index.php
index 213c66e4..997be1c8 100644
--- a/sections/ajax/index.php
+++ b/sections/ajax/index.php
@@ -147,6 +147,9 @@
case 'news_ajax':
require(SERVER_ROOT . '/sections/ajax/news_ajax.php');
break;
+ case 'community_stats':
+ require(SERVER_ROOT . '/sections/ajax/community_stats.php');
+ break;
default:
// If they're screwing around with the query string
json_die("failure");
diff --git a/sections/artist/artist.php b/sections/artist/artist.php
index 3cab8123..eeae01e9 100644
--- a/sections/artist/artist.php
+++ b/sections/artist/artist.php
@@ -228,12 +228,12 @@ function compare($X, $Y) {
}
if (!empty($LoggedUser['DiscogView']) || (isset($LoggedUser['SortHide']) && array_key_exists($ReleaseType, $LoggedUser['SortHide']) && $LoggedUser['SortHide'][$ReleaseType] == 1)) {
- $ToggleStr = " onclick=\"$('.releases_$ReleaseID').show(); return true;\"";
+ $ToggleStr = " onclick=\"$('.releases_$ReleaseID').gshow(); return true;\"";
} else {
$ToggleStr = '';
}
?>
- " class="brackets"=$ToggleStr?>>=$DisplayName?>
+ >=$DisplayName?>
}
if ($NumRequests > 0) {
@@ -323,7 +323,7 @@ function compare($X, $Y) {
|
- ↑ =$DisplayName?> (View) |
+ ↑ =$DisplayName?> (View) |
Size |
|
|
@@ -717,7 +717,7 @@ function compare($X, $Y) {
AND Deleted='0'
AND CategoryID = '7'");
$Collages = $DB->to_array();
- $Cache->cache_value('artists_collages_'.$ArtistID, $Collages, 3600*6);
+ $Cache->cache_value('artists_collages_'.$ArtistID, $Collages, 3600 * 6);
}
if (count($Collages) > 0) {
if (count($Collages) > MAX_COLLAGES) {
@@ -725,7 +725,7 @@ function compare($X, $Y) {
$Range = range(0,count($Collages) - 1);
shuffle($Range);
$Indices = array_slice($Range, 0, MAX_COLLAGES);
- $SeeAll = ' (See all)';
+ $SeeAll = ' (See all)';
} else {
$Indices = range(0, count($Collages)-1);
$SeeAll = '';
@@ -929,7 +929,7 @@ function require(file, callback) {
=$Text->full_format($Body)?>
diff --git a/sections/artist/concerts.php b/sections/artist/concerts.php
index db9c798e..1606046f 100644
--- a/sections/artist/concerts.php
+++ b/sections/artist/concerts.php
@@ -26,7 +26,7 @@
>
=$Concerts?>
diff --git a/sections/collages/new.php b/sections/collages/new.php
index 833ad31f..69db176a 100644
--- a/sections/collages/new.php
+++ b/sections/collages/new.php
@@ -2,7 +2,7 @@
View::show_header('Create a collage');
if (!check_perms('site_collages_renamepersonal')) {
- $ChangeJS = " onchange=\"if ( this.options[this.selectedIndex].value == '0') { $('#namebox').hide(); $('#personal').show(); } else { $('#namebox').show(); $('#personal').hide(); }\"";
+ $ChangeJS = " onchange=\"if ( this.options[this.selectedIndex].value == '0') { $('#namebox').ghide(); $('#personal').gshow(); } else { $('#namebox').gshow(); $('#personal').ghide(); }\"";
}
$Name = $_REQUEST['name'];
diff --git a/sections/forums/forum.php b/sections/forums/forum.php
index a3cef96b..077fefb5 100644
--- a/sections/forums/forum.php
+++ b/sections/forums/forum.php
@@ -85,7 +85,7 @@
if (check_forumperm($ForumID, 'Write') && check_forumperm($ForumID, 'Create')) { ?>
New thread
} ?>
- Search this forum
+ Search this forum
Search this forum:
diff --git a/sections/forums/newthread.php b/sections/forums/newthread.php
index 796da98a..c724b624 100644
--- a/sections/forums/newthread.php
+++ b/sections/forums/newthread.php
@@ -35,7 +35,7 @@
if (check_perms('forums_polls_create')) { ?>
-
+
@@ -135,7 +135,7 @@ function RemoveAnswerField() {
Poll Settings
- View
+ View
|
diff --git a/sections/forums/search.php b/sections/forums/search.php
index b07a5706..9c24ba55 100644
--- a/sections/forums/search.php
+++ b/sections/forums/search.php
@@ -311,7 +311,7 @@
=Format::cut_string($Title, 80); ?>
}
if ($Type == 'body') { ?>
- (show)
+ (show)
} ?>
diff --git a/sections/forums/thread.php b/sections/forums/thread.php
index d8c5d8da..02c483a5 100644
--- a/sections/forums/thread.php
+++ b/sections/forums/thread.php
@@ -176,7 +176,7 @@
@@ -264,7 +264,7 @@
?>
- Poll if ($Closed) { echo ' [Closed]'; } ?> if ($Featured && $Featured !== '0000-00-00 00:00:00') { echo ' [Featured]'; } ?> View
+ Poll if ($Closed) { echo ' [Closed]'; } ?> if ($Featured && $Featured !== '0000-00-00 00:00:00') { echo ' [Featured]'; } ?> View
=display_str($Question)?>
if ($UserResponse !== null || $Closed || $ThreadInfo['IsLocked'] || !check_forumperm($ForumID)) { ?>
diff --git a/sections/index/private.php b/sections/index/private.php
index 793a8998..eb72e2ae 100644
--- a/sections/index/private.php
+++ b/sections/index/private.php
@@ -408,7 +408,7 @@
Latest Vanity House additions
- Show
+ Show
@@ -455,7 +455,7 @@
if (check_perms('admin_manage_news')) { ?>
- Edit
} ?>
- Hide
+ Hide
=$Text->full_format($Body)?>
diff --git a/sections/login/disabled.php b/sections/login/disabled.php
index 96486ca9..d5fe7405 100644
--- a/sections/login/disabled.php
+++ b/sections/login/disabled.php
@@ -22,29 +22,14 @@ function toggle_visibility(id) {
}
-
-
- - All staff decisions must be respected. If you take issue with a decision, you must do so privately with the staff member who issued the decision or with an administrator of the site. Complaining about staff decisions in public or otherwise disrespecting staff members will not be taken lightly.
- - Access to this web site is a privilege, not a right, and it can be taken away from you for any reason.
- - One account per person per lifetime. Anyone creating additional accounts will be banned.
- - Avatars must not exceed 256 kB or be vertically longer than 400 pixels. Avatars must be safe for work, be entirely unoffensive, and cannot contain any nudity or religious imagery. Use common sense.
-A - Do not post our .torrent files on other sites. Every .torrent file has your personal passkey embedded in it. The tracker will automatically disable your account if you share your torrent files with others. You will not get your account back. This doesn't prohibit you from sharing the content on other sites, but it does prohibit you from sharing the .torrent file.
- - Any torrent you are seeding to this tracker must only have our tracker's URL in it. Adding another tracker's URL will cause incorrect data to be sent to our tracker and will lead to you getting disabled for cheating. Similarly, your client must have DHT and PEX (peer exchange) disabled for all What.CD torrents.
- - This is a torrent site which promotes sharing amongst the community. If you are not willing to give back to the community what you take from it, this site is not for you. In other words, we expect you to have an acceptable share
- - Do not browse the site using proxies or TOR. The site will automatically alert us. This includes VPNs with dynamic IP addresses.
- - Asking for invites to any site is not allowed anywhere on What.CD or our IRC network. Invites may be offered in the Invites forum, and nowhere else.
- - Trading, selling, sharing, or giving away your account is prohibited. If you no longer want your account, send a staff PM requesting that it be disabled.
- - You're completely responsible for the people you invite. If your invitees are caught cheating or trading/selling invites, not only will they be banned, so will you. Be careful who you invite. Invites are a precious commodity.
- - Be careful when sharing an IP address or a computer with a friend if they have (or have had) an account. From then on your accounts will be inherently linked and if one of you violates the rules, both accounts will be disabled along with any other accounts linked by IP. This rule applies to logging into the site.
- - Attempting to find or exploit a bug in the site code is the worst possible offense you can commit. We have automatic systems in place for monitoring these activities, and committing them will result in the banning of you, your inviter, and your inviter's entire invite tree.
- - We're a community. Working together is what makes this place what it is. There are well over a thousand new torrents uploaded every day and sadly the staff aren't psychic. If you come across something that violates a rule, report it and help us better organize the site for you.
- - We respect the wishes of other sites here, as we wish for them to do the same. Please refrain from posting links to or full names for sites that do not want to be mentioned.
-
+
+ Rules::display_golden_rules(); ?>
+
If you do not have access to an IRC client, you can use the WebIRC interface provided below.
-Please use your What.CD username.
+Please use your =SITE_NAME?> username.
| | |