cvs: phpweb / search.php /include layout.inc

From: Date: Wed, 23 Apr 2003 16:50:59 +0000
Subject: cvs: phpweb / search.php /include layout.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-16952@lists.php.net to get a copy of this message
goba Wed Apr 23 12:50:59 2003 EDT Modified files: /phpweb search.php /phpweb/include layout.inc Log: Provide a base URL for relative PHP.net links on the search page [and only on the search page], so when someone uses remote searching, he can get back to the original mirror with any relative link on the page. Index: phpweb/search.php diff -u phpweb/search.php:1.71 phpweb/search.php:1.72 --- phpweb/search.php:1.71 Wed Apr 23 12:29:36 2003 +++ phpweb/search.php Wed Apr 23 12:50:59 2003 @@ -1,5 +1,5 @@ <?php -/* $Id: search.php,v 1.71 2003/04/23 16:29:36 goba Exp $ */ +/* $Id: search.php,v 1.72 2003/04/23 16:50:59 goba Exp $ */ include_once "prepend.inc"; @@ -76,9 +76,14 @@ } // If we are on the same site, there is no need for the base -// This makes URLs shorter and POST data smaller +// This makes URLs shorter and POST data smaller. If we have +// a base, and not on the same site, we need to make relative +// links be relative to the original server +unset($SEARCH_BASE); if (isset($base) && $base == $MYSITE) { unset($base); +} else { + $SEARCH_BASE = $base . "search.php"; } // ============================================================================ Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.133 phpweb/include/layout.inc:1.134 --- phpweb/include/layout.inc:1.133 Wed Apr 2 11:00:09 2003 +++ phpweb/include/layout.inc Wed Apr 23 12:50:59 2003 @@ -1,6 +1,6 @@ <?php -/* $Id: layout.inc,v 1.133 2003/04/02 16:00:09 cmv Exp $ */ +/* $Id: layout.inc,v 1.134 2003/04/23 16:50:59 goba Exp $ */ // Print an image for a sized spacer function spacer($width = 1, $height = 1, $return = false, $align = false, $extras = false) @@ -197,13 +197,14 @@ # function commonHeader($title="",$dont_enclose=0,$headers_gone=0) { - global $MYSITE, $base, $enclosed, $EXPL_LANG, $SIDEBAR_DATA; + global $MYSITE, $base, $enclosed, $EXPL_LANG, $SIDEBAR_DATA, $SEARCH_BASE; ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>PHP<?php if ($title) echo ": $title";?></title> <link rel="stylesheet" href="/style.css" /> <link rel="shortcut icon" href="/favicon.ico" /> + <?php echo (isset($SEARCH_BASE) ? '<base href="' . $SEARCH_BASE . '" />' : ''); ?> </head> <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" text="#000000" link="#000099" alink="#0000ff"

« previous php.mirrors (#16952) next »