diff options
author | Steve Dibb <beandog@gentoo.org> | 2010-02-11 20:17:46 -0700 |
---|---|---|
committer | Steve Dibb <beandog@gentoo.org> | 2010-02-11 20:17:46 -0700 |
commit | 32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b (patch) | |
tree | f9b8efa8def14998bc8f7a4fed123cc34c98f8db /category.php | |
parent | Zero (diff) | |
download | znurt-org-frontend-32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b.tar.gz znurt-org-frontend-32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b.tar.bz2 znurt-org-frontend-32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b.zip |
initial commit
Diffstat (limited to 'category.php')
-rw-r--r-- | category.php | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/category.php b/category.php new file mode 100644 index 0000000..ddc7c6a --- /dev/null +++ b/category.php @@ -0,0 +1,61 @@ +<? + + require_once 'class.db.category.php'; + + if($category_id) { + + $obj = new DBCategory($category_id); + + $name = $obj->name; + $description = $obj->description; + + $url = $base_uri."categories"; + + echo "<h4>$name</h4>"; + + echo "<div class='description'>$description</div>"; + + $sql = "SELECT package_name, package, id AS ebuild FROM ebuilds WHERE category = ".$db->quote($category_id).";"; + $arr = $db->getAll($sql); + + foreach($arr as $row) { + extract($row); + $arr_packages[$package][] = $ebuild; + $arr_name[$package] = $package_name; + } + + foreach($arr_packages as $package => $arr) { + if(count($arr)) { + + $e = new DBEbuild(current($arr)); + $arr_desc[$package] = $e->description; + + $div_versions .= keywordsRow($arr, 'category'); + } + } + + foreach(array_keys($arr_packages) as $package) { + + $name = $arr_name[$package]; + $desc = $arr_desc[$package]; + + $div_names .= "<tr>\n"; + $div_names .= "<td class='use' valign='top' style='white-space: nowrap;'><a href='$name/' style='color: black;'>$name</a></td>\n"; + $div_names .= "<td class='use' valign='top'>$desc</td>\n"; + $div_names .= "</tr>\n"; + + } + + echo "<div id='names' style='display: none;'>\n"; + echo "<table class='content centerpage'>\n"; + echo $div_names; + echo "</table>\n"; + echo "</div>\n"; + + echo "<div id='versions'>\n"; + echo $div_versions; + echo "</div>\n"; + + } + +?>
\ No newline at end of file |