Index: trunk/www/en/ports.php
===================================================================
--- trunk/www/en/ports.php	(revision 1014)
+++ trunk/www/en/ports.php	(revision 1026)
@@ -30,4 +30,5 @@
 				<option value="desc"<? if ($by == "desc") { echo " selected=\"selected\""; } ?>>Description</option>
 				<option value="cat"<? if ($by == "cateogry") { echo " selected=\"selected\""; } ?>>Category</option>
+				<option value="maintainer"<? if ($by == "maintainer") { echo " selected=\"selected\""; } ?>>Maintainer</option>
 				</select>
 			</td>
@@ -68,8 +69,9 @@
 	</form>
 
-	<dl>
 <?
 	if ($by && ($substr || $by == "all")) {
-		$query = "SELECT DISTINCT name,path,version,description,maintainer FROM darwinports.portfiles p, darwinports.maintainers m, darwinports.categories c WHERE p.name=m.portfile AND p.name=c.portfile AND m.is_primary=1";
+		$query = "SELECT DISTINCT name,path,version,description,maintainer FROM darwinports.portfiles p, ".
+		"darwinports.maintainers m, darwinports.categories c, darwinports.variants v, darwinports.platforms pl ".
+		"WHERE p.name=m.portfile AND p.name=v.portfile AND p.name=pl.portfile AND p.name=c.portfile AND m.is_primary=1";
 		if ($by == "name") {
 			$query = $query . " AND p.name LIKE '%" . addslashes($substr) . "%'";
@@ -81,7 +83,22 @@
 			$query = $query . " AND c.category='" . addslashes($substr) . "'";
 		}
+		if ($by == "variant") {
+			$query = $query . " AND v.variant='" . addslashes($substr) . "'";
+		}
+		if ($by == "platform") {
+			$query = $query . " AND pl.platform ='" . addslashes($substr) . "'";
+		}
+		if ($by == "maintainer") {
+			$query = $query . " AND m.maintainer LIKE '%" . addslashes($substr) . "%'";
+		}
 		$query = $query . " ORDER BY name";
 		$result = mysql_query($query);
 		if($result) {
+?>
+	<p>
+	<i><?= mysql_num_rows($result); ?> Portfile<? if (mysql_num_rows($result) != 1) { echo "s"; } ?> Selected</i>
+	</p>
+	<dl>
+<?		
 			while( $row = mysql_fetch_assoc($result) ) {
 ?>
@@ -90,9 +107,12 @@
 	<?= $row['description']; ?><br />
 	<i>Maintained by:</i> <a href="mailto:<?= $row['maintainer']; ?>"><?= $row['maintainer']; ?></a><br />
-	<i>Categories:</i> 
 	<?
+// CATEGORIES
 				$nquery = "SELECT category FROM darwinports.categories WHERE portfile='" . $row['name'] . "' ORDER BY is_primary DESC, category";
 				$nresult = mysql_query($nquery);
 				if ($nresult) {
+?>
+	<i>Categories:</i>
+<?
 					$primary = 1;
 					while ( $nrow = mysql_fetch_assoc($nresult) ) {
@@ -105,4 +125,54 @@
 					}
 				}
+
+// PLATFORMS
+				$nquery = "SELECT platform FROM darwinports.platforms WHERE portfile='" . $row['name'] . "' ORDER BY platform";
+				$nresult = mysql_query($nquery);
+				if ($nresult && mysql_num_rows($nresult) > 0) {
+?>
+	<br />
+	<i>Platforms:</i>
+<?
+					while ( $nrow = mysql_fetch_array($nresult) ) {
+						$platform = $nrow[0];
+					?>
+						<a href="<?= $PHP_SELF; ?>?by=platform&substr=<?= $platform; ?>"><?= $platform; ?></a>
+					<?
+					}
+				}
+
+// DEPENDENCIES
+				$nquery = "SELECT library FROM darwinports.dependencies WHERE portfile='" . $row['name'] . "' ORDER BY library";
+				$nresult = mysql_query($nquery);
+				if ($nresult && mysql_num_rows($nresult) > 0) {
+?>
+	<br />
+	<i>Dependencies:</i>
+<?
+					while ( $nrow = mysql_fetch_array($nresult) ) {
+						// lib:libpng.3:libpng -> libpng
+						$library = eregi_replace("^[^:]*:[^:]*:", "", $nrow[0]);
+					?>
+						<a href="<?= $PHP_SELF; ?>?by=name&substr=<?= $library; ?>"><?= $library; ?></a>
+					<?
+					}
+				}
+/*
+// VARIANTS
+				$nquery = "SELECT variant FROM darwinports.variants WHERE portfile='" . $row['name'] . "' ORDER BY variant";
+				$nresult = mysql_query($nquery);
+				if ($nresult && mysql_num_rows($nresult) > 0) {
+?>
+	<br />
+	<i>Variants:</i>
+<?
+					while ( $nrow = mysql_fetch_array($nresult) ) {
+						$variant = $nrow[0];
+					?>
+						<a href="<?= $PHP_SELF; ?>?by=variant&substr=<?= $variant; ?>"><?= $variant; ?></a>
+					<?
+					}
+				}
+*/
 	?>
 	<br />
Index: trunk/www/ports.php
===================================================================
--- trunk/www/ports.php	(revision 1014)
+++ trunk/www/ports.php	(revision 1026)
@@ -30,4 +30,5 @@
 				<option value="desc"<? if ($by == "desc") { echo " selected=\"selected\""; } ?>>Description</option>
 				<option value="cat"<? if ($by == "cateogry") { echo " selected=\"selected\""; } ?>>Category</option>
+				<option value="maintainer"<? if ($by == "maintainer") { echo " selected=\"selected\""; } ?>>Maintainer</option>
 				</select>
 			</td>
@@ -68,8 +69,9 @@
 	</form>
 
-	<dl>
 <?
 	if ($by && ($substr || $by == "all")) {
-		$query = "SELECT DISTINCT name,path,version,description,maintainer FROM darwinports.portfiles p, darwinports.maintainers m, darwinports.categories c WHERE p.name=m.portfile AND p.name=c.portfile AND m.is_primary=1";
+		$query = "SELECT DISTINCT name,path,version,description,maintainer FROM darwinports.portfiles p, ".
+		"darwinports.maintainers m, darwinports.categories c, darwinports.variants v, darwinports.platforms pl ".
+		"WHERE p.name=m.portfile AND p.name=v.portfile AND p.name=pl.portfile AND p.name=c.portfile AND m.is_primary=1";
 		if ($by == "name") {
 			$query = $query . " AND p.name LIKE '%" . addslashes($substr) . "%'";
@@ -81,7 +83,22 @@
 			$query = $query . " AND c.category='" . addslashes($substr) . "'";
 		}
+		if ($by == "variant") {
+			$query = $query . " AND v.variant='" . addslashes($substr) . "'";
+		}
+		if ($by == "platform") {
+			$query = $query . " AND pl.platform ='" . addslashes($substr) . "'";
+		}
+		if ($by == "maintainer") {
+			$query = $query . " AND m.maintainer LIKE '%" . addslashes($substr) . "%'";
+		}
 		$query = $query . " ORDER BY name";
 		$result = mysql_query($query);
 		if($result) {
+?>
+	<p>
+	<i><?= mysql_num_rows($result); ?> Portfile<? if (mysql_num_rows($result) != 1) { echo "s"; } ?> Selected</i>
+	</p>
+	<dl>
+<?		
 			while( $row = mysql_fetch_assoc($result) ) {
 ?>
@@ -90,9 +107,12 @@
 	<?= $row['description']; ?><br />
 	<i>Maintained by:</i> <a href="mailto:<?= $row['maintainer']; ?>"><?= $row['maintainer']; ?></a><br />
-	<i>Categories:</i> 
 	<?
+// CATEGORIES
 				$nquery = "SELECT category FROM darwinports.categories WHERE portfile='" . $row['name'] . "' ORDER BY is_primary DESC, category";
 				$nresult = mysql_query($nquery);
 				if ($nresult) {
+?>
+	<i>Categories:</i>
+<?
 					$primary = 1;
 					while ( $nrow = mysql_fetch_assoc($nresult) ) {
@@ -105,4 +125,54 @@
 					}
 				}
+
+// PLATFORMS
+				$nquery = "SELECT platform FROM darwinports.platforms WHERE portfile='" . $row['name'] . "' ORDER BY platform";
+				$nresult = mysql_query($nquery);
+				if ($nresult && mysql_num_rows($nresult) > 0) {
+?>
+	<br />
+	<i>Platforms:</i>
+<?
+					while ( $nrow = mysql_fetch_array($nresult) ) {
+						$platform = $nrow[0];
+					?>
+						<a href="<?= $PHP_SELF; ?>?by=platform&substr=<?= $platform; ?>"><?= $platform; ?></a>
+					<?
+					}
+				}
+
+// DEPENDENCIES
+				$nquery = "SELECT library FROM darwinports.dependencies WHERE portfile='" . $row['name'] . "' ORDER BY library";
+				$nresult = mysql_query($nquery);
+				if ($nresult && mysql_num_rows($nresult) > 0) {
+?>
+	<br />
+	<i>Dependencies:</i>
+<?
+					while ( $nrow = mysql_fetch_array($nresult) ) {
+						// lib:libpng.3:libpng -> libpng
+						$library = eregi_replace("^[^:]*:[^:]*:", "", $nrow[0]);
+					?>
+						<a href="<?= $PHP_SELF; ?>?by=name&substr=<?= $library; ?>"><?= $library; ?></a>
+					<?
+					}
+				}
+/*
+// VARIANTS
+				$nquery = "SELECT variant FROM darwinports.variants WHERE portfile='" . $row['name'] . "' ORDER BY variant";
+				$nresult = mysql_query($nquery);
+				if ($nresult && mysql_num_rows($nresult) > 0) {
+?>
+	<br />
+	<i>Variants:</i>
+<?
+					while ( $nrow = mysql_fetch_array($nresult) ) {
+						$variant = $nrow[0];
+					?>
+						<a href="<?= $PHP_SELF; ?>?by=variant&substr=<?= $variant; ?>"><?= $variant; ?></a>
+					<?
+					}
+				}
+*/
 	?>
 	<br />
