source: trunk/www/downloads.php @ 28393

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

Relocate Id fields.

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