[35131] trunk/www/ports.php
jmpp at macports.org
jmpp at macports.org
Mon Mar 17 20:30:38 PDT 2008
Revision: 35131
http://trac.macosforge.org/projects/macports/changeset/35131
Author: jmpp at macports.org
Date: 2008-03-17 20:30:37 -0700 (Mon, 17 Mar 2008)
Log Message:
-----------
Some more php <==> html reorg. Also, provide an alternative if the last regen date can't be determined for whatever reason (feel free to provide an alternative to my alternative!).
Modified Paths:
--------------
trunk/www/ports.php
Modified: trunk/www/ports.php
===================================================================
--- trunk/www/ports.php 2008-03-18 03:19:46 UTC (rev 35130)
+++ trunk/www/ports.php 2008-03-18 03:30:37 UTC (rev 35131)
@@ -4,30 +4,32 @@
/* $Id$ */
/* Copyright (c) 2004, OpenDarwin. */
/* Copyright (c) 2004-2007, The MacPorts Project. */
+
$MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
include_once("$MPWEB/includes/common.inc");
print_header('The MacPorts Project -- Available Ports', 'utf-8');
$portsdb_info = portsdb_connect($portsdb_host, $portsdb_user, $portsdb_passwd);
$by = isset($_GET['by']) ? $_GET['by'] : '';
$substr = isset($_GET['substr']) ? $_GET['substr'] : '';
-?>
-
-<div id="content">
-
- <h2 class="hdr">MacPorts Portfiles</h2>
-
-<?php
$sql = "SELECT UNIX_TIMESTAMP(activity_time) FROM $portsdb_name.log ORDER BY UNIX_TIMESTAMP(activity_time) DESC";
$result = mysql_query($sql);
if ($result && $row = mysql_fetch_row($result)) {
$date = date('Y-m-d', $row[0]);
$time = date('H:i:s e', $row[0]);
+ } else {
+ $date = '(unknown)';
+ $time = '(unknown)';
}
?>
+
+<div id="content">
+
+ <h2 class="hdr">MacPorts Portfiles</h2>
+
<p>The MacPorts Project currently distributes <b><?php print $portsdb_info['num_ports']; ?></b> ports, organized across
<?php print $portsdb_info['num_categories']; ?> different categories and available below for viewing. This form allows
- you to search the MacPorts software index, last updated on <b><?php print $date; ?></b> at <b><?php print $time; ?></b>.
+ you to search the MacPorts software index, last updated on <?php print '<b>' . $date . '</b> at <b>' . $time . '</b>'; ?>.
</p>
<br />
@@ -50,7 +52,6 @@
ports)</a>.</p>
<br />
-
<?php
if (!$by || (!$substr && $by != "all")) {
$query = "SELECT DISTINCT category FROM $portsdb_name.categories ORDER BY category";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080317/dc21fe28/attachment.html
More information about the macports-changes
mailing list