Advertisement
Guest User

Untitled

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