Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta http-equiv="Content-Language" content="en">
- <title>HLTV Demos</title>
- </head>
- <body bgcolor="#151515">
- <div align="center"><a href="./" style="color: #FCAA21; font-size: 22px;">Evil Soldiers Clan Demo Archive</a>
- <p style="color: #FFFFFF;">
- <?php
- function human_filesize($bytes, $decimals = 2) {
- $sz = 'BKMGTP';
- $factor = floor((strlen($bytes) - 1) / 3);
- return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
- }
- if ($handle = opendir('c:/xampp/htdocs/esclan.net/hltv/')) { // dir with .zip files
- echo "<table cellspacing = '2' width = '500' bgcolor = '#333333' style = 'text-align: center;'>
- ";
- $files = array();
- while (false !== ($file = readdir($handle)))
- {
- if (strlen($file) > 4)
- {
- /*($line) ? $line-- : $line++;
- $color = ($line) ? '#151515' : '#000000';
- $gabali = explode("-", $file);
- $date = $gabali[1];
- $mape = $gabali[2];
- $mapesgabali = explode(".", $mape);
- $name = $mapesgabali[0];
- $year = substr($date,0,2);
- $month = substr($date,2,2);
- $day = substr($date,4,2);
- $hour = substr($date,6,2);
- $minute = substr($date,8,2);
- $size = filesize("c:/xampp/htdocs/esclan.net/hltv/".$file);
- $goodsize = human_filesize($size);*/
- $files[] = $file;
- /*echo " <tr style='background-color: $color;'>
- <td>
- <font color='#FFFFFF' face='Verdana' size='2'>$month/$day/$year $hour:$minute</li>
- </font></td>
- <td>
- <font color='#75B5EA' face='Verdana' size='2'>$name</font></td>
- <td> <a href='hltv/$file'>
- <font color='#FCAA21' face='Verdana' size='2'>download ($goodsize bytes)</font></a></td>
- </tr>";*/
- }
- }
- closedir($handle);
- }
- $files = array_reverse($files);
- $line=1;
- $filecount = count($files);
- $show = 10;
- $page = (int)$_GET['page']?:0; // _GET['page'] or 0 for default
- $startcount =$page * $show;
- $endcount = $startcount + $show;
- $pages = ceil(count($files)/$show);
- $shownfiles = 0;
- echo "Page $page of $pages <br> $filecount files. <br> Displaying $startcount to $endcount.<br>";
- //print_r($filearray);
- foreach ($files as $file)
- {
- $shownfiles++;
- ($line) ? $line-- : $line++;
- $color = ($line) ? '#151515' : '#000000';
- $gabali = explode("-", $file);
- $date = $gabali[1];
- $mape = $gabali[2];
- $mapesgabali = explode(".", $mape);
- $name = $mapesgabali[0];
- $year = substr($date,0,2);
- $month = substr($date,2,2);
- $day = substr($date,4,2);
- $hour = substr($date,6,2);
- $minute = substr($date,8,2);
- $size = filesize("c:/xampp/htdocs/esclan.net/hltv/".$file);
- $goodsize = human_filesize($size);
- //$files[] = $file;
- //echo "$shownfiles ($startcount <= $shownfiles && $shownfiles <= $endcount)<br>";
- if($startcount <= $shownfiles && $shownfiles <= $endcount)
- //if($shownfiles < $startcount || $shownfiles >= $maxlimit + $limit)
- {
- echo "<tr style='background-color: $color;'>
- <td>
- <font color='#FFFFFF' face='Verdana' size='2'>$month/$day/$year $hour:$minute</li>
- </font></td>
- <td>
- <font color='#75B5EA' face='Verdana' size='2'>$name</font></td>
- <td> <a href='hltv/$file'>
- <font color='#FCAA21' face='Verdana' size='2'>download ($goodsize bytes)</font></a></td>
- </tr>";
- }
- //print "<li>$file</li>\n";
- }
- echo "</table>";
- $pagecounter=0;
- while($pagecounter < $pages) {
- if($pagecounter == $page) {
- echo "[".$pagecounter."] ";
- } else {
- echo "[<a href='?page=".$pagecounter."'] ";
- }
- $pagecounter++;
- }
- ?>
- </p></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement