Update of /cvsroot/fink/web/pdb
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv7580

Modified Files:
      Tag: redesign_pdb
        browse.php header.inc index.php package.php 
Log Message:


Index: package.php
===================================================================
RCS file: /cvsroot/fink/web/pdb/package.php,v
retrieving revision 1.43.2.16
retrieving revision 1.43.2.17
diff -u -d -r1.43.2.16 -r1.43.2.17
--- package.php 5 Feb 2007 23:00:40 -0000       1.43.2.16
+++ package.php 9 Feb 2007 17:31:21 -0000       1.43.2.17
@@ -261,7 +261,7 @@
 
   show_desc('Usage Hints:', $pkg2disp[descusage]);
 
-  it_item("Section:", '<a 
href="'.$pdbroot.'section.php/'.$pkg2disp[section].'">'.$pkg2disp[section].'</a>');
+  it_item("Section:", '<a 
href="'.$pdbroot.'browse.php?section='.$pkg2disp[section].'">'.$pkg2disp[section].'</a>');
 
   // Get the maintainer field, and try to parse out the email address
   if ($pkg2disp[maintainer]) {
@@ -275,10 +275,10 @@
   // If there was an email specified, make the maintainer field a mailto: link
   if ($email) {
     $email = str_replace(array("@","."), array("AT","DOT"), $email);
-    it_item("Maintainer:", '<a 
href="'.$pdbroot.'maintainer.php?maintainer='.$maintainer.'">'.$maintainer.' 
&lt;'.$email.'&gt;'.'</a>');
+    it_item("Maintainer:", '<a 
href="'.$pdbroot.'browse.php?maintainer='.$maintainer.'">'.$maintainer.' 
&lt;'.$email.'&gt;'.'</a>');
 #    it_item("Maintainer:", '<a href="mailto:'.$email.'">'.$maintainer.'</a>');
   } else {
-    it_item("Maintainer:", '<a 
href="'.$pdbroot.'maintainer.php?maintainer='.$maintainer.'">'.$maintainer.'</a>');
+    it_item("Maintainer:", '<a 
href="'.$pdbroot.'browse.php?maintainer='.$maintainer.'">'.$maintainer.'</a>');
   }
   if ($pkg2disp[homepage]) {
     it_item("Website:", '<a 
href="'.$pkg2disp[homepage].'">'.$pkg2disp[homepage].'</a>');
@@ -322,7 +322,9 @@
 ?>
 
 <p><a href="<? print $pdbroot ?>sections.php">Section list</a> -
-<a href="<? print $pdbroot ?>list.php">Flat package list</a></p>
+<a href="<? print $pdbroot ?>browse.php">Flat package list</a> -
+<a href="<? print $pdbroot ?>browse.php?nolist=on">Search packages</a>
+</p>
 
 
 <?

Index: header.inc
===================================================================
RCS file: /cvsroot/fink/web/pdb/header.inc,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -u -d -r1.10.2.2 -r1.10.2.3
--- header.inc  5 Feb 2007 20:16:41 -0000       1.10.2.2
+++ header.inc  9 Feb 2007 17:31:21 -0000       1.10.2.3
@@ -1,7 +1,7 @@
 <?
 /* $Id$ */
 
-$linkroot = "http://fink.sourceforge.net/";;
+$linkroot = "http://pdb.finkproject.org/";;
 
 $server = $_SERVER['SERVER_NAME'];
 $uri = $_SERVER['REQUEST_URI'];
@@ -39,9 +39,9 @@
 $navbox = array(
   "pdb/index.php", "Introduction",
   "pdb/sections.php", "By Section",
-  "pdb/list.php", "By Package",
-  "pdb/search.php", "Search",
-  "pdb/testing.php", "Help needed"
+  "pdb/browse.php", "By Package",
+  "pdb/browse.php?nolist=on", "Search",
+  "pdb/help.php", "Help needed"
 );
 include "timestamp.inc";
 

Index: browse.php
===================================================================
RCS file: /cvsroot/fink/web/pdb/browse.php,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -d -r1.1.2.5 -r1.1.2.6
--- browse.php  8 Feb 2007 04:49:06 -0000       1.1.2.5
+++ browse.php  9 Feb 2007 17:31:21 -0000       1.1.2.6
@@ -45,7 +45,7 @@
 
 // This function generates a form popup, with the given label,
 // variable name, current value, and list of possible values.
-function genFormSelect($label, $var_name, $cur_val, $values) {
+function genFormSelect($label, $var_name, $cur_val, $values, $description = 
'') {
        echo $label;
        echo "<select NAME='$var_name'>\n";
        foreach ($values as $key => $val) {
@@ -54,6 +54,7 @@
                echo ">$val</option>\n";
        }
        echo "</select>\n";
+       echo $description ? " $description" : '';
        echo "<br>";
 }
 
@@ -85,6 +86,8 @@
 // Read url parameters
 $maintainer = get_safe_param('maintainer', '/[EMAIL PROTECTED] ]+$/');
 $name = get_safe_param('name', '/^[a-z0-9+\-.]+$/');
+$summary = get_safe_param('summary', '/.*/');
+$nolist = get_safe_param('nolist', '/on/');
 
 // Extract the distribution
 // TODO
@@ -106,15 +109,15 @@
 
 // 
 $nochildren = $_GET['nochildren'];
-if ($nochildren != "on") $nochildren = "off";
+if ($nochildren != "on") $nochildren = "";
 
 // 
 $noshlibsdev = $_GET['noshlibsdev'];
-if ($noshlibsdev != "on") $noshlibsdev = "off";
+if ($noshlibsdev != "on") $noshlibsdev = "";
 
 // Sort direction
 $sort = $_GET['sort'];
-if ($sort != "DESC") $sort = "ASC";
+if ($sort != "DESC") $sort = "";
 
 ?>
 
@@ -137,8 +140,12 @@
 <input name="name" type="text" value="<?=$name?>">
 <br>
 
+Summary:
+<input name="summary" type="text" value="<?=$summary?>">
+<br>
+
 <?
-genFormSelect("Tree: ", "tree", $tree, $tree_values);
+genFormSelect("Tree: ", "tree", $tree, $tree_values, 'TODO: Doesn\'t work 
yet!');
 genFormSelect("Section: ", "section", $section, $section_values);
 genFormSelect("Sort: ", "sort", $sort, $sort_values);
 ?>
@@ -152,11 +159,14 @@
 <br>
 
 <input name="submit" type="submit" value="Browse">
+<input type="reset" value="Clear Form">
 </form>
 
 
 <?
 
+if (!$nolist) {
+
 //
 // Build the big query string
 //
@@ -179,6 +189,9 @@
 if ($name != "")
        $query .= "AND p.name LIKE '%$name%' ";
 
+if ($summary != "")
+       $query .= "AND (p.name LIKE '%$summary%' OR p.descshort LIKE 
'%$summary%' OR p.desclong LIKE '%$summary%' OR p.descusage LIKE '%$summary%') 
";
+
 if ($section != "any") {
        if ($section == "games") {
                $sectionquery = " (p.section='$section' OR p.parentname REGEXP 
'kdegames3|kdetoys3') ";
@@ -221,6 +234,7 @@
 <p>Query took <? printf("%.2f", $time_sql_end - $time_sql_start); ?> sec</p>
 <?
 }
+} // if($nolist)
 ?>
 
 <?

Index: index.php
===================================================================
RCS file: /cvsroot/fink/web/pdb/index.php,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -d -r1.20.2.1 -r1.20.2.2
--- index.php   5 Feb 2007 20:37:40 -0000       1.20.2.1
+++ index.php   9 Feb 2007 17:31:21 -0000       1.20.2.2
@@ -23,14 +23,14 @@
 "unstable" because they are not well-tested.
 You can help improve the situation by testing those packages and
 reporting both success and failure to the package maintainer.
-The <a href="testing.php">Packages in Testing</a> page lists all
+The <a href="browse.php?testing=on">Packages in Testing</a> page lists all
 packages that still have to pass testing.
 In order to test the packages, you need to configure Fink to <a 
href="http://fink.sourceforge.net/faq/usage-fink.php#unstable";>use
 unstable</a> and then download the latest descriptions by running <i>fink 
selfupdate-rsync</i> 
 (or <i>fink selfupdate-cvs</i> if you can't use rsync for some reason).
 </p>
 <p>Help is also needed to find new maintainers for the <a
-href="nomaintainer.php">packages without maintainers</a>.</p>
+href="browse.php?maintainer=None&nochildren=on">packages without 
maintainers</a>.</p>
 
 <?
 $q = "SELECT COUNT(DISTINCT name) FROM package";
@@ -57,21 +57,21 @@
 <? print $pkgcount ?> packages in <? print $seccount ?> sections.
 </p>
 
-<form action="search.php" method="GET">
+<form action="browse.php" method="GET">
 <p>Search for package: <input type="text" name="summary" size="15" value="">
 <input type="submit" value="Search">
 </p>
 </form>
 
 <p>
-You can browse a <a href="list.php">complete list of packages</a>,
+You can browse a <a href="browse.php">complete list of packages</a>,
 or you can browse by archive section:
 </p>
 
 <ul>
 <?
   while ($row = mysql_fetch_array($rs)) {
-    print '<li><a href="section.php/'.$row[name].'">'.$row[name].'</a>'.
+    print '<li><a href="browse.php?section='.$row[name].'">'.$row[name].'</a>'.
       ($row[description] ? (' - '.$row[description]) : '').
       '</li>'."\n";
   }


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to