aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php14
-rw-r--r--include/text.php33
2 files changed, 46 insertions, 1 deletions
diff --git a/include/conversation.php b/include/conversation.php
index bad511551..7f1973d0d 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -441,6 +441,10 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
+ $profile_avatar = $item['author']['xchan_photo'];
+ $profile_link = zrl($item['author']['xchan_profile']);
+ $profile_name = $item['author']['xchan_name'];
+
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
@@ -615,7 +619,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
'body' => template_escape($body),
'text' => strip_tags(template_escape($body)),
'id' => $item['item_id'],
- 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
+ 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_link),
'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $owner_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
'to' => t('to'),
'wall' => t('Wall-to-Wall'),
@@ -649,6 +653,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
'thread_level' => $thread_level,
);
+ logger('tmp_item: ' . print_r($tmp_item,true));
$arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr);
@@ -1197,6 +1202,13 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
+
+
+ $profile_avatar = $item['author']['xchan_photo'];
+ $profile_link = zrl($item['author']['xchan_profile']);
+ $profile_name = $item['author']['xchan_name'];
+
+
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
diff --git a/include/text.php b/include/text.php
index a68782f2a..464396d62 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1687,4 +1687,37 @@ function ids_to_querystr($arr,$idx = 'id') {
foreach($arr as $x)
$t[] = $x[$idx];
return(implode(',', $t));
+}
+
+function xchan_query(&$items) {
+ $arr = array();
+ if($items && count($items)) {
+ foreach($items as $item) {
+ if($item['owner_xchan'] && (! in_array($item['owner_xchan'],$arr)))
+ $arr[] = "'" . dbesc($item['owner_xchan']) . "'";
+ if($item['author_xchan'] && (! in_array($item['author_xchan'],$arr)))
+ $arr[] = "'" . dbesc($item['author_xchan']) . "'";
+ }
+ }
+ if(count($arr)) {
+ $chans = q("select * from xchan where xchan_hash in (" . implode(',', $arr) . ")");
+ }
+ if($items && count($items) && $chans && count($chans)) {
+ for($x = 0; $x < count($items); $x ++) {
+ $items[$x]['owner'] = find_xchan_in_array($items[$x]['owner_xchan'],$chans);
+ $items[$x]['author'] = find_xchan_in_array($items[$x]['author_xchan'],$chans);
+ }
+ }
+
+}
+
+function find_xchan_in_array($xchan,$arr) {
+ if(count($arr)) {
+ foreach($arr as $x) {
+ if($x['xchan_hash'] === $xchan) {
+ return $x;
+ }
+ }
+ }
+ return array();
} \ No newline at end of file