diff options
author | friendica <info@friendica.com> | 2015-01-28 16:06:36 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-28 16:06:36 -0800 |
commit | da842da6839a8feeac4ef1084dce576de34fa874 (patch) | |
tree | 5535e4107e8d9762c20748735948c14c8cbb82ae /mod | |
parent | f0b900057a63a5c9efb8f35daa05b6c7e79d0adb (diff) | |
parent | 54fd8b21db2d8f3841cf590f88611a1d4f44ce48 (diff) | |
download | volse-hubzilla-da842da6839a8feeac4ef1084dce576de34fa874.tar.gz volse-hubzilla-da842da6839a8feeac4ef1084dce576de34fa874.tar.bz2 volse-hubzilla-da842da6839a8feeac4ef1084dce576de34fa874.zip |
Merge branch 'master' into pocorate
Diffstat (limited to 'mod')
-rw-r--r-- | mod/acl.php | 10 | ||||
-rw-r--r-- | mod/share.php | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/mod/acl.php b/mod/acl.php index d406942c3..8eff93a9a 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -33,7 +33,7 @@ function acl_init(&$a){ $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") "; // This horrible mess is needed because position also returns 0 if nothing is found. W/ould be MUCH easier if it instead returned a very large value - // Otherwise we could just order by LEAST(POSTION($search IN xchan_name),POSITION($search IN xchan_addr)). + // Otherwise we could just order by LEAST(POSITION($search IN xchan_name),POSITION($search IN xchan_addr)). $order_extra2 = "CASE WHEN xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) ." then POSITION('".dbesc($search)."' IN xchan_name) else position('".dbesc($search)."' IN xchan_addr) end, "; $col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' ); $sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; @@ -171,6 +171,7 @@ function acl_init(&$a){ ); } elseif(($type == 'a') || ($type == 'p')) { + $r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and not (xchan_flags & %d)>0 @@ -180,6 +181,7 @@ function acl_init(&$a){ intval(XCHAN_FLAGS_DELETED) ); + } elseif($type == 'x') { $r = navbar_complete($a); @@ -209,7 +211,7 @@ function acl_init(&$a){ foreach($r as $g){ // remove RSS feeds from ACLs - they are inaccessible - if(strpos($g['hash'],'/')) + if(strpos($g['hash'],'/') && $type != 'a') continue; if(($g['abook_their_perms'] & PERMS_W_TAGWALL) && $type == 'c' && (! $noforums)) { @@ -233,7 +235,7 @@ function acl_init(&$a){ "id" => $g['id'], "xid" => $g['hash'], "link" => $g['nick'], - "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), + "nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : t('RSS')), "self" => (($g['abook_flags'] & ABOOK_FLAG_SELF) ? 'abook-self' : ''), "taggable" => '', "label" => '', @@ -248,6 +250,8 @@ function acl_init(&$a){ 'count' => $count, 'items' => $items, ); + + echo json_encode($o); diff --git a/mod/share.php b/mod/share.php index 78a25ee10..d70336ed1 100644 --- a/mod/share.php +++ b/mod/share.php @@ -53,7 +53,7 @@ function share_init(&$a) { "' avatar='".$r[0]['author']['xchan_photo_s']. "' link='".$r[0]['plink']. "' posted='".$r[0]['created']. - "' message_id='".$r[0]['mid']."']\n"; + "' message_id='".$r[0]['mid']."']"; if($r[0]['title']) $o .= '[b]'.$r[0]['title'].'[/b]'."\n"; $o .= $r[0]['body']; |