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

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