From 5af48bb75ef7787123cab9b050cdca47ce2397b7 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Thu, 24 Aug 2006 14:53:41 +0000 Subject: feed-browser: another set of functionality and look changes - added sections tree on left side - need some work as we do not have 'e' or 'gnome' section so parts are wrong - letterchooser is always visible - removed menu as it is useless now - package details has versions sorted by PV - all pages should now validate as HTML 1.0 Strict - restructured code a bit - now HTML mainblock is in one place --- contrib/feed-browser/css/feed.css | 32 ++++++++-- contrib/feed-browser/index.php | 131 +++++++++++++++++++++++++------------- 2 files changed, 112 insertions(+), 51 deletions(-) (limited to 'contrib/feed-browser') diff --git a/contrib/feed-browser/css/feed.css b/contrib/feed-browser/css/feed.css index 7a7e55ebd6..b1252c4f7e 100644 --- a/contrib/feed-browser/css/feed.css +++ b/contrib/feed-browser/css/feed.css @@ -29,11 +29,6 @@ td vertical-align: top; } -#page { - margin: 1em auto; - width: 80%; -} - #letters { margin: 1em 0; @@ -60,3 +55,30 @@ dt { padding-top: 0.5em; } + +#sections +{ + list-style: none; + font-size: 0.8em; +} + +.subsections +{ + list-style: none; + margin-left: -1em; +} + +#page +{ +} + +#left +{ + float: left; + width: 20%; +} + +#right +{ + width: 79%; +} diff --git a/contrib/feed-browser/index.php b/contrib/feed-browser/index.php index 1603cfd779..c34fa4ffb8 100644 --- a/contrib/feed-browser/index.php +++ b/contrib/feed-browser/index.php @@ -30,22 +30,6 @@ * */ -?> - - -Feed browser - - - - - -
- - -
- + + + + Feed browser + + + + + +
+
+ +
+ "; $alfabet = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y'); @@ -238,16 +228,11 @@ function searchletter($searchletter) } else { - $ipkgoutput .= sprintf(" %s |", $letter, $letter ); + $ipkgoutput .= sprintf(" %s |", $letter, $letter, $letter ); } } - $ipkgoutput .= " z"; - - if(isset($searchletter)) - { - $ipkgoutput .= searchpkg("$searchletter%"); - } + $ipkgoutput .= " z"; return $ipkgoutput; } @@ -274,8 +259,8 @@ function searchpkg ($searchword) } $ipkgoutput .= sprintf - ("%s%s %s\n", - urlencode($package['p_name']), $package['p_name'], $package['p_section'], $package['p_section'], $package['p_desc']); + ("%s%s %s\n", + urlencode($package['p_name']), $package['p_name'], $package['p_section'], $package['p_section'], htmlentities($package['p_desc'])); } } @@ -306,11 +291,11 @@ function searchsection($section) } } - $ipkgoutput .= sprintf ("%s%s%s", + $ipkgoutput .= sprintf ("%s%s%s", urlencode($package['p_name']), $package['p_name'], $package['p_section'], $package['p_section'], - $package['p_desc']); + htmlentities($package['p_desc'])); }//if strstr } @@ -321,7 +306,9 @@ function searchsection($section) function pkgdetails ($package) { - $result = db_query("SELECT * FROM packages,feeds WHERE packages.p_name='$package' AND feeds.f_name = packages.p_feed"); + $result = db_query("SELECT * FROM packages,feeds + WHERE packages.p_name='$package' AND feeds.f_name = packages.p_feed + ORDER BY packages.p_version DESC"); // display first result @@ -330,7 +317,7 @@ function pkgdetails ($package) $package = $result[0]; $details = sprintf("

Package details for %s %s

", $package['packages.p_name'], $package['packages.p_version']); - $details .= sprintf ("

%s

", $package['packages.p_desc']); + $details .= sprintf ("

%s

", htmlentities($package['packages.p_desc'])); $details .= "
"; $details .= sprintf ("\n
Maintainer:
%s
", htmlentities(str_replace('@', ' at ', $package['packages.p_maintainer']))); @@ -342,7 +329,7 @@ function pkgdetails ($package) if($package['packages.p_section']) { - $details .= sprintf ("\n
Section:
%s
", $package['packages.p_section'],$package['packages.p_section']); + $details .= sprintf ("\n
Section:
%s
", $package['packages.p_section'],$package['packages.p_section']); } if($package['packages.p_depends']) @@ -417,10 +404,13 @@ function pkgdetails ($package) foreach($result as $packages_a) { - $details .= sprintf("\n
  • %s %s for %s
  • \n", + $details .= sprintf("\n
  • %s %s for %s
  • \n", $packages_a['feeds.f_uri']."/".$packages_a['packages.p_file'], $packages_a['packages.p_name'], $packages_a['packages.p_version'], + $packages_a['packages.p_arch'], + $packages_a['packages.p_name'], + $packages_a['packages.p_version'], $packages_a['packages.p_arch']); } @@ -456,7 +446,7 @@ function addlinks ($input) { // find position of string in line $pos = strpos ($input, $element, $offset); - $link = sprintf("$element", urlencode ($element)); + $link = sprintf("$element", urlencode ($element)); // replace element with a link $input = substr_replace ($input, $link, $pos, strlen ($element)); @@ -480,13 +470,62 @@ function sectionslist() if($result = db_query ("SELECT DISTINCT p_section FROM packages ORDER BY p_section")) { - $ipkgoutput = "\n"; -- cgit 1.2.3-korg