Changeset 31563


Ignore:
Timestamp:
Nov 28, 2007, 6:12:20 AM (12 years ago)
Author:
sfiera@…
Message:

Make better use of horizontal space in ports.php; get rid of that nasty table

Location:
trunk/www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/macports.css

    r31547 r31563  
    196196}
    197197
     198div.port {
     199    width: 120px;
     200    margin: 0.25em;
     201    float: left;
     202}
     203
    198204.email {
    199205    width: 1em;
  • trunk/www/ports.php

    r31516 r31563  
    1818    <h2 class="hdr">MacPorts Portfiles</h2>
    1919
    20     <p>
    21         This form allows you to search the current index of MacPorts software. <br />
    22         <i>Index last updated: </i>
    2320<?php
    2421        $sql = "SELECT UNIX_TIMESTAMP(activity_time) FROM $portsdb_name.log ORDER BY UNIX_TIMESTAMP(activity_time) DESC";
    2522        $result = mysql_query($sql);
    2623        if ($result && $row = mysql_fetch_row($result)) {
    27             echo date("d-M-Y H:i:s", $row[0]);
    28         }
    29 ?>
     24            $date = date('Y-m-d', $row[0]);
     25            $time = date('H:i', $row[0]);
     26        }
     27?>
     28    <p>
     29        MacPorts currently has <?php print ports_count(); ?> ports of software, across a wide variety of categories. This form allows you to search the current index of MacPorts software, updated <?php echo $date; ?> at <?php echo $time; ?>.
    3030    </p>
    3131       
    3232    <form action="<?php echo $_SERVER['PHP_SELF']; ?>">
    33         <table>
    34             <tr>
    35                 <th>Search by:</th>
    36                 <td>
    37                     <select name="by">
    38                         <option value="name"<?php if ($by == "name") { echo " selected=\"selected\""; } ?>>Software Title</option>
    39                         <option value="desc"<?php if ($by == "desc") { echo " selected=\"selected\""; } ?>>Description</option>
    40                         <option value="cat"<?php if ($by == "cat") { echo " selected=\"selected\""; } ?>>Category</option>
    41                         <option value="maintainer"<?php if ($by == "maintainer") { echo " selected=\"selected\""; } ?>>Maintainer</option>
    42                     </select>
    43                 </td>
    44                 <td><input type="text" name="substr" size="40" /></td>
    45                 <td><input type="submit" value="Search" /></td>
    46             </tr>
    47             <tr><td colspan="4"><hr /></td></tr>
    48             <tr>
    49                 <td colspan="4" align="left"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?by=all">View All Software Titles (<?php print ports_count(); ?>)</a></td>
    50             </tr>
     33        <label>Search by:</label>
     34        <select name="by">
     35            <option value="name"<?php if ($by == "name") { echo " selected=\"selected\""; } ?>>Software Title</option>
     36            <option value="desc"<?php if ($by == "desc") { echo " selected=\"selected\""; } ?>>Description</option>
     37            <option value="cat"<?php if ($by == "cat") { echo " selected=\"selected\""; } ?>>Category</option>
     38            <option value="maintainer"<?php if ($by == "maintainer") { echo " selected=\"selected\""; } ?>>Maintainer</option>
     39        </select>
     40        <input type="text" name="substr" size="40" />
     41        <input type="submit" value="Search" />
     42    </form>
     43    <h3>Port Categories</h3>
     44        <p>View the complete <a href="<?php echo $_SERVER['PHP_SELF']; ?>?by=all">Ports List</a></p>
    5145<?php
    5246            if (!$by || (!$substr && $by != "all")) {
    53 ?>
    54                 <tr><td colspan="4"><hr /></td></tr>
    55                 <tr><th colspan="4" align="left">View By Category:</th></tr>
    56 <?php
    5747                $query = "SELECT DISTINCT category FROM $portsdb_name.categories ORDER BY category";
    5848                $result = mysql_query($query);
     
    6050                    while ($row = mysql_fetch_assoc($result)) {
    6151?>
    62                         <tr><td colspan="4"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?by=cat&amp;substr=<?php echo urlencode($row['category']); ?>"><?php echo htmlspecialchars($row['category']); ?></a></td></tr>
     52                        <div class="port"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?by=cat&amp;substr=<?php echo urlencode($row['category']); ?>"><?php echo htmlspecialchars($row['category']); ?></a></div>
    6353<?php
    6454                    }
     
    6656            }
    6757?>
    68         </table>
    69     </form>
    7058
    7159<?php
Note: See TracChangeset for help on using the changeset viewer.