Changeset 35131 for trunk/www


Ignore:
Timestamp:
Mar 18, 2008, 3:30:37 AM (12 years ago)
Author:
jmpp@…
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!).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/ports.php

    r35130 r35131  
    55    /* Copyright (c) 2004, OpenDarwin. */
    66    /* Copyright (c) 2004-2007, The MacPorts Project. */
     7   
    78    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
    89    include_once("$MPWEB/includes/common.inc");
     
    1112    $by = isset($_GET['by']) ? $_GET['by'] : '';
    1213    $substr = isset($_GET['substr']) ? $_GET['substr'] : '';
    13 ?>
    14 
    15 
    16 <div id="content">
    17 
    18     <h2 class="hdr">MacPorts Portfiles</h2>
    19 
    20 <?php
     14
    2115    $sql = "SELECT UNIX_TIMESTAMP(activity_time) FROM $portsdb_name.log ORDER BY UNIX_TIMESTAMP(activity_time) DESC";
    2216    $result = mysql_query($sql);
     
    2418        $date = date('Y-m-d', $row[0]);
    2519        $time = date('H:i:s e', $row[0]);
     20    } else {
     21        $date = '(unknown)';
     22        $time = '(unknown)';
    2623    }
    2724?>
     25
     26<div id="content">
     27
     28    <h2 class="hdr">MacPorts Portfiles</h2>
     29
    2830    <p>The MacPorts Project currently distributes <b><?php print $portsdb_info['num_ports']; ?></b> ports, organized across
    2931    <?php print $portsdb_info['num_categories']; ?> different categories and available below for viewing. This form allows
    30     you to search the MacPorts software index, last updated on <b><?php print $date; ?></b> at <b><?php print $time; ?></b>.
     32    you to search the MacPorts software index, last updated on <?php print '<b>' . $date . '</b> at <b>' . $time . '</b>'; ?>.
    3133    </p>
    3234   
     
    5052    ports)</a>.</p>
    5153    <br />
    52 
    5354
    5455<?php
Note: See TracChangeset for help on using the changeset viewer.