aboutsummaryrefslogtreecommitdiffstats
path: root/include/help.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-08-30 06:14:22 -0400
committerAndrew Manning <tamanning@zoho.com>2016-08-30 06:14:22 -0400
commitad5c93d6738d705b9ca196cc7481c26a3a9b9962 (patch)
treeca090d4dcb461dc46ba79d726c39cda388deeef6 /include/help.php
parentb05474fc30cad393bd4fbf244d2afbbbe2e5f86e (diff)
parent202b757bc46d17b324f79751ce754e16ba737386 (diff)
downloadvolse-hubzilla-ad5c93d6738d705b9ca196cc7481c26a3a9b9962.tar.gz
volse-hubzilla-ad5c93d6738d705b9ca196cc7481c26a3a9b9962.tar.bz2
volse-hubzilla-ad5c93d6738d705b9ca196cc7481c26a3a9b9962.zip
Merge remote-tracking branch 'upstream/dev' into website-export
Diffstat (limited to 'include/help.php')
-rw-r--r--include/help.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/help.php b/include/help.php
index 7f57f3334..4bcc09670 100644
--- a/include/help.php
+++ b/include/help.php
@@ -40,8 +40,13 @@ function search_doc_files($s) {
$r = fetch_post_tags($r,true);
for($x = 0; $x < count($r); $x ++) {
-
- $r[$x]['text'] = $r[$x]['body'];
+ $position = stripos($r[$x]['body'], $s);
+ $dislen = 300;
+ $start = $position-floor($dislen/2);
+ if ( $start < 0) {
+ $start = 0;
+ }
+ $r[$x]['text'] = substr($r[$x]['body'], $start, $dislen);
$r[$x]['rank'] = 0;
if($r[$x]['term']) {