Advertisement
abeksis

sdfsdf

Oct 24th, 2015
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.73 KB | None | 0 0
  1. <?php
  2. const PAGE_SIZE = 30;
  3.  
  4. function human_filesize($bytes, $decimals = 2) {
  5. $sz = 'BKMGTP';
  6. $factor = floor((strlen($bytes) - 1) / 3);
  7. return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
  8. }
  9.  
  10. $repo = "repo/addons.xml";
  11. $zip_folder = "repo/";
  12. $packs = Array();
  13. $xml = simplexml_load_file($repo);
  14. $packs_xml = $xml->xpath("//addon");
  15.  
  16. $i=1;
  17. foreach ($packs_xml as $pack_xml)
  18. {
  19. $pack = Array();
  20. $pack["name"] = trim($pack_xml[0]->attributes()->id);
  21. $pack["version"] = trim($pack_xml[0]->attributes()->version);
  22. $pack["file"] = $zip_folder.$pack["name"]."/".$pack["name"]."-".$pack["version"].".zip";
  23. if (is_file($pack["file"]))
  24. {
  25. $pack["size"] = human_filesize(filesize($pack["file"]));
  26. $pack["timestamp"] = filemtime($pack["file"]);
  27. $pack["date"] = date ("d/m/Y", $pack["timestamp"]);
  28. }
  29. $packs[] = $pack;
  30. }
  31. //ksort($packs);
  32.  
  33. function cmp($a, $b) {
  34. return strcmp($b['timestamp'], $a['timestamp']);
  35. }
  36.  
  37. usort($packs, "cmp");
  38.  
  39. $items = PAGE_SIZE;
  40. $page = (isset($_GET['page'])) ? $_GET['page'] : 1;
  41. $page = (int) $page;
  42. $total = count($packs);
  43. $packs = array_slice($packs, $page - 1, $items);
  44.  
  45. ?>
  46. <!DOCTYPE html>
  47. <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  48. <head>
  49. <meta charset="UTF-8">
  50. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  51. <meta name="keywords" content="kodi, קודי, קודי ישראל, ריפו, סורס, טלוויזיה">
  52. <meta name="description" content="הרחבות, קודי ישראל, הקוסם, thewiz, מקורות, סורסים">
  53. <title>Abeksis - Kodi Addons List</title>
  54. <style type="text/css" media="screen"> @import url("style.css"); </style>
  55. <link rel="stylesheet" type="text/css" href="http://www.abeksis.com/css/jquery.smarticker.css">
  56. <script type="text/javascript" src="../lib/jquery-1.10.2.min.js"></script>
  57. <script type="text/javascript" src="../lib/jquery.smarticker.js"></script>
  58. </head>
  59.  
  60. <script>
  61. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  62. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  63. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  64. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  65.  
  66. ga('create', 'UA-61825601-2', 'auto');
  67. ga('send', 'pageview');
  68.  
  69. </script>
  70.  
  71. <body id="sp">
  72. <div class="container">
  73. <div id="header">
  74. <a href="http://abeksis.com/" class="logo">
  75. <img src="../images/logo.png" alt="" />
  76. </a>
  77. <div style="float: right; margin-right: -20px;">
  78. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  79. <ins class="adsbygoogle"
  80. style="display:inline-block;width:728px;height:90px"
  81. data-ad-client="ca-pub-1765760546116873"
  82. data-ad-slot="3733614851"></ins>
  83. <script>
  84. (adsbygoogle = window.adsbygoogle || []).push({});
  85. </script></div>
  86. </div>
  87. </div></div>
  88. <div id="MainNav">
  89. <div id="menu">
  90. <div style="float: right; margin-right: 10px;">
  91. <a class="menu" href="/">ראשי</a> |
  92. <a class="menu" target="_blank" href="https://www.facebook.com/groups/kodiisrael/?ref=bookmarks">פייסבוק</a> |
  93. <a class="menu" href="mailto:zivhad@gmail.com?Subject=שלום%20זיו.%20 מהאתר של אבקסיס">זיו חדד - מעצב גרפי לקודי</a> |
  94. <a class="menu" target="_blank" href="http://repo.thewiz.info/">הקוסם</a>
  95. </div></ul></div>
  96.  
  97.  
  98. <div id="date">
  99. <p class="update">עדכון אחרון: <? echo date("d/m/Y H:i", filemtime("repo/update.txt")+1*60*60); ?></p></div>
  100. </div>
  101. <!-- news Start -->
  102. <div class="target">
  103. <ul>
  104. <li><a href="#">ההרחבה MorePower ( סרטי 1080p, 5.1, 3D movies ) התווספה לריפו. </a></li>
  105. <li><a href="#">ההרחבה dexterTv עודכנה לגרסה חדשה</a></li>
  106. <li><a href="#">BBTS חזרה לפעילות מלאה</a></li>
  107. <li><a href="#">SportsDevil - עודכן לגרסה חדשה</a></li>
  108. <li><a href="#">הסקין htpt התווסף לריפו</a></li>
  109. </ul>
  110. </div>
  111. <script type="text/javascript" src="../lib/jquery-1.10.2.min.js"></script>
  112. <script type="text/javascript" src="../lib/jquery.smarticker.js"></script>
  113. <script type="text/javascript">
  114. (function(){
  115. $('.target').smarticker();
  116. })();
  117. </script>
  118. <!-- news and -->
  119.  
  120. <center>
  121. <table id="main">
  122. <tr>
  123. <td valign='top'>
  124. <div id="table">
  125. <div id="sidebar" style="float: right; margin-right: -219px;">
  126. <p>לחצו להורדת הריפו<p>
  127. <a href="../repo/repository.abeksis/repository.abeksis.zip"><img src="images/download-button.png"></a>
  128. </div>
  129. <table width="770" align='center' id='searchResult' valign='top'>
  130. <tr><th width='100px'><img src="images/list.png" alt="#"/></th><th><img src="images/database.png" alt="Addon" /></th><th width='150px'><img src="images/Version.png" alt="גרסה"/></th><th width='150px'> <img src="images/disc.png" alt="גודל" /></th><th width='150px'><img src="images/Calendar.png" alt="תאריך" /></th>
  131. </tr>
  132. <?
  133.  
  134. $i=1;
  135. foreach ($packs as $pack)
  136. {
  137. echo "<tr>";
  138. echo "<td>".((($page-1) * $items) + $i++)."</td><td>".$pack["name"].'</td>';
  139. echo "<td>".'<a href="'.$pack["file"].'">'.$pack["version"]."</a>";
  140. echo '</td>';
  141. if (is_file($pack["file"]))
  142. echo "<td>".$pack["size"]."</td><td class=\"date-col\">".$pack["date"];
  143. if (time()-filemtime($pack["file"]) < 3*24*60*60)
  144. echo '<img src="../images/new.png">';
  145. echo "</td>";
  146. echo "</tr>";
  147. }
  148. ?>
  149. </tr></table></center></div>
  150.  
  151. <div id="footer">
  152. <a class="home" target="_blank" href="http://kodisrael.net">פורום</a> |
  153. <a class="home" target="_blank" href="http://kodi.tv/download/">הורדת קודי</a>
  154. </div>
  155.  
  156. </body>
  157. </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement