cvs: phpweb / results.php search.php
| From: | Rasmus Lerdorf | Date: | Tue, 28 Feb 2006 05:14:26 +0000 |
| Subject: | cvs: phpweb / results.php search.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-30713@lists.php.net to get a copy of this message | ||
rasmus Tue Feb 28 05:14:26 2006 UTC
Modified files:
/phpweb search.php results.php
Log:
Pass the scope along
http://cvs.php.net/viewcvs.cgi/phpweb/search.php?r1=1.105&r2=1.106&diff_format=u
Index: phpweb/search.php
diff -u phpweb/search.php:1.105 phpweb/search.php:1.106
--- phpweb/search.php:1.105 Tue Feb 28 01:06:32 2006
+++ phpweb/search.php Tue Feb 28 05:14:25 2006
@@ -1,5 +1,5 @@
<?php
-// $Id: search.php,v 1.105 2006/02/28 01:06:32 imajes Exp $
+// $Id: search.php,v 1.106 2006/02/28 05:14:25 rasmus Exp $
$_SERVER['BASE_PAGE'] = 'search.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
@@ -61,10 +61,9 @@
mirror_redirect("{$ml_url}l=phpdoc&s={$ucp}");
case "bugdb" :
-
// Redirect to bug page in case of exact number
if (preg_match("!^\\d+$!", $_FORM['pattern'])) {
- mirror_redirect("http://bugs.php.net/{$_FORM['pattern']}");
+ mirror_redirect("http://bugs.php.net/{$ucp}");
}
// Redirect to bug search page in case of some other pattern
@@ -75,9 +74,11 @@
);
}
- // Covers "wholesite", "manual" and any malicios targets
+ // Covers "wholesite", "manual" and any malicious targets
default:
- mirror_redirect($MYSITE . "results.php?q={$ucp}&l=$LANG");
+ $p = urlencode($_FORM['show']);
+ mirror_redirect($MYSITE . "results.php?q={$ucp}&l=$LANG&p=$p");
+ break;
}
}
@@ -129,13 +130,14 @@
<?php
if (empty($_FORM['show'])) { $_FORM['show'] = 'quickref'; }
$searchoptions = array(
- "quickref" => "function list",
- "wholesite" => "whole site",
- "manual" => "online documentation [en]",
- "bugdb" => "bug database",
- "maillist" => "general mailing list",
- "devlist" => "developer mailing list",
- "phpdoc" => "documentation mailing list",
+ "quickref" => "function list",
+ "all" => "all php.net sites",
+ "local" => "this mirror only",
+ "manual" => "online documentation [en]",
+ "bugdb" => "bug database",
+ "maillist" => "general mailing list",
+ "devlist" => "developer mailing list",
+ "phpdoc" => "documentation mailing list",
);
// Print out an <option> for all search options
http://cvs.php.net/viewcvs.cgi/phpweb/results.php?r1=1.4&r2=1.5&diff_format=u
Index: phpweb/results.php
diff -u phpweb/results.php:1.4 phpweb/results.php:1.5
--- phpweb/results.php:1.4 Tue Feb 28 01:06:32 2006
+++ phpweb/results.php Tue Feb 28 05:14:26 2006
@@ -1,5 +1,5 @@
<?php
-// $Id: results.php,v 1.4 2006/02/28 01:06:32 imajes Exp $
+// $Id: results.php,v 1.5 2006/02/28 05:14:26 rasmus Exp $
$_SERVER['BASE_PAGE'] = 'results.php';
include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
#include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
@@ -25,7 +25,7 @@
$data = file_get_contents("http://www.php.net/ws.php?profile=$scope&q=$q&results=$per_page&start=$s");
$res = unserialize($data);
-// HTTP status line is passed on, signifies and error
+// HTTP status line is passed on, signifies an error
site_header('Search results');
if (is_string($res)) {
@@ -82,16 +82,17 @@
}
echo <<<EOB
</ul>
+<span style="margin-left: 3.5em;"><a href="http://developer.yahoo.net/about">
+<img src="http://us.dev1.yimg.com/us.yimg.com/i/us/nt/bdg/websrv_120_1.gif"
border="0">
+</a></span>
+<div id="results_nav"><h4>Results Page:</h4><ul
id="results_nav_list">
EOB;
-
$start = 0;
-echo '<span style="margin-left: 3.5em;"><a href="http://developer.yahoo.net/about"><img
src="http://us.dev1.yimg.com/us.yimg.com/i/us/nt/bdg/websrv_120_1.gif"
border="0"></a></span>';
-echo '<div id="results_nav"><h4>Results Page:</h4><ul
id="results_nav_list">';
for($z=1; $z < 11; $z++) {
if($start > $res['ResultSet']['totalResultsAvailable']) {
break;
}
- printf('<li><a
href="/results.php?q=%s&start=%d">%d</a></li>', $q, $start, $z);
+ printf('<li><a
href="/results.php?q=%s&start=%d&p=$scope">%d</a></li>', $q,
$start, $z);
$start += $per_page;
}
echo '</ul></div>';