[31597] trunk/www

jmpp at macports.org jmpp at macports.org
Wed Nov 28 16:22:58 PST 2007


Revision: 31597
          http://trac.macosforge.org/projects/macports/changeset/31597
Author:   jmpp at macports.org
Date:     2007-11-28 16:22:56 -0800 (Wed, 28 Nov 2007)

Log Message:
-----------

My brain lit up, columns creation is now amount of categories agnostic! Categories can now increase to whatever amount
and this code will simply work and list them all.

Also remove an unnecessary <br /> right underneath the h3, eliminating the necessity to push the lists up on the CSS.

Modified Paths:
--------------
    trunk/www/macports.css
    trunk/www/ports.php

Modified: trunk/www/macports.css
===================================================================
--- trunk/www/macports.css	2007-11-28 22:23:49 UTC (rev 31596)
+++ trunk/www/macports.css	2007-11-29 00:22:56 UTC (rev 31597)
@@ -196,7 +196,6 @@
 }
 
 #categories > ul > li {
-    margin-top: -10px;
     margin-bottom: 40px;
 }
 

Modified: trunk/www/ports.php
===================================================================
--- trunk/www/ports.php	2007-11-28 22:23:49 UTC (rev 31596)
+++ trunk/www/ports.php	2007-11-29 00:22:56 UTC (rev 31597)
@@ -52,36 +52,36 @@
 
 <?php
     if (!$by || (!$substr && $by != "all")) {
-        echo "<h3>Port Categories</h3><br />";
         $query = "SELECT DISTINCT category FROM $portsdb_name.categories ORDER BY category";
         $result = mysql_query($query);
         if ($result) {
-            $columns = 0;
 ?>
+            <h3>Port Categories</h3>
+
             <div id="categories">
             
                 <ul>
 
 <?php
-                    while ($columns < 5) {
-                        $entries_per_colum = 0;
+                    while ($row = mysql_fetch_assoc($result)) {
 ?>
                         <li>
                             <ul>
 <?php
-                                while ($row = mysql_fetch_assoc($result)) {
+                                $entries_per_colum = 0;
+                                while (1) {
 ?>
                                     <li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?by=cat&amp;substr=<?php echo urlencode($row['category']); ?>">
                                     <?php echo htmlspecialchars($row['category']); ?></a></li>
 <?php
                                     if ($entries_per_colum == 14) break;
                                     $entries_per_colum++;
+                                    $row = mysql_fetch_assoc($result);
                                 }
 ?>
                             </ul>
                         </li>
 <?php
-                        $columns++;
                     }
 ?>
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071128/4ddf163f/attachment.html


More information about the macports-changes mailing list