Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Builder (auto-launcher)</title>
- <script>
- refresher = window.setTimeout(function() {
- window.location.reload();
- },10000);
- </script>
- <style>
- @import 'https://fonts.googleapis.com/css?family=Open+Sans';
- body {
- font-family: Open Sans;
- }
- td {
- padding: .3em;
- }
- a {
- text-decoration: none;
- }
- a:hover, a:active, a:focus {
- text-decoration: underline;
- }
- </style>
- </head>
- <body>
- <table style="width: 50%; min-width: 700px; margin: 0 auto;">
- <col width="30%" />
- <?php
- $files = array();
- if ($handle = opendir('build')) {
- while (false !== ($file = readdir($handle))) {
- if ($file != "." && $file != "..") {
- $files[filemtime('build/'.$file)] = $file;
- }
- }
- closedir($handle);
- // sort
- ksort($files);
- // find the last modification
- $reallyLastModified = end($files);
- foreach($files as $file) {
- $lastModified = date('d F Y, H:i:s',filemtime('build/'.$file));
- $mtime = date("Y-m-d H:i:s",filemtime('build/'.$file));
- $ip = $_SERVER['REMOTE_ADDR'];
- if (in_array(substr($file,-4,4),array('.apk','.exe','.plist'))) {
- if ($file == $reallyLastModified) {
- $style = 'background-color: rgba(128,128,128,.2)';
- //$sha1 = sha1('build/'.$file);
- if(strpos(@file_get_contents('builder.log'),strval($mtime)." $file $ip\r\n")!==false) {
- echo "<tr style=\"background-color: rgba(255,0,0,.2)\"><!--<td><input type=\"checkbox\" name=\"box[]\"></td>--><td><a href=\"build/$file\" target=\"_blank\">$file</a></td><td>$lastModified</td></tr>";
- continue;
- } else {
- file_put_contents('builder.log',strval($mtime)." $file $ip\r\n",FILE_APPEND);
- ?>
- <script>
- window.setTimeout(function() {
- window.location.replace('http://imanuelhab.mooo.com/<?php echo 'build/'.$file; ?>');
- window.clearTimeout(refresher);
- },5000);
- </script>
- <?php
- }
- } else {
- $style = '';
- }
- echo "<tr style=\"$style\"><!--<td><input type=\"checkbox\" name=\"box[]\"></td>--><td><a href=\"build/$file\" target=\"_blank\">$file</a></td><td>$lastModified</td></tr>";
- }
- }
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement