Revision history for Mod014fTextSearchImproved


Revision [23253]

Last edited on 2016-05-20 07:38:47 by JavaWoman [Replaces old-style internal links with new pipe-split links.]
Additions:
[[http://www.wakkawiki.com/TextSearchImproved | TextSearchImproved @ WakkaWiki]]
Deletions:
[[http://www.wakkawiki.com/TextSearchImproved TextSearchImproved @ WakkaWiki]]


Revision [19272]

Edited on 2008-01-28 00:14:45 by JavaWoman [Modified links pointing to docs server]

No Differences

Revision [17187]

Edited on 2007-07-07 08:22:34 by JavaWoman [standardized link to WakkaWiki origin]
Additions:
[[http://www.wakkawiki.com/TextSearchImproved TextSearchImproved @ WakkaWiki]]
Deletions:
[[http://www.wakkawiki.com/TextSearchImproved WakkaWiki TextSearchImproved]]


Revision [17142]

Edited on 2007-07-07 04:19:01 by JavaWoman [ links for wakkawiki]
Additions:
[[http://www.wakkawiki.com/TextSearchImproved WakkaWiki TextSearchImproved]]
Deletions:
http://www.wakkawiki.com/TextSearchImproved


Revision [16955]

Edited on 2007-05-31 23:27:31 by JsnX [Reverted]
Additions:
<td>Search for: </td>
<td><input name="phrase" size="40" value="<?php echo htmlentities($_REQUEST["phrase"]) ?>" /> <input type="submit" value="Search"/></td>
</tr>
</table>
<?php echo $this->FormClose(); ?>
<?php
if ($phrase = $_REQUEST["phrase"])
{
print("<br />");
if ($results = $this->FullTextSearch($phrase))
{
print("<strong>Search results for \"$phrase\":</strong><br /><br />\n");
print "<table border=0 celpadding=0 cellspacing=0>";
$STORE_FORMATING_AS_TEXT = 1;
foreach ($results as $i => $page)
{
//print(($i+1).". ".$this->Link($page["tag"])."<br />\n");
//print implode($this->LoadPage($page["tag"]));
//$matchString = preg_match("/(.{0,40}$phrase.{0,40})/",implode($this->LoadPage($page['tag'])));
/* display portion of the matching body and highlight
the search term */
preg_match("/(.{0,120}$phrase.{0,120})/is",$page['body'],$matchString);
$text = $matchString[0];
include("formatters/wakka.php");
$highlightMatch = preg_replace("/($phrase)/i","<font color=green><b>$1</b></font>",$text,-1);
$matchText = "<font color=gray size=-1>...</font>$highlightMatch<font color=gray size=-1>...</font>";
print "
<tr>
<td valign=top align=right>
<!-- result number -->
<table>
<tr>
<td valign=top align=left bgcolor=#DDDDDD>
<font color=white size=-3>
".($i+1)."
</font>
</td>
</tr>
</table>
</td>
<!-- link -->
<td valign=top>
".$this->Link($page["tag"])."
</td>
<!-- date of last update -->
<td valign=top align=right>
<font color=gray size=-3>
$page[time]
</font>
</td>
</tr>
<tr>
<td>
 
</td>
<td colspan=2>
$matchText
</td>
</tr>
<tr>
<td>
 
</td>
</tr>
";
}
print "</table>";
}
else
{
print("No results for \"$phrase\".");
}
}
?>
%%
In order to properly format the matching text the following small modification must be made to the **formatters/wakka.php** file. Modify the last line of the file. It should originally read
print($text);
The new version should read
if (!$STORE_FORMATING_AS_TEXT) print($text);
Heavyk, 3/8/04 (k m r @ h e a v y k . o r g)
Deletions:
<td>Search for:


Revision [16754]

Edited on 2007-05-31 10:44:32 by DazDkn [Reverted]
Additions:
<td>Search for:
Deletions:
<td>Search for: </td>
<td><input name="phrase" size="40" value="<?php echo htmlentities($_REQUEST["phrase"]) ?>" /> <input type="submit" value="Search"/></td>
</tr>
</table>
<?php echo $this->FormClose(); ?>
<?php
if ($phrase = $_REQUEST["phrase"])
{
print("<br />");
if ($results = $this->FullTextSearch($phrase))
{
print("<strong>Search results for \"$phrase\":</strong><br /><br />\n");
print "<table border=0 celpadding=0 cellspacing=0>";
$STORE_FORMATING_AS_TEXT = 1;
foreach ($results as $i => $page)
{
//print(($i+1).". ".$this->Link($page["tag"])."<br />\n");
//print implode($this->LoadPage($page["tag"]));
//$matchString = preg_match("/(.{0,40}$phrase.{0,40})/",implode($this->LoadPage($page['tag'])));
/* display portion of the matching body and highlight
the search term */
preg_match("/(.{0,120}$phrase.{0,120})/is",$page['body'],$matchString);
$text = $matchString[0];
include("formatters/wakka.php");
$highlightMatch = preg_replace("/($phrase)/i","<font color=green><b>$1</b></font>",$text,-1);
$matchText = "<font color=gray size=-1>...</font>$highlightMatch<font color=gray size=-1>...</font>";
print "
<tr>
<td valign=top align=right>
<!-- result number -->
<table>
<tr>
<td valign=top align=left bgcolor=#DDDDDD>
<font color=white size=-3>
".($i+1)."
</font>
</td>
</tr>
</table>
</td>
<!-- link -->
<td valign=top>
".$this->Link($page["tag"])."
</td>
<!-- date of last update -->
<td valign=top align=right>
<font color=gray size=-3>
$page[time]
</font>
</td>
</tr>
<tr>
<td>
 
</td>
<td colspan=2>
$matchText
</td>
</tr>
<tr>
<td>
 
</td>
</tr>
";
}
print "</table>";
}
else
{
print("No results for \"$phrase\".");
}
}
?>
%%
In order to properly format the matching text the following small modification must be made to the **formatters/wakka.php** file. Modify the last line of the file. It should originally read
print($text);
The new version should read
if (!$STORE_FORMATING_AS_TEXT) print($text);
Heavyk, 3/8/04 (k m r @ h e a v y k . o r g)


Revision [85]

The oldest known version of this page was created on 2004-04-01 01:45:26 by JsnX [Reverted]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki