source: trunk/www/downloads.php @ 28314

Last change on this file since 28314 was 28314, checked in by jmpp@…, 13 years ago

Fix svn props across the board.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-php
File size: 931 bytes
RevLine 
[14587]1  <?php
2    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
[28303]3    include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
4    print_header('MacPorts Downloads', 'utf-8');
[28314]5    /* $Id: downloads.php 28314 2007-08-28 02:28:47Z jmpp@macports.org $ */
[14587]6  ?>
7
8    <div id="content">
9       
10                <h2 class="hdr">Available Downloads</h2>
[17280]11                <table>
[14587]12<?php
[17223]13$dir=".";
14
15// Read files from the dirctory
16$files = array();
17$rep=opendir($dir);
18while ($file = readdir($rep)) {
[28303]19        if (   preg_match('/^(\..*)|(.*\.php)|(.*\.css)|(.*\.html)$/', $file)
[17223]20                || is_dir($file)
[17280]21           ) {
[17223]22                continue;
[17280]23        }
24       
25        // Add file to array, as key, with modtime as value
26        $files[$file] = filemtime($file);
[14587]27}
[15226]28closedir($rep);
[17223]29
[17280]30// Sort the array in reverse order by value (modtime)
31arsort($files);
[17223]32
33// Emit the files, with dates
[17280]34foreach ($files as $f => $t) {
35        echo "<tr>";
[28303]36        echo "<td>".date("d-M-Y G:i", $t)."</td><td><a href=\"/macports/downloads/$f\">$f</a></td>\n";
[17280]37        echo "</tr>";
[17223]38}
[14587]39?>
[17280]40                </table>
[14587]41    </div>
42  </div>
43
44<?php
45  print_footer();
46?>
Note: See TracBrowser for help on using the repository browser.