cvs: phpweb / manual-lookup.php

From: Date: Fri, 08 Aug 2003 13:46:28 +0000
Subject: cvs: phpweb / manual-lookup.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-20001@lists.php.net to get a copy of this message
goba Fri Aug 8 09:46:28 2003 EDT Modified files: /phpweb manual-lookup.php Log: Manual lookup remake: - use new type of includes - add base page functionality - use $_GET vars instead of register_globals - use existing information ($MQ, $LANG) - use mirror_redirect() for redirection Index: phpweb/manual-lookup.php diff -u phpweb/manual-lookup.php:1.21 phpweb/manual-lookup.php:1.22 --- phpweb/manual-lookup.php:1.21 Thu May 22 13:31:44 2003 +++ phpweb/manual-lookup.php Fri Aug 8 09:46:28 2003 @@ -1,25 +1,27 @@ -<?php // -*- C++ -*- - -require_once 'prepend.inc'; -require_once 'loadavg.inc'; -require_once 'manual-lookup.inc'; - -if (!$function && $pattern) $function = $pattern; - -if (get_magic_quotes_gpc()) $function = stripslashes($function); - -$function = strtolower($function); - -if (empty($lang)) $lang = default_language(); - -$file = find_manual_page($lang, $function); +<?php +// $Id: manual-lookup.php,v 1.22 2003/08/08 13:46:28 goba Exp $ +$_SERVER['BASE_PAGE'] = 'manual-lookup.php'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/manual-lookup.inc'; + +// BC code, so patter and function can equaly be used as +// parameters to specify the function name +if (empty($_GET['function']) && !empty($_GET['pattern'])) { + $_GET['function'] = $_GET['pattern']; +} -if ($file) { - header("Location: $file"); - exit; +// Prepare data for search +if ($MQ) { $_GET['function'] = stripslashes($_GET['function']); } +$_GET['function'] = strtolower($_GET['function']); + +// Try to find appropriate manual page +if ($file = find_manual_page($LANG, $_GET['function'])) { + mirror_redirect($file); } -$notfound = $function; -include 'quickref.php'; +// Fall back to a quick reference search +$notfound = $_GET['function']; +include_once $_SERVER['DOCUMENT_ROOT'] . '/quickref.php'; ?>

« previous php.mirrors (#20001) next »