diff options
author | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-25 08:44:07 +0200 |
---|---|---|
committer | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-25 08:44:07 +0200 |
commit | 6324a07dd8b17db5da0ce66c99fb69e2f3ec49e1 (patch) | |
tree | 89e81409add34df97f633515181790d6aed4c726 /include/text.php | |
parent | 7da97c198182f8f6f4286e16d80de205431d81bb (diff) | |
parent | 92c723d37cd8ded2183d3334eb51e740170e191b (diff) | |
download | volse-hubzilla-6324a07dd8b17db5da0ce66c99fb69e2f3ec49e1.tar.gz volse-hubzilla-6324a07dd8b17db5da0ce66c99fb69e2f3ec49e1.tar.bz2 volse-hubzilla-6324a07dd8b17db5da0ce66c99fb69e2f3ec49e1.zip |
Rebase from upstream
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php index 599c5d445..22cf17866 100644 --- a/include/text.php +++ b/include/text.php @@ -1183,7 +1183,11 @@ function theme_attachments(&$item) { $title = t('unknown.???'); $title .= ' ' . $r['length'] . ' ' . t('bytes'); - $url = z_root() . '/magic?f=&hash=' . $item['author_xchan'] . '&dest=' . $r['href'] . '/' . $r['revision']; + require_once('include/identity.php'); + if(is_foreigner($item['author_xchan'])) + $url = $r['href']; + else + $url = z_root() . '/magic?f=&hash=' . $item['author_xchan'] . '&dest=' . $r['href'] . '/' . $r['revision']; $s .= '<a href="' . $url . '" title="' . $title . '" class="attachlink" >' . $icon . '</a>'; $attaches[] = array('title' => $title, 'url' => $url, 'icon' => $icon ); @@ -1851,9 +1855,17 @@ function ids_to_querystr($arr,$idx = 'id') { // author_xchan and owner_xchan. If $abook is true also include the abook info. // This is needed in the API to save extra per item lookups there. -function xchan_query(&$items,$abook = true) { +function xchan_query(&$items,$abook = true,$effective_uid = 0) { $arr = array(); if($items && count($items)) { + + if($effective_uid) { + for($x = 0; $x < count($items); $x ++) { + $items[$x]['real_uid'] = $items[$x]['uid']; + $items[$x]['uid'] = $effective_uid; + } + } + foreach($items as $item) { if($item['owner_xchan'] && (! in_array($item['owner_xchan'],$arr))) $arr[] = "'" . dbesc($item['owner_xchan']) . "'"; |