diff options
author | Thomas Willingham <founder@kakste.com> | 2013-07-02 18:36:39 +0100 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2013-07-02 18:36:39 +0100 |
commit | d1cae2da2abc3a602f682114bc02cce08a7e7578 (patch) | |
tree | ef3147f9db85bdde8e26303971a40d86e10bb508 /mod/search.php | |
parent | 33696cc8392daeb08d011aa3b1209f3b121898ea (diff) | |
parent | b86253c655f974920c4d3de0915611a7e66c7336 (diff) | |
download | volse-hubzilla-d1cae2da2abc3a602f682114bc02cce08a7e7578.tar.gz volse-hubzilla-d1cae2da2abc3a602f682114bc02cce08a7e7578.tar.bz2 volse-hubzilla-d1cae2da2abc3a602f682114bc02cce08a7e7578.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/search.php')
-rw-r--r-- | mod/search.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mod/search.php b/mod/search.php index 4e093d865..1335ea508 100644 --- a/mod/search.php +++ b/mod/search.php @@ -153,7 +153,7 @@ function search_content(&$a,$update = 0, $load = false) { // because browser prefetching might change it on us. We have to deliver it with the page. $o .= '<div id="live-search"></div>' . "\r\n"; - $o .= "<script> var profile_uid = " . intval(local_user()) + $o .= "<script> var profile_uid = " . ((intval(local_user())) ? local_user() : (-1)) . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( @@ -171,7 +171,7 @@ function search_content(&$a,$update = 0, $load = false) { '$nouveau' => '0', '$wall' => '0', '$page' => (($a->pager['page'] != 1) ? $a->pager['page'] : 1), - '$search' => (($tag) ? '#' : '') . $search, + '$search' => (($tag) ? urlencode('#') : '') . $search, '$order' => '', '$file' => '', '$cats' => '', @@ -189,7 +189,7 @@ function search_content(&$a,$update = 0, $load = false) { $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); dbg(1); if($load) { - $r = q("SELECT distinct(mid), item.* from item + $r = q("SELECT distinct mid, id as item_id from item WHERE item_restrict = 0 AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) OR ( `item`.`uid` = %d )) @@ -209,15 +209,15 @@ dbg(0); if($r) { $parents_str = ids_to_querystr($r,'item_id'); - +dbg(1); $items = q("SELECT `item`.*, `item`.`id` AS `item_id` FROM `item` WHERE item_restrict = 0 - $sql_extra ", - intval($a->profile['profile_uid']), - dbesc($parents_str) + $sql_extra and parent in ( $parents_str ) " +// intval($a->profile['profile_uid']), +// dbesc($parents_str) ); - +dbg(0); xchan_query($items); $items = fetch_post_tags($items,true); $items = conv_sort($items,'created'); |