diff options
Diffstat (limited to 'mod/search.php')
-rw-r--r-- | mod/search.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/mod/search.php b/mod/search.php index 426642141..a0085fca9 100644 --- a/mod/search.php +++ b/mod/search.php @@ -35,6 +35,8 @@ function search_content(&$a,$update = 0, $load = false) { $o = '<div id="live-search"></div>' . "\r\n"; + $o = '<div class="generic-content-wrapper-styled">' . "\r\n"; + $o .= '<h3>' . t('Search') . '</h3>'; if(x($a->data,'search')) @@ -59,6 +61,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) { @@ -125,6 +131,7 @@ function search_content(&$a,$update = 0, $load = false) { } + $item_normal = item_normal(); $pub_sql = public_permissions_sql($observer_hash); require_once('include/identity.php'); @@ -143,7 +150,7 @@ function search_content(&$a,$update = 0, $load = false) { if($load) { $r = null; - + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { $prefix = 'distinct on (created, mid)'; $suffix = 'ORDER BY created DESC, mid'; @@ -153,26 +160,24 @@ function search_content(&$a,$update = 0, $load = false) { } if(local_channel()) { $r = q("SELECT $prefix mid, item.id as item_id, item.* from item - WHERE item_restrict = 0 AND ( item_flags & %d ) = 0 - AND ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) + WHERE ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) OR ( `item`.`uid` = %d )) OR item.owner_xchan = '%s' ) + $item_normal $sql_extra $suffix $pager_sql ", - intval(ITEM_OBSCURED), intval(local_channel()), dbesc($sys['xchan_hash']) ); } if($r === null) { $r = q("SELECT $prefix mid, item.id as item_id, item.* from item - WHERE item_restrict = 0 AND ( item_flags & %d ) = 0 - AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' + WHERE (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) and owner_xchan in ( " . stream_perms_xchans(($observer) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) $pub_sql ) OR owner_xchan = '%s') + $item_normal $sql_extra $suffix $pager_sql", - intval(ITEM_OBSCURED), dbesc($sys['xchan_hash']) ); } @@ -209,6 +214,8 @@ function search_content(&$a,$update = 0, $load = false) { $o .= conversation($a,$items,'search',$update,'client'); + $o .= '</div>'; + return $o; } |