summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26482e9)
raw | patch | inline | side by side (parent: 26482e9)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Jun 2005 12:00:27 +0000 (12:00 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Jun 2005 12:00:27 +0000 (12:00 +0000) |
include/functions_helpviewer.inc | patch | blob | history |
index ee03d28c92d42c264d2913576412627506755922..9d699c58941e8e14b2c3b0ced00a86665a745228 100644 (file)
/* Readfile conent too ? */
if(!$onlyIndex){
$str[$file]['content']= remove_unwanted_tags(linkwrapper(getcontents($basedir.$file),""),$replacements);
+ $str[$file]['headline'] = getheader_from_content($str[$file]['content']);
}
/* Include file status, for debugging, not used in script yet */
/* If onlyIndex == true skip reading content */
if(!$onlyIndex){
$str[$file]['content']= remove_unwanted_tags(linkwrapper(getcontents($basedir.$file),""),$replacements);
+ $str[$file]['headline'] = getheader_from_content($str[$file]['content']);
}
/* Include file status, for debugging, not used in script yet */
function createResultEntry($entry,$res,$name,$max)
{
$percentage = (int)(($res['hits']['overall'] / $max) * 100) ;
-
- $str = "<b><a href=\"?pg=".$name."&mark=1\">".sprintf(_("%s%% hit rate in file %s"),$percentage,$name)."</a></b><br>" ;
+ $str = "<b>".$entry['headline']."</b><br>";
+ $str.= "<b><a href=\"?pg=".$name."&mark=1\">".sprintf(_("%s%% hit rate in file %s"),$percentage,$name)."</a></b><br>" ;
$str.= substr(strip_tags($entry['content']),0,200);
$str.= "<hr>";
}
}
+/*Returns frist line of readable text, it should be the headline */
+function getheader_from_content($str)
+{
+ $str = strip_tags($str);
+ $pos = 0;
+ $arr = split("\n",$str);
+ foreach($arr as $possibleheadline){
+ if(strlen($possibleheadline)>=3){
+ return $possibleheadline;
+ }
+ }
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>