1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Pass the scope along

This commit is contained in:
Rasmus Lerdorf
2006-02-28 05:14:26 +00:00
parent 20257b14b4
commit 4db4fa47e3
2 changed files with 19 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ $scope = in_array($_GET['p'], $valid_profiles) ? $_GET['p'] : 'all';
$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 @@ EOB;
}
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>';

View File

@@ -61,10 +61,9 @@ if (!empty($_FORM['pattern'])) {
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 @@ if (!empty($_FORM['pattern'])) {
);
}
// 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 @@ else {
<?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