Gazelle/sections/user/community_stats.php

247 lines
12 KiB
PHP
Raw Normal View History

2012-10-04 08:00:22 +00:00
<?
2013-06-09 08:01:21 +00:00
$DB->query("
2013-08-28 23:08:41 +00:00
SELECT Page, COUNT(1)
FROM comments
WHERE AuthorID = $UserID
GROUP BY Page");
$Comments = $DB->to_array('Page');
$NumComments = $Comments['torrents'][1];
$NumArtistComments = $Comments['artist'][1];
$NumCollageComments = $Comments['collages'][1];
$NumRequestComments = $Comments['requests'][1];
2013-03-10 08:00:41 +00:00
2013-06-09 08:01:21 +00:00
$DB->query("
SELECT COUNT(ID)
FROM collages
WHERE Deleted = '0'
AND UserID = '$UserID'");
2012-10-04 08:00:22 +00:00
list($NumCollages) = $DB->next_record();
2013-05-16 16:15:57 +00:00
$DB->query("
SELECT COUNT(DISTINCT CollageID)
FROM collages_torrents AS ct
JOIN collages ON CollageID = ID
2013-06-09 08:01:21 +00:00
WHERE Deleted = '0'
AND ct.UserID = '$UserID'");
2012-10-04 08:00:22 +00:00
list($NumCollageContribs) = $DB->next_record();
2013-06-09 08:01:21 +00:00
$DB->query("
SELECT COUNT(DISTINCT GroupID)
FROM torrents
WHERE UserID = '$UserID'");
2012-10-04 08:00:22 +00:00
list($UniqueGroups) = $DB->next_record();
2013-05-16 16:15:57 +00:00
$DB->query("
SELECT COUNT(ID)
FROM torrents
WHERE ((LogScore = 100 AND Format = 'FLAC')
OR (Media = 'Vinyl' AND Format = 'FLAC')
OR (Media = 'WEB' AND Format = 'FLAC')
OR (Media = 'DVD' AND Format = 'FLAC')
OR (Media = 'Soundboard' AND Format = 'FLAC')
OR (Media = 'Cassette' AND Format = 'FLAC')
OR (Media = 'SACD' AND Format = 'FLAC')
OR (Media = 'Blu-ray' AND Format = 'FLAC')
OR (Media = 'DAT' AND Format = 'FLAC'))
AND UserID = '$UserID'");
2012-10-04 08:00:22 +00:00
list($PerfectFLACs) = $DB->next_record();
?>
<div class="box box_info box_userinfo_community">
<div class="head colhead_dark">Community</div>
<ul class="stats nobullet">
2013-10-26 08:00:58 +00:00
<li id="comm_posts">Forum posts: <?=number_format($ForumPosts)?> <a href="userhistory.php?action=posts&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_paranoia_here('torrentcomments+')) { ?>
2013-08-22 08:00:54 +00:00
<li id="comm_torrcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Torrent comments: <?=number_format($NumComments)?>
2013-04-17 08:00:58 +00:00
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
2013-10-26 08:00:58 +00:00
<a href="comments.php?id=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2012-10-04 08:00:22 +00:00
</li>
2013-08-22 08:00:54 +00:00
<li id="comm_artcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Artist comments: <?=number_format($NumArtistComments)?>
2013-04-17 08:00:58 +00:00
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
2013-10-26 08:00:58 +00:00
<a href="comments.php?id=<?=$UserID?>&amp;action=artist" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-06-07 08:00:54 +00:00
<? } ?>
</li>
2013-08-22 08:00:54 +00:00
<li id="comm_collcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collage comments: <?=number_format($NumCollageComments)?>
2013-06-07 08:00:54 +00:00
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
2013-10-26 08:00:58 +00:00
<a href="comments.php?id=<?=$UserID?>&amp;action=collages" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2012-10-29 08:00:20 +00:00
</li>
2013-08-22 08:00:54 +00:00
<li id="comm_reqcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Request comments: <?=number_format($NumRequestComments)?>
2013-04-17 08:00:58 +00:00
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
2013-10-26 08:00:58 +00:00
<a href="comments.php?id=<?=$UserID?>&amp;action=requests" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2013-03-10 08:00:41 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-04-17 08:00:58 +00:00
if (($Override = check_paranoia_here('collages+'))) { ?>
2013-08-22 08:00:54 +00:00
<li id="comm_collstart"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages started: <?=number_format($NumCollages)?>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_paranoia_here('collages')) { ?>
2013-10-26 08:00:58 +00:00
<a href="collages.php?userid=<?=$UserID?>" class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2012-10-04 08:00:22 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-04-17 08:00:58 +00:00
if (($Override = check_paranoia_here('collagecontribs+'))) { ?>
2013-10-19 08:01:09 +00:00
<li id="comm_collcontrib"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages contributed to: <? echo number_format($NumCollageContribs); ?>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_paranoia_here('collagecontribs')) { ?>
2013-10-26 08:00:58 +00:00
<a href="collages.php?userid=<?=$UserID?>&amp;contrib=1" class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2012-10-04 08:00:22 +00:00
</li>
2013-06-17 08:01:02 +00:00
<?
}
2013-04-17 08:00:58 +00:00
2013-06-17 08:01:02 +00:00
//Let's see if we can view requests because of reasons
$ViewAll = check_paranoia_here('requestsfilled_list');
$ViewCount = check_paranoia_here('requestsfilled_count');
$ViewBounty = check_paranoia_here('requestsfilled_bounty');
2012-10-04 08:00:22 +00:00
2013-02-07 08:00:47 +00:00
if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
2012-10-11 08:00:15 +00:00
<li>Requests filled: <?=number_format($RequestsFilled)?></li>
2013-03-30 08:00:31 +00:00
<? } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
2013-03-27 08:01:00 +00:00
<li>Requests filled: <?=Format::get_size($TotalBounty)?> collected</li>
2013-03-30 08:00:31 +00:00
<? } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
2012-10-11 08:00:15 +00:00
<li>Requests filled: <?=number_format($RequestsFilled)?> for <?=Format::get_size($TotalBounty)?></li>
2013-03-30 08:00:31 +00:00
<? } elseif ($ViewAll) { ?>
2012-10-04 08:00:22 +00:00
<li>
2013-06-17 08:01:02 +00:00
<span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests filled: <?=number_format($RequestsFilled)?></span>
<span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($TotalBounty) ?></span>
2013-10-26 08:00:58 +00:00
<a href="requests.php?type=filled&amp;userid=<?=$UserID?>" class="brackets<?=(($ViewAll === 2) ? ' paranoia_override' : '')?>">View</a>
2012-10-04 08:00:22 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-04-17 08:00:58 +00:00
2013-06-17 08:01:02 +00:00
//Let's see if we can view requests because of reasons
$ViewAll = check_paranoia_here('requestsvoted_list');
$ViewCount = check_paranoia_here('requestsvoted_count');
$ViewBounty = check_paranoia_here('requestsvoted_bounty');
2012-10-04 08:00:22 +00:00
2013-02-07 08:00:47 +00:00
if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
2013-04-22 08:00:58 +00:00
<li>Requests created: <?=number_format($RequestsCreated)?></li>
2012-10-11 08:00:15 +00:00
<li>Requests voted: <?=number_format($RequestsVoted)?></li>
2013-03-30 08:00:31 +00:00
<? } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
2013-04-22 08:00:58 +00:00
<li>Requests created: <?=Format::get_size($RequestsCreatedSpent)?> spent</li>
2012-10-11 08:00:15 +00:00
<li>Requests voted: <?=Format::get_size($TotalSpent)?> spent</li>
2013-03-30 08:00:31 +00:00
<? } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
2013-04-22 08:00:58 +00:00
<li>Requests created: <?=number_format($RequestsCreated)?> for <?=Format::get_size($RequestsCreatedSpent)?></li>
2012-10-11 08:00:15 +00:00
<li>Requests voted: <?=number_format($RequestsVoted)?> for <?=Format::get_size($TotalSpent)?></li>
2013-03-30 08:00:31 +00:00
<? } elseif ($ViewAll) { ?>
2013-04-22 08:00:58 +00:00
<li>
2013-06-17 08:01:02 +00:00
<span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests created: <?=number_format($RequestsCreated)?></span>
<span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($RequestsCreatedSpent)?></span>
2013-10-26 08:00:58 +00:00
<a href="requests.php?type=created&amp;userid=<?=$UserID?>" class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
2013-04-22 08:00:58 +00:00
</li>
2012-10-04 08:00:22 +00:00
<li>
2013-06-17 08:01:02 +00:00
<span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests voted: <?=number_format($RequestsVoted)?></span>
<span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($TotalSpent)?></span>
2013-10-26 08:00:58 +00:00
<a href="requests.php?type=voted&amp;userid=<?=$UserID?>" class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
2012-10-04 08:00:22 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-06-17 08:01:02 +00:00
if ($Override = check_paranoia_here('uploads+')) { ?>
2013-08-22 08:00:54 +00:00
<li id="comm_upload"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Uploaded: <?=number_format($Uploads)?>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_paranoia_here('uploads')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? if (check_perms('zip_downloader')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?action=redownload&amp;type=uploads&amp;userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">Download</a>
2013-08-22 08:00:54 +00:00
<?
}
2013-03-30 08:00:31 +00:00
}
?>
2012-10-04 08:00:22 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-06-17 08:01:02 +00:00
if ($Override = check_paranoia_here('uniquegroups+')) { ?>
2013-08-22 08:00:54 +00:00
<li id="comm_uniquegroup"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Unique groups: <?=number_format($UniqueGroups)?>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_paranoia_here('uniquegroups')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>&amp;filter=uniquegroup" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2012-10-04 08:00:22 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-06-17 08:01:02 +00:00
if ($Override = check_paranoia_here('perfectflacs+')) { ?>
2013-08-22 08:00:54 +00:00
<li id="comm_perfectflac"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>"Perfect" FLACs: <?=number_format($PerfectFLACs)?>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_paranoia_here('perfectflacs')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>&amp;filter=perfectflac" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2013-02-09 08:01:01 +00:00
</li>
2013-06-17 08:01:02 +00:00
<?
}
if ($Override = check_paranoia_here('seeding+')) {
?>
2013-08-22 08:00:54 +00:00
<li id="comm_seeding"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Seeding:
2013-06-19 08:01:09 +00:00
<span class="user_commstats" id="user_commstats_seeding"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
2013-10-11 08:01:04 +00:00
<? if ($Override = check_paranoia_here('snatched+')) { ?>
<span<?=($Override === 2 ? ' class="paranoia_override"' : '')?> id="user_commstats_seedingperc"></span>
2013-06-17 08:01:02 +00:00
<?
2013-10-11 08:01:04 +00:00
}
if ($Override = check_paranoia_here('seeding')) {
2013-06-17 08:01:02 +00:00
?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?type=seeding&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-06-17 08:01:02 +00:00
<? if (check_perms('zip_downloader')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?action=redownload&amp;type=seeding&amp;userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets">Download</a>
2013-06-17 08:01:02 +00:00
<?
}
}
2013-03-30 08:00:31 +00:00
?>
2012-10-04 08:00:22 +00:00
</li>
2013-06-17 08:01:02 +00:00
<?
}
if ($Override = check_paranoia_here('leeching+')) {
2013-03-30 08:00:31 +00:00
?>
2013-08-22 08:00:54 +00:00
<li id="comm_leeching"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Leeching:
2013-06-19 08:01:09 +00:00
<span class="user_commstats" id="user_commstats_leeching"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_paranoia_here('leeching')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?type=leeching&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-06-17 08:01:02 +00:00
<?
}
if ($DisableLeech == 0 && check_perms('users_view_ips')) {
?>
<strong>(Disabled)</strong>
<? } ?>
2012-10-04 08:00:22 +00:00
</li>
2013-06-17 08:01:02 +00:00
<?
}
if ($Override = check_paranoia_here('snatched+')) { ?>
2013-08-22 08:00:54 +00:00
<li id="comm_snatched"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Snatched:
2013-06-19 08:01:09 +00:00
<span class="user_commstats" id="user_commstats_snatched"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
2013-06-17 08:01:02 +00:00
<? if ($Override = check_perms('site_view_torrent_snatchlist', $Class)) { ?>
2013-06-19 08:01:09 +00:00
<span id="user_commstats_usnatched"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>></span>
2013-08-22 08:00:54 +00:00
<?
}
2013-04-17 08:00:58 +00:00
}
2013-06-17 08:01:02 +00:00
if ($Override = check_paranoia_here('snatched')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?type=snatched&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
2013-03-30 08:00:31 +00:00
<? if (check_perms('zip_downloader')) { ?>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?action=redownload&amp;type=snatches&amp;userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected, be sure to check the size of all torrents before redownloading.');" class="brackets">Download</a>
2013-03-30 08:00:31 +00:00
<? } ?>
2012-10-04 08:00:22 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-06-17 08:01:02 +00:00
if (check_perms('site_view_torrent_snatchlist', $Class)) {
2012-10-04 08:00:22 +00:00
?>
2013-08-22 08:00:54 +00:00
<li id="comm_downloaded">Downloaded:
2013-06-19 08:01:09 +00:00
<span class="user_commstats" id="user_commstats_downloaded"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
2013-06-17 08:01:02 +00:00
<span id="user_commstats_udownloaded"></span>
2013-10-26 08:00:58 +00:00
<a href="torrents.php?type=downloaded&amp;userid=<?=$UserID?>" class="brackets">View</a>
2013-02-09 08:01:01 +00:00
</li>
2013-08-22 08:00:54 +00:00
<?
}
2013-06-17 08:01:02 +00:00
if ($Override = check_paranoia_here('invitedcount')) {
2013-06-09 08:01:21 +00:00
$DB->query("
SELECT COUNT(UserID)
FROM users_info
WHERE Inviter = '$UserID'");
2012-10-04 08:00:22 +00:00
list($Invited) = $DB->next_record();
?>
2013-08-22 08:00:54 +00:00
<li id="comm_invited">Invited: <?=number_format($Invited)?></li>
2012-10-04 08:00:22 +00:00
<?
2013-03-30 08:00:31 +00:00
}
?>
2012-10-04 08:00:22 +00:00
</ul>
2013-06-17 08:01:02 +00:00
<? if ($LoggedUser['AutoloadCommStats']) { ?>
<script type="text/javascript">
commStats(<?=$UserID?>);
</script>
<? } ?>
2012-10-04 08:00:22 +00:00
</div>