Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 93.34 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. ***************************************
  5. ** FreeTSP Version: 2.0 Multilingual **
  6. ***************************************
  7. ** http://www.freetsp.com
  8. ** Licence Info: GPL
  9. ** Copyright (C) 2017 FreeTSP v2.0 Multilingual
  10. ** A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
  11. ** Full Respects & Credits To Mindless & All The Team @ U232
  12. ** Project Leaders. Fireknight & Rushed.
  13. ** Project Founder: Krypto.
  14. **/
  15.  
  16. require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'functions' . DIRECTORY_SEPARATOR . 'function_main.php');
  17. require_once(FUNC_DIR . 'function_user.php');
  18. require_once(FUNC_DIR . 'function_vfunctions.php');
  19. require_once(FUNC_DIR . 'function_torrenttable.php');
  20. require_once(FUNC_DIR . 'function_bbcode.php');
  21. require_once(FUNC_DIR . 'function_page_verify.php');
  22.  
  23. db_connect(false);
  24. logged_in();
  25.  
  26. $lang = array_merge(load_language('userdetails'),
  27. load_language('func_vfunctions'),
  28. load_language('func_bbcode'),
  29. load_language('global'));
  30.  
  31. $newpage = new page_verify();
  32. $newpage->create('_modtask_');
  33.  
  34. function snatchtable($res)
  35. {
  36. global $FTSP_V2, $lang;
  37.  
  38. $table = "<table class='main' border='1' width='100%' cellspacing='0' cellpadding='5'>
  39. <tr>
  40. <td class='colhead' width='5%' align='center'>{$lang['table_snatch_cat']}</td>
  41. <td class='colhead' align='center'>{$lang['table_snatch_tor']}</td>
  42. <td class='colhead' align='center'>{$lang['table_snatch_up']}</td>
  43. <td class='colhead' align='center'>{$lang['table_snatch_rate']}</td>
  44. <td class='colhead' align='center'>{$lang['table_snatch_down']}</td>
  45. <td class='colhead' align='center'>{$lang['table_snatch_rate']}</td>
  46. <td class='colhead' align='center'>{$lang['table_snatch_ratio']}</td>
  47. <td class='colhead' align='center'>{$lang['table_snatch_activity']}</td>
  48. <td class='colhead' align='center'>{$lang['table_snatch_finished']}</td>
  49. </tr>";
  50.  
  51. while ($arr = mysqli_fetch_assoc($res))
  52. {
  53. $upspeed = ($arr['upspeed'] > 0 ? mksize($arr['upspeed']) : ($arr['seedtime'] > 0 ? mksize($arr['uploaded'] / ($arr['seedtime'] + $arr['leechtime'])) : mksize(0)));
  54.  
  55. $downspeed = ($arr['downspeed'] > 0 ? mksize($arr['downspeed']) : ($arr['leechtime'] > 0 ? mksize($arr['downloaded'] / $arr['leechtime']) : mksize(0)));
  56.  
  57. $ratio = ($arr['downloaded'] > 0 ? number_format($arr['uploaded'] / $arr['downloaded'], 3) : ($arr['uploaded'] > 0 ? "{$lang['table_snatch_inf']}" : "---"));
  58.  
  59. $table .= "<tr>
  60. <td class='rowhead' align='center' style='padding : 0px'>
  61. <img src='{$FTSP_V2['$image_dir']}caticons/" . htmlspecialchars($arr['catimg']) . "' width='60' height='54' border='0' alt='" . htmlspecialchars($arr['catname']) . "' title='" . htmlspecialchars($arr['catname']) . "' />
  62. </td>
  63. <td class='rowhead' align='center'>
  64. <a href='details.php?id={$arr['torrentid']}'><strong>" . (strlen($arr['name']) > 50 ? substr($arr['name'], 0, 50 - 3) . '...' : $arr['name']) . "</strong></a>
  65. </td>
  66. <td class='rowhead' align='center'>" . mksize($arr['uploaded']) . "</td>
  67. <td class='rowhead' align='center'>$upspeed/s</td>
  68. <td class='rowhead' align='center'>" . mksize($arr['downloaded']) . "</td>
  69. <td class='rowhead' align='center'>$downspeed/s</td>
  70. <td class='rowhead' align='center'>$ratio</td>
  71. <td class='rowhead' align='center'>" . mkprettytime($arr['seedtime'] + $arr['leechtime']) . "</td>
  72. <td class='rowhead' align='center'>
  73. " . ($arr['complete_date'] <> "0000-00-00 00:00:00" ? "<span class='userdetails_snatched_complete_yes'><strong>{$lang['table_snatch_yes']}</strong></span>" : "<span class='userdetails_snatched_complete_no'><strong>{$lang['table_snatch_no']}</strong></span>") . "
  74. </td>
  75. </tr>";
  76. }
  77.  
  78. $table .= "</table>";
  79.  
  80. return $table;
  81. }
  82.  
  83. function snatch_table($res)
  84. {
  85. global $FTSP_V2, $lang;
  86.  
  87. $table1 = "<table class='main' border='1' width='100%' cellspacing='0' cellpadding='5'>
  88. <tr>
  89. <td class='colhead' align='center'>{$lang['table_snatch_cat']}</td>
  90. <td class='colhead' align='center'>{$lang['table_snatch_tor']}</td>
  91. <td class='colhead' align='center'>{$lang['table_snatch_sl']}</td>
  92. <td class='colhead' align='center'>{$lang['table_snatch_up_down']}</td>
  93. <td class='colhead' align='center'>{$lang['table_snatch_tor_size']}</td>
  94. <td class='colhead' align='center'>{$lang['table_snatch_ratio']}</td>
  95. <td class='colhead' align='center'>{$lang['table_snatch_client']}</td>
  96. <td class='colhead' align='center'>{$lang['table_snatch_reseed']}</td>
  97. </tr>";
  98.  
  99. while ($arr = mysqli_fetch_assoc($res))
  100. {
  101. //----- Speed Color Red = Fast / Green = Slow ;) -----//
  102. if ($arr['upspeed'] > 0)
  103. {
  104. $ul_speed = ($arr['upspeed'] > 0 ? mksize( $arr['upspeed']) : ($arr['seedtime'] > 0 ? mksize( $arr['uploaded'] / ($arr['seedtime'] + $arr['leechtime'])) : mksize(0)));
  105. }
  106. else
  107. {
  108. $ul_speed = mksize(($arr['uploaded'] / ($arr['l_a'] - $arr['s'] + 1)));
  109. }
  110.  
  111. if ($arr['downspeed'] > 0)
  112. {
  113. $dl_speed = ($arr['downspeed'] > 0 ? mksize($arr['downspeed']) : ($arr['leechtime'] > 0 ? mksize( $arr['downloaded'] / $arr['leechtime'] ) : mksize(0)));
  114. }
  115. else
  116. {
  117. $dl_speed = mksize(($arr['downloaded'] / ($arr['c'] - $arr['s'] + 1)));
  118. }
  119.  
  120. if ($arr['downloaded'] > 0)
  121. {
  122. $ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3);
  123. $ratio = "<font color='" . get_ratio_color( $ratio ) . "'><strong>{$lang['table_snatch_ratio']}:</strong><br />$ratio</font>";
  124. }
  125. else
  126. {
  127. if ($arr['uploaded'] > 0)
  128. {
  129. $ratio = "{$lang['table_snatch_inf']}";
  130. }
  131. else
  132. {
  133. $ratio = "{$lang['table_snatch_na']}";
  134. }
  135. }
  136.  
  137. $table1 .= "<tr>
  138. <td align='center'>
  139. " . ($arr['complete_date'] != '0000-00-00 00:00:00' ? "<strong>{$lang['table_snatch_finished']}</strong><br />" : "<strong>{$lang['table_snatch_not_finished']}</strong><br />") . "
  140. <img src='{$FTSP_V2['$image_dir']}caticons/" . htmlspecialchars($arr['image']) . "' width='60' height='54' border='0' alt='" . htmlspecialchars($arr['name']) . "' title='" . htmlspecialchars($arr['name']) . "' />
  141. </td>
  142.  
  143. <td align='center'>
  144. <a class='altlink' href='details.php?id={$arr['torrentid']}'><strong>{$arr['torrent_name']}</strong></a>
  145. " . ($arr['complete_date'] != '0000-00-00 00:00:00' ? "<br />
  146.  
  147. <strong>{$lang['table_snatch_started']}</strong><br />{$arr['start_date']}<br />
  148.  
  149. <strong>{$lang['table_snatch_completed']}</strong><br />{$arr['complete_date']}" : "<br />
  150.  
  151. <strong>{$lang['table_snatch_last_action']}</strong>{$arr['last_action']}
  152. " . ($arr['complete_date'] == '0000-00-00 00:00:00' ? "
  153. " . ($arr['owner'] == $id ? "" : "[ " . mksize( $arr['size'] - $arr['downloaded']) . "{$lang['table_snatch_to_go']}]") . "" : "") . "") . "
  154. " . ($arr['complete_date'] != '0000-00-00 00:00:00' ? "<br />
  155.  
  156. <strong>{$lang['table_snatch_time_dl']}</strong>" . ($arr['leechtime'] != '0' ? mkprettytime($arr['leechtime']) : mkprettytime($arr['c'] - $arr['s']) . "" ) . "<br />
  157.  
  158. [{$lang['table_snatch_dl_at']}$dl_speed ]<br />" : "<br />" ) . "
  159.  
  160. " . ( $arr['seedtime'] != '0' ? "<strong>{$lang['table_snatch_total_seed']}</strong>" . mkprettytime($arr['seedtime']) . " " : "<strong>{$lang['table_snatch_total_seed']}</strong>{$lang['table_snatch_na']}" ) . "<br />
  161.  
  162. [{$lang['table_snatch_up_at']}@ $ul_speed ]
  163.  
  164. " . ($arr['complete_date'] == '0000-00-00 00:00:00' ? "<br />
  165.  
  166. <strong>{$lang['table_snatch_dl_speed']}</strong> $dl_speed" : "") . "
  167. </td>
  168.  
  169. <td align='center'>
  170. <span class='userdetails_snatched_seeders'>{$lang['table_snatch_seeds']}<strong>{$arr['seeders']}</strong></span><br />
  171. <span class='userdetails_snatched_leechers'>{$lang['table_snatch_leech']}<strong>{$arr['leechers']}</strong></span>
  172. </td>
  173.  
  174. <td align='center'>
  175. <span class='userdetails_snatched_ul'>{$lang['table_snatch_up']}<br /><strong>" . $uploaded = mksize($arr['uploaded']) . "</strong></span><br />
  176. <span class='userdetails_snatched_dl'>{$lang['table_snatch_down']}<br /><strong>" . $downloaded = mksize($arr['downloaded']) . "</strong></span>
  177. </td>
  178.  
  179. <td align='center'>
  180. <span class='userdetails_snatched_dl_diff'>" . mksize($arr['size']) . "</span><br /><strong>{$lang['table_snatch_diff']}</strong><br /><strong>
  181. <span class='userdetails_snatched_dl_size'>" . mksize($arr['size'] - $arr['downloaded']) . "</span></strong>
  182. </td>
  183.  
  184. <td align='center'>$ratio<br />" . ($arr['seeder'] == "yes" ? "
  185. <span class='userdetails_snatched_seeding'><strong>{$lang['table_snatch_seeding']}</strong></span>" : "
  186. <span class='userdetails_snatched_leeching'><strong>{$lang['table_snatch_not_seeding']}</strong></span>") . "
  187. </td>
  188.  
  189. <td align='center'>
  190. {$arr['agent']}<br /><strong>{$lang['table_snatch_port']}</strong>{$arr['port']}<br />
  191.  
  192. " . ($arr['connectable'] == "yes" ? "<strong>{$lang['table_snatch_connectable']}<span class='userdetails_snatched_con'>{$lang['table_snatch_yes']}</span></strong>" : "<strong>{$lang['table_snatch_connectable']}</strong><span class='userdetails_snatched_uncon'><strong>{$lang['table_snatch_no']}</strong></span>") . "
  193. </td>
  194.  
  195. <td align='center'>
  196. <strong>{$lang['table_snatch_reseed']}</strong><br />
  197. <a href='download.php/{$arr['torrentid']}/{$arr['torrent_name']}.torrent'>
  198. <img src='{$FTSP_V2['$image_dir']}download.png' width='16' height='16' border='0' alt='{$lang['img_alt_download']}' title='{$lang['img_alt_download']}' />
  199. </a>
  200. </td>
  201. </tr>";
  202. }
  203.  
  204. $table1 .= "</table>";
  205.  
  206. return $table1;
  207. }
  208.  
  209. function maketable($res)
  210. {
  211. global $FTSP_V2, $lang;
  212.  
  213. $ret = "<table class='main' border='1' width='100%' cellspacing='0' cellpadding='5'>
  214. <tr>
  215. <td class='colhead' width='5%' align='center'>{$lang['table_seed_cat']}</td>
  216. <td class='colhead' align='center'>{$lang['table_seed_name']}</td>
  217. <td class='colhead' align='center' width='7%'>{$lang['table_seed_size']}</td>
  218. <td class='colhead' align='right' width='5%'>{$lang['table_seed_seeds']}</td>
  219. <td class='colhead' align='right' width='5%'>{$lang['table_seed_leech']}</td>
  220. <td class='colhead' align='center' width='7%'>{$lang['table_seed_ul']}</td>
  221. <td class='colhead' align='center' width='7%'>{$lang['table_seed_dl']}</td>
  222. <td class='colhead' align='center' width='7%'>{$lang['table_seed_ratio']}</td>
  223. </tr>";
  224.  
  225. foreach ($res
  226. AS
  227. $arr)
  228. {
  229. if ($arr['downloaded'] > 0)
  230. {
  231. $ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3);
  232. $ratio = "<font color='" . get_ratio_color($ratio) . "'>$ratio</font>";
  233. }
  234. else
  235. {
  236. if ($arr['uploaded'] > 0)
  237. {
  238. $ratio = "{$lang['table_seed_inf']}";
  239. }
  240. else
  241. {
  242. $ratio = "---";
  243. }
  244. }
  245.  
  246. $catimage = "{$FTSP_V2['$image_dir']}caticons/{$arr['image']}";
  247. $catname = htmlspecialchars($arr['catname']);
  248. $catimage = "<img src='" . htmlspecialchars($catimage) . "' width='60' height='54' border='0' alt='$catname' title='$catname' />";
  249.  
  250. /*
  251. $ttl = (28*24) - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr['added'])) / 3600);
  252.  
  253. if ($ttl == 1) $ttl .= "<br />{$lang['table_seed_hour']}";
  254. else $ttl .= "<br />{$lang['table_seed_hours']}";
  255. */
  256.  
  257.  
  258. $size = str_replace(" ", "<br />", mksize($arr['size']));
  259. $uploaded = str_replace(" ", "<br />", mksize($arr['uploaded']));
  260. $downloaded = str_replace(" ", "<br />", mksize($arr['downloaded']));
  261. $seeders = number_format($arr['seeders']);
  262. $leechers = number_format($arr['leechers']);
  263.  
  264. $ret .= "<tr>
  265. <td class='rowhead' align='center' style='padding : 0px'>$catimage</td>
  266. <td class='rowhead' align='left'>
  267. <a href='details.php?id={$arr['torrent']}&amp;hit=1'><strong>" . htmlspecialchars($arr['torrentname']) . "</strong></a>
  268. </td>
  269. <td class='rowhead' align='center'>$size</td>
  270. <td class='rowhead' align='right'>$seeders</td>
  271. <td class='rowhead' align='right'>$leechers</td>
  272. <td class='rowhead' align='center'>$uploaded</td>
  273. <td class='rowhead' align='center'>$downloaded</td>
  274. <td class='rowhead' align='center'>$ratio</td>
  275. </tr>";
  276. }
  277.  
  278. $ret .= "</table>";
  279. return $ret;
  280. }
  281.  
  282. $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
  283.  
  284. if (!is_valid_id($id))
  285. {
  286. error_message("error",
  287. "{$lang['gbl_error']}",
  288. "{$lang['err_bad_id']}$id.");
  289. }
  290.  
  291. $r = sql_query("SELECT *
  292. FROM users
  293. WHERE id=".sqlesc($id)) or sqlerr();
  294.  
  295. $user = mysqli_fetch_assoc($r) or error_message("error",
  296. "{$lang['gbl_error']}",
  297. "{$lang['err_no_userid']}$id.");
  298.  
  299. if ($user['status'] == 'pending')
  300. {
  301. error_message("error",
  302. "{$lang['gbl_sorry']}",
  303. "{$lang['err_pending']}");
  304. }
  305.  
  306. $r = sql_query("SELECT id, name, seeders, leechers, category
  307. FROM torrents
  308. WHERE owner = $id
  309. ORDER BY name") or sqlerr();
  310.  
  311. if (mysqli_num_rows($r) > 0)
  312. {
  313. $torrents = "<table class='main' border='1' width='100%' cellspacing='0' cellpadding='5'>
  314. <tr>
  315. <td class='colhead' align='center' width='5%' style='padding : 0px'>{$lang['table_up_cat']}</td>
  316. <td class='colhead' align='center'>{$lang['table_up_name']}</td>
  317. <td class='colhead' align='center' width='10%'>{$lang['table_up_seeds']}</td>
  318. <td class='colhead' align='center' width='10%'>{$lang['table_up_leech']}</td>
  319. </tr>";
  320.  
  321. while ($a = mysqli_fetch_assoc($r))
  322. {
  323. $r2 = sql_query("SELECT name, image
  324. FROM categories
  325. WHERE id = {$a['category']}") or sqlerr(__FILE__, __LINE__);
  326.  
  327. $a2 = mysqli_fetch_assoc($r2);
  328.  
  329. $cat = "<img src='" . htmlspecialchars("{$FTSP_V2['$image_dir']}caticons/{$a2['image']}") . "' width='60' height='54' border='0' alt='" . htmlspecialchars($a2['name']) . "' title='" . htmlspecialchars($a2['name']) . "' />";
  330.  
  331. $torrents .= "<tr>
  332. <td class='rowhead' style='padding : 0px'>$cat</td>
  333. <td class='rowhead' align='left' style='padding : 0px'>
  334. <a href='details.php?id={$a['id']}&amp;hit=1'>&nbsp;<strong>" . htmlspecialchars($a['name']) . "</strong></a>
  335. </td>
  336. <td class='rowhead' align='right'>{$a['seeders']}</td>
  337. <td class='rowhead' align='right'>{$a['leechers']}</td>
  338. </tr>";
  339. }
  340.  
  341. $torrents .= "</table>";
  342. }
  343.  
  344. if ($user['ip'] && (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  345. && $CURUSER['mod_access'] == "yes"
  346. && $CURUSER['staff_code'] == "$staff_code"
  347. || $user['id'] == $CURUSER['id']))
  348. {
  349. $dom = @gethostbyaddr($user['ip']);
  350. $addr = ($dom == $user['ip'] || @gethostbyname($dom) != $user['ip']) ? $user['ip'] : $user['ip'] . ' (' . $dom . ')';
  351. }
  352.  
  353. if ($user['added'] == "0000-00-00 00:00:00")
  354. {
  355. $joindate = "{$lang['table_general_na']}";
  356. }
  357. else
  358. {
  359. $date1 = date_create($user['added']);
  360. $date2 = date_format($date1, "F j, Y, g:i a");
  361.  
  362. $joindate = "$date2 (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($user["added"])) . " {$lang['table_general_ago']})";
  363. $lastseen = $user["last_access"];
  364. }
  365.  
  366. if ($lastseen == "0000-00-00 00:00:00")
  367. {
  368. $lastseen = "{$lang['table_general_never']}";
  369. }
  370. else
  371. {
  372. $date3 = date_create($user["last_access"]);
  373. $date4 = date_format($date3, "F j, Y, g:i a");
  374.  
  375. $lastseen = "$date4 (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($user["last_access"])) . " {$lang['table_general_ago']})";
  376. }
  377.  
  378. if ($user['onlinetime'] > 0)
  379. {
  380. $onlinetime = time_return($user['onlinetime']);
  381. }
  382. else
  383. {
  384. $onlinetime = "{$lang['table_general_never']}";
  385. }
  386.  
  387. if ($user['last_access'] > (get_date_time(gmtime() - 60)))
  388. {
  389.  
  390. $status = "<span class='userdetails_online'>{$lang['table_general_online']}</span>";
  391. }
  392. else
  393. {
  394. $status = "<span class='userdetails_offline'>{$lang['table_general_offline']}</span>";
  395. }
  396.  
  397. $res = sql_query("SELECT COUNT(id)
  398. FROM comments
  399. WHERE user = {$user['id']}") or sqlerr();
  400.  
  401. $arr3 = mysqli_fetch_row($res);
  402. $torrentcomments = $arr3[0];
  403.  
  404. $res = sql_query("SELECT COUNT(id)
  405. FROM posts
  406. WHERE userid = {$user['id']}") or sqlerr();
  407.  
  408. $arr3 = mysqli_fetch_row($res);
  409. $forumposts = $arr3[0];
  410. $country = "";
  411.  
  412. $res = sql_query("SELECT name,flagpic
  413. FROM countries
  414. WHERE id = {$user['country']}
  415. LIMIT 1") or sqlerr();
  416.  
  417. if (mysqli_num_rows($res) == 1)
  418. {
  419. $arr = mysqli_fetch_assoc($res);
  420. $country = "<td class='embedded'>
  421. <img src='{$FTSP_V2['$image_dir']}flag/{$arr['flagpic']}' width='32' height='20' border='0' alt='" . htmlspecialchars($arr['name']) . "' title='" . htmlspecialchars($arr['name']) . "' style='margin-left : 8pt' />
  422. </td>";
  423. }
  424.  
  425. $res = sql_query("SELECT p.torrent, p.uploaded, p.downloaded, p.seeder, t.added, t.name AS torrentname, t.size, t.category, t.seeders, t.leechers, c.name AS catname, c.image
  426. FROM peers p
  427. LEFT JOIN torrents t ON p.torrent = t.id
  428. LEFT JOIN categories c ON t.category = c.id
  429. WHERE p.userid = $id") or sqlerr();
  430.  
  431. while ($arr = mysqli_fetch_assoc($res))
  432. {
  433. if ($arr['seeder'] == "yes")
  434. {
  435. $seeding[] = $arr;
  436. }
  437. else
  438. {
  439. $leeching[] = $arr;
  440. }
  441. }
  442.  
  443. if (($user["downloaded"] == 0 && $user["uploaded"] == 0)
  444. || ($user["downloaded"] >= 1
  445. && $user["uploaded"] == 0)
  446. || ($user["downloaded"] == 0
  447. && $user["uploaded"] >= 1))
  448. {
  449. $s = "confused";
  450.  
  451. $sr = "<table class='img' cellspacing='0' cellpadding='0'>
  452. <tr>
  453. <td class='embedded'>{$lang['text_ntsy']}&nbsp;</td>
  454. <td class='embedded'>&nbsp;&nbsp;
  455. <img src='{$FTSP_V2['$image_dir']}smilies/{$s}.png' width='16' height='16' border='0' alt='$s' title='$s' />
  456. </td>
  457. </tr>
  458. </table>";
  459. }
  460.  
  461. //--- If Upload Or Download = 0 It Causes A - Division By Zero PHP Warning ---//
  462. //--- Which Is Why The Code Above Does Not Caculate The Ratio ---//
  463. //--- And The Code Below Does ---//
  464.  
  465. if ($user['downloaded'] >= 1 && $user["uploaded"] >= 1)
  466. {
  467. $sr = $user['uploaded'] / $user['downloaded'];
  468.  
  469. if ($sr >= 4)
  470. $s = "cool";
  471.  
  472. else if ($sr >= 2)
  473. $s = "grin";
  474.  
  475. else if ($sr >= 1)
  476. $s = "happy";
  477.  
  478. else if ($sr >= 0.5)
  479. $s = "expressionless";
  480.  
  481. else if ($sr >= 0.25)
  482. $s = "sad";
  483.  
  484. else
  485. $s = "reallyevil";
  486.  
  487. $sr = floor($sr * 1000) / 1000;
  488. $sr = "<table border='0' cellspacing='0' cellpadding='0'>
  489. <tr>
  490. <td class='embedded'>
  491. <font color='" . get_ratio_color($sr) . "'>" . number_format($sr, 3) . "</font>
  492. </td>
  493. <td class='embedded'>&nbsp;&nbsp;
  494. <img src='{$FTSP_V2['$image_dir']}smilies/{$s}.png' width='16' height='16' border='0' alt='$s' title='$s' />
  495. </td>
  496. </tr>
  497. </table>";
  498. }
  499.  
  500. //----- Connectable And Port Shit -----//
  501. $q1 = sql_query("SELECT connectable, port,agent
  502. FROM peers
  503. WHERE userid = $id LIMIT 1") or sqlerr();
  504.  
  505. if ($a = mysqli_fetch_row($q1))
  506. {
  507. $connect = $a[0];
  508.  
  509. if ($connect == "yes")
  510. {
  511. $connectable = "<span class='userdetails_connectable'>{$lang['table_general_yes']}</span>";
  512. }
  513. else
  514. {
  515. $connectable = "<span class='userdetails_unconnectable'>{$lang['table_general_no']}</span>";
  516. }
  517. }
  518. else
  519. {
  520. $connectable = "<img src='{$FTSP_V2['$image_dir']}smilies/expressionless.png' width='16' height='16' border='0' alt='{$lang['img_alt_not_connected']}' title='{$lang['img_alt_not_connected']}' style='border : none; padding : 2px;' /><span class='userdetails_notconnected'>{$lang['img_alt_not_connected']}</span>";
  521. }
  522.  
  523. site_header("{$lang['title_details_for']}{$user['username']}");
  524.  
  525. //----- Start Reset Members Password Part 1 Of 2 -----//
  526. if ($_SERVER['REQUEST_METHOD'] == 'POST')
  527. {
  528. $username = trim($_POST['username']);
  529.  
  530. $res = sql_query("SELECT *
  531. FROM users
  532. WHERE username = " . sqlesc($username) . " ") or sqlerr();
  533.  
  534. $arr = mysqli_fetch_assoc($res);
  535.  
  536. $nick = ($username . rand(1000, 9999));
  537. $id = $arr['id'];
  538. $wantpassword = "$nick";
  539. $secret = mksecret();
  540. $wantpasshash = md5($secret . $wantpassword . $secret);
  541.  
  542. sql_query("UPDATE users
  543. SET passhash = '$wantpasshash'
  544. WHERE id = $id");
  545.  
  546. sql_query("UPDATE users
  547. SET secret = '$secret'
  548. WHERE id = $id");
  549.  
  550. //-----Uncomment If You Want To See When A Member Changes Their Passkey -----//
  551. // write_stafflog("{$lang['writelog_pass_reset']}$username{$lang['writelog_pass_by']}$CURUSER[username]");
  552.  
  553. if (mysqli_affected_rows($GLOBALS["___mysqli_ston"]) != 1)
  554.  
  555. error_message("warn",
  556. "{$lang['gbl_warning']}",
  557. "{$lang['err_fail_reset_pass']}");
  558.  
  559. error_message("success",
  560. "{$lang['gbl_success']}",
  561. "{$lang['err_pass_for']}<strong>$username</strong>{$lang['err_pass_reset_to']}<br /><br /><strong>$nick</strong><br /><br />{$lang['err_pass_inform_user']}");
  562. }
  563.  
  564. //----- Finish Reset Members Password Part 1 Of 2 -----//
  565. $enabled = $user['enabled'] == "yes";
  566.  
  567. print("<br /><table class='main' border='0' align='center' cellspacing='0' cellpadding='0'><tr>
  568. <td class='embedded'>
  569. <h1 style='margin : 0px'>{$user['username']}" . get_user_icons($user, true) . "</h1>
  570. </td>$country
  571. </tr>
  572. </table><br />
  573. <table class='main' border='0' align='center' cellspacing='0' cellpadding='0'>");
  574.  
  575. if (!empty($user['avatar']))
  576. {
  577. print("<tr>
  578. <td class='rowhead' align='left'>
  579. <img src='" . htmlspecialchars($user['avatar']) . "' width='125' height='125' border='0' alt='{$lang['img_alt_avatar']}' title='{$lang['img_alt_avatar']}' />
  580. </td>
  581. </tr>");
  582. }
  583. else
  584. {
  585. print("<tr>
  586. <td class='rowhead' align='left'>
  587. <img src='{$FTSP_V2['$image_dir']}default_avatar.gif' width='125' height='125' border='0' alt='{$lang['img_alt_avatar']}' title='{$lang['img_alt_avatar']}' />
  588. </td>
  589. </tr>");
  590. }
  591.  
  592. print("</table><br />");
  593.  
  594. if (!$enabled)
  595. {
  596. print("<p><strong>{$lang['text_acc_disabled']}</strong></p>");
  597. }
  598.  
  599. elseif ($CURUSER['id'] <> $user['id'])
  600. {
  601. $r = sql_query("SELECT id
  602. FROM friends
  603. WHERE userid = {$CURUSER['id']}
  604. AND friendid = $id") or sqlerr(__FILE__, __LINE__);
  605.  
  606. $friend = mysqli_num_rows($r);
  607.  
  608. $r = sql_query("SELECT id
  609. FROM blocks
  610. WHERE userid = {$CURUSER['id']}
  611. AND blockid = $id") or sqlerr(__FILE__, __LINE__);
  612.  
  613. $block = mysqli_num_rows($r);
  614.  
  615. if ($friend)
  616. {
  617. print("<div align='center'>
  618. <a class='btn' href='friends.php?action=delete&amp;type=friend&amp;targetid=$id'>{$lang['btn_del_friend']}</a>
  619. </div><br />");
  620. }
  621.  
  622. elseif ($block)
  623. {
  624. print("<div align='center'>
  625. <a class='btn' href='friends.php?action=delete&amp;type=block&amp;targetid=$id'>{$lang['btn_del_block']}</a>
  626. </div><br />");
  627. }
  628. else
  629. {
  630. print("<div align='center'>
  631. <a class='btn' href='friends.php?action=add&amp;type=friend&amp;targetid=$id'>{$lang['btn_add_friend']}</a>");
  632.  
  633. print("&nbsp;&nbsp;&nbsp;&nbsp;<a href='friends.php?action=add&amp;type=block&amp;targetid=$id' class='btn'>{$lang['btn_add_block']}</a></div><br />");
  634. }
  635. }
  636.  
  637. if ($user['enabled'] == "yes")
  638. {
  639. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  640. && $CURUSER['mod_access'] == "yes"
  641. && $CURUSER['admin_access'] == "yes"
  642. && $CURUSER['sysop_access'] == "yes"
  643. && $CURUSER['staff_code'] == "$staff_code"
  644. && $user['class'] < get_user_class())
  645. {
  646. print("<a class='btn' href='quickban.php?id={$user['id']}'>{$lang['btn_quick_ban']}</a><br /><br />");
  647. }
  648. }
  649.  
  650. if ($user['protected'] == "yes")
  651. {
  652. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  653. && $CURUSER['mod_access'] == "yes"
  654. && $CURUSER['staff_code'] == "$staff_code")
  655. {
  656. print("<span class='userdetails_pcon'>{$lang['text_protected']}</span><br /><br />");
  657. }
  658. }
  659.  
  660. if ($user['pcoff'] == "yes")
  661. {
  662. print("<span class='userdetails_pcon'>{$lang['text_pc_on']}</span>");
  663. }
  664.  
  665. if ($user['pcoff'] == "no")
  666. {
  667. print("<span class='userdetails_pcoff'>{$lang['text_pc_off']}</span>");
  668. }
  669.  
  670. if ( $user['parked'] == "yes" )
  671. {
  672. print("<br /><br /><span class='userdetails_parked'>{$lang['text_parked']}</span>");
  673. }
  674.  
  675. print("<div align='center' id='featured'><br /><ul>
  676. <li><a class='btn' href='#fragment-1'>{$lang['btn_general']}</a></li>
  677. <li><a class='btn' href='#fragment-2'>{$lang['btn_torrents']}</a></li>
  678. <li><a class='btn' href='#fragment-3'>{$lang['btn_info']}</a></li>
  679. ");
  680.  
  681. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  682. && $CURUSER['mod_access'] == "yes"
  683. && $CURUSER['staff_code'] == "$staff_code"
  684. || $user['id'] == $CURUSER['id'])
  685. {
  686. print("<li><a class='btn' href='#fragment-4'>{$lang['btn_snatch_list']}</a></li>");
  687. }
  688.  
  689. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  690. && $CURUSER['mod_access'] == "yes"
  691. && $CURUSER['staff_code'] == "$staff_code"
  692. || $user['id'] == $CURUSER['id'])
  693. {
  694. print("<li><a class='btn' href='#fragment-8'>{$lang['btn_invited']}</a></li>");
  695. }
  696.  
  697. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  698. && $CURUSER['mod_access'] == "yes"
  699. && $CURUSER['admin_access'] == "yes"
  700. && $CURUSER['sysop_access'] == "yes"
  701. && $CURUSER['staff_code'] == "$staff_code"
  702. && $user['class'] < get_user_class())
  703. {
  704. print("<li><a class='btn' href='#fragment-5'>{$lang['btn_alter_ratio']}</a></li>");
  705. }
  706.  
  707. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  708. && $CURUSER['mod_access'] == "yes"
  709. && $CURUSER['staff_code'] == "$staff_code"
  710. && $user['class'] < get_user_class())
  711. {
  712. print("<li><a class='btn' href='#fragment-6'>{$lang['btn_edit_user']}</a></li>");
  713. }
  714.  
  715. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  716. && $CURUSER['mod_access'] == "yes"
  717. && $CURUSER['admin_access'] == "yes"
  718. && $CURUSER['sysop_access'] == "yes"
  719. && $CURUSER['staff_code'] == "$staff_code"
  720. && $user['class'] < get_user_class())
  721. {
  722. print("<li><a class='btn' href='#fragment-7'>{$lang['btn_reset_pass']}</a></li>");
  723. }
  724.  
  725. print("</ul>");
  726. print("<br />");
  727.  
  728. //----- Start General Details Content -----//
  729. print("<div class='ui-tabs-panel' id='fragment-1'>
  730. <table class='coltable' width='70%'>
  731. <tr>
  732. <td class='std' align='center' colspan='2'>
  733. <h2>{$lang['table_general_details']}</h2>
  734. </td>
  735. </tr>
  736. <tr>
  737. <td class='colhead' width='20%'>&nbsp;{$lang['table_general_joined']}</td>
  738. <td class='rowhead' align='left' width='99%'>&nbsp;$joindate</td>
  739. </tr>
  740.  
  741. <tr>
  742. <td class='colhead' width='20%'>&nbsp;{$lang['table_general_last_seen']}</td>
  743. <td class='rowhead' align='left'>&nbsp;$lastseen</td>
  744. </tr>
  745.  
  746. <tr>
  747. <td class='colhead'>&nbsp;{$lang['table_general_time_online']}</td>
  748. <td class='rowhead' align='left'>&nbsp;$onlinetime</td>
  749. </tr>
  750.  
  751. <tr>
  752. <td class='colhead'>&nbsp;{$lang['table_general_status']}</td>
  753. <td class='rowhead' align='left'>&nbsp;$status</td>
  754. </tr>");
  755.  
  756. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  757. && $CURUSER['mod_access'] == "yes"
  758. && $CURUSER['staff_code'] == "$staff_code"
  759. && $user['invitedby'] > 0
  760. || $user['id'] == $CURUSER['id']
  761. && $user['invitedby'] > 0)
  762. {
  763. $invitedby = sql_query("SELECT username
  764. FROM users
  765. WHERE id = ". sqlesc($user['invitedby']));
  766.  
  767. $invitedby2 = mysqli_fetch_array($invitedby);
  768.  
  769. print("<tr>
  770. <td class='colhead'>&nbsp;{$lang['table_general_invited_by']}</td>
  771. <td class='rowhead' align='left'>
  772. &nbsp;<a href='userdetails.php?id={$user['invitedby']}'>" . htmlspecialchars($invitedby2['username']) . "</a>
  773. </td>
  774. </tr>");
  775. }
  776.  
  777. if ( get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  778. && $CURUSER['mod_access'] == "yes"
  779. && $CURUSER['staff_code'] == "$staff_code")
  780. {
  781. print("<tr>
  782. <td class='colhead' width='20%'>&nbsp;{$lang['table_general_email']}</td>
  783. <td class='rowhead' align='left'>
  784. <a href='mailto:{$user['email']}'>&nbsp;{$user['email']}</a>
  785. </td>
  786. </tr>
  787.  
  788. <tr>
  789. <td class='colhead'>&nbsp;{$lang['table_general_address']}</td>
  790. <td class='rowhead' align='left'>&nbsp;$addr</td>
  791. </tr>");
  792. }
  793.  
  794. if ($FTSP_V2['$site_reputation'] == true)
  795. {
  796. print("<tr>
  797. <td class='colhead'>&nbsp;{$lang['table_general_give_rep']}</td>
  798. <td class='rowhead' align='left'>
  799. <form method='post' action='takereppoints.php?id={$user['id']}'>
  800. <input type='submit' class='btn' name='givepoints' value='{$lang['btn_give_rep']}' />
  801. </form>
  802. </td>
  803. </tr>
  804.  
  805. <tr>
  806. <td class='colhead'>&nbsp;{$lang['table_general_cur_rep']}</td>
  807. <td class='rowhead' align='left'>&nbsp;{$lang['table_general_rep_points']}{$user['reputation']}");
  808.  
  809. $total = 0 + $user['reputation'];
  810. $nbrpics = 0 + $total / 5;
  811. $nbrpics = (int) $nbrpics;
  812.  
  813. while ($nbrpics > 0)
  814. {
  815. print"&nbsp;<img src='{$FTSP_V2['$image_dir']}rep.png' width='24' height='25' border='0' alt='{$lang['img_alt_rep']}' title='{$lang['img_alt_rep']}' />&nbsp;";
  816.  
  817. $nbrpics = 0 + $nbrpics - 1;
  818. }
  819.  
  820. print("<br /></td></tr>");
  821.  
  822. }
  823.  
  824. if ($user['title'])
  825. {
  826. print("<tr>
  827. <td class='colhead' width='20%'>&nbsp;{$lang['table_general_title']}</td>
  828. <td class='rowhead' align='left'>&nbsp;" . htmlspecialchars($user['title']) . "</td>
  829. </tr>");
  830. }
  831.  
  832. print("<tr>
  833. <td class='colhead' width='20%'>&nbsp;{$lang['table_general_class']}</td>
  834. <td class='rowhead' align='left'>&nbsp;" . get_user_class_name($user['class']) . "</td>
  835. </tr>");
  836.  
  837. if ($user['supportfor'])
  838. {
  839. print("<tr>
  840. <td class='colhead'>&nbsp;{$lang['table_general_fls']}</td>
  841. <td class='rowhead' align='left'>&nbsp;" . htmlspecialchars($user['supportfor']) . "</td>
  842. </tr>");
  843. }
  844.  
  845. print("<tr>
  846. <td class='colhead' width='20%'>&nbsp;{$lang['table_general_forum_posts']}</td>");
  847.  
  848. if ($forumposts && (($user['class'] >= UC_POWER_USER
  849. && $user['id'] == $CURUSER['id'])
  850. || get_user_class() >= UC_MODERATOR
  851. && $CURUSER['staff_access'] == "yes"
  852. && $CURUSER['mod_access'] == "yes"
  853. && $CURUSER['staff_code'] == "$staff_code"))
  854. {
  855. print("<td class='rowhead' align='left'>
  856. <a href='userhistory.php?action=viewposts&amp;id=$id'>&nbsp;$forumposts</a>
  857. </td>
  858. </tr>");
  859. }
  860. else
  861. {
  862. print("<td class='rowhead' align='left'>&nbsp;$forumposts</td>
  863. </tr>");
  864. }
  865.  
  866. if ($CURUSER['id'] != $user['id'])
  867. {
  868. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  869. && $CURUSER['mod_access'] == "yes"
  870. && $CURUSER['staff_code'] == "$staff_code")
  871. {
  872. $showpmbutton = 1;
  873. }
  874. }
  875.  
  876. if ($user['acceptpms'] == "yes")
  877. {
  878. $r = sql_query("SELECT id
  879. FROM blocks
  880. WHERE userid = {$user['id']}
  881. AND blockid= {$CURUSER['id']}") or sqlerr(__FILE__, __LINE__);
  882.  
  883. $showpmbutton = (mysqli_num_rows($r) == 1 ? 0 : 1);
  884. }
  885.  
  886. if ($user['acceptpms'] == "friends")
  887. {
  888. $r = sql_query("SELECT id
  889. FROM friends
  890. WHERE userid = {$user['id']}
  891. AND friendid = {$CURUSER['id']}") or sqlerr(__FILE__, __LINE__);
  892.  
  893. $showpmbutton = (mysqli_num_rows($r) == 1 ? 1 : 0);
  894. }
  895.  
  896. if ($user['id'] != $CURUSER['id'])
  897. {
  898. print("<tr>
  899. <td class='std' align='center' colspan='2'>
  900. <form method='post' action='report.php?type=User&amp;id=$id'>
  901. <input type='submit' class='btn' value='{$lang['btn_report_user']}' />
  902. </form>
  903. </td>
  904. </tr>");
  905.  
  906. if (isset($showpmbutton))
  907. {
  908. print("<tr>
  909. <td class='std' align='center' colspan='2'>
  910. <form method='get' action='sendmessage.php'>
  911. <input type='hidden' name='receiver' value='{$user['id']}' />
  912. <input type='submit' class='btn' value='{$lang['btn_send_msg']}' style='height : 23px' />
  913. </form>
  914. </td>
  915. </tr>");
  916. }
  917. }
  918.  
  919. print("</table></div>");
  920. //----- Finish General Details Content -----//
  921.  
  922. //----- Start Torrent Details Content -----//
  923. print("<div class='ui-tabs-panel' id='fragment-2'>
  924. <table class='coltable' width='70%'>
  925. <tr>
  926. <td class='std' align='center' colspan='2'>
  927. <h2>{$lang['table_torrents_details']}</h2>
  928. </td>
  929. </tr>");
  930.  
  931. $port = $a[1];
  932. $agent = $a[2];
  933.  
  934. if (!empty($port))
  935. {
  936. print("<tr>
  937. <td class='colhead'>&nbsp;{$lang['table_torrents_port']}</td>
  938. <td align='left'>&nbsp;$port</td>
  939. </tr>
  940.  
  941. <tr>
  942. <td class='colhead'>&nbsp;{$lang['table_torrents_client']}</td>
  943. <td align='left'>&nbsp;" . htmlentities($agent) . "</td>
  944. </tr>
  945.  
  946. <tr>
  947. <td class='colhead' width='20%'>&nbsp;{$lang['table_torrents_connectable']}</td>
  948. <td class='rowhead' align='left'>&nbsp;" . $connectable . "</td>
  949. </tr>");
  950. }
  951.  
  952. print("<tr>
  953. <td class='colhead' width='20%'>&nbsp;{$lang['table_torrents_uploaded']}</td>
  954. <td class='rowhead' align='left'>&nbsp;" . mksize($user['uploaded']) . "</td>
  955. </tr>
  956.  
  957. <tr>
  958. <td class='colhead' width='20%'>&nbsp;{$lang['table_torrents_downloaded']}</td>
  959. <td class='rowhead' align='left'>&nbsp;" . mksize($user['downloaded']) . "</td>
  960. </tr>
  961.  
  962. <tr>
  963. <td class='colhead' width='20%'>&nbsp;{$lang['table_torrents_ratio']}</td>
  964. <td class='rowhead' align='left' style='font-weight : bold;'>&nbsp;$sr</td>
  965. </tr>");
  966.  
  967. if ($torrentcomments && (($user['class'] >= UC_POWER_USER
  968. && $user['id'] == $CURUSER['id'])
  969. || get_user_class() >= UC_MODERATOR
  970. && $CURUSER['staff_access'] == "yes"
  971. && $CURUSER['mod_access'] == "yes"
  972. && $CURUSER['staff_code'] == "$staff_code"))
  973. {
  974. print("<tr>
  975. <td class='colhead' width='20%'>&nbsp;{$lang['table_torrents_comments']}</td>
  976. <td class='rowhead' align='left'>
  977. <a href='userhistory.php?action=viewcomments&amp;id=$id'>&nbsp;$torrentcomments</a>
  978. </td>
  979. </tr>");
  980. }
  981. else
  982. {
  983. print("<tr>
  984. <td class='colhead' width='20%'>&nbsp;{$lang['table_torrents_comments']}</td>
  985. <td class='rowhead' align='left'>&nbsp;$torrentcomments</td>
  986. </tr>");
  987. }
  988.  
  989. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  990. && $CURUSER['mod_access'] == "yes"
  991. && $CURUSER['staff_code'] == "$staff_code"
  992. || $user['id'] == $CURUSER['id'])
  993. {
  994. print("<tr>
  995. <td class='colhead' width='20%'>&nbsp;{$lang['table_torrents_flush']}</td>
  996. <td align='left'>
  997. <a href='flushghosts.php?id={$user['id']}'>&nbsp;<strong>{$lang['table_torrents_flush1']}</strong></a>
  998. {$lang['table_torrents_flush2']}
  999. </td>
  1000. </tr>");
  1001. }
  1002.  
  1003. print("</table></div>");
  1004. //----- Finish Torrent Details Content -----//
  1005.  
  1006. //----- Start Information Details Content -----//
  1007. print("<div class='ui-tabs-panel' id='fragment-3'>
  1008. <table class='coltable' width='70%'>
  1009. <tr>
  1010. <td class='std' align='center' colspan='2'>
  1011. <h2>{$lang['table_info_details']}</h2>
  1012. </td>
  1013. </tr>");
  1014.  
  1015. if ($user['info'])
  1016. {
  1017. print("<tr>
  1018. <td class='colhead' width='20%'>&nbsp;{$lang['table_info_share_info']}</td>
  1019. <td class='rowhead' align='left'>&nbsp;" . format_comment($user['info']) . "</td>
  1020. </tr>");
  1021. }
  1022.  
  1023. if ($user['signature'])
  1024. {
  1025. print("<tr>
  1026. <td class='colhead' width='20%'>&nbsp;{$lang['table_info_signature']}</td>
  1027. <td class='rowhead' align='left'>&nbsp;" . format_comment($user['signature']) . "</td>
  1028. </tr>");
  1029. }
  1030.  
  1031. print("</table>");
  1032. print("</div>");
  1033. //----- Finish Information Details Content -----//
  1034.  
  1035. //----- Start Snatch List Details Content -----//
  1036. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1037. && $CURUSER['mod_access'] == "yes"
  1038. && $CURUSER['staff_code'] == "$staff_code"
  1039. || $user['id'] == $CURUSER['id'])
  1040. {
  1041. print("<div class='ui-tabs-panel' id='fragment-4'>
  1042. <table class='coltable' width='70%'>
  1043. <tr>
  1044. <td class='std' align='center' colspan='2'>
  1045. <h2>{$lang['table_snatched_details']}</h2>
  1046. </td>
  1047. </tr>");
  1048.  
  1049. //----- Start Recently Snatched Expanding Table -----//
  1050. $snatches = "";
  1051.  
  1052. $r= sql_query("SELECT id, name, seeders, leechers, category
  1053. FROM torrents
  1054. WHERE owner = $id
  1055. ORDER BY name") or sqlerr();
  1056.  
  1057. if (mysqli_num_rows($r) > 0)
  1058. {
  1059. $numbupl = mysqli_num_rows($r);
  1060. }
  1061.  
  1062. if (isset($torrents))
  1063. {
  1064. print("<tr valign='top'>
  1065. <td class='colhead' width='15%'>&nbsp;{$lang['table_snatched_uploaded']}&nbsp;</td>
  1066. <td class='rowhead' align='left' colspan='85%'>
  1067.  
  1068. <a href=\"javascript: klappe_news('a1')\">
  1069. <img src='{$FTSP_V2['$image_dir']}plus.png' width='16' height='16' border='0' id='pica1' alt='{$lang['img_alt_hide_show']}' title='{$lang['img_alt_hide_show']}' />
  1070. </a>
  1071.  
  1072. <span class='userdetails_hide_show'>&nbsp;&nbsp;$numbupl</span>
  1073.  
  1074. <div id='ka1' style='display : none; overflow : auto; width : 100%; height : 200px'>$torrents</div>
  1075. </td>
  1076. </tr>");
  1077. }
  1078.  
  1079. //----- Start Expanding Currently Seeding -----//
  1080. if (mysqli_num_rows($res) > 0)
  1081. {
  1082. $numbseeding = mysqli_num_rows($res);
  1083. }
  1084.  
  1085. if (isset($seeding))
  1086. {
  1087. print("<tr valign='top'>
  1088. <td class='colhead' width='15%'>&nbsp;{$lang['table_snatched_seeding']}&nbsp;</td>
  1089. <td class='rowhead' align='left' colspan='85%'>
  1090.  
  1091. <a href=\"javascript: klappe_news('a2')\">
  1092. <img src='{$FTSP_V2['$image_dir']}plus.png' width='16' height='16' border='0' id='pica2' alt='{$lang['img_alt_hide_show']}' title='{$lang['img_alt_hide_show']}' />
  1093. </a>
  1094.  
  1095. <span class='userdetails_hide_show'>&nbsp;&nbsp;$numbseeding</span>
  1096.  
  1097. <div id='ka2' style='display : none; overflow : auto; width : 100%; height : 200px'>&nbsp" . maketable($seeding) . "</div>
  1098. </td>
  1099. </tr>");
  1100. }
  1101. //----- Finish Expanding Currently Seeding -----//
  1102.  
  1103. //----- Start Expanding Currently Leeching -----//
  1104. if (mysqli_num_rows($res) > 0)
  1105. {
  1106. $numbleeching = mysqli_num_rows($res);
  1107. }
  1108.  
  1109. if (isset($leeching))
  1110. {
  1111. print("<tr valign='top'>
  1112. <td class='colhead' width='15%'>&nbsp;{$lang['table_snatched_leeching']}&nbsp;</td>
  1113. <td class='rowhead' align='left' width='85%'>
  1114.  
  1115. <a href=\"javascript: klappe_news('a3')\">
  1116. <img src='{$FTSP_V2['$image_dir']}plus.png' width='16' height='16' border='0' id='pica3' alt='{$lang['img_alt_hide_show']}' title='{$lang['img_alt_hide_show']}' />
  1117. </a>
  1118.  
  1119. <span class='userdetails_hide_show'>&nbsp;&nbsp;$numbleeching</span>
  1120.  
  1121. <div id='ka3' style='display : none; overflow : auto; width : 100%; height : 200px'>&nbsp;" . maketable($leeching) . "</div>
  1122. </td>
  1123. </tr>");
  1124. }
  1125. //----- Finish Expanding Currently Leeching -----//
  1126.  
  1127. //----- Start Snatched Table -----//
  1128. $snatches = "";
  1129.  
  1130. $res = sql_query("SELECT s.*, t.name AS name, c.name AS catname, c.image AS catimg
  1131. FROM snatched AS s
  1132. INNER JOIN torrents AS t ON s.torrentid = t.id
  1133. LEFT JOIN categories AS c ON t.category = c.id
  1134. WHERE s.userid = $user[id]") or sqlerr(__FILE__, __LINE__);
  1135.  
  1136. if (mysqli_num_rows($res) > 0)
  1137. {
  1138. $snatches = snatchtable($res);
  1139. }
  1140.  
  1141. $numbsnatched = mysqli_num_rows($res);
  1142.  
  1143. if (isset($snatches))
  1144. {
  1145. print("<tr valign='top'>
  1146. <td class='colhead' width='15%'>&nbsp;{$lang['table_snatched_recent']}&nbsp;</td>
  1147. <td class='rowhead' align='left' width='85%'>
  1148.  
  1149. <a href=\"javascript: klappe_news('a4')\">
  1150. <img src='{$FTSP_V2['$image_dir']}plus.png' width='16' height='16' border='0' id='pica4' alt='{$lang['img_alt_hide_show']}' title='{$lang['img_alt_hide_show']}' />
  1151. </a>
  1152.  
  1153. <span class='userdetails_hide_show'>&nbsp;&nbsp;$numbsnatched</span>
  1154.  
  1155. <div id='ka4' style='display : none; overflow : auto; width : 100%; height : 200px'>$snatches</div>
  1156. </td>
  1157. </tr>");
  1158. }
  1159. //----- Finish Snatched Table -----//
  1160.  
  1161. //----- Finish Recently Snatched Expanding Table -----//
  1162. $res1 = sql_query("SELECT UNIX_TIMESTAMP(sn.start_date) AS s,
  1163. UNIX_TIMESTAMP(sn.complete_date) AS c,
  1164. UNIX_TIMESTAMP(sn.last_action) AS l_a,
  1165. UNIX_TIMESTAMP(sn.seedtime) AS s_t,
  1166. sn.seedtime,
  1167. UNIX_TIMESTAMP(sn.leechtime) AS l_t,
  1168. sn.leechtime, sn.downspeed, sn.upspeed, sn.uploaded, sn.downloaded, sn.torrentid, sn.start_date, sn.complete_date, sn.seeder, sn.last_action, sn.connectable, sn.agent, sn.seedtime, sn.port, cat.name, cat.image, t.size, t.seeders, t.leechers, t.owner, t.name AS torrent_name
  1169. FROM snatched AS sn
  1170. LEFT JOIN torrents AS t ON t.id = sn.torrentid
  1171. LEFT JOIN categories AS cat ON cat.id = t.category
  1172. WHERE sn.userid = $id
  1173. ORDER BY sn.start_date DESC") or die(mysqli_error());
  1174.  
  1175. if (mysqli_num_rows($res1) > 0)
  1176. {
  1177. $snatched = snatch_table($res1);
  1178. }
  1179.  
  1180. $numbsnatched = mysqli_num_rows($res1);
  1181.  
  1182. if (isset($snatched))
  1183. {
  1184. print("<tr valign='top'>
  1185. <td class='colhead' width='15%'>&nbsp;{$lang['table_snatched_status']}&nbsp;</td>
  1186. <td class='rowhead' align='left' width='85%'>
  1187.  
  1188. <a href=\"javascript: klappe_news('a5')\">
  1189. <img src='{$FTSP_V2['$image_dir']}plus.png' width='16' height='16' border='0' id='pica5' alt='{$lang['img_alt_hide_show']}' title='{$lang['img_alt_hide_show']}' />
  1190. </a>
  1191.  
  1192. <span class='userdetails_hide_show'>&nbsp;&nbsp;$numbsnatched</span>
  1193.  
  1194. <div id='ka5' style='display : none; overflow : auto; width : 100%; height : 200px'>$snatched</div>
  1195. </td>
  1196. </tr>");
  1197. }
  1198.  
  1199. print("</table></div>");}
  1200. //----- Finish Snatch List Details Content -----//
  1201.  
  1202. //----- Start Alter Ratio Details Content -----//
  1203. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  1204. && $CURUSER['mod_access'] == "yes"
  1205. && $CURUSER['admin_access'] == "yes"
  1206. && $CURUSER['sysop_access'] == "yes"
  1207. && $CURUSER['staff_code'] == "$staff_code"
  1208. && $user['class'] < get_user_class())
  1209. {
  1210. print("<div class='ui-tabs-panel' id='fragment-5'>
  1211. <form method='post' action='ratio.php'>
  1212. <table class='coltable' width='70%'>
  1213. <tr>
  1214. <td class='std' align='center' colspan='2'>
  1215. <h2>{$lang['table_ratio_details']}</h2>
  1216. </td>
  1217. </tr>");
  1218.  
  1219. //----- Start Create Ratio By Fireknight Based On The Original Code By Dodge -----//
  1220. print("<tr>
  1221. <td class='colhead'>&nbsp;{$lang['form_field_ratio_user']}</td>
  1222. <td class='rowhead'>
  1223. <input name='username' value='{$user['username']}' size='40' readonly='readonly' />
  1224. </td>
  1225. </tr>");
  1226.  
  1227. print("<tr>
  1228. <td class='colhead'>&nbsp;{$lang['form_field_ratio_uploaded']}</td>
  1229. <td class='rowhead'>
  1230. <input type='text' name='uploaded' value='0' size='40' />
  1231. </td>
  1232. </tr>");
  1233.  
  1234. print("<tr>
  1235. <td class='colhead'>&nbsp;{$lang['form_field_ratio_downloaded']}</td>
  1236. <td class='rowhead'>
  1237. <input type='text' name='downloaded' value='0' size='40' />
  1238. </td>
  1239. </tr>");
  1240.  
  1241. print("<tr>
  1242. <td class='colhead'>&nbsp;{$lang['form_field_ratio_select']}</td>
  1243. <td class='rowhead'>
  1244. <select name='bytes'>");
  1245.  
  1246. print("<option value='1'>{$lang['form_opt_ratio_mb']}</option>
  1247. <option value='2'>{$lang['form_opt_ratio_gb']}</option>
  1248. <option value='3'>{$lang['form_opt_ratio_tb']}</option>
  1249. </select></td>
  1250.  
  1251. <tr>
  1252. <td class='colhead'>&nbsp;{$lang['form_field_ratio_action']}</td>
  1253. <td class='rowhead'>
  1254. <select name='action'>
  1255. <option value='1'>{$lang['form_opt_ratio_add']}</option>
  1256. <option value='2'>{$lang['form_opt_ratio_del']}</option>
  1257. <option value='3'>{$lang['form_opt_ratio_replace_ul']}</option>
  1258. <option value='4'>{$lang['form_opt_ratio_replace_dl']}</option>
  1259. </select>
  1260. </td>
  1261. </tr>
  1262.  
  1263. <tr>
  1264. <td class='std' align='center' colspan='2'>
  1265. <input type='submit' class='btn' value='{$lang['gbl_btn_submit']}' />
  1266. </td>
  1267. </tr>");
  1268. //----- End Create Ratio By Fireknight Based On The Original Code By Dodge -----//
  1269.  
  1270. print("</table></form></div>");
  1271. }
  1272. //------ Finish Alter Ratio Details Content -----//
  1273.  
  1274. //----- Start Edit User Details Content -----//
  1275. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1276. && $CURUSER['mod_access'] == "yes"
  1277. && $CURUSER['staff_code'] == "$staff_code"
  1278. && $user['class'] < get_user_class())
  1279. {
  1280. print("<div class='ui-tabs-panel' id='fragment-6'>
  1281. <form method='post' action='modtask.php'>");
  1282.  
  1283. require_once(FUNC_DIR.'function_user_validator.php');
  1284.  
  1285. print(validatorForm("ModTask_{$user['id']}"));
  1286. print("<input type='hidden' name='action' value='edituser' />
  1287. <input type='hidden' name='userid' value='$id' />
  1288. <input type='hidden' name='returnto' value='userdetails.php?id=$id' />
  1289. <table class='coltable' width='70%'>
  1290. <tr>
  1291. <td class='std' align='center' colspan='3'>
  1292. <h2>{$lang['table_edit_user_details']}</h2>
  1293. </td>
  1294. </tr>");
  1295.  
  1296. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1297. && $CURUSER['mod_access'] == "yes"
  1298. && $CURUSER['staff_code'] == "$staff_code")
  1299. {
  1300. print("<tr>
  1301. <td class='colhead'>&nbsp;{$lang['form_field_edit_title']}</td>
  1302. <td class='rowhead' align='left' colspan='2'>
  1303. <input type='text' name='title' size='60' value='" . htmlsafechars($user['title']) . "' />
  1304. </td>
  1305. </tr>");
  1306. }
  1307.  
  1308. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  1309. && $CURUSER['mod_access'] == "yes"
  1310. && $CURUSER['admin_access'] == "yes"
  1311. && $CURUSER['sysop_access'] == "yes"
  1312. && $CURUSER['staff_code'] == "$staff_code")
  1313. {
  1314. print("<tr>
  1315. <td class='colhead'>&nbsp;{$lang['form_field_edit_username']}</td>
  1316. <td class='rowhead' align='left' colspan='2'>
  1317. <input type='text' name='username' size='60' value='" . htmlspecialchars($user['username']) . "' />
  1318. </td>
  1319. </tr>");
  1320. }
  1321.  
  1322. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  1323. && $CURUSER['mod_access'] == "yes"
  1324. && $CURUSER['admin_access'] == "yes"
  1325. && $CURUSER['sysop_access'] == "yes"
  1326. && $CURUSER['staff_code'] == "$staff_code")
  1327. {
  1328. print("<tr>
  1329. <td class='colhead'>&nbsp;{$lang['form_field_edit_email']}</td>
  1330. <td class='rowhead' align='left' colspan='2'>
  1331. <input type='text' name='email' size='60' value='" . htmlspecialchars($user['email']) . "' />
  1332. </td>
  1333. </tr>");
  1334. }
  1335.  
  1336. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1337. && $CURUSER['mod_access'] == "yes"
  1338. && $CURUSER['staff_code'] == "$staff_code")
  1339. {
  1340. $avatar = htmlspecialchars($user['avatar']);
  1341.  
  1342. print("<tr>
  1343. <td class='colhead' align='left'>&nbsp;{$lang['form_field_edit_avatar']}</td>
  1344. <td class='rowhead' align='left' colspan='2'>
  1345. <input type='text' name='avatar' size='60' value='" . htmlspecialchars($user['avatar']) . "' />
  1346. </td>
  1347. </tr>");
  1348. }
  1349.  
  1350. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1351. && $CURUSER['mod_access'] == "yes"
  1352. && $CURUSER['staff_code'] == "$staff_code")
  1353. {
  1354. $info = htmlspecialchars($user['info']);
  1355.  
  1356. print("<tr>
  1357. <td class='colhead'>&nbsp;{$lang['form_field_edit_info']}</td>
  1358. <td class='rowhead' align='left' colspan='2'>
  1359. <input type='text' name='info' size='60' value='" . htmlspecialchars($user['info']) . "' />
  1360. </td>
  1361. </tr>");
  1362. }
  1363.  
  1364. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1365. && $CURUSER['mod_access'] == "yes"
  1366. && $CURUSER['staff_code'] == "$staff_code")
  1367. {
  1368. $signature = htmlspecialchars($user['signature']);
  1369.  
  1370. print("<tr>
  1371. <td class='colhead'>&nbsp;{$lang['form_field_edit_sig']}</td>
  1372. <td class='rowhead' align='left' colspan='2'>
  1373. <input type='text' name='signature' size='60' value='$signature' />
  1374. </td>
  1375. </tr>");
  1376. }
  1377.  
  1378. //----- We Do Not Want Mods To Be Able To Change User Classes Or Amount Donated... -----//
  1379. if ($CURUSER['class'] >= UC_ADMINISTRATOR && $CURUSER['staff_access'] == "yes"
  1380. && $CURUSER['mod_access'] == "yes"
  1381. && $CURUSER['admin_access'] == "yes"
  1382. && $CURUSER['staff_code'] == "$staff_code")
  1383. {
  1384. print("<tr>
  1385. <td class='colhead'>&nbsp;{$lang['form_field_edit_donor']}</td>
  1386. <td class='rowhead' align='left' colspan='2'>
  1387.  
  1388. <input type='radio' name='donor' value='yes' " . ($user['donor'] == "yes" ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1389.  
  1390. <input type='radio' name='donor' value='no' " . ($user['donor'] == "no" ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1391. </td>
  1392. </tr>");
  1393. }
  1394.  
  1395. if ($user['class'] >= $CURUSER['class'])
  1396.  
  1397. {
  1398. print("<input type='hidden' name='class' value='{$user['class']}' />");
  1399. }
  1400. else
  1401. {
  1402. print("<tr>
  1403. <td class='colhead'>&nbsp;{$lang['form_field_edit_class']}</td>
  1404. <td class='rowhead' align='left' colspan='2'>
  1405. <select name='class'>");
  1406.  
  1407. if (get_user_class() == UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1408. && $CURUSER['mod_access'] == "yes"
  1409. && $CURUSER['staff_code'] == "$staff_code")
  1410. {
  1411. $maxclass = UC_VIP;
  1412. }
  1413. else
  1414. {
  1415. $maxclass = get_user_class() - 1;
  1416. }
  1417.  
  1418. for ($i = 0;
  1419. $i <= $maxclass;
  1420. ++$i)
  1421. {
  1422. $members_current_class = get_user_class_name($i);
  1423.  
  1424. if ($members_current_class)
  1425. {
  1426. //print("<option value='$i' " . (isset($user['class']) == $i ? " selected='selected' " : "") . "> " . $members_current_class . "</option>");
  1427.  
  1428. print("<option value='$i' " . ($user['class'] == $i ? " selected='selected' " : "") . ">" . $members_current_class . "</option>\n");
  1429. }
  1430. }
  1431.  
  1432. print("</select></td></tr>");
  1433. }
  1434.  
  1435. //----- Start First Line Support -----//
  1436. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1437. && $CURUSER['mod_access'] == "yes"
  1438. && $CURUSER['staff_code'] == "$staff_code")
  1439. {
  1440. print("<tr>
  1441. <td class='colhead'>&nbsp;{$lang['form_field_edit_support']}</td>
  1442. <td class='rowhead' align='left' colspan='2'>
  1443.  
  1444. <input type='radio' name='support' value='yes' " . ($user['support'] == "yes" ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1445.  
  1446. <input type='radio' name='support' value='no' " . ($user['support'] == "no" ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1447. </td>
  1448. </tr>");
  1449.  
  1450. $supportfor = htmlspecialchars($user['supportfor']);
  1451.  
  1452. print("<tr>
  1453. <td class='colhead'>&nbsp;{$lang['form_field_edit_sup_for']}</td>
  1454. <td class='rowhead' align='left' colspan='2'>
  1455. <textarea name='supportfor' cols='60' rows='3'>$supportfor</textarea>
  1456. </td>
  1457. </tr>");
  1458.  
  1459. $support_language = "<option value=''>----{$lang['form_field_opt_edit_non_sel']}----</option>";
  1460.  
  1461. $sl_r = sql_query("SELECT name
  1462. FROM support_lang
  1463. ORDER BY name") or sqlerr(__FILE__, __LINE__);
  1464.  
  1465. while ($sl_a = mysqli_fetch_assoc($sl_r))
  1466. {
  1467. $support_language .= "<option value='{$sl_a['name']}' " . ($user['support_lang'] == $sl_a['name'] ? " selected='selected' " : "") . ">{$sl_a['name']}</option>";
  1468. }
  1469.  
  1470. print("<tr>
  1471. <td class='colhead'>&nbsp;{$lang['form_field_edit_lang']}</td>
  1472. <td class='rowhead' colspan='2'>
  1473. <select name='support_lang'>$support_language</select>
  1474. </td>
  1475. </tr>");
  1476. }
  1477. //----- Finish First Line Support -----//
  1478.  
  1479. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1480. && $CURUSER['mod_access'] == "yes"
  1481. && $CURUSER['staff_code'] == "$staff_code")
  1482. {
  1483. print("<tr>
  1484. <td class='colhead'>&nbsp;{$lang['form_field_edit_invite']}</td>
  1485. <td class='rowhead' align='left' colspan='2'>
  1486.  
  1487. <input type='radio' name='invite_rights' value='yes' " . ($user['invite_rights']=="yes" ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1488.  
  1489. <input type='radio' name='invite_rights' value='no' " . ($user['invite_rights']=="no" ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1490. </td>
  1491. </tr>");
  1492.  
  1493. print("<tr>
  1494. <td class='colhead'>&nbsp;{$lang['form_field_edit_invites']}</td>
  1495. <td class='rowhead' align='left' colspan='2'>
  1496. <input type='text' size='3' name='invites' value='" . htmlspecialchars($user['invites']) . "' />
  1497. </td>
  1498. </tr>");
  1499. }
  1500.  
  1501. $modcomment = htmlspecialchars($user['modcomment']);
  1502.  
  1503. if (get_user_class() < UC_SYSOP && $CURUSER['staff_access'] == "yes"
  1504. && $CURUSER['mod_access'] == "yes"
  1505. && $CURUSER['sysop_access'] == "no"
  1506. && $CURUSER['staff_code'] == "$staff_code")
  1507. {
  1508. print("<tr>
  1509. <td class='colhead'>&nbsp;{$lang['form_field_edit_comment']}</td>
  1510. <td class='rowhead' align='left' colspan='2'>
  1511. <textarea name='modcomment' cols='60' rows='18' readonly='readonly'>$modcomment</textarea>
  1512. </td>
  1513. </tr>");
  1514. }
  1515. else
  1516. {
  1517. print("<tr>
  1518. <td class='colhead'>&nbsp;{$lang['form_field_edit_comment']}</td>
  1519. <td class='rowhead' align='left' colspan='2'>
  1520. <textarea name='modcomment' cols='60' rows='18'>$modcomment</textarea>
  1521. </td>
  1522. </tr>");
  1523. }
  1524.  
  1525. print("<tr>
  1526. <td class='colhead'>&nbsp;{$lang['form_field_edit_add_comm']}</td>
  1527. <td class='rowhead' align='left' colspan='2'>
  1528. <textarea name='addcomment' cols='60' rows='2'></textarea>
  1529. </td>
  1530. </tr>");
  1531.  
  1532. $warned = $user['warned'] == "yes";
  1533.  
  1534. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1535. && $CURUSER['mod_access'] == "yes"
  1536. && $CURUSER['staff_code'] == "$staff_code")
  1537. {
  1538. print("<tr>
  1539. <td class='colhead' " . (!$warned ? " rowspan='2' " : "") . ">&nbsp;{$lang['form_field_edit_warned']}</td>
  1540. <td class='rowhead' align='left' width='20%'>&nbsp;" . ($warned ? "
  1541.  
  1542. <input type='radio' name='warned' value='yes' checked='checked' />{$lang['form_field_opt_edit_yes']}
  1543.  
  1544. <input type='radio' name='warned' value='no' />{$lang['form_field_opt_edit_no']}" : "{$lang['form_field_opt_edit_no']}") . "
  1545. </td>");
  1546.  
  1547. if ($warned)
  1548. {
  1549. $warneduntil = $user['warneduntil'];
  1550.  
  1551. if ($warneduntil == '0000-00-00 00:00:00')
  1552. {
  1553. print("<td class='rowhead'>{$lang['table_edit_user_warning']}</td></tr>");
  1554. }
  1555. else
  1556. {
  1557. print("<td class='rowhead' align='center'>{$lang['table_edit_user_until']}$warneduntil (" . mkprettytime(strtotime($warneduntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1558. }
  1559. }
  1560. else
  1561. {
  1562. print("<td class='rowhead'>&nbsp;{$lang['form_field_edit_worn_for']}<select name='warnlength'>
  1563. <option value='0'>------</option>
  1564. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1565. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1566. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1567. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1568. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1569. </select>
  1570. </td>
  1571. </tr>
  1572. <tr>
  1573. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1574. <input type='text' name='warnpm' size='60' />
  1575. </td>
  1576.  
  1577. </tr>");
  1578. }
  1579. }
  1580.  
  1581. //----- Start Upload Enable / Disable -----//
  1582. if (get_user_class() >= UC_ADMINISTRATOR && $CURUSER['staff_access'] == "yes"
  1583. && $CURUSER['mod_access'] == "yes"
  1584. && $CURUSER['admin_access'] == "yes"
  1585. && $CURUSER['staff_code'] == "$staff_code")
  1586. {
  1587. if ($user['uploadpos'] == "no")
  1588. {
  1589. $uploadposuntil = $user['uploadposuntil'];
  1590. $uploadpos = $user['uploadpos'];
  1591.  
  1592. print("<tr>
  1593. <td class='colhead'>&nbsp;{$lang['form_field_edit_ul_enabled']}</td>
  1594. <td class='rowhead' align='left' width='20%'>
  1595.  
  1596. <input type='radio' name='uploadpos' value='yes' " . (!$uploadpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1597.  
  1598. <input type='radio' name='uploadpos' value='no' " . ($uploadpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1599. </td>");
  1600.  
  1601. if ($user['uploadposuntil'] == "0000-00-00 00:00:00")
  1602. {
  1603. print("<td class='rowhead'>&nbsp;<strong>{$lang['table_edit_user_total_ban']}</strong> - {$lang['table_edit_user_advice']}</td></tr>");
  1604. }
  1605. else
  1606. {
  1607. print("<td class='rowhead'>&nbsp;{$lang['table_edit_user_until']}$uploadposuntil");
  1608. print(" (" . mkprettytime(strtotime($uploadposuntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1609. }
  1610. }
  1611.  
  1612. if ($user['uploadpos'] == "yes")
  1613. {
  1614. print("<tr>
  1615. <td class='colhead' rowspan='2'>&nbsp;{$lang['form_field_edit_ul_enabled']}</td>
  1616. <td class='rowhead'>&nbsp;{$lang['form_field_opt_edit_yes']}</td>
  1617. <td class='rowhead'>&nbsp;{$lang['table_edit_user_disable']}:-&nbsp;<select name='uploadposuntillength'>
  1618. <option value='0'>------</option>
  1619. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1620. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1621. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1622. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1623. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1624. </select>
  1625. </td>
  1626. </tr>
  1627. <tr>
  1628. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1629. <input type='text' name='uploadposuntilpm' size='60' />
  1630. </td>
  1631. </tr>");
  1632. }
  1633. }
  1634. //----- Finish Upload Enable / Disable -----//
  1635.  
  1636. //----- Start Download Enable - Disable -----//
  1637. if (get_user_class() >= UC_ADMINISTRATOR && $CURUSER['staff_access'] == "yes"
  1638. && $CURUSER['mod_access'] == "yes"
  1639. && $CURUSER['admin_access'] == "yes"
  1640. && $CURUSER['staff_code'] == "$staff_code")
  1641. {
  1642. if ($user['downloadpos'] == "no")
  1643. {
  1644. $downloadposuntil = $user['downloadposuntil'];
  1645. $downloadpos = $user['downloadpos'];
  1646.  
  1647. print("<tr>
  1648. <td class='colhead'>&nbsp;{$lang['form_field_edit_dl_enabled']}</td>
  1649. <td class='rowhead' align='left' width='20%'>
  1650.  
  1651. <input type='radio' name='downloadpos' value='yes' " . (!$downloadpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1652.  
  1653. <input type='radio' name='downloadpos' value='no' " . ($downloadpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1654. </td>");
  1655.  
  1656. if ($user['downloadposuntil'] == "0000-00-00 00:00:00")
  1657. {
  1658. print("<td class='rowhead'>&nbsp;<strong>{$lang['table_edit_user_total_ban']}</strong> - {$lang['table_edit_user_advice']}</td></tr>");
  1659. }
  1660. else
  1661. {
  1662. print("<td class='rowhead'>&nbsp;{$lang['table_edit_user_until']}$downloadposuntil");
  1663. print(" (" . mkprettytime(strtotime($downloadposuntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1664. }
  1665. }
  1666.  
  1667. if ($user['downloadpos'] == "yes")
  1668. {
  1669. print("<tr>
  1670. <td class='colhead' rowspan='2'>&nbsp;{$lang['form_field_edit_dl_enabled']}</td>
  1671. <td class='rowhead'>&nbsp;{$lang['form_field_opt_edit_yes']}</td>
  1672. <td class='rowhead'>&nbsp;{$lang['table_edit_user_disable']}:-&nbsp;<select name='downloadposuntillength'>
  1673. <option value='0'>------</option>
  1674. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1675. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1676. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1677. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1678. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1679. </select>
  1680. </td>
  1681. </tr>
  1682.  
  1683. <tr>
  1684. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1685. <input type='text' name='downloadposuntilpm' size='60' />
  1686. </td>
  1687. </tr>");
  1688. }
  1689. }
  1690. //----- Finish Download Enable - Disable -----//
  1691.  
  1692. //----- Start Shoutbox Enable - Disable -----//
  1693. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1694. && $CURUSER['mod_access'] == "yes"
  1695. && $CURUSER['staff_code'] == "$staff_code")
  1696. {
  1697. if ($user['shoutboxpos'] == "no")
  1698. {
  1699. $shoutboxposuntil = $user['shoutboxposuntil'];
  1700. $shoutboxpos = $user['shoutboxpos'];
  1701.  
  1702. print("<tr>
  1703. <td class='colhead'>&nbsp;{$lang['form_field_edit_sb_enabled']}</td>
  1704. <td class='rowhead' align='left' width='20%'>
  1705.  
  1706. <input type='radio' name='shoutboxpos' value='yes' " . (!$shoutboxpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1707.  
  1708. <input type='radio' name='shoutboxpos' value='no' " . ($shoutboxpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1709. </td>");
  1710.  
  1711. if ($user['shoutboxposuntil'] == "0000-00-00 00:00:00")
  1712. {
  1713. print("<td class='rowhead'>&nbsp;<strong>{$lang['table_edit_user_total_ban']}</strong> - {$lang['table_edit_user_advice']}</td></tr>");
  1714. }
  1715. else
  1716. {
  1717. print("<td class='rowhead'>{$lang['table_edit_user_until']}$shoutboxposuntil");
  1718. print(" (" . mkprettytime(strtotime($shoutboxposuntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1719. }
  1720. }
  1721.  
  1722. if ($user['shoutboxpos'] == "yes")
  1723. {
  1724. print("<tr>
  1725. <td class='colhead' rowspan='2'>&nbsp;{$lang['form_field_edit_sb_enabled']}</td>
  1726. <td class='rowhead'>&nbsp;{$lang['form_field_opt_edit_yes']}</td>
  1727. <td class='rowhead'>&nbsp;{$lang['table_edit_user_disable']}:-&nbsp;<select name='shoutboxposuntillength'>
  1728. <option value='0'>------</option>
  1729. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1730. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1731. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1732. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1733. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1734. </select>
  1735. </td>
  1736. </tr>
  1737.  
  1738. <tr>
  1739. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1740. <input type='text' name='shoutboxposuntilpm' size='60' />
  1741. </td>
  1742. </tr>");
  1743. }
  1744. }
  1745. //----- Finish Shoutbox Enable - Disable -----//
  1746.  
  1747. //----- Start Torrent Comment Enable - Disable -----//
  1748. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1749. && $CURUSER['mod_access'] == "yes"
  1750. && $CURUSER['staff_code'] == "$staff_code")
  1751. {
  1752. if ($user['torrcompos'] == "no")
  1753. {
  1754. $torrcomposuntil = $user['torrcomposuntil'];
  1755. $torrcompos = $user['torrcompos'];
  1756.  
  1757. print("<tr>
  1758. <td class='colhead'>&nbsp;{$lang['form_field_edit_com_enabled']}</td>
  1759. <td class='rowhead' align='left' width='20%'>
  1760.  
  1761. <input type='radio' name='torrcompos' value='yes' " . (!$torrcompos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1762.  
  1763. <input type='radio' name='torrcompos' value='no' " . ($torrcompos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1764. </td>");
  1765.  
  1766. if ($user['torrcomposuntil'] == "0000-00-00 00:00:00")
  1767. {
  1768. print("<td class='rowhead'>&nbsp;<strong>{$lang['table_edit_user_total_ban']}</strong> - {$lang['table_edit_user_advice']}</td></tr>");
  1769. }
  1770. else
  1771. {
  1772. print("<td class='rowhead'>{$lang['table_edit_user_until']}$torrcomposuntil");
  1773. print(" (" . mkprettytime(strtotime($torrcomposuntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1774. }
  1775. }
  1776.  
  1777. if ($user['torrcompos'] == "yes")
  1778. {
  1779. print("<tr>
  1780. <td class='colhead' rowspan='2'>&nbsp;{$lang['form_field_edit_com_enabled']}</td>
  1781. <td class='rowhead'>&nbsp;{$lang['form_field_opt_edit_yes']}</td>
  1782. <td class='rowhead'>&nbsp;{$lang['table_edit_user_disable']}:-&nbsp;<select name='torrcomposuntillength'>
  1783. <option value='0'>------</option>
  1784. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1785. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1786. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1787. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1788. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1789. </select>
  1790. </td>
  1791. </tr>
  1792.  
  1793. <tr>
  1794. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1795. <input type='text' name='torrcomposuntilpm' size='60' />
  1796. </td>
  1797. </tr>");
  1798. }
  1799. }
  1800. //----- Finish Torrent Comment Enable - Disable -----//
  1801.  
  1802. //----- Start Offer Comment Enable - Disable -----//
  1803. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1804. && $CURUSER['mod_access'] == "yes"
  1805. && $CURUSER['staff_code'] == "$staff_code")
  1806. {
  1807. if ($user['offercompos'] == "no")
  1808. {
  1809. $offercomposuntil = $user['offercomposuntil'];
  1810. $offercompos = $user['offercompos'];
  1811.  
  1812. print("<tr>
  1813. <td class='colhead'>&nbsp;{$lang['form_field_edit_offer_enabled']}</td>
  1814. <td class='rowhead' align='left' width='20%'>
  1815.  
  1816. <input type='radio' name='offercompos' value='yes' " . (!$offercompos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1817.  
  1818. <input type='radio' name='offercompos' value='no' " . ($offercompos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1819. </td>");
  1820.  
  1821. if ($user['offercomposuntil'] == "0000-00-00 00:00:00")
  1822. {
  1823. print("<td class='rowhead'>&nbsp;<strong>{$lang['table_edit_user_total_ban']}</strong> - {$lang['table_edit_user_advice']}</td></tr>");
  1824. }
  1825. else
  1826. {
  1827. print("<td class='rowhead'>{$lang['table_edit_user_until']}$offercomposuntil");
  1828. print(" (" . mkprettytime(strtotime($offercomposuntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1829. }
  1830. }
  1831.  
  1832. if ($user['offercompos'] == "yes")
  1833. {
  1834. print("<tr>
  1835. <td class='colhead' rowspan='2'>&nbsp;{$lang['form_field_edit_offer_enabled']}</td>
  1836. <td class='rowhead'>&nbsp;{$lang['form_field_opt_edit_yes']}</td>
  1837. <td class='rowhead'>&nbsp;{$lang['table_edit_user_disable']}:-&nbsp;<select name='offercomposuntillength'>
  1838. <option value='0'>------</option>
  1839. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1840. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1841. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1842. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1843. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1844. </select>
  1845. </td>
  1846. </tr>
  1847.  
  1848. <tr>
  1849. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1850. <input type='text' name='offercomposuntilpm' size='60' />
  1851. </td>
  1852. </tr>");
  1853. }
  1854. }
  1855. //----- Finish Offer Comment Enable - Disable -----//
  1856.  
  1857. //----- Start Request Comment Enable - Disable -----//
  1858. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  1859. && $CURUSER['mod_access'] == "yes"
  1860. && $CURUSER['staff_code'] == "$staff_code")
  1861. {
  1862. if ($user['requestcompos'] == "no")
  1863. {
  1864. $requestcomposuntil = $user['requestcomposuntil'];
  1865. $requestcompos = $user['requestcompos'];
  1866.  
  1867. print("<tr>
  1868. <td class='colhead'>&nbsp;{$lang['form_field_edit_req_com_enabled']}</td>
  1869. <td class='rowhead' align='left' width='20%'>
  1870.  
  1871. <input type='radio' name='requestcompos' value='yes' " . (!$requestcompos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1872.  
  1873. <input type='radio' name='requestcompos' value='no' " . ($requestcompos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1874. </td>");
  1875.  
  1876. if ($user['requestcomposuntil'] == "0000-00-00 00:00:00")
  1877. {
  1878. print("<td class='rowhead'>&nbsp;<strong>{$lang['table_edit_user_total_ban']}</strong> - {$lang['table_edit_user_advice']}</td></tr>");
  1879. }
  1880. else
  1881. {
  1882. print("<td class='rowhead'>{$lang['table_edit_user_until']}$requestcomposuntil");
  1883. print(" (" . mkprettytime(strtotime($requestcomposuntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1884. }
  1885. }
  1886.  
  1887. if ($user['requestcompos'] == "yes")
  1888. {
  1889. print("<tr>
  1890. <td class='colhead' rowspan='2'>&nbsp;{$lang['form_field_edit_req_com_enabled']}</td>
  1891. <td class='rowhead'>&nbsp;{$lang['form_field_opt_edit_yes']}</td>
  1892. <td class='rowhead'>&nbsp;{$lang['table_edit_user_disable']}:-&nbsp;<select name='requestcomposuntillength'>
  1893. <option value='0'>------</option>
  1894. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1895. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1896. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1897. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1898. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1899. </select>
  1900. </td>
  1901. </tr>
  1902.  
  1903. <tr>
  1904. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1905. <input type='text' name='requestcomposuntilpm' size='60' />
  1906. </td>
  1907. </tr>");
  1908. }
  1909. }
  1910. //----- Finish Request Comment Enable - Disable -----//
  1911.  
  1912.  
  1913. //----- Start Forum Enable - Disable -----//
  1914. if (get_user_class() >= UC_ADMINISTRATOR && $CURUSER['staff_access'] == "yes"
  1915. && $CURUSER['mod_access'] == "yes"
  1916. && $CURUSER['admin_access'] == "yes"
  1917. && $CURUSER['staff_code'] == "$staff_code")
  1918. {
  1919. if ($user['forumpos'] == "no")
  1920. {
  1921. $forumposuntil = $user['forumposuntil'];
  1922. $forumpos = $user['forumpos'];
  1923.  
  1924. print("<tr>
  1925. <td class='colhead'>&nbsp;{$lang['form_field_edit_forum_enabled']}</td>
  1926. <td class='rowhead' align='left' width='20%'>
  1927.  
  1928. <input type='radio' name='forumpos' value='yes' " . (!$forumpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1929.  
  1930. <input type='radio' name='forumpos' value='no' " . ($forumpos ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1931. </td>");
  1932.  
  1933. if ($user['forumposuntil'] == "0000-00-00 00:00:00")
  1934. {
  1935. print("<td class='rowhead'>&nbsp;<strong>{$lang['table_edit_user_total_ban']}</strong> - {$lang['table_edit_user_advice']}</td></tr>");
  1936. }
  1937. else
  1938. {
  1939. print("<td class='rowhead'>{$lang['table_edit_user_until']}$forumposuntil (" . mkprettytime(strtotime($forumposuntil) - gmtime()) . "{$lang['table_edit_user_to_go']})</td></tr>");
  1940. }
  1941. }
  1942.  
  1943. if ($user['forumpos'] == "yes")
  1944. {
  1945. print("<tr>
  1946. <td class='colhead' rowspan='2'>&nbsp;{$lang['form_field_edit_forum_enabled']}</td>
  1947. <td class='rowhead'>&nbsp;{$lang['form_field_opt_edit_yes']}</td>
  1948. <td class='rowhead'>&nbsp;{$lang['table_edit_user_disable']}:-&nbsp;<select name='forumposuntillength'>
  1949. <option value='0'>------</option>
  1950. <option value='1'>{$lang['form_field_opt_edit_1week']}</option>
  1951. <option value='2'>{$lang['form_field_opt_edit_2week']}</option>
  1952. <option value='4'>{$lang['form_field_opt_edit_4week']}</option>
  1953. <option value='8'>{$lang['form_field_opt_edit_8week']}</option>
  1954. <option value='255'>{$lang['form_field_opt_edit_unlimited']}</option>
  1955. </select>
  1956. </td>
  1957. </tr>
  1958.  
  1959. <tr>
  1960. <td class='rowhead' align='left' colspan='2'>&nbsp;{$lang['form_field_edit_comment']}:-&nbsp;&nbsp;&nbsp;
  1961. <input type='text' name='forumposuntilpm' size='60' />
  1962. </td>
  1963. </tr>");
  1964. }
  1965. }
  1966. //----- Finish Forum Enable - Disable -----//
  1967.  
  1968. if (get_user_class() >= UC_ADMINISTRATOR && $CURUSER['staff_access'] == "yes"
  1969. && $CURUSER['mod_access'] == "yes"
  1970. && $CURUSER['admin_access'] == "yes"
  1971. && $CURUSER['staff_code'] == "$staff_code")
  1972. {
  1973. print("<tr>
  1974. <td class='colhead'>&nbsp;{$lang['form_field_edit_acc_modaccess']}</td>
  1975. <td class='rowhead' align='left' colspan='2'>
  1976.  
  1977. <input type='radio' name='mod_access' value='yes' " . ($user['mod_access']=='yes' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1978.  
  1979. <input type='radio' name='mod_access' value='no' " . ($user['mod_access']=='no' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1980. </tr>");
  1981. }
  1982.  
  1983. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  1984. && $CURUSER['mod_access'] == "yes"
  1985. && $CURUSER['admin_access'] == "yes"
  1986. && $CURUSER['sysop_access'] == "yes"
  1987. && $CURUSER['staff_code'] == "$staff_code")
  1988. {
  1989. print("<tr>
  1990. <td class='colhead'>&nbsp;{$lang['form_field_edit_acc_adminaccess']}</td>
  1991. <td class='rowhead' align='left' colspan='2'>
  1992.  
  1993. <input type='radio' name='admin_access' value='yes' " . ($user['admin_access']=='yes' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  1994.  
  1995. <input type='radio' name='admin_access' value='no' " . ($user['admin_access']=='no' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  1996. </tr>");
  1997. }
  1998.  
  1999. if (get_user_class() >= UC_MANAGER && $CURUSER['staff_access'] == "yes"
  2000. && $CURUSER['mod_access'] == "yes"
  2001. && $CURUSER['admin_access'] == "yes"
  2002. && $CURUSER['sysop_access'] == "yes"
  2003. && $CURUSER['manager_access'] == "yes"
  2004. && $CURUSER['staff_code'] == "$staff_code")
  2005. {
  2006. print("<tr>
  2007. <td class='colhead'>&nbsp;{$lang['form_field_edit_acc_sysopaccess']}</td>
  2008. <td class='rowhead' align='left' colspan='2'>
  2009.  
  2010. <input type='radio' name='sysop_access' value='yes' " . ($user['sysop_access']=='yes' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  2011.  
  2012. <input type='radio' name='sysop_access' value='no' " . ($user['sysop_access']=='no' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  2013. </tr>");
  2014. }
  2015.  
  2016. print("<tr>
  2017. <td class='colhead'>&nbsp;{$lang['form_field_edit_acc_enabled']}</td>
  2018. <td class='rowhead' align='left' colspan='2'>
  2019.  
  2020. <input type='radio' name='enabled' value='yes' " . ($enabled ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  2021.  
  2022. <input type='radio' name='enabled' value='no' " . (!$enabled ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}</td>
  2023. </tr>
  2024.  
  2025. <tr>
  2026. <td class='colhead'>&nbsp;{$lang['form_field_edit_acc_parked']}</td>
  2027. <td class='rowhead' colspan='2' align='left'>
  2028.  
  2029. <input type='radio' name='parked' value='yes' " . ($user['parked']=='yes' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_yes']}
  2030.  
  2031. <input type='radio' name='parked' value='no' " . ($user['parked']=='no' ? " checked='checked' " : "") . " />{$lang['form_field_opt_edit_no']}
  2032. </td>
  2033. </tr>");
  2034.  
  2035. if (get_user_class() >= UC_ADMINISTRATOR && $CURUSER['staff_access'] == "yes"
  2036. && $CURUSER['mod_access'] == "yes"
  2037. && $CURUSER['admin_access'] == "yes"
  2038. && $CURUSER['staff_code'] == "$staff_code")
  2039. {
  2040. print("<tr>
  2041. <td class='colhead'>&nbsp;{$lang['form_field_edit_acc_protection']}</td>
  2042. <td class='rowhead' colspan='2' align='left'>
  2043.  
  2044. <input type='radio' name='protected' value='yes'" .($user['protected']=='yes' ? " checked='checked'" : "")." />{$lang['form_field_opt_edit_yes']}
  2045.  
  2046. <input type='radio' name='protected' value='no'" .($user['protected']=='no' ? " checked='checked'" : "")." />{$lang['form_field_opt_edit_no']}
  2047. </td>
  2048. </tr>");
  2049. }
  2050.  
  2051. print("<tr>
  2052. <td class='colhead'>&nbsp;{$lang['form_field_edit_passkey']}</td>
  2053. <td class='rowhead' align='left' colspan='2'>
  2054. <input type='checkbox' name='resetpasskey' value='1' />{$lang['form_opt_reset_passkey']}
  2055. </td>
  2056. </tr>
  2057.  
  2058. <tr>
  2059. <td colspan='3' align='center'>
  2060. <input type='submit' class='btn' value='{$lang['gbl_btn_submit']}' />
  2061. </td>
  2062. </tr>
  2063. </table>
  2064. </form>");
  2065.  
  2066. //----- Start Delete Member By Wilba -----//
  2067. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  2068. && $CURUSER['mod_access'] == "yes"
  2069. && $CURUSER['admin_access'] == "yes"
  2070. && $CURUSER['sysop_access'] == "yes"
  2071. && $CURUSER['staff_code'] == "$staff_code"
  2072. && $user['class'] < get_user_class())
  2073. {
  2074. print("<br />
  2075. <form method='post' action='delete_member.php?&amp;action=deluser'>
  2076. <table class='coltable' width='70%'>
  2077. <tr>
  2078. <td class='rowhead' align='center'>
  2079. <h2>{$lang['table_edit_del_user']}</h2>
  2080. </td>
  2081. </tr>");
  2082.  
  2083. $username = htmlspecialchars($user['username']);
  2084.  
  2085. print("<tr>
  2086. <td class='rowhead' align='center'>
  2087. <input name='username' size='20' value='" . $username . "' type='hidden' />
  2088. <input type='submit' class='btn' value='{$lang['btn_del_user']}\"$username\"' />
  2089. <br />
  2090. </td>
  2091. </tr>
  2092. </table>
  2093. </form>");
  2094. }
  2095. //----- Finish Delete Member By Wilba -----//
  2096.  
  2097. print("</div>");
  2098. }
  2099. //----- Finish Edit User Details Content -----//
  2100.  
  2101. //----- Start Reset Password Content -----//
  2102. if (get_user_class() >= UC_SYSOP && $CURUSER['staff_access'] == "yes"
  2103. && $CURUSER['mod_access'] == "yes"
  2104. && $CURUSER['admin_access'] == "yes"
  2105. && $CURUSER['sysop_access'] == "yes"
  2106. && $CURUSER['staff_code'] == "$staff_code"
  2107. && $user['class'] < get_user_class())
  2108. {
  2109. print("<div class='ui-tabs-panel' id='fragment-7'>
  2110. <form method='post' action=''>
  2111. <table class='main' border='0' cellspacing='0' cellpadding='0'>
  2112. <tr>
  2113. <td style='border : none;'>
  2114. <input type='hidden' name='username' value='{$user['username']}' size='40' readonly='readonly' />
  2115. <input type='submit' class='btn' value='{$lang['btn_reset']}' />
  2116. </td>
  2117. </tr>
  2118. </table>
  2119. </form>
  2120. </div>");
  2121. }
  2122. //----- Finish Reset Password Content -----//
  2123.  
  2124. //----- Start Invite Tree -----//
  2125. if (get_user_class() >= UC_MODERATOR && $CURUSER['staff_access'] == "yes"
  2126. && $CURUSER['mod_access'] == "yes"
  2127. && $CURUSER['staff_code'] == "$staff_code"
  2128. || $user['id'] == $CURUSER['id'])
  2129. {
  2130. print("<div class='ui-tabs-panel' id='fragment-8'>");
  2131.  
  2132. $query = sql_query("SELECT id, username, uploaded, downloaded, status, warned, enabled, donor
  2133. FROM users
  2134. WHERE invitedby = " . sqlesc($user['id'])) or sqlerr(__FILE__, __LINE__);
  2135.  
  2136. $rows = mysqli_num_rows($query);
  2137.  
  2138. print("<table border='1' width='81%' cellspacing='0' cellpadding='5'>
  2139. <tr>
  2140. <td class='colhead' align='center' colspan='7'><strong>{$lang['table_invite_users']}</strong></td>
  2141. </tr>");
  2142.  
  2143. if (!$rows)
  2144. {
  2145. print("<tr>
  2146. <td class='rowhead' align='center' colspan='7'>{$lang['table_invite_none']}</td>
  2147. </tr>
  2148. </table><br />");
  2149. }
  2150. else
  2151. {
  2152. print("<tr>
  2153. <td class='rowhead' align='center'><strong>{$lang['table_invite_username']}</strong></td>
  2154. <td class='rowhead' align='center'><strong>{$lang['table_invite_uploaded']}</strong></td>
  2155. <td class='rowhead' align='center'><strong>{$lang['table_invite_downloaded']}</strong></td>
  2156. <td class='rowhead' align='center'><strong>{$lang['table_invite_ratio']}</strong></td>
  2157. <td class='rowhead' align='center'><strong>{$lang['table_invite_status']}</strong></td>
  2158. </tr>");
  2159.  
  2160. for ($i = 0; $i < $rows; ++$i)
  2161. {
  2162. $arr = mysqli_fetch_assoc($query);
  2163.  
  2164. if ($arr['status'] == 'pending')
  2165. {
  2166. $user = "" . htmlspecialchars($arr['username']) . "";
  2167. }
  2168. else
  2169. {
  2170. $user = "<a href='userdetails.php?id={$arr['id']}'>" . htmlspecialchars($arr['username']) . "</a>
  2171. " . ($arr['warned'] == "yes" ?"&nbsp;<img src='{$FTSP_V2['$image_dir']}warned.png' width='16' height='16' border='0' alt='{$lang['gbl_img_alt_warned']}' title='{$lang['gbl_img_alt_warned']}' />" : "") . "&nbsp;
  2172. " . ($arr['enabled'] == "no" ?"&nbsp;<img src='{$FTSP_V2['$image_dir']}disabled.png' width='16' height='16' border='0' alt='{$lang['gbl_img_alt_disabled']}' title='{$lang['gbl_img_alt_disabled']}' />" : "") . "&nbsp;
  2173. " . ($arr['donor'] == "yes" ?"<img src='{$FTSP_V2['$image_dir']}star.png' width='16' height='16' border='0' alt='{$lang['gbl_img_alt_donor']}' title='{$lang['gbl_img_alt_donor']}' />" : "") . " ";
  2174. }
  2175.  
  2176. if ($arr['downloaded'] > 0)
  2177. {
  2178. $ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3);
  2179. $ratio = "<font color='" . get_ratio_color($ratio) . "'>$ratio</font>";
  2180. }
  2181. else
  2182. {
  2183. if ($arr['uploaded'] > 0)
  2184. {
  2185. $ratio = "{$lang['table_invite_inf']}";
  2186. }
  2187. else
  2188. {
  2189. $ratio = "---";
  2190. }
  2191. }
  2192.  
  2193. if ($arr['status'] == 'confirmed')
  2194. {
  2195. $status = "<span class='userdetails_inv_confirmed'>{$lang['table_invite_confirmed']}</span>";
  2196. }
  2197. else
  2198. {
  2199. $status = "<span class='userdetails_inv_pending'>{$lang['table_invite_pending']}</span>";
  2200. }
  2201.  
  2202. print("<tr>
  2203. <td class='rowhead'align='center'>$user</td>
  2204. <td class='rowhead'align='center'>" . mksize($arr['uploaded']) . "</td>
  2205. <td class='rowhead'align='center'>" . mksize($arr['downloaded']) . "</td>
  2206. <td class='rowhead'align='center'>$ratio</td>
  2207. <td class='rowhead'align='center'>$status</td></tr>");
  2208. }
  2209.  
  2210. print("</table><br />");
  2211. }
  2212. print("</div>");
  2213. }
  2214. //----- Finish Invite Tree -----//
  2215.  
  2216. print("</div>");
  2217.  
  2218. ?>
  2219.  
  2220. <script type="text/javascript" src="/js/jquery-1.8.2.js" ></script>
  2221. <script type="text/javascript" src="/js/jquery-ui-1.9.0.custom.min.js" ></script>
  2222. <script type="text/javascript">
  2223. $(document).ready(function()
  2224. {
  2225. $("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
  2226. });
  2227. </script>
  2228.  
  2229. <?php
  2230.  
  2231. site_footer();
  2232.  
  2233. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement