Ejemplo n.º 1
0
// ============================================================================
// Try to find the page using the preferred language as a manual page
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/manual-lookup.inc";
$try = find_manual_page($LANG, $URI);
if ($try) {
    status_header(200);
    include_once $_SERVER['DOCUMENT_ROOT'] . $try;
    exit;
}
// BC. The class methods are now classname.methodname
if (preg_match("!^manual/(.+)/function\\.(.+)-(.+).php\$!", $URI, $array)) {
    $try = find_manual_page($array[1], $array[2] . "." . $array[3]);
    if ($try) {
        status_header(301);
        mirror_redirect($try);
        exit;
    }
}
// ============================================================================
// 404 page for manual pages (eg. not built language)
if (strpos($URI, "manual/") === 0) {
    error_404_manual();
}
// ============================================================================
// If no match was found till this point, the last action is to start a
// search with the URI the user typed in
$fallback = myphpnet_urlsearch() === MYPHPNET_URL_MANUAL ? "404manual" : "404quickref";
mirror_redirect('/search.php?show=' . $fallback . '&lang=' . urlencode($LANG) . '&pattern=' . substr($_SERVER['REQUEST_URI'], 1));
/*
 * vim: set et ts=4 sw=4 ft=php: :
 */
Ejemplo n.º 2
0
</div>

<h2>URL search fallback</h2>

<p>
 When you try to access a PHP.net page via an URL shortcut, and
 the site is unable to find that particular page, it falls back
 to a documentation search, or a function list lookup, depending on
 your choice. The default is a function list lookup, as most of
 the URL shortcut users try to access function documentation pages.
</p>

<div class="indent">
 Your setting: <input type="radio" name="urlsearch" value="quickref"
<?php 
$type = myphpnet_urlsearch();
if ($type === MYPHPNET_URL_NONE || $type === MYPHPNET_URL_FUNC) {
    echo ' checked="checked"';
}
echo ' /> Function list search <input type="radio" name="urlsearch" value="manual"';
if ($type === MYPHPNET_URL_MANUAL) {
    echo ' checked="checked"';
}
?>
 /> PHP Documentation search
</div>

<h2>Search field suggestions</h2>

<p>
 Whenever you start a search on a PHP.net page, a list of suggested function