cvs: phpweb /error index.php /gifs b-next-p.gif b-prev-p.gif gcap-left.gif gcap-right.gif
| From: | Colin Viebrock | Date: | Sun, 13 May 2001 22:38:07 +0000 |
| Subject: | cvs: phpweb /error index.php /gifs b-next-p.gif b-prev-p.gif gcap-left.gif gcap-right.gif | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-4982@lists.php.net to get a copy of this message | ||
cmv Sun May 13 15:38:07 2001 EDT
Removed files:
/phpweb/gifs b-next-p.gif b-prev-p.gif gcap-left.gif gcap-right.gif
Modified files:
/phpweb/error index.php
Log:
Remove those old images again, and fix the error/index.php page to not need them. :)
Index: phpweb/error/index.php
diff -u phpweb/error/index.php:1.24 phpweb/error/index.php:1.25
--- phpweb/error/index.php:1.24 Sat May 5 13:45:29 2001
+++ phpweb/error/index.php Sun May 13 15:38:06 2001
@@ -70,122 +70,11 @@
exit;
}
-?>
-<?Header("HTTP/1.0 404 Not Found")?>
-<?commonHeader("404: File not found: /$uri");
-
- if(!isset($pattern)) {
- $pattern = $uri;
- }
-
-function makeBar($no,$page,$pages,$baseurl,$firstdisplayed,$lastdisplayed) {
- global $FONTFACE;
- if ($page>1) {
- $i=$page-1;
- $last="<A HREF=\"$baseurl&page=$i\"
onMouseover=\"change('prev$no',1);\" onMouseout=\"hide();\"><IMG
SRC='/gifs/b-prev-p.gif' ALT='Previous page' WIDTH=75 HEIGHT=21 VSPACE=7
BORDER=0 NAME='prev$no' align=absmiddle></A>";
- } else {
- $last=" ";
- }
- if ($page<$pages) {
- $i=$page+1;
- $next="<A HREF=\"$baseurl&page=$i\"
onMouseover=\"change('next$no',1);\" onMouseout=\"hide();\"><IMG
SRC='/gifs/b-next-p.gif' ALT='Next page' WIDTH=75 HEIGHT=21 VSPACE=7 BORDER=0
NAME='next$no' align=absmiddle></A>";
- } else {
- $next=" ";
- }
-
- $middle="<B>Displaying results $firstdisplayed to $lastdisplayed</B>";
-
- echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR='#D0D0D0' CELLPADDING=0
CELLSPACING=0>\n";
- echo "<TR VALIGN=middle>\n";
- echo "<TD ALIGN=left WIDTH=18><IMG SRC='/gifs/gcap-left.gif' WIDTH=18
HEIGHT=36 BORDER=0><BR></TD>\n";
- echo "<TD ALIGN=left WIDTH=75>$last<BR></TD>\n";
- echo "<TD ALIGN=center WIDTH=100%><FONT FACE='$FONTFACE'
SIZE=-1>$middle<BR></TD>\n";
- echo "<TD ALIGN=right WIDTH=75>$next<BR></TD>\n";
- echo "<TD ALIGN=right WIDTH=18><IMG SRC='/gifs/gcap-right.gif' WIDT=18
HEIGHT=36 BORDER=0><BR></TD>\n";
- echo "</TR></TABLE><BR>\n";
-}
-
- $form=$PHP_SELF;
- if (!isset($base)) {
- if (ereg("^(.+//[^/]+)/",$HTTP_REFERER,$reg)) {
- $base=$reg[1];
- }
- if ($base==$MYSITE) {
- $base="-";
- }
- }
-
- if ($base=="-") {
- $sourceurl=$PHP_SELF;
- } else {
- $sourceurl=$base.$PHP_SELF;
- }
-
- if ($pattern=="") {
- echo "<b>Error:</B> No search words specified.<BR><BR>";
- echo "Click here for a <A HREF=\"$sourceurl\">New
Search</A><BR><BR>\n";
- exit();
- }
-
- $words=EscapeShellCmd(UrlEncode($pattern));
- $config="php";
- if ($show=="source") {
- $exclude="/manual";
- $restrict=$MYSITE."source";
- $where="PHP site source code";
- } elseif ($show=="manual") {
- $restrict=$MYSITE."manual";
- $exclude="/source";
- $where="PHP documentation";
- } else {
- $exclude="/source";
- $restrict=$MYSITE;
- $where="PHP web site";
- }
- if (isset($page)) {$off="&page=$page";} else {$off="";}
- $query="words=$words&config=$config&exclude=$exclude&restrict=$restrict$off";
- exec("$htsearch_prog \"$query\"",$result);
- $rc=count($result);
- if ($rc<2) {
- echo "<B>There was an error executing this query.</B><BR><BR>Please
try later<BR><BR>";
- commonFooter();
- exit;
- }
- if ($result[2]=="NOMATCH") {
- echo "Sorry, that URL does not exist, and a quick search for the
<b>$pattern</b> ";
- echo "keyword did not turn anything up.<br><br>";
- commonFooter();
- exit;
- }
- $matches=$result[2];
- $firstdisplayed=$result[3];
- $lastdisplayed=$result[4];
- $page=$result[5];
- $pages=$result[6];
- $baseurl=$PHP_SELF."?pattern=$words&show=$show&base=$base";
-
- echo "The page you requested does not exist, however a quick search turned up the ";
- echo "following potential pages related to your request.<br><br>";
-
- makeBar("",$page,$pages,$baseurl,$firstdisplayed,$lastdisplayed);
- $i=7; #skip response header
- while($i<$rc) {
- if ($base=="-") {
- echo $result[$i];
- } else {
- echo eregi_replace("http://[^.]+\.php\.net/","$base/",$result[$i]);
- }
- echo "\n";
- $i++;
- }
- echo "<BR>\n";
+# If all else fails ... redirect to the search page with the pattern set to $uri
- makeBar("2",$page,$pages,$baseurl,$firstdisplayed,$lastdisplayed);
+header('HTTP/1.0 302 Redirect');
+header('Location: /search.php?show=nosource&pattern='.urlencode($uri) );
+exit;
?>
-<CENTER>
-<BR><I>Search results courtesy of</I><BR>
-<A HREF="http://htdig.sdsu.edu/"><IMG
SRC="/gifs/htdig.gif" BORDER=0 ALT="ht:dig"></A>
-</CENTER>
-<?php commonFooter();?>