PageRenderTime 55ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/static/js.php

http://rapidleech36b.googlecode.com/
PHP | 679 lines | 592 code | 33 blank | 54 comment | 74 complexity | 427db42be70300a08b73e57f956808f2 MD5 | raw file
  1. <?php
  2. define('RAPIDLEECH', 'yes');
  3. if (!isset($_GET['mod']) and isset($_SERVER['QUERY_STRING'])) {
  4. $_GET['mod'] = $_SERVER['QUERY_STRING'];
  5. }
  6. $nn = "\r\n";
  7. $validpage = array('main','audl', 'auul', 'lynx', 'mtn');
  8. $req = urldecode($_GET['mod']);
  9. $validSearch = preg_match("/^[a-zA-Z0-9_]+$/i", $req);
  10. if(!$validSearch || !in_array($req, $validpage)){
  11. $req = 'main';
  12. header("Location: " . basename(__FILE__) . "?" . $req);
  13. }
  14. define('PATH_SPLITTER', (strstr(realpath('./'), '\\')!==false ? '\\' : '/'));
  15. define('ROOT_DIR', realpath('../') . PATH_SPLITTER );
  16. define('CLASS_DIR', ROOT_DIR . 'classes' . PATH_SPLITTER );
  17. define('STATIC_DIR', 'static/');
  18. define('LANG_DIR', CLASS_DIR . 'languages' . PATH_SPLITTER);
  19. define('CONFIG_DIR', ROOT_DIR . 'configs' . PATH_SPLITTER );
  20. require_once(CONFIG_DIR . 'config.php');
  21. define('TEMPLATE_DIR', 'tpl/' . $options['template_used'] . '/');
  22. define('IMAGE_DIR', TEMPLATE_DIR . 'skin/'. $options["csstype"] . '/');
  23. $loca["thisFile"] = str_replace('\\','/',(__FILE__));
  24. $loca["docRoot"] = $_SERVER['DOCUMENT_ROOT'] . (substr($_SERVER['DOCUMENT_ROOT'],-1) != "/" ? "/":"");
  25. $webRoot = str_replace(array($loca["docRoot"], STATIC_DIR . basename(__FILE__) ), '', $loca["thisFile"]);
  26. unset($loca);
  27. if($webRoot=="/") $webRoot = "";
  28. define('ROOT_URL', "http://". $_SERVER["SERVER_NAME"] . "/" . $webRoot);
  29. // Language initialisation
  30. require_once(CLASS_DIR."lang.class.php");
  31. $L = new RxLang;
  32. $L->set_path(LANG_DIR);
  33. // Load language
  34. $L->set_language($options['lang']);
  35. $L->load();
  36. $charSet = $L->settings["charset"];
  37. unset($options);
  38. header('Cache-control: must-revalidate');
  39. header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 10800) . ' GMT');
  40. header('Content-type: application/javascript');
  41. echo "/*=====".$nn."JS Lib".$nn."Mode: ";
  42. echo ($req);
  43. echo "\r\n=====*/\r\n";
  44. ?>
  45. var d = document;
  46. var php_js_strings = [];
  47. php_js_strings[1] = "<?php echo $L->say['loading_pwait'];?>";
  48. php_js_strings[2] = "<?php echo $L->say['acc_username'];?>";
  49. php_js_strings[3] = "<?php echo $L->say['acc_password'];?>";
  50. php_js_strings[4] = "<?php echo $L->say['acc_free_rp'];?>";
  51. php_js_strings[5] = "<?php echo $L->say['acc_fpoints'];?>";
  52. php_js_strings[6] = "<?php echo $L->say['acc_pre_rp'];?>";
  53. php_js_strings[7] = "<?php echo $L->say['acc_ppoints'];?>";
  54. php_js_strings[8] = "<?php echo $L->say['acc_ref_rp'];?>";
  55. php_js_strings[9] = "<?php echo $L->say['acc_rfpoints'];?>";
  56. php_js_strings[10] = "<?php echo $L->say['acc_antihack'];?>";
  57. php_js_strings[11] = "<?php echo $L->say['acc_security'];?>";
  58. php_js_strings[12] = "<?php echo $L->say['acc_email'];?>";
  59. php_js_strings[13] = "<?php echo $L->say['traficshare_left'];?>";
  60. php_js_strings[14] = "<?php echo $L->say['traffic'];?>";
  61. php_js_strings[15] = "<?php echo $L->say['traffic_left'];?>";
  62. php_js_strings[16] = "<?php echo $L->say['traffic__left'];?>";
  63. php_js_strings[17] = "<?php echo $L->say['exp_date'];?>";
  64. php_js_strings[18] = "<?php echo $L->say['acc_expired'];?>";
  65. php_js_strings[19] = "<?php echo $L->say['acc_formated'];?>";
  66. php_js_strings[20] = "<?php echo $L->say['acc_checked'];?>";
  67. php_js_strings[21] = "<?php echo $L->say['acc_checked_dead'];?>";
  68. php_js_strings[22] = "<?php echo $L->say['acc_nosecure'];?>";
  69. php_js_strings[23] = "<?php echo $L->say['acc_nodetail'];?>";
  70. php_js_strings[24] = "<?php echo $L->say['rs_acc_unavailable'];?>";
  71. php_js_strings[25] = "<?php echo $L->say['loading_current_chk'];?>";
  72. php_js_strings[26] = "<?php echo $L->say['_status'];?>";
  73. php_js_strings[27] = "<?php echo $L->say['acc_pre_acc'];?>";
  74. php_js_strings[28] = "<?php echo $L->say['term_download'];?>";
  75. php_js_strings[29] = "<?php echo $L->say['term_nosimultan'];?>";
  76. php_js_strings[30] = "<?php echo $L->say['term_autodelete'];?>";
  77. php_js_strings[31] = "<?php echo $L->say['term_usedelink'];?>";
  78. php_js_strings[32] = "<?php echo $L->say['term_dontpost'];?>";
  79. php_js_strings[33] = "<?php echo $L->say['term_cendolink'];?>";
  80. php_js_strings[34] = "<?php echo $L->say['term_dellink'];?>";
  81. php_js_strings[35] = "<?php echo $L->say['no_selectfile'];?>";
  82. php_js_strings[36] = "<?php echo $L->say['_uploading'];?>";
  83. php_js_strings[37] = "<?php echo $L->say['_pwait_sec'];?>";
  84. php_js_strings[281] = "<?php echo $L->say['local_time'];?>";
  85. var IMG_DIR_TPL = '<?php echo ROOT_URL.IMAGE_DIR;?>';
  86. var STATIC_DIR = '<?php echo ROOT_URL.STATIC_DIR;?>';
  87. var phpjx = '<?php echo ROOT_URL.'ajax_main.php';?>';
  88. // Frame Buster
  89. if (top != self) {
  90. try {
  91. if (top.location.host != self.location.host) {
  92. top.location = self.location;
  93. }
  94. } catch (err) {
  95. top.location = self.location;
  96. }
  97. }
  98. function deleteCookie(name, path, domain) {
  99. if (getCookie(name)) {
  100. d.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  101. }
  102. }
  103. function getCookie(name) {
  104. var dc = d.cookie;
  105. var prefix = name + "=";
  106. var begin = dc.indexOf("; " + prefix);
  107. if (begin == -1) {
  108. begin = dc.indexOf(prefix);
  109. if (begin != 0) {
  110. return null;
  111. }
  112. } else {
  113. begin += 2;
  114. }
  115. var end = d.cookie.indexOf(";", begin);
  116. if (end == -1) {
  117. end = dc.length;
  118. }
  119. return unescape(dc.substring(begin + prefix.length, end));
  120. }
  121. function showAll(){
  122. if(getCookie("showAll") == 1){
  123. deleteCookie("showAll");
  124. }else{
  125. d.cookie = "showAll = 1;";
  126. }
  127. urlload();
  128. }
  129. function urlload(){
  130. location.href = location.href.split('?',1)+'?act=files';
  131. }
  132. function clk(idck){
  133. var cur = d.getElementById(idck).checked;
  134. d.getElementById(idck).checked = !cur;
  135. }
  136. function highlight(field) {
  137. field.focus(); field.select();
  138. }
  139. function fc(caption,displaytext) {
  140. if(c>0) {
  141. d.getElementById("dl").innerHTML = caption + php_js_strings[37].replace('{1}', c.toFixed(1));
  142. c = c - 0.5;
  143. setTimeout("fc('"+caption+"','"+displaytext+"')", 500);
  144. } else {
  145. d.getElementById("dl").style.display="none";
  146. d.getElementById("code").innerHTML = unescape(displaytext);
  147. }
  148. }
  149. // ===== batas global =====
  150. <?php
  151. if($req == 'main' OR $req == 'auul'){
  152. ?>
  153. function setCheckboxes(act) {
  154. try {
  155. elts = d.getElementsByName("files[]");
  156. } catch (e) {}
  157. if (elts == undefined || elts == null) {
  158. return false;
  159. };
  160. var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0;
  161. var dc;
  162. if (elts_cnt) {
  163. for (var i = 0; i < elts_cnt; i++) {
  164. elts[i].checked = (act == 1 || act == 0) ? act : (elts[i].checked ? 0 : 1);
  165. dc = d.getElementById('brs' + eval(i + 1));
  166. if (dc) {
  167. dc.className = (elts[i].checked == 1) ? 'rowlist_checked' : 'rowlist';
  168. }
  169. }
  170. }
  171. }
  172. // end-($req == 'main' OR $req == 'auul')
  173. <?php
  174. }
  175. if($req == 'main' OR $req == 'lynx'){
  176. ?>
  177. function gosetfacebook(){
  178. $(document).ready(function($) {
  179. $('a[rel*=facebox]').facebox({
  180. loading_text: php_js_strings[1], close_image: STATIC_DIR + 'images/nav_close6.png'
  181. })
  182. });
  183. }
  184. // end -($req == 'main' OR $req == 'lynx')
  185. <?php
  186. }
  187. if($req == 'main'){
  188. ?>
  189. function neoClass_tab(id){
  190. var tbobj = d.getElementById("tb" + id);
  191. d.getElementById("navcell" + id).className = "tab-on";
  192. tbobj.className = "tab-content show-table";
  193. }
  194. function switchCell(m) {
  195. var style;
  196. var obj = d.getElementById("tb" + m);
  197. for (i=1; i<=5; i++) {
  198. if(i != m){
  199. d.getElementById("navcell" + i).className = "tab-off";
  200. d.getElementById("tb" + i).className = "hide-table";
  201. }
  202. }
  203. setTimeout("neoClass_tab("+m+")", 70);
  204. }
  205. function clearSettings() {
  206. clear("domail"); clear("email"); clear("split"); clear("method");
  207. clear("partSize"); clear("useproxy"); clear("proxy"); clear("saveto");
  208. clear("path"); clear("savesettings");
  209. $('#domail, #splitchkbox, #useproxy, #premium_acc, #saveto, #savesettings').attr('checked', false);
  210. $('#email, #proxyproxy, #proxyuser, #proxypass, #premium_user, #premium_pass').val('');
  211. $('#emailtd, #splittd, #methodtd, #proxy, #prblock, #path, #clearsettings').hide();
  212. d.cookie = "clearsettings = 1;";
  213. }
  214. function clear(name) {
  215. d.cookie = name + " = " + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  216. }
  217. function showAdd() {
  218. d.getElementById('add').style.display = show ? 'none' : '';
  219. show = show ? 0 : 1;
  220. }
  221. function showAdd2() {
  222. d.getElementById('add2').style.display = show2 ? 'none' : '';
  223. show2 = show2 ? 0 : 1;
  224. }
  225. function mail(str, field) {
  226. d.getElementById("mailPart." + field).innerHTML = str;
  227. return true;
  228. }
  229. function setFtpParams() {
  230. setParam("host");
  231. setParam("port");
  232. setParam("login");
  233. setParam("password");
  234. setParam("dir");
  235. d.cookie = "ftpParams=1";
  236. d.getElementById("hrefSetFtpParams").style.color = "#808080";
  237. d.getElementById("hrefDelFtpParams").style.color = "#0000FF";
  238. }
  239. function delFtpParams() {
  240. deleteCookie("host");
  241. deleteCookie("port");
  242. deleteCookie("login");
  243. deleteCookie("password");
  244. deleteCookie("dir");
  245. deleteCookie("ftpParams");
  246. d.getElementById("hrefSetFtpParams").style.color = "#0000FF";
  247. d.getElementById("hrefDelFtpParams").style.color = "#808080";
  248. }
  249. function setParam(param) {
  250. d.cookie = param + "=" + d.getElementById(param).value;
  251. }
  252. function pr(percent, received, speed) {
  253. d.getElementById("received").innerHTML = '<b>' + received + '</b>';
  254. d.getElementById("percent").innerHTML = '<b>' + percent + '%</b>';
  255. d.getElementById("progress").style.width = percent + '%';
  256. d.getElementById("speed").innerHTML = '<b>' + speed + ' KB/s</b>';
  257. d.title = 'Uploaded ' + percent + '%';
  258. return true;
  259. }
  260. function changeStatus(file, size) {
  261. d.getElementById("status").innerHTML = php_js_strings[36] + ' <b>' + file + '</b>, Size <b>' + size + '</b>...<br />';
  262. }
  263. function zip() {
  264. var i = d.ziplist.act.selectedIndex;
  265. var selected = d.ziplist.act.options[i].value;
  266. d.getElementById('add').style.display = 'none';
  267. switch (selected){
  268. case "zip_add":
  269. d.getElementById('add').style.display = 'block';
  270. break;
  271. }
  272. }
  273. function new_transload_window() {
  274. var tmp = new Date();
  275. tmp = tmp.getTime();
  276. $('form[name=transload]').attr('target', 'rapidleech_'+tmp);
  277. var options = "width=700,height=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no";
  278. window.open('','rapidleech_'+tmp, options);
  279. window.setTimeout("$('form[name=transload]').submit();", 200);
  280. }
  281. //end-$req == 'main'
  282. <?php
  283. }
  284. if($req == 'lynx'){
  285. ?>
  286. function trparser(){
  287. var _tpl = "", i = 0;
  288. for(var date in dFile) {
  289. pfile = dFile[date];
  290. _tpl = dtemplate;
  291. // do replacement string; 10-May-2009, 23:09
  292. var now = new Date(parseInt(date) * 1000);
  293. dDate = now.toGMTString("dd-mmm-yy, HH:MM");
  294. dDate = dDate.split(" ");
  295. _tpl = _tpl.replace(/\(\(chkidx\)\)/g, i);
  296. _tpl = _tpl.replace(/\(\(filename\)\)/g, (pfile["name"]));
  297. _tpl = _tpl.replace(/\(\(filelink\)\)/g, (_dlpath + (pfile["name"])) );
  298. _tpl = _tpl.replace(/\(\(filesize\)\)/g, pfile["size"]);
  299. _tpl = _tpl.replace(/\(\(formatdate\)\)/g, dDate[1]+'-'+dDate[2]+'-'+dDate[3].substr(2,2)+', '+dDate[4].substr(0,2)+':'+dDate[4].substr(3,2)+':'+dDate[4].substr(6,2));
  300. _tpl = _tpl.replace(/\(\(fileage\)\)/g, pfile["age"]);
  301. _tpl = _tpl.replace(/\(\(dlpath\)\)/g, _dlpath);
  302. _tpl = _tpl.replace(/\(\(b64filename\)\)/g, pfile["delkey"]);
  303. text+= _tpl;
  304. i++;
  305. }
  306. }
  307. var idwindow = new Array();
  308. function opennewwindow(id) {
  309. var options = "width=700,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no";
  310. var start_link = d.getElementById(id);
  311. idwindow[id] = window.open(start_link, dwindow+id, options);
  312. idwindow[id].opener=self;
  313. idwindow[id].focus();
  314. }
  315. function sAll(niLai){
  316. var dc;
  317. diq=d.getElementById('add_comment').checked=false;
  318. d.getElementById('comment').style.display='none';
  319. for (i=0;i< Opt["nC"] ;i++) {
  320. d.getElementById('chkfL-'+i).checked=niLai;
  321. dc = d.getElementById('brs'+i);
  322. if(niLai){
  323. dc.className='rowlist_checked';
  324. }else{
  325. dc.className='rowlist';
  326. }
  327. }
  328. }
  329. function GenTag() {
  330. var displ = d.getElementById('add_comment').checked ? '' : 'none';
  331. if (!displ) {
  332. var chk, buFF = "", kd = unescape("%B2"), cLnk = 0;
  333. var nC = Opt["nC"], AdL = Opt["AdL"];
  334. var ttip = "", ttip2 = "", ttip3 = "", ttip4 = "", delink = "";
  335. var Simultan = true; //set this true if your server allow simultan download
  336. var codeTagOnly = d.getElementById('wterm').checked ? false : true; //true is without Term of Download
  337. var DelLink = Opt["DelLink"] && d.getElementById('dellnk').checked;
  338. var poslynx,
  339. hostpath = d.location.href;
  340. poslynx = hostpath.lastIndexOf("/");
  341. hostpath = hostpath.substring(0, poslynx + 1);
  342. if (!codeTagOnly) {
  343. ttip = "\n[SIZE=1]"+php_js_strings[28]+"";
  344. if (!Simultan) ttip2 = "\n-"+php_js_strings[29]+"";
  345. if (AdL > 0) ttip3 = "\n-"+php_js_strings[30].replace('{1}', AdL)+"";
  346. if (DelLink) ttip3 += "\n-"+php_js_strings[31]+"";
  347. ttip4 = "\n-"+php_js_strings[32]+"";
  348. ttip4 += "\n"+php_js_strings[33]+"";
  349. }
  350. delink = "\n[SPOILER="+php_js_strings[34]+"][SIZE=2][CODE]";
  351. for (i = 0; i < nC; i++) {
  352. chk = d.getElementById('chkfL-' + i).checked;
  353. if ((chk) && (chk != '')) {
  354. buFF = buFF + "\n" + (d.getElementById('fL-' + i));
  355. if (DelLink) {
  356. dL = d.getElementById('dL-' + i).href;
  357. dL = dL.substring(0, dL.indexOf('&lineid'));
  358. delink = delink + "\n" + dL;
  359. }
  360. cLnk++;
  361. }
  362. }
  363. delink = delink + "\n[/CODE][/SIZE][/SPOILER]";
  364. if (buFF != '') {
  365. buFF = "[CODE]" + (buFF) + "\n[/CODE]";
  366. if (DelLink) {
  367. buFF = buFF + delink;
  368. }
  369. buFF += ttip;
  370. if (cLnk > 1) {
  371. buFF += ttip2 + ttip3;
  372. } else {
  373. buFF += ttip3;
  374. }
  375. buFF += ttip4;
  376. if (!codeTagOnly) {
  377. buFF += "[/SIZE]";
  378. }
  379. }
  380. }
  381. var dca = d.getElementById('comment');
  382. var trwarn = d.getElementById('warn_alert');
  383. if (buFF != "") {
  384. dca.style.display = displ;
  385. d.getElementById('cmtarea').value = buFF;
  386. trwarn.style.display = 'none';
  387. } else {
  388. dca.style.display = 'none';
  389. d.getElementById('td_warn').innerHTML = '<div class="acthistory_result" style="width:200px;">'+php_js_strings[35]+'</div>';
  390. trwarn.style.display = '';
  391. }
  392. }
  393. //end-$req == 'lynx'
  394. <?php
  395. }
  396. ?>
  397. // =========Below is global use============
  398. /** //BASE64
  399. * ===========================
  400. * Location : ./static/b64
  401. * Adapted for : RL OLC 36B
  402. *
  403. * Re-generated : 1009-09 // ddmm-yy
  404. * ===========================
  405. */
  406. var base64Chars = new Array(
  407. 'A','B','C','D','E','F','G','H',
  408. 'I','J','K','L','M','N','O','P',
  409. 'Q','R','S','T','U','V','W','X',
  410. 'Y','Z','a','b','c','d','e','f',
  411. 'g','h','i','j','k','l','m','n',
  412. 'o','p','q','r','s','t','u','v',
  413. 'w','x','y','z','0','1','2','3',
  414. '4','5','6','7','8','9','+','/'
  415. );
  416. var base64Str,base64Count;
  417. function setBase64Str(str){
  418. base64Str = str;
  419. base64Count = 0;
  420. }
  421. function readBase64(){
  422. if (!base64Str) return -1;
  423. if (base64Count >= base64Str.length) return -1;
  424. var c = base64Str.charCodeAt(base64Count) & 0xff;
  425. base64Count++;
  426. return c;
  427. }
  428. function encodeBase64(str){
  429. setBase64Str(str);
  430. var result = '',inBuffer = new Array(3),lineCount = 0,done = false;
  431. while (!done && (inBuffer[0] = readBase64()) != -1){
  432. inBuffer[1] = readBase64();
  433. inBuffer[2] = readBase64();
  434. result += (base64Chars[ inBuffer[0] >> 2 ]);
  435. if (inBuffer[1] != -1){
  436. result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30) | (inBuffer[1] >> 4) ]);
  437. if (inBuffer[2] != -1){
  438. result += (base64Chars [((inBuffer[1] << 2) & 0x3c) | (inBuffer[2] >> 6) ]);
  439. result += (base64Chars [inBuffer[2] & 0x3F]);
  440. } else {
  441. result += (base64Chars [((inBuffer[1] << 2) & 0x3c)]);
  442. result += ('=');
  443. done = true;
  444. }
  445. } else {
  446. result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30)]);
  447. result += ('=');
  448. result += ('=');
  449. done = true;
  450. }
  451. /*
  452. lineCount += 4;
  453. if (lineCount >= 76){
  454. result += ('\n');
  455. lineCount = 0;
  456. }
  457. */
  458. }
  459. return result;
  460. }
  461. //--- end base64
  462. // =====================
  463. /**
  464. * Script by : Daniel_X_x
  465. * ===========================
  466. * Location : ./static/matches
  467. * Adapted for : RL OLC 36B
  468. *
  469. * Re-generated : 3009-09 // ddmm-yy
  470. * ===========================
  471. */
  472. var fl_rwhide=new Array(); // buffer global table object and selected rows array
  473. function flist_match_hide() {
  474. var obj_container = d.getElementById('flist_match_hitems');
  475. var tmp = obj_container.style.display == 'none' ? 'block' : 'none';
  476. var obj_inp = obj_container.getElementsByTagName('input')[0];
  477. obj_container.style.display = tmp;
  478. if (tmp != 'none') {
  479. obj_inp.focus();
  480. } else {
  481. flist_toogle_rrestore();
  482. }
  483. }
  484. function flist_match() {
  485. var text = d.getElementById('flist_match_search').value;
  486. var rows = d.getElementById("intbl").tBodies[0].rows;
  487. if (text == '') {
  488. clear_chk_row(rows);
  489. return false;
  490. }
  491. var csensitive = d.getElementById('flist_match_ins').checked;
  492. var hdunmatch = d.getElementById('flist_match_hide').checked;
  493. var tmp;
  494. var cell_text;
  495. var cell_matches;
  496. var text_regexp;
  497. text = '*' + text + '*';
  498. while (text != text.replace(/\*\*/g, '*')) {
  499. text = text.replace(/\*\*/g, '*');
  500. }
  501. text = text.replace(/\^|\$|\?|\+|\||\(|\{|\[|\\/g, '');
  502. text = text.replace(/\./g, '\\.');
  503. text = text.replace(/\*/g, '.*?');
  504. text_regexp = new RegExp(text, csensitive ? '' : 'i');
  505. clear_chk_row(rows);
  506. fl_rwhide = {
  507. "table": "",
  508. "baris": new Array()
  509. };
  510. fl_rwhide["table"] = rows;
  511. for (var i = 0; i < rows.length; i++) {
  512. if (rows[i].id == '' || rows[i].id == null) {
  513. rows[i].id = 'table_filelist_tbody_trs' + i;
  514. }
  515. tmp = rows[i].cells[1].getElementsByTagName('*');
  516. cell_text = (tmp.length > 0) ? tmp[0].innerHTML : rows[i].cells[1].innerHTML;
  517. cell_matches = text_regexp.exec(cell_text);
  518. if (cell_matches != null) {
  519. tmp = rows[i].cells[0].getElementsByTagName('input');
  520. for (var j = 0; j < tmp.length; j++) {
  521. if (tmp[j].type == 'checkbox') {
  522. tmp[j].checked = true;
  523. d.getElementById(rows[i].id).className = 'rowlist_checked';
  524. break;
  525. }
  526. }
  527. } else {
  528. if (hdunmatch) {
  529. d.getElementById(rows[i].id).style.display = 'none';
  530. fl_rwhide["baris"].push(i)
  531. }
  532. }
  533. }
  534. return false;
  535. }
  536. function clear_chk_row(obj) {
  537. var tmp;
  538. for (var i = 0; i < obj.length; i++) {
  539. tmp = obj[i].cells[0].getElementsByTagName('input');
  540. for (var j = 0; j < tmp.length; j++) {
  541. if (tmp[j].type == 'checkbox') {
  542. tmp[j].checked = false;
  543. break;
  544. }
  545. }
  546. d.getElementById(obj[i].id).style.display = '';
  547. d.getElementById(obj[i].id).className = 'rowlist';
  548. }
  549. }
  550. function flist_toogle_rrestore() {
  551. if (fl_rwhide["baris"] && fl_rwhide["baris"].length > 0) {
  552. flist_restore_row(fl_rwhide);
  553. fl_rwhide = new Array();
  554. }
  555. }
  556. function flist_restore_row(ar_rw) {
  557. for (var i = 0; i < ar_rw["baris"].length; i++) {
  558. d.getElementById(ar_rw["table"][ar_rw["baris"][i]].id).style.display = '';
  559. }
  560. }
  561. /*Mod by:~Idx*/
  562. //--- end matches
  563. // =====================
  564. /** //Clock tik tok
  565. * ===========================
  566. * Adapted for : RL OLC 36B
  567. *
  568. * Re-generated : 1009-09 // ddmm-yy
  569. * ===========================
  570. */
  571. // Javascript clock for server time
  572. /**
  573. * Numbers < 10 should be presented with a zero in front
  574. */
  575. function fixNumber(number) {
  576. return (number < 10) ? '0' + number : number;
  577. }
  578. /**
  579. * Fixed look for month
  580. */
  581. function fixMonth(number) {
  582. number = number + 1;
  583. return (number < 10) ? '0' + number : number;
  584. }
  585. function getLocalDate(year, month, day, dateFormat) {
  586. if (dateFormat.length < 2) { // When not logged in there is no dateformat
  587. dateFormat = 'yyyy-mm-dd';
  588. }
  589. dateFormat = dateFormat.replace('yyyy', year);
  590. dateFormat = dateFormat.replace('mm', month);
  591. dateFormat = dateFormat.replace('dd', day);
  592. dateFormat = dateFormat.replace('d', day);
  593. dateFormat = dateFormat.replace('m', month);
  594. return dateFormat;
  595. }
  596. /**
  597. * Show online users and clock
  598. */
  599. function runClock(timeDiff, dateFormat) {
  600. var now = new Date();
  601. var newTime;
  602. newTime = now.getTime() - timeDiff;
  603. now.setTime(newTime);
  604. var localDate = getLocalDate(now.getFullYear(), fixMonth(now.getMonth()), fixNumber(now.getDate()), dateFormat);
  605. d.getElementById('server').innerHTML = fixNumber(now.getHours()) + ':' + fixNumber(now.getMinutes()) + ':' + fixNumber(now.getSeconds());
  606. setTimeout('runClock(timeDiff,"' + dateFormat + '");', 1000);
  607. }
  608. /**
  609. * Calculates a time difference between client and server, to make js clock to run correctly
  610. */
  611. function timeDiff(Year, Month, Day, Hour, Minute, Second, dateFormat) {
  612. var timeDifferense;
  613. var serverClock = new Date(Year, Month - 1, Day, Hour, Minute, Second);
  614. var clientClock = new Date();
  615. var serverSeconds;
  616. var clientSeconds;
  617. timeDiff = clientClock.getTime() - serverClock.getTime() - 3000;
  618. runClock(timeDiff, dateFormat);
  619. }
  620. function getthedate(){
  621. var mydate=new Date();
  622. var hours=mydate.getHours();
  623. var minutes=mydate.getMinutes();
  624. var seconds=mydate.getSeconds();
  625. var dn="AM";
  626. if (hours>=12) dn="PM";
  627. if (hours>12) hours=hours-12;
  628. if (hours==0) hours=12;
  629. if (hours<=9) hours="0"+hours;
  630. if (minutes<=9) minutes="0"+minutes;
  631. if (seconds<=9) seconds="0"+seconds;
  632. var cdate="<span style=\"color:#999\">"+hours+":"+minutes+":"+seconds+" "+dn+"&nbsp;</span><span style=\"color:#FF8700\">("+php_js_strings[281]+")</span>";
  633. $('#clock').html(cdate);
  634. setTimeout("getthedate()",1000);
  635. }
  636. // =====================