View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000101 | WackoWiki | action | public | 2007-10-10 20:52 | 2009-10-13 16:03 |
Reporter | administrator | Assigned To | administrator | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.2 | ||||
Target Version | 5.0.beta | Fixed in Version | 5.0.beta | ||
Summary | 0000101: add preview_text in search | ||||
Description | copy-paste and update of original search action. displays pagenames and lines in page where the phrase was found. new param – “clean”, if true – omits the phrase from result lines. | ||||
Additional Information | needs update to wacko.php. more info - http://wackowiki.org/Dev/PatchesHacks/SearchLine update to wacko.php <?php function FullTextSearchWithBody($phrase,$filter) { return $this->LoadAll("SELECT ".$this->pages_meta.", body FROM ".$this->config["table_prefix"]."pages WHERE latest = 'Y' AND (( match(body) against('".quote($this->dblink, $phrase)."') OR lower(tag) LIKE lower('%".quote($this->dblink, $phrase)."%')) ".($filter?"AND comment_on=''":"")." )"); } ?> /actions/searchline.php <?php if (($topic == 1) || ($title == 1)) $mode = "topic"; else $mode = "full"; if ($_REQUEST["topic"] == "on") $mode = "topic"; //if (!$delim) $delim="---"; if (!in_array($style,array("br","ul","ol","comma"))) $style="ol"; $i = 0; if ($filter!="pages") $filter = "all"; if (!isset($clean)) $clean = false; if ($vars[0] != "") $phrase = $vars[0]; else { $phrase=""; $form=1; } if ($phrase == "") $phrase = $_REQUEST["phrase"]; if ($phrase) { if (strlen($phrase)>2) { if ($mode == "topic") $results = $this->TagSearch($phrase); else $results = $this->FullTextSearchWithBody($phrase, ($filter=="all"?0:1)); $phrase = htmlspecialchars($phrase); if ($results) { if (!$nomark) print( "<fieldset><legend>". $this->GetResourceValue(($mode=="topic"?"Topic":"")."SearchResults"). " \"$phrase\":</legend>"); if ($style=="ul") print "<ul class=\"SearchResults\">\n"; if ($style=="ol") print "<ol class=\"SearchResults\">\n"; foreach ($results as $page) if (!$this->config["hide_locked"] || $this->HasAccess("read",$page["tag"]) && $page["tag"] != $this->getPageTag() ) { if ($style=="ul" || $style=="ol") print " if ($style=="comma" && $i>0) print ",\n"; print($this->Link("/".$page["tag"],"",$page["tag"])); print(" " . getLineWithPhrase($phrase, $page["body"], $clean)); if ($style=="br") print " \n"; if ($style=="ul" || $style=="ol") print " $i++; } if ($style=="ul") print ""; if ($style=="ol") print ""; if (!$nomark) print("</fieldset>"); } else if (!$nomark) echo $this->GetResourceValue("NoResultsFor")."\"$phrase\"."; } else if (!$nomark) echo $this->GetResourceValue("NoResultsFor")."\"$phrase\"."; } function getLineWithPhrase($phrase, $string, $cleanup) { $lines = split("\n", $string); $result = ""; foreach ($lines as $line) { if (strpos($line, $phrase)) { if ($result) $result .= " \n"; $result .= $cleanup ? str_replace("$phrase", "", $line) : $line; } } return $result; } ?> | ||||
Tags | No tags attached. | ||||
related to | 0000173 | assigned | administrator | Extended Search |
Date Modified | Username | Field | Change |
---|---|---|---|
2007-10-10 20:52 | administrator | New Issue | |
2007-10-10 20:53 | administrator | File Added: searchline.php | |
2007-10-10 20:53 | administrator | Legacy | => NPJ |
2007-12-01 15:36 | Tann San | Status | new => assigned |
2007-12-01 15:36 | Tann San | Assigned To | => Tann San |
2008-04-10 02:04 | administrator | Additional Information Updated | |
2008-05-16 19:40 | administrator | Relationship added | related to 0000173 |
2008-08-01 23:40 | administrator | Additional Information Updated | |
2008-08-01 23:43 | administrator | Description Updated | |
2008-08-01 23:43 | administrator | Additional Information Updated | |
2008-08-23 14:02 | administrator | Additional Information Updated | |
2009-01-06 16:59 | administrator | Additional Information Updated | |
2009-03-01 20:12 | administrator | Note Added: 0000582 | |
2009-03-01 20:12 | administrator | Assigned To | Tann San => administrator |
2009-03-01 20:12 | administrator | Status | assigned => resolved |
2009-03-01 20:12 | administrator | Resolution | open => fixed |
2009-03-01 20:12 | administrator | Fixed in Version | => 5.0.0 |
2009-03-01 20:12 | administrator | Target Version | => 5.0.0 |
2009-03-01 20:12 | administrator | Additional Information Updated | |
2009-03-01 20:14 | administrator | Summary | new action - searchline => add preview_text in search |
2009-03-01 20:14 | administrator | File Deleted: searchline.php | |
2009-03-01 20:16 | administrator | Additional Information Updated | |
2009-10-13 16:00 | administrator | Target Version | 5.0.0 => 5.0.beta |
2009-10-13 16:03 | administrator | Fixed in Version | 5.0.0 => 5.0.beta |
2010-03-08 10:09 | administrator | Category | Action => action |