aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/Primary-Directory.md (renamed from doc/Primary-Directory)0
-rw-r--r--mod/help.php32
-rw-r--r--mod/search.php4
-rw-r--r--version.inc2
-rw-r--r--view/css/widgets.css4
-rw-r--r--view/theme/redbasic/schema/focus.php2
6 files changed, 40 insertions, 4 deletions
diff --git a/doc/Primary-Directory b/doc/Primary-Directory.md
index 37b0c0431..37b0c0431 100644
--- a/doc/Primary-Directory
+++ b/doc/Primary-Directory.md
diff --git a/mod/help.php b/mod/help.php
index 2ced3d30a..809313a3e 100644
--- a/mod/help.php
+++ b/mod/help.php
@@ -63,16 +63,43 @@ function search_doc_files($s) {
// If the file was edited more recently than we've stored a copy in the database, use the file.
// The stored database item will be searchable, the file won't be.
+ $regexop = db_getfunc('REGEXP');
+
$r = q("select item_id.sid, item.* from item left join item_id on item.id = item_id.iid where service = 'docfile' and
- body regexp '%s' and item_type = %d order by created desc $pager_sql",
+ body $regexop '%s' and item_type = %d $pager_sql",
dbesc($s),
intval(ITEM_TYPE_DOC)
);
+
+ $r = fetch_post_tags($r,true);
+ require_once('include/html2plain.php');
+
+ for($x = 0; $x < count($r); $x ++) {
+
+ $r[$x]['text'] = html2plain(prepare_text($r[$x]['body'],$r[$x]['mimetype'], true));
+ $r[$x]['rank'] = 0;
+ if($r[$x]['term']) {
+ foreach($r[$x]['term'] as $t) {
+ if(stristr($t['term'],$s)) {
+ $r[$x]['rank'] ++;
+ }
+ }
+ }
+ if(stristr($r[$x]['sid'],$s))
+ $r[$x]['rank'] ++;
+ $r[$x]['rank'] += substr_count(strtolower($r[$x]['text']),strtolower($s));
+ }
+ usort($r,'doc_rank_sort');
return $r;
}
+function doc_rank_sort($a,$b) {
+ if($a['rank'] == $b['rank'])
+ return 0;
+ return (($a['rank'] < $b['rank']) ? 1 : (-1));
+}
@@ -140,7 +167,8 @@ function help_content(&$a) {
$fname = substr($fname,0,strrpos($fname,'.'));
$path = trim(substr($dirname,4),'/');
- $o .= '<li><a href="help/' . (($path) ? $path . '/' : '') . $fname . '" >' . ucwords(str_replace('_',' ',notags($fname))) . '</a></li>';
+ $o .= '<li><a href="help/' . (($path) ? $path . '/' : '') . $fname . '" >' . ucwords(str_replace('_',' ',notags($fname))) . '</a><br />' .
+ str_replace('$Projectname',PLATFORM_NAME,substr($rr['text'],0,200)) . '...<br /><br /></li>';
}
$o .= '</ul>';
diff --git a/mod/search.php b/mod/search.php
index dceb7d72a..ce8357fb9 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -59,6 +59,10 @@ function search_content(&$a,$update = 0, $load = false) {
$search = substr($search,1);
goaway(z_root() . '/directory' . '?f=1&navsearch=1&search=' . $search);
}
+ if(strpos($search,'?') === 0) {
+ $search = substr($search,1);
+ goaway(z_root() . '/help' . '?f=1&navsearch=1&search=' . $search);
+ }
// look for a naked webbie
if(strpos($search,'@') !== false) {
diff --git a/version.inc b/version.inc
index 39bb632b7..fe5a631ad 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2015-07-03.1082
+2015-07-06.1085
diff --git a/view/css/widgets.css b/view/css/widgets.css
index 0a901b1f9..63c380c75 100644
--- a/view/css/widgets.css
+++ b/view/css/widgets.css
@@ -13,6 +13,10 @@
border-bottom-right-radius: 0px;
}
+.tags {
+ word-wrap: break-word;
+}
+
/* suggest */
.suggest-widget-more {
diff --git a/view/theme/redbasic/schema/focus.php b/view/theme/redbasic/schema/focus.php
index 2a6900271..d93ee003e 100644
--- a/view/theme/redbasic/schema/focus.php
+++ b/view/theme/redbasic/schema/focus.php
@@ -46,7 +46,7 @@ if (! $radius)
if (! $shadow)
$shadow = "0";
if (! $converse_width)
- $converse_width = "640";
+ $converse_width = "676";
if(! $top_photo)
$top_photo = '48px';
if(! $comment_indent)