PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/classes/options/md5.php

http://rapidleech36b.googlecode.com/
PHP | 78 lines | 72 code | 5 blank | 1 comment | 4 complexity | a42cb997f2a6a32f8a0a5efc6d28d469 MD5 | raw file
  1. <?php
  2. function rl_md5() {
  3. global $list, $L, $PHP_SELF;
  4. $n_md5 = count($_GET["files"])
  5. ?>
  6. <script type="text/javascript">
  7. var mL = 0, cnt = <?php echo (is_numeric($n_md5) ? $n_md5 : 0);?>;
  8. var d = document, formMd5, tmrLoop;
  9. var singlemd5 = true;
  10. function chAll(){singlemd5 = false; initMD5change(mL);nextFile(mL);loopchk(mL);}
  11. function loopchk(id){
  12. if(id < cnt){ret = d.getElementById('actstat'+id).innerHTML;if(ret.indexOf('_result') != -1){mL++; nextFile(mL);}tmrLoop = setTimeout("loopchk("+mL+")", 50); } else { clearTimeout(tmrLoop); singlemd5=true; mL=0; return;}}
  13. // send filename to form input hidden
  14. function nextFile(id){d.getElementById('misionMd5').value = d.getElementById('md5fname'+id).innerHTML; setTimeout("FireUp("+id+")", 200);}
  15. function FireUp(id){d.getElementById('misionMd5').value += ":" + d.getElementById('impurity').selectedIndex;formMd5.action = 'javascript:get("misionMd5","actstat'+id+'","actstat'+id+'","")';formMd5.submit();}
  16. function initMD5change(id){var btnAll = d.getElementById('changeall');formMd5 = d.getElementById('frmMD5');if(btnAll.style.display!='none'){ setTimeout("d.getElementById('changeall').style.display='none'", 420);}if(singlemd5){ nextFile(id); }else { for(var i=0; i<cnt; i++){d.getElementById('actstat'+i).innerHTML = 'wait..'; }}}
  17. function ntfy(){
  18. var msg = "How this MD5 Changer is working?\n\n"; msg += "It is modifying your file by adding single or more char to the end of file.\n"; msg += "It's not guaranted it works properly for every file,\nsomeside effect like corrupted files may occurs.\n"; msg += "Select Impurity Char to pick char(s) that may suitable to your file instead using the default char: 0 (zero)\n\n"; msg += "T_T''"; alert(msg);}
  19. </script>
  20. <form name="frmMD5" id="frmMD5" action="<?php echo $PHP_SELF;?>">
  21. <input type="hidden" id="misionMd5" name="misionMd5" value="">
  22. </form>
  23. <?php
  24. echo $L->say['you_selected'];?>&nbsp;<b class="g"><?php echo $n_md5;?></b>&nbsp;files.<div id="changeall"><?php echo $L->say['you_sure_ch_md5'];?><br />
  25. <input type="button" name="md5ch" onclick="chAll();" value="<?php echo $L->say['_yes'];?>"></div><div style="padding-top:8px;"></div>
  26. <table align="center" border=0 cellspacing="1" cellpadding="3">
  27. <tr class="rowtitleChangemd5">
  28. <td align="center">File</td><td align="center">Size</td><td align="center"><?php echo $L->say['cur_md5'];?></td>
  29. <td valign="middle" width="200">
  30. <select id="impurity" name="impurity" title="Impurity Char" style="float:right;" width=60>
  31. <option selected='selected'>Impurity Char</option>
  32. <option value="char0">0 (Default)</option>
  33. <option value="char1">" "</option>
  34. <option value="char2">//</option>
  35. <option value="char3">/**/</option>
  36. <option value="char4">#</option>
  37. </select><?php echo $L->say['new_md5'];?>&nbsp;&nbsp;<a href="javascript:;" onclick="ntfy();" title="RTFM"><b style="color:red"><blink>?</blink></b></a>
  38. </td></tr>
  39. <?php
  40. for($i = 0; $i < $n_md5; $i++){
  41. $file = $list[($_GET["files"][$i])];
  42. if (file_exists($file["name"])) {
  43. ?>
  44. <tr class="rowChangemd5">
  45. <td nowrap>&nbsp;<b id="md5fname<?php echo $i;?>"><?php echo basename($file["name"]);?></b></td>
  46. <td align="center" class="txtmd5">&nbsp;<span title="<?php echo $file["size"];?>" style="color:#FFA300; cursor:pointer;">
  47. <?php
  48. $max2gb = 2147483647;
  49. //$mdfsize = filesize($file["name"]);
  50. $mdfsize = getfilesize($file["name"]);
  51. $mdfsize = ($mdfsize > $max2gb || $mdfsize < 0 ? -1 : $mdfsize . " B");
  52. echo ($mdfsize);
  53. ?></span>&nbsp;</td>
  54. <td nowrap class="txtmd5">&nbsp;<span id="md5hash<?php print $i;?>" style="color:#FFA300"><?php echo ($mdfsize >= 0 ? md5_file($file["name"]) : "File to big"); ?></span>&nbsp;</td>
  55. <td align="center">
  56. <?php if($mdfsize>=0){?>
  57. <div id="actstat<?php print $i;?>">
  58. <a href="javascript:;" onclick="initMD5change('<?php print $i;?>')" class="y"><?php echo $L->say['change_md5'];?></a></div>
  59. <?php }?>
  60. </td>
  61. </tr>
  62. <?php
  63. }
  64. }
  65. ?>
  66. </table><br />
  67. <script type="text/javascript">
  68. var mproces = d.getElementById('md5_process');
  69. mproces.style.display = 'none';
  70. </script>
  71. <?php
  72. }
  73. ?>