source: trunk/www/downloads.php @ 28649

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

New clothes!

  • Applies style of my mockup to /trunk/www, at jmpp@'s request
  • Use php long-tags (mostly)
  • Valid XHTML 1.1 (mostly)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-php
File size: 879 bytes
Line 
1  <?php
2    /* $Id: downloads.php 28649 2007-09-06 07:04:17Z sfiera@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                <h2 class="hdr">Available Downloads</h2>
9                <table>
10<?php
11$dir=".";
12
13// Read files from the dirctory
14$files = array();
15$rep=opendir($dir);
16while ($file = readdir($rep)) {
17        if (preg_match('/^(\..*)|(.*\.(php|css|html|js))$/', $file)
18                || is_dir($file)
19           ) {
20                continue;
21        }
22       
23        // Add file to array, as key, with modtime as value
24        $files[$file] = filemtime($file);
25}
26closedir($rep);
27
28// Sort the array in reverse order by value (modtime)
29arsort($files);
30
31// Emit the files, with dates
32foreach ($files as $f => $t) {
33        echo "<tr>";
34        echo "<td>".date("d-M-Y G:i", $t)."</td><td><a href=\"/macports/downloads/$f\">$f</a></td>\n";
35        echo "</tr>";
36}
37?>
38                </table>
39
40<?php
41  print_footer();
42?>
Note: See TracBrowser for help on using the repository browser.