source: trunk/www/downloads.php @ 28303

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

Major but minor commit to the www svn space: reorder the sources a bit to have a cleaner
layout while bringing the content up to speed with current practices and reality, otherwise
sticking to the same website we had back in OpenDarwin days.

The one big thing about this commit, though, is that the old ports.php page is again operational,
as shown in my local server: http://apollo.homeunix.net/macports/ports.php. Woot!

Further discussion of what to do with these sources is needed, however, so I'm not gonna push to
host them anywhere for the time being until we have a clearer map of how we should move forward
wrt our web presence.

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