PageRenderTime 46ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/knark.php

https://github.com/delete66/sikevux-s-tracker
PHP | 331 lines | 277 code | 49 blank | 5 comment | 33 complexity | 2f58ddb0aa70e0f8201a2c8de5313f9a MD5 | raw file
Possible License(s): GPL-2.0
  1. <?
  2. require "include/bittorrent.php";
  3. dbconn();
  4. loggedinorreturn();
  5. stdhead("Staff");
  6. begin_main_frame();
  7. begin_frame("");
  8. ?>
  9. <?
  10. $act = $_GET["act"];
  11. if (!$act) {
  12. // Get current datetime
  13. $dt = gmtime() - 60;
  14. $dt = sqlesc(get_date_time($dt));
  15. // Search User Database for Moderators and above and display in alphabetical order
  16. $res = mysql_query("SELECT * FROM users WHERE class>=".UC_UPLOADER.
  17. " AND status='confirmed' ORDER BY username" ) or sqlerr();
  18. while ($arr = mysql_fetch_assoc($res))
  19. {
  20. $staff_table[$arr['class']]=$staff_table[$arr['class']].
  21. "<td class=embedded><a class=altlink href=userdetails.php?id=".$arr['id'].">".
  22. $arr['username']."</a></td><td class=embedded> ".("'".$arr['last_access']."'">$dt?"<img src=".$pic_base_url."button_online.gif border=0 alt=\"online\">":"<img src=".$pic_base_url."button_offline.gif border=0 alt=\"offline\">" )."</td>".
  23. "<td class=embedded><a href=sendmessage.php?receiver=".$arr['id'].">".
  24. "<img src=".$pic_base_url."button_pm.gif border=0></a></td>".
  25. " ";
  26. // Show 3 staff per row, separated by an empty column
  27. ++ $col[$arr['class']];
  28. if ($col[$arr['class']]<=2)
  29. $staff_table[$arr['class']]=$staff_table[$arr['class']]."<td class=embedded>&nbsp;</td>";
  30. else
  31. {
  32. $staff_table[$arr['class']]=$staff_table[$arr['class']]."</tr><tr height=15>";
  33. $col[$arr['class']]=0;
  34. }
  35. }
  36. begin_frame("Staff");
  37. ?>
  38. <table width=725 cellspacing=0>
  39. <tr>
  40. <tr><td class=embedded colspan=11>All software support questions and those already answered in the FAQ will be ignored.</td></tr>
  41. <!-- Define table column widths -->
  42. <td class=embedded width="125">&nbsp;</td>
  43. <td class=embedded width="25">&nbsp;</td>
  44. <td class=embedded width="35">&nbsp;</td>
  45. <td class=embedded width="85">&nbsp;</td>
  46. <td class=embedded width="125">&nbsp;</td>
  47. <td class=embedded width="25">&nbsp;</td>
  48. <td class=embedded width="35">&nbsp;</td>
  49. <td class=embedded width="85">&nbsp;</td>
  50. <td class=embedded width="125">&nbsp;</td>
  51. <td class=embedded width="25">&nbsp;</td>
  52. <td class=embedded width="35">&nbsp;</td>
  53. </tr>
  54. <tr><td class=embedded colspan=11><b>Administrators</b></td></tr>
  55. <tr><td class=embedded colspan=11><hr color="#4040c0" size=1></td></tr>
  56. <tr height=15>
  57. <?=$staff_table[UC_ADMINISTRATOR]?>
  58. </tr>
  59. <tr><td class=embedded colspan=11>&nbsp;</td></tr>
  60. <tr><td class=embedded colspan=11><b>Moderators</b></td></tr>
  61. <tr><td class=embedded colspan=11><hr color="#4040c0" size=1></td></tr>
  62. <tr height=15>
  63. <?=$staff_table[UC_MODERATOR]?>
  64. </tr>
  65. <tr><td class=embedded colspan=11>&nbsp;</td></tr>
  66. <tr><td class=embedded colspan=11><b>Uploaders</b></td></tr>
  67. <tr><td class=embedded colspan=11><hr color="#4040c0" size=1></td></tr>
  68. <tr height=15>
  69. <?=$staff_table[UC_UPLOADER]?>
  70. </tr>
  71. </table>
  72. <?
  73. end_frame();
  74. }
  75. ?>
  76. <? if (get_user_class() >= UC_SYSOP) { ?>
  77. <? begin_frame("Site Owner Tools<font color=#FF0000> - Viewable by SysOp only.</font>"); ?>
  78. <table width=500 cellspacing=10 align=center>
  79. <tr>
  80. <td class=embedded><form method=get action=importpg.php><input type=submit value="PeerGuardian" style='height: 20px; width: 100px'></form></td>
  81. <td class=embedded><form method=get action=staffmess.php><input type=submit value="Mass Messager" style='height: 20px; width: 100px'></form></td>
  82. <td class=embedded><form method=get action=category.php><input type=submit value="Modify Categories" style='height: 20px; width: 100px'></form></td>
  83. <td class=embedded><form method=get action=delacct.php><input type=submit value="Delete Account" style='height: 20px; width: 100px'></form></td>
  84. <td class=embedded><form method=get action=status.php><input type=submit value="Server Status" style='height: 20px; width: 100px'></form></td>
  85. </tr>
  86. </table>
  87. <? end_frame();
  88. }
  89. if (get_user_class() >= UC_ADMINISTRATOR) { ?>
  90. <? begin_frame("Site Owner Tools<font color=#009900> - Viewable by Administrators only.</font>"); ?>
  91. <table width=500 cellspacing=10 align=center>
  92. <tr>
  93. <td class=embedded><form method=get action=unco.php><input type=submit value="Unconfirmed Users" style='height: 20px; width: 100px'></form></td>
  94. <td class=embedded><form method=get action=delacctadmin.php><input type=submit value="Delete USERS" style='height: 20px; width: 100px'></form></td>
  95. <td class=embedded><form method=get action=bans.php><input type=submit value="Client Bans" style='height: 20px; width: 100px'></form></td>
  96. </tr>
  97. <tr>
  98. <td class=embedded><form method=get action=topten.php><input type=submit value="Top 10" style='height: 20px; width: 100px'></form></td>
  99. <td class=embedded><form method=get action=bitbucketlog.php><input type=submit value="Bitbucket Logs" style='height: 20px; width: 100px'></form></td>
  100. <td class=embedded><form method=get action=findnotconnectable.php><input type=submit value="NON Connectable" style='height: 20px; width: 100px'></form></td>
  101. </tr>
  102. </table>
  103. <? end_frame();
  104. }
  105. if (get_user_class() >= UC_MODERATOR) { ?>
  106. <? begin_frame("Staff tools - <font color=#004E98>Viewable by Mods only.</font>"); ?>
  107. <table width=640 cellspacing=3>
  108. <tr>
  109. <? if (get_user_class() >= UC_MODERATOR) { ?>
  110. </tr>
  111. <tr>
  112. <td class=embedded><a class=altlink href=staff.php?act=users>List users with ratio below 0.20</a></td>
  113. <td class=embedded>Lists all the users that have an share ratio below 0.20</td>
  114. </tr>
  115. <tr>
  116. <td class=embedded><a class=altlink href=staff.php?act=banned>List all banned users</a></td>
  117. <td class=embedded>Lists all the users that have been banned from the site</td>
  118. </tr>
  119. <tr>
  120. <td class=embedded><a class=altlink href=staff.php?act=last>Newest users</a></td>
  121. <td class=embedded>100 newest user accounts</td>
  122. </tr>
  123. <tr>
  124. <td class=embedded><a class=altlink href=log.php>Site log</a></td>
  125. <td class=embedded>See whats been upped/deleted/etc</td>
  126. </tr>
  127. </table>
  128. <? end_frame(); ?>
  129. <br>
  130. <? begin_frame("Moderators and Tools - <font color=#004E98>Viewable by Mods only.</font>"); ?>
  131. <br>
  132. <table width=500 cellspacing=3>
  133. <tr>
  134. <td class=embedded></td>
  135. </tr>
  136. </table>
  137. <table width=500 cellspacing=10 align=center>
  138. <tr>
  139. <td class=embedded><form method=get action=warned.php><input type=submit value="Users Warned" style='height: 20px; width: 100px'></form></td>
  140. <td class=embedded><form method=get action=adduser.php><input type=submit value="Add User" style='height: 20px; width: 100px'></form></td>
  141. <td class=embedded><form method=get action=makepoll.php><input type=submit value="Create a Poll" style='height: 20px; width: 100px'></form></td>
  142. <td class=embedded><form method=get action=recover.php><input type=submit value="Recover Account" style='height: 20px; width: 100px'></form></td>
  143. <td class=embedded><form method=get action=upstats.php><input type=submit value="Uploaders" style='height: 20px; width: 100px'></form></td>
  144. </tr>
  145. <tr>
  146. <td class=embedded><form method=get action=polloverview.php><input type=submit value="Poll Overview" style='height: 20px; width: 100px'></form></td>
  147. <td class=embedded><form method=get action=users.php><input type=submit value="User List" style='height: 20px; width: 100px'></form></td>
  148. <td class=embedded><form method=get action=tags.php><input type=submit value="Forum Tags" style='height: 20px; width: 100px'></form></td>
  149. <td class=embedded><form method=get action=smilies.php><input type=submit value="Smilies" style='height: 20px; width: 100px'></form></td>
  150. <td class=embedded><form method=get action=pending.php><input type=submit value="Pending" style='height: 20px; width: 100px'></form></td>
  151. </tr>
  152. <tr>
  153. <td class=embedded><form method=get action=stats.php><input type=submit value="Tracker Stats" style='height: 20px; width: 100px'></form></td>
  154. <td class=embedded><form method=get action=testip.php><input type=submit value="Test IP" style='height: 20px; width: 100px'></form></td>
  155. <td class=embedded><form method=get action=reports.php><input type=submit value="Reports" style='height: 20px; width: 100px'></form></td>
  156. <td class=embedded><form method=get action=ipcheck.php><input type=submit value="Duplicate IPs" style='height: 20px; width: 100px'></form></td>
  157. </tr>
  158. </table>
  159. <br>
  160. <? end_frame(); ?>
  161. <? begin_frame("Search user - <font color=#004E98>Viewable by Mods only.</font>"); ?>
  162. <table width=640 cellspacing=3>
  163. <tr>
  164. <td class=embedded>
  165. <form method=get action="users.php">
  166. Search: <input type=text size=30 name=search>
  167. <select name=class>
  168. <option value='-'>(any class)</option>
  169. <option value=0>User</option>
  170. <option value=1>Power User</option>
  171. <option value=2>VIP</option>
  172. <option value=3>Uploader</option>
  173. <option value=4>Moderator</option>
  174. <option value=5>Administrator</option>
  175. <option value=6>SysOp</option>
  176. </select>
  177. <input type=submit value='Okay'>
  178. </form>
  179. </td>
  180. </tr>
  181. <tr><td class=embedded><li><a href="usersearch.php">Advance user search</li></a></td></tr>
  182. </table>
  183. <? end_frame(); ?>
  184. <br>
  185. <? if ($act == "users") {
  186. begin_frame("Users with ratio below 0.20");
  187. echo '<table width="640" border="0" align="center" cellpadding="2" cellspacing="0">';
  188. echo "<tr><td class=colhead align=left>User</td><td class=colhead>Ratio</td><td class=colhead>IP</td><td class=colhead>Date Joined</td><td class=colhead>Last Access</td><td class=colhead>Download</td><td class=colhead>Upload</td></tr>";
  189. $result = mysql_query ("SELECT * FROM users WHERE uploaded / downloaded < 0.20 AND enabled = 'yes' ORDER BY downloaded DESC ");
  190. if ($row = mysql_fetch_array($result)) {
  191. do {
  192. if ($row["uploaded"] == "0") { $ratio = "inf"; }
  193. elseif ($row["downloaded"] == "0") { $ratio = "inf"; }
  194. $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
  195. echo "<tr><td><a href=userdetails.php?id=".$row["id"]."><b>".$row["username"]."</b></a></td><td><strong>".$ratio."</strong></td><td>".$row["ip"]."</td><td>".$row["added"]."</td><td>".$row["last_access"]."</td><td>".mksize($row["downloaded"])."</td><td>".mksize($row["uploaded"])."</td></tr>";
  196. } while($row = mysql_fetch_array($result));
  197. } else {print "<tr><td>Sorry, no records were found!</td></tr>";}
  198. echo "</table>";
  199. end_frame(); }?>
  200. <? if ($act == "last") {
  201. begin_frame("Latest users");
  202. echo '<table width="640" border="0" align="center" cellpadding="2" cellspacing="0">';
  203. echo "<tr><td class=colhead align=left>User</td><td class=colhead>Ratio</td><td class=colhead>IP</td><td class=colhead>Date Joined</td><td class=colhead>Last Access</td><td class=colhead>Download</td><td class=colhead>Upload</td></tr>";
  204. $result = mysql_query ("SELECT * FROM users WHERE enabled = 'yes' AND status = 'confirmed' ORDER BY added DESC limit 100");
  205. if ($row = mysql_fetch_array($result)) {
  206. do {
  207. if ($row["uploaded"] == "0") { $ratio = "inf"; }
  208. elseif ($row["downloaded"] == "0") { $ratio = "inf"; }
  209. else {
  210. $ratio = number_format($row["uploaded"] / $row["downloaded"], 3);
  211. $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
  212. }
  213. echo "<tr><td><a href=userdetails.php?id=".$row["id"]."><b>".$row["username"]."</b></a></td><td><strong>".$ratio."</strong></td><td>".$row["ip"]."</td><td>".$row["added"]."</td><td>".$row["last_access"]."</td><td>".mksize($row["downloaded"])."</td><td>".mksize($row["uploaded"])."</td></tr>";
  214. } while($row = mysql_fetch_array($result));
  215. } else {print "<tr><td>Sorry, no records were found!</td></tr>";}
  216. echo "</table>";
  217. end_frame(); }?>
  218. <? if ($act == "banned") {
  219. begin_frame("Banned users");
  220. echo '<table width="640" border="0" align="center" cellpadding="2" cellspacing="0">';
  221. echo "<tr><td class=colhead align=left>User</td><td class=colhead>Ratio</td><td class=colhead>IP</td><td class=colhead>Date Joined</td><td class=colhead>Last Access</td><td class=colhead>Download</td><td class=colhead>Upload</td></tr>";
  222. $result = mysql_query ("SELECT * FROM users WHERE enabled = 'no' ORDER BY last_access DESC ");
  223. if ($row = mysql_fetch_array($result)) {
  224. do {
  225. if ($row["uploaded"] == "0") { $ratio = "inf"; }
  226. elseif ($row["downloaded"] == "0") { $ratio = "inf"; }
  227. else {
  228. $ratio = number_format($row["uploaded"] / $row["downloaded"], 3);
  229. $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
  230. }
  231. echo "<tr><td><a href=userdetails.php?id=".$row["id"]."><b>".$row["username"]."</b></a></td><td><strong>".$ratio."</strong></td><td>".$row["ip"]."</td><td>".$row["added"]."</td><td>".$row["last_access"]."</td><td>".mksize($row["downloaded"])."</td><td>".mksize($row["uploaded"])."</td></tr>";
  232. } while($row = mysql_fetch_array($result));
  233. } else {print "<tr><td>Sorry, no records were found!</td></tr>";}
  234. echo "</table>";
  235. end_frame(); } }
  236. }
  237. if (get_user_class() >= UC_USER) {
  238. if (!$act) {
  239. $dt = gmtime() - 180;
  240. $dt = sqlesc(get_date_time($dt));
  241. // LIST ALL FIRSTLINE SUPPORTERS
  242. // Search User Database for Firstline Support and display in alphabetical order
  243. $res = mysql_query("SELECT * FROM users WHERE support='yes' AND status='confirmed' ORDER BY username LIMIT 10") or sqlerr();
  244. while ($arr = mysql_fetch_assoc($res))
  245. {
  246. $land = mysql_query("SELECT name,flagpic FROM countries WHERE id=$arr[country]") or sqlerr();
  247. $arr2 = mysql_fetch_assoc($land);
  248. $firstline .= "<tr height=15><td class=embedded><a class=altlink href=userdetails.php?id=".$arr['id'].">".$arr['username']."</a></td>
  249. <td class=embedded> ".("'".$arr['last_access']."'">$dt?"<img src=".$pic_base_url."button_online.gif border=0 alt=\"online\">":"<img src=".$pic_base_url."button_offline.gif border=0 alt=\"offline\">" )."</td>".
  250. "<td class=embedded><a href=sendmessage.php?receiver=".$arr['id'].">"."<img src=".$pic_base_url."button_pm.gif border=0></a></td>".
  251. "<td class=embedded><img src=".$pic_base_url."/flag/$arr2[flagpic] border=0 width=19 height=12></td>".
  252. "<td class=embedded>".$arr['supportfor']."</td></tr>\n";
  253. }
  254. begin_frame("Firstline Support");
  255. ?>
  256. <table width=725 cellspacing=0>
  257. <tr>
  258. <td class=embedded colspan=11>General support questions should preferably be directed to these users. Note that they are volunteers, giving away their time and effort to help you.
  259. Treat them accordingly. (Languages listed are those besides English.)<br><br><br></td></tr>
  260. <!-- Define table column widths -->
  261. <tr>
  262. <td class=embedded width="30"><b>Username</b></td>
  263. <td class=embedded width="5"><b>Active</b></td>
  264. <td class=embedded width="5"><b>Contact</b></td>
  265. <td class=embedded width="85"><b>Language</b></td>
  266. <td class=embedded width="200"><b>Support for:</b></td>
  267. </tr>
  268. <tr>
  269. <tr><td class=embedded colspan=11><hr color="#4040c0" size=1></td></tr>
  270. <?=$firstline?>
  271. </tr>
  272. </table>
  273. <?
  274. end_frame();
  275. }
  276. ?>
  277. <?
  278. end_frame();
  279. end_main_frame();
  280. stdfoot();
  281. }
  282. ?>