cvs: smarty-web / manual-lookup.php /manual/en search.php
| From: | Monte Ohrt | Date: | Wed, 01 May 2002 22:12:23 +0000 |
| Subject: | cvs: smarty-web / manual-lookup.php /manual/en search.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-90@lists.php.net to get a copy of this message | ||
mohrt Wed May 1 18:12:23 2002 EDT
Added files:
/smarty-web/manual/en search.php
Modified files:
/smarty-web manual-lookup.php
Log:
update doc search logic
Index: smarty-web/manual-lookup.php
diff -u smarty-web/manual-lookup.php:1.1.1.1 smarty-web/manual-lookup.php:1.2
--- smarty-web/manual-lookup.php:1.1.1.1 Mon Mar 25 12:21:00 2002
+++ smarty-web/manual-lookup.php Wed May 1 18:12:23 2002
@@ -20,7 +20,7 @@
//$notfound = $prevsearch = $function;
//include 'quickref.php';
/* -- We need to setup htdig and sort out quick ref at some point */
-header("Location: http://gtk.php.net/");
+header("Location: http://smarty.php.net/");
exit;
?>
Index: smarty-web/manual/en/search.php
+++ smarty-web/manual/en/search.php
<?php /* drop this into the documentation directory for Smarty */ ?>
<HTML>
<HEAD>
<TITLE>Smarty Documentation Search</TITLE>
</HEAD>
<BODY bgcolor="#ffffff">
<A href="/php/code/Smarty/index.html">To home page</A><br>
<A href="index.html">To documentation index</A><br>
<br>
This will find phrase matches only, case insensitive.
<br>
<FORM method="GET" action="search.php">
<INPUT type=text name=query size=30 value="<?php echo $_GET['query'];
?>">
<INPUT type=submit name=submit value="Search">
</FORM>
<?php
if($_GET['query']) {
$query = str_replace('"','',$_GET['query']);
$results =
grep -il "$query" *.html;
$lines = split("\n",$results);
foreach($lines as $line) {
if(!empty($line)) {
$title = grep '</TITLE' $line;
$title = str_replace('>','',$title);
$title = str_replace("</TITLE\n",'',$title);
if(empty($title)) {
$title = $line;
}
if(strstr($title,$query)) {
echo "<b><A
href=\"$line\">$title</A></b><br>\n";
} else {
echo "<A href=\"$line\">$title</A><br>\n";
}
}
}
}
?>
</BODY>
</HTML>