Empty commit

This commit is contained in:
Git 2012-01-30 08:00:24 +00:00
parent 1ebb99d66a
commit 4942f451a3
4 changed files with 64 additions and 36 deletions

View File

@ -518,14 +518,14 @@
$JsonGroup = $Data; $JsonGroup = $Data;
} }
$JsonGroups[] = array( $JsonGroups[] = array(
'groupId' => $GroupID, 'groupId' => (int) $GroupID,
'groupName' => $GroupName, 'groupName' => $GroupName,
'tags' => $TagList, 'tags' => $TagList,
'torrentId' => $TorrentID, 'torrentId' => (int) $TorrentID,
'categoryId' => $Categories[$CategoryID-1], 'categoryId' => (int) $Categories[$CategoryID-1],
'totalSnatched' => $TotalSnatched, 'totalSnatched' => (int) $TotalSnatched,
'totalSeeders' => $TotalSeeders, 'totalSeeders' => (int) $TotalSeeders,
'totalLeechers' => $TotalLeechers, 'totalLeechers' => (int) $TotalLeechers,
'group' => $JsonGroup 'group' => $JsonGroup
); );
} }

View File

@ -47,6 +47,8 @@
case 'top10': case 'top10':
require(SERVER_ROOT.'/sections/ajax/top10/index.php'); require(SERVER_ROOT.'/sections/ajax/top10/index.php');
break; break;
case 'browse':
require(SERVER_ROOT.'/sections/ajax/browse.php');
case 'usersearch': case 'usersearch':
require(SERVER_ROOT.'/sections/ajax/usersearch.php'); require(SERVER_ROOT.'/sections/ajax/usersearch.php');
break; break;
@ -78,6 +80,9 @@
case 'notifications': case 'notifications':
require(SERVER_ROOT.'/sections/ajax/notifications.php'); require(SERVER_ROOT.'/sections/ajax/notifications.php');
break; break;
case 'request':
require(SERVER_ROOT.'/sections/ajax/request.php');
break;
default: default:
// If they're screwing around with the query string // If they're screwing around with the query string
print json_encode(array('status' => 'failure')); print json_encode(array('status' => 'failure'));

View File

@ -1,6 +1,10 @@
<?php <?php
authorize();
authorize(true);
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
$Text = new TEXT;
require(SERVER_ROOT.'/sections/requests/functions.php'); require(SERVER_ROOT.'/sections/requests/functions.php');
@ -8,7 +12,6 @@
$UserID = $_GET['id']; $UserID = $_GET['id'];
if($UserID == $LoggedUser['ID']) { if($UserID == $LoggedUser['ID']) {
$OwnProfile = true; $OwnProfile = true;
} else { } else {
@ -99,7 +102,7 @@ function check_paranoia_here($Setting) {
$DB->query("SELECT COUNT(ID) FROM torrents WHERE UserID='$UserID'"); $DB->query("SELECT COUNT(ID) FROM torrents WHERE UserID='$UserID'");
list($Uploads) = $DB->next_record(); list($Uploads) = $DB->next_record();
} else { } else {
$Uploads = 0; $Uploads = null;
} }
if (check_paranoia_here('artistsadded')) { if (check_paranoia_here('artistsadded')) {
@ -115,22 +118,34 @@ function check_paranoia_here($Setting) {
if (check_paranoia_here('uploaded')) { if (check_paranoia_here('uploaded')) {
$UploadedRank = $Rank->get_rank('uploaded', $Uploaded); $UploadedRank = $Rank->get_rank('uploaded', $Uploaded);
} else {
$UploadedRank = null;
} }
if (check_paranoia_here('downloaded')) { if (check_paranoia_here('downloaded')) {
$DownloadedRank = $Rank->get_rank('downloaded', $Downloaded); $DownloadedRank = $Rank->get_rank('downloaded', $Downloaded);
} else {
$DownloadedRank = null;
} }
if (check_paranoia_here('uploads+')) { if (check_paranoia_here('uploads+')) {
$UploadsRank = $Rank->get_rank('uploads', $Uploads); $UploadsRank = $Rank->get_rank('uploads', $Uploads);
} else {
$UploadsRank = null;
} }
if (check_paranoia_here('requestsfilled_count')) { if (check_paranoia_here('requestsfilled_count')) {
$RequestRank = $Rank->get_rank('requests', $RequestsFilled); $RequestRank = $Rank->get_rank('requests', $RequestsFilled);
} else {
$RequestRank = null;
} }
$PostRank = $Rank->get_rank('posts', $ForumPosts); $PostRank = $Rank->get_rank('posts', $ForumPosts);
if (check_paranoia_here('requestsvoted_bounty')) { if (check_paranoia_here('requestsvoted_bounty')) {
$BountyRank = $Rank->get_rank('bounty', $TotalSpent); $BountyRank = $Rank->get_rank('bounty', $TotalSpent);
} else {
$BountyRank = null;
} }
if (check_paranoia_here('artistsadded')) { if (check_paranoia_here('artistsadded')) {
$ArtistsRank = $Rank->get_rank('artists', $ArtistsAdded); $ArtistsRank = $Rank->get_rank('artists', $ArtistsAdded);
} else {
$ArtistsRank = null;
} }
if($Downloaded == 0) { if($Downloaded == 0) {
@ -140,13 +155,17 @@ function check_paranoia_here($Setting) {
} else { } else {
$Ratio = round($Uploaded/$Downloaded, 2); $Ratio = round($Uploaded/$Downloaded, 2);
} }
if (!check_paranoia_here(array('uploaded', 'downloaded', 'uploads+', 'requestsfilled_count', 'requestsvoted_bounty', 'artistsadded'))) { if (check_paranoia_here(array('uploaded', 'downloaded', 'uploads+', 'requestsfilled_count', 'requestsvoted_bounty', 'artistsadded'))) {
$OverallRank = $Rank->overall_score($UploadedRank, $DownloadedRank, $UploadsRank, $RequestRank, $PostRank, $BountyRank, $ArtistsRank, $Ratio); $OverallRank = floor($Rank->overall_score($UploadedRank, $DownloadedRank, $UploadsRank, $RequestRank, $PostRank, $BountyRank, $ArtistsRank, $Ratio));
} else {
$OverallRank = null;
} }
// Community section // Community section
if(check_paranoia_here(array('snatched', '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'"); $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(); list($Snatched, $UniqueSnatched) = $DB->next_record();
}
if (check_paranoia_here(array('torrentcomments', 'torrentcomments+'))) { if (check_paranoia_here(array('torrentcomments', 'torrentcomments+'))) {
$DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE AuthorID='$UserID'"); $DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE AuthorID='$UserID'");
@ -189,21 +208,21 @@ function check_paranoia_here($Setting) {
} }
if (!$OwnProfile) { if (!$OwnProfile) {
unset($torrent_pass); $torrent_pass = "";
} }
// Run through some paranoia stuff to decide what we can send out. // Run through some paranoia stuff to decide what we can send out.
if (!check_paranoia_here('lastseen')) { if (!check_paranoia_here('lastseen')) {
unset($LastAccess); $LastAccess = "";
} }
if (!check_paranoia_here('uploaded')) { if (!check_paranoia_here('uploaded')) {
unset($Uploaded); $Uploaded = null;
} }
if (!check_paranoia_here('downloaded')) { if (!check_paranoia_here('downloaded')) {
unset($Downloaded); $Downloaded = null;
} }
if (isset($RequiredRatio) && !check_paranoia_here('requiredratio')) { if (isset($RequiredRatio) && !check_paranoia_here('requiredratio')) {
unset($RequiredRatio); $RequiredRatio = null;
} }
if($ParanoiaLevel == 0) { if($ParanoiaLevel == 0) {
$ParanoiaLevelText = 'Off'; $ParanoiaLevelText = 'Off';
@ -224,13 +243,14 @@ function check_paranoia_here($Setting) {
'username' => $Username, 'username' => $Username,
'avatar' => $Avatar, 'avatar' => $Avatar,
'isFriend' => $Friend, 'isFriend' => $Friend,
'profileText' => $Text->full_format($Info),
'stats' => array( 'stats' => array(
'joinedDate' => $JoinDate, 'joinedDate' => $JoinDate,
'lastAccess' => $LastAccess, 'lastAccess' => $LastAccess,
'uploaded' => $Uploaded, 'uploaded' => $Uploaded == null ? null : (int) $Uploaded,
'downloaded' => $Downloaded, 'downloaded' => $Downloaded == null ? null: (int) $Downloaded,
'ratio' => $Ratio, 'ratio' => $Ratio,
'requiredRatio' => $RequiredRatio 'requiredRatio' => $RequiredRatio == null ? null : (float) $RequiredRatio
), ),
'ranks' => array( 'ranks' => array(
'uploaded' => $UploadedRank, 'uploaded' => $UploadedRank,
@ -240,32 +260,34 @@ function check_paranoia_here($Setting) {
'bounty' => $BountyRank, 'bounty' => $BountyRank,
'posts' => $PostRank, 'posts' => $PostRank,
'artists' => $ArtistsRank, 'artists' => $ArtistsRank,
'overall' => $OverallRank 'overall' => $OverallRank == null ? 0 : $OverallRank
), ),
'personal' => array( 'personal' => array(
'class' => $ClassLevels[$Class]['Name'], 'class' => $ClassLevels[$Class]['Name'],
'paranoia' => $ParanoiaLevel, 'paranoia' => $ParanoiaLevel,
'paranoiaText' => $ParanoiaLevelText, 'paranoiaText' => $ParanoiaLevelText,
'donor' => $Donor, 'donor' => $Donor == 1,
'warned' => ($Warned!='0000-00-00 00:00:00'), 'warned' => ($Warned != '0000-00-00 00:00:00'),
'enabled' => ($Enabled == '1' || $Enabled == '0' || !$Enabled), 'enabled' => ($Enabled == '1' || $Enabled == '0' || !$Enabled),
'passkey' => $torrent_pass 'passkey' => $torrent_pass
), ),
'community' => array( 'community' => array(
'posts' => $ForumPosts, 'posts' => (int) $ForumPosts,
'torrentComments' => $NumComments, 'torrentComments' => (int)$NumComments,
'collagesStarted' => $NumCollages, 'collagesStarted' => $NumCollages == null ? null : (int) $NumCollages,
'collagesContrib' => $NumCollageContribs, 'collagesContrib' => $NumCollageContribs == null ? null : (int) $NumCollageContribs,
'requestsFilled' => $RequestsFilled, 'requestsFilled' => $RequestsFilled == null ? null : (int) $RequestsFilled,
'requestsVoted' => $RequestsVoted, 'requestsVoted' => $RequestsVoted == null ? null : (int) $RequestsVoted,
'uploaded' => $Uploads, 'perfectFlacs' => $PerfectFLACs == null ? null : (int) $PerfectFlacs,
'groups' => $UniqueGroups, 'uploaded' => $Uploads == null ? null : (int) $Uploads,
'seeding' => $Seeding, 'groups' => $UniqueGroups == null ? null : (int) $UniqueGroups,
'leeching' => $Leeching, 'seeding' => $Seeding == null ? null : (int) $Seeding,
'snatched' => $Snatched, 'leeching' => $Leeching == null ? null : (int) $Leeching,
'invited' => $Invited 'snatched' => $Snatched == null ? null : (int) $Snatched,
'invited' => $Invited == null ? null : (int) $Invited
) )
) )
) )
); // <- He's sad. ); // <- He's sad.
?> ?>

View File

@ -50,6 +50,7 @@
} else { } else {
// Assign to user // Assign to user
$DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', AssignedToUser=$NewLevel WHERE ID=$ConvID"); $DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', AssignedToUser=$NewLevel WHERE ID=$ConvID");
} }
echo '1'; echo '1';