cvs: phpweb / results.php ws.php
| From: | Nuno Lopes | Date: | Tue, 28 Feb 2006 12:05:29 +0000 |
| Subject: | cvs: phpweb / results.php ws.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-30719@lists.php.net to get a copy of this message | ||
nlopess Tue Feb 28 12:05:29 2006 UTC
Modified files:
/phpweb results.php ws.php
Log:
fix searches in specific languages
allow searches in the manual
http://cvs.php.net/viewcvs.cgi/phpweb/results.php?r1=1.7&r2=1.8&diff_format=u
Index: phpweb/results.php
diff -u phpweb/results.php:1.7 phpweb/results.php:1.8
--- phpweb/results.php:1.7 Tue Feb 28 11:43:32 2006
+++ phpweb/results.php Tue Feb 28 12:05:29 2006
@@ -1,5 +1,5 @@
<?php
-// $Id: results.php,v 1.7 2006/02/28 11:43:32 nlopess Exp $
+// $Id: results.php,v 1.8 2006/02/28 12:05:29 nlopess Exp $
$_SERVER['BASE_PAGE'] = 'results.php';
include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
#include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
@@ -19,10 +19,10 @@
$s = (int) $_GET['start'];
$per_page = 15;
-$valid_profiles = array('all', 'local', 'news', 'bugs',
'pear', 'pecl', 'talks');
+$valid_profiles = array('all', 'local', 'manual', 'news',
'bugs', 'pear', 'pecl', 'talks');
$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");
+$data = file_get_contents("http://www.php.net/ws.php?profile=$scope&q=$q&lang=$l&results=$per_page&start=$s");
$res = unserialize($data);
// HTTP status line is passed on, signifies an error
http://cvs.php.net/viewcvs.cgi/phpweb/ws.php?r1=1.5&r2=1.6&diff_format=u
Index: phpweb/ws.php
diff -u phpweb/ws.php:1.5 phpweb/ws.php:1.6
--- phpweb/ws.php:1.5 Tue Feb 28 09:46:37 2006
+++ phpweb/ws.php Tue Feb 28 12:05:29 2006
@@ -8,21 +8,23 @@
$r = isset($_REQUEST['results']) ? (int)$_REQUEST['results'] : 10;
$s = isset($_REQUEST['start']) ? (int)$_REQUEST['start'] : 1;
$l = isset($_REQUEST['lang']) ? htmlspecialchars($_REQUEST['lang']) :
'en';
-$sites = array( 'all'=>'site=php.net',
- 'local'=>'site=www.php.net',
- 'news'=>'site=news.php.net',
- 'bugs'=>'site=bugs.php.net',
- 'pear'=>'site=pear.php.net',
- 'pecl'=>'site=pecl.php.net',
- 'talks'=>'site=talks.php.net',
+$sites = array( 'all'=>'php.net',
+ 'local'=>'www.php.net',
+ 'manual'=>'www.php.net',
+ 'news'=>'news.php.net',
+ 'bugs'=>'bugs.php.net',
+ 'pear'=>'pear.php.net',
+ 'pecl'=>'pecl.php.net',
+ 'talks'=>'talks.php.net',
);
+
if(isset($sites[$_REQUEST['profile']])) {
$scope = $_REQUEST['profile'];
} else {
$scope = 'all';
}
-$request =
"{$conf['svc']}?appid={$conf['appid']}&query=$q&start=$s&results=$r&{$sites[$scope]}&language=$l&output=php";
+$request =
"{$conf['svc']}?appid={$conf['appid']}&query=$q&start=$s&results=$r&site={$sites[$scope]}&language=$l&output=php";
$data = @file_get_contents($request);
list($version,$status_code,$msg) = explode(' ',$http_response_header[0], 3);
if($status_code==200) echo $data;