Advertisement
abeksis

sfsdfsdf

Oct 5th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. <?php
  2. function human_filesize($bytes, $decimals = 2) {
  3. $sz = 'BKMGTP';
  4. $factor = floor((strlen($bytes) - 1) / 3);
  5. return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
  6. }
  7.  
  8. $repo = "repo/addons.xml";
  9. $zip_folder = "repo/";
  10. $packs = Array();
  11. $xml = simplexml_load_file($repo);
  12. $packs_xml = $xml->xpath("//addon");
  13.  
  14. $i=1;
  15. foreach ($packs_xml as $pack_xml)
  16. {
  17. $pack = Array();
  18. $pack["name"] = trim($pack_xml[0]->attributes()->id);
  19. $pack["version"] = trim($pack_xml[0]->attributes()->version);
  20. $pack["file"] = $zip_folder.$pack["name"]."/".$pack["name"]."-".$pack["version"].".zip";
  21. if (is_file($pack["file"]))
  22. {
  23. $pack["size"] = human_filesize(filesize($pack["file"]));
  24. $pack["date"] = date ("d/m/Y",filemtime($pack["file"]));
  25. }
  26. $packs[] = $pack;
  27. }
  28. ksort($packs);
  29. ?>
  30. <!DOCTYPE html>
  31. <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  32. <head>
  33.  
  34. <meta charset="utf-8">
  35. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  36. <link rel="stylesheet" type="text/css" href="style.css">
  37. <title>Abeksis - Kodi Addons List </title>
  38. </head>
  39.  
  40. <body>
  41.  
  42. <div id="links_bar">
  43. <div style="float: right; margin-right: 10px;">
  44. <a class="home" href="/">ראשי</a> |
  45. <a class="home" target="_blank" href="https://www.facebook.com/groups/kodiisrael/?ref=bookmarks">פייסבוק</a> |
  46. <a class="home" href="mailto:zivhad@gmail.com?Subject=שלום%20זיו.%20 מהאתר של אבקסיס">זיו חדד - מעצב גרפי לקודי</a> |
  47. <a style="color:#000;" target="_blank" href="http://repo.thewiz.info/">הקוסם</a>
  48. </div>
  49.  
  50. <div id="date">
  51. <SCRIPT LANGUAGE="JavaScript">
  52. var now = new Date();
  53. var days = new Array('ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת');
  54. var months = new Array('ינואר','פברואר','מרץ','אפריל','מאי','יוני','יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר');
  55. var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
  56. function fourdigits(number) {
  57. return (number < 1000) ? number + 1900 : number;
  58. }
  59. today = days[now.getDay()] + ", " +
  60. months[now.getMonth()] + " " +
  61. date + ", " +
  62. (fourdigits(now.getYear())) ;
  63. document.write(today);
  64. </script></div>
  65. </div>
  66.  
  67. <center>
  68. <table id="main">
  69. <tr>
  70. <td valign='top'>
  71. <table valign='top' align='center' id='searchResult'>
  72. <div id="banner"><tr></th></tr></div>
  73. <div id="repo">
  74. <div id="repo-download" style="float: right; margin-right: 10px;">
  75. <a href="/">לחצו להורדת הריפו לקודי</a> <img id="down" src="http://www.abeksis.com/images/Download.png" alt="">
  76. </div>
  77. <p class="update">עדכון אחרון: <? echo date("d/m/Y H:i", filemtime("update.txt")+1*60*60); ?></p>
  78. <tr><th width='100px'><img src="http://www.abeksis.com/images/list.png" alt="#"/></th><th><img src="http://www.abeksis.com/images/database.png" alt="Addon" /></th><th width='150px'><img src="http://www.abeksis.com/images/Version.png" alt="גרסה"/></th><th width='150px'> <img src="http://www.abeksis.com/images/disc.png" alt="גודל" /></th><th width='150px'><img src="http://www.abeksis.com/images/Calendar.png" alt="תאריך" /></th>
  79. </tr>
  80. <?
  81.  
  82. $i=1;
  83. foreach ($packs as $pack)
  84. {
  85. echo "<tr>";
  86. echo "<td>".$i++."</td><td>".$pack["name"].'</td>';
  87. echo "<td>".'<a href="'.$pack["file"].'">'.$pack["version"]."</a>";
  88. echo '</td>';
  89. if (is_file($pack["file"]))
  90. echo "<td>".$pack["size"]."</td><td>".$pack["date"]."</td>";
  91. echo "<img src='../images/new.png' width='18px'>";
  92. echo "</tr>";
  93. }
  94. ?>
  95. </tr></table></center>
  96.  
  97. </body></HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement