Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

community_stats.php 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?
  2. $DB->query("
  3. SELECT Page, COUNT(1)
  4. FROM comments
  5. WHERE AuthorID = $UserID
  6. GROUP BY Page");
  7. $Comments = $DB->to_array('Page');
  8. $NumComments = isset($Comments['torrents']) ? $Comments['torrents'][1]:0;
  9. $NumArtistComments = isset($Comments['artist']) ? $Comments['artist'][1]:0;
  10. $NumCollageComments = isset($Comments['collages']) ? $Comments['collages'][1]:0;
  11. $NumRequestComments = isset($Comments['requests']) ? $Comments['requests'][1]:0;
  12. $DB->query("
  13. SELECT COUNT(ID)
  14. FROM collages
  15. WHERE Deleted = '0'
  16. AND UserID = '$UserID'");
  17. list($NumCollages) = $DB->next_record();
  18. $DB->query("
  19. SELECT COUNT(DISTINCT CollageID)
  20. FROM collages_torrents AS ct
  21. JOIN collages ON CollageID = ID
  22. WHERE Deleted = '0'
  23. AND ct.UserID = '$UserID'");
  24. list($NumCollageContribs) = $DB->next_record();
  25. $DB->query("
  26. SELECT COUNT(DISTINCT GroupID)
  27. FROM torrents
  28. WHERE UserID = '$UserID'");
  29. list($UniqueGroups) = $DB->next_record();
  30. ?>
  31. <div class="box box_info box_userinfo_community">
  32. <div class="head colhead_dark">Community</div>
  33. <ul class="stats nobullet">
  34. <li id="comm_posts">Forum posts: <?=number_format($ForumPosts)?> <a href="userhistory.php?action=posts&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
  35. <? if ($Override = check_paranoia_here('torrentcomments+')) { ?>
  36. <li id="comm_torrcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Torrent comments: <?=number_format($NumComments)?>
  37. <? if ($Override = check_paranoia_here('torrentcomments')) { ?>
  38. <a href="comments.php?id=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  39. <? } ?>
  40. </li>
  41. <li id="comm_artcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Artist comments: <?=number_format($NumArtistComments)?>
  42. <? if ($Override = check_paranoia_here('torrentcomments')) { ?>
  43. <a href="comments.php?id=<?=$UserID?>&amp;action=artist" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  44. <? } ?>
  45. </li>
  46. <li id="comm_collcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collage comments: <?=number_format($NumCollageComments)?>
  47. <? if ($Override = check_paranoia_here('torrentcomments')) { ?>
  48. <a href="comments.php?id=<?=$UserID?>&amp;action=collages" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  49. <? } ?>
  50. </li>
  51. <li id="comm_reqcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Request comments: <?=number_format($NumRequestComments)?>
  52. <? if ($Override = check_paranoia_here('torrentcomments')) { ?>
  53. <a href="comments.php?id=<?=$UserID?>&amp;action=requests" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  54. <? } ?>
  55. </li>
  56. <?
  57. }
  58. if (($Override = check_paranoia_here('collages+'))) { ?>
  59. <li id="comm_collstart"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages started: <?=number_format($NumCollages)?>
  60. <? if ($Override = check_paranoia_here('collages')) { ?>
  61. <a href="collages.php?userid=<?=$UserID?>" class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
  62. <? } ?>
  63. </li>
  64. <?
  65. }
  66. if (($Override = check_paranoia_here('collagecontribs+'))) { ?>
  67. <li id="comm_collcontrib"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages contributed to: <? echo number_format($NumCollageContribs); ?>
  68. <? if ($Override = check_paranoia_here('collagecontribs')) { ?>
  69. <a href="collages.php?userid=<?=$UserID?>&amp;contrib=1" class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
  70. <? } ?>
  71. </li>
  72. <?
  73. }
  74. //Let's see if we can view requests because of reasons
  75. $ViewAll = check_paranoia_here('requestsfilled_list');
  76. $ViewCount = check_paranoia_here('requestsfilled_count');
  77. $ViewBounty = check_paranoia_here('requestsfilled_bounty');
  78. if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
  79. <li>Requests filled: <?=number_format($RequestsFilled)?></li>
  80. <? } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
  81. <li>Requests filled: <?=Format::get_size($TotalBounty)?> collected</li>
  82. <? } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
  83. <li>Requests filled: <?=number_format($RequestsFilled)?> for <?=Format::get_size($TotalBounty)?></li>
  84. <? } elseif ($ViewAll) { ?>
  85. <li>
  86. <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests filled: <?=number_format($RequestsFilled)?></span>
  87. <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($TotalBounty) ?></span>
  88. <a href="requests.php?type=filled&amp;userid=<?=$UserID?>" class="brackets<?=(($ViewAll === 2) ? ' paranoia_override' : '')?>">View</a>
  89. </li>
  90. <?
  91. }
  92. //Let's see if we can view requests because of reasons
  93. $ViewAll = check_paranoia_here('requestsvoted_list');
  94. $ViewCount = check_paranoia_here('requestsvoted_count');
  95. $ViewBounty = check_paranoia_here('requestsvoted_bounty');
  96. if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
  97. <li>Requests created: <?=number_format($RequestsCreated)?></li>
  98. <li>Requests voted: <?=number_format($RequestsVoted)?></li>
  99. <? } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
  100. <li>Requests created: <?=Format::get_size($RequestsCreatedSpent)?> spent</li>
  101. <li>Requests voted: <?=Format::get_size($TotalSpent)?> spent</li>
  102. <? } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
  103. <li>Requests created: <?=number_format($RequestsCreated)?> for <?=Format::get_size($RequestsCreatedSpent)?></li>
  104. <li>Requests voted: <?=number_format($RequestsVoted)?> for <?=Format::get_size($TotalSpent)?></li>
  105. <? } elseif ($ViewAll) { ?>
  106. <li>
  107. <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests created: <?=number_format($RequestsCreated)?></span>
  108. <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($RequestsCreatedSpent)?></span>
  109. <a href="requests.php?type=created&amp;userid=<?=$UserID?>" class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
  110. </li>
  111. <li>
  112. <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests voted: <?=number_format($RequestsVoted)?></span>
  113. <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($TotalSpent)?></span>
  114. <a href="requests.php?type=voted&amp;userid=<?=$UserID?>" class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
  115. </li>
  116. <?
  117. }
  118. if ($Override = check_paranoia_here('screenshotcount')) {
  119. $DB->query("
  120. SELECT COUNT(*)
  121. FROM torrents_screenshots
  122. WHERE UserID = '$UserID'");
  123. list($Screenshots) = $DB->next_record();
  124. ?>
  125. <li id="comm_screenshots">Screenshots added: <?=number_format($Screenshots)?></li>
  126. <?
  127. }
  128. if ($Override = check_paranoia_here('uploads+')) { ?>
  129. <li id="comm_upload"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Uploaded: <?=number_format($Uploads)?>
  130. <? if ($Override = check_paranoia_here('uploads')) { ?>
  131. <a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  132. <? if (check_perms('zip_downloader')) { ?>
  133. <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>
  134. <?
  135. }
  136. }
  137. ?>
  138. </li>
  139. <?
  140. }
  141. if ($Override = check_paranoia_here('uniquegroups+')) { ?>
  142. <li id="comm_uniquegroup"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Unique groups: <?=number_format($UniqueGroups)?>
  143. <? if ($Override = check_paranoia_here('uniquegroups')) { ?>
  144. <a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>&amp;filter=uniquegroup" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  145. <? } ?>
  146. </li>
  147. <?
  148. }
  149. if ($Override = check_paranoia_here('seeding+')) {
  150. ?>
  151. <li id="comm_seeding"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Seeding:
  152. <span class="user_commstats" id="user_commstats_seeding"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
  153. <? if ($Override = check_paranoia_here('snatched+')) { ?>
  154. <span<?=($Override === 2 ? ' class="paranoia_override"' : '')?> id="user_commstats_seedingperc"></span>
  155. <?
  156. }
  157. if ($Override = check_paranoia_here('seeding')) {
  158. ?>
  159. <a href="torrents.php?type=seeding&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  160. <? if (check_perms('zip_downloader')) { ?>
  161. <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>
  162. <?
  163. }
  164. }
  165. ?>
  166. </li>
  167. <?
  168. }
  169. if ($Override = check_paranoia_here('leeching+')) {
  170. ?>
  171. <li id="comm_leeching"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Leeching:
  172. <span class="user_commstats" id="user_commstats_leeching"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
  173. <? if ($Override = check_paranoia_here('leeching')) { ?>
  174. <a href="torrents.php?type=leeching&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  175. <?
  176. }
  177. if ($DisableLeech == 0 && check_perms('users_view_ips')) {
  178. ?>
  179. <strong>(Disabled)</strong>
  180. <? } ?>
  181. </li>
  182. <?
  183. }
  184. if ($Override = check_paranoia_here('snatched+')) { ?>
  185. <li id="comm_snatched"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Snatched:
  186. <span class="user_commstats" id="user_commstats_snatched"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
  187. <? if ($Override = check_perms('site_view_torrent_snatchlist', $Class)) { ?>
  188. <span id="user_commstats_usnatched"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>></span>
  189. <?
  190. }
  191. }
  192. if ($Override = check_paranoia_here('snatched')) { ?>
  193. <a href="torrents.php?type=snatched&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
  194. <? if (check_perms('zip_downloader')) { ?>
  195. <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>
  196. <? } ?>
  197. </li>
  198. <?
  199. }
  200. if (check_perms('site_view_torrent_snatchlist', $Class)) {
  201. ?>
  202. <li id="comm_downloaded">Downloaded:
  203. <span class="user_commstats" id="user_commstats_downloaded"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
  204. <span id="user_commstats_udownloaded"></span>
  205. <a href="torrents.php?type=downloaded&amp;userid=<?=$UserID?>" class="brackets">View</a>
  206. </li>
  207. <?
  208. }
  209. if ($Override = check_paranoia_here('invitedcount')) {
  210. $DB->query("
  211. SELECT COUNT(UserID)
  212. FROM users_info
  213. WHERE Inviter = '$UserID'");
  214. list($Invited) = $DB->next_record();
  215. ?>
  216. <li id="comm_invited">Invited: <?=number_format($Invited)?></li>
  217. <?
  218. }
  219. ?>
  220. </ul>
  221. <? if ($LoggedUser['AutoloadCommStats']) { ?>
  222. <script type="text/javascript">
  223. commStats(<?=$UserID?>);
  224. </script>
  225. <? } ?>
  226. </div>