From 4db4fa47e35df886f41924f4d2fcdfc793346d1a Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Tue, 28 Feb 2006 05:14:26 +0000 Subject: [PATCH] Pass the scope along --- results.php | 11 ++++++----- search.php | 24 +++++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/results.php b/results.php index f73209e2b..a7c41faa2 100644 --- a/results.php +++ b/results.php @@ -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 << + + + +

Results Page:

    EOB; - $start = 0; -echo ''; -echo '

    Results Page:

      '; for($z=1; $z < 11; $z++) { if($start > $res['ResultSet']['totalResultsAvailable']) { break; } - printf('
    • %d
    • ', $q, $start, $z); + printf('
    • %d
    • ', $q, $start, $z); $start += $per_page; } echo '
    '; diff --git a/search.php b/search.php index d5543d78f..0399cd8b3 100644 --- a/search.php +++ b/search.php @@ -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 { "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