aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ItemObject.php10
-rwxr-xr-xview/tpl/conv_list.tpl2
2 files changed, 10 insertions, 2 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 6037daa7a..6f177b606 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -231,7 +231,14 @@ class Item extends BaseObject {
localize_item($item);
$body = prepare_body($item,true);
-
+
+ // $viewthread (below) is only valid in list mode. If this is a channel page, build the thread viewing link
+ // since we can't depend on llink or plink pointing to the right local location.
+
+ $owner_address = substr($item['owner']['xchan_addr'],0,strpos($item['owner']['xchan_addr'],'@'));
+ $viewthread = $item['llink'];
+ if($conv->get_mode() === 'channel')
+ $viewthread = z_root() . '/channel/' . $owner_address . '?f=&mid=' . $item['mid'];
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
@@ -249,6 +256,7 @@ class Item extends BaseObject {
'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, $item['author']['xchan_addr']),
'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), $item['owner']['xchan_addr']),
'llink' => $item['llink'],
+ 'viewthread' => $viewthread,
'to' => t('to'),
'via' => t('via'),
'wall' => t('Wall-to-Wall'),
diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl
index 42ecc82b5..121a58514 100755
--- a/view/tpl/conv_list.tpl
+++ b/view/tpl/conv_list.tpl
@@ -107,7 +107,7 @@
<div class="wall-item-tools-left{{if $item.unseen_comments || $item.like_count || $item.dislike_count}} btn-group{{/if}}">
- <div class="wall-item-list-comments btn-group"><button class="btn btn-default btn-sm" onclick="window.location.href='{{$item.llink}}'; return false;">{{$item.comment_count_txt}}{{if $item.unseen_comments}}
+ <div class="wall-item-list-comments btn-group"><button class="btn btn-default btn-sm" onclick="window.location.href='{{$item.viewthread}}'; return false;">{{$item.comment_count_txt}}{{if $item.unseen_comments}}
<span class="unseen-wall-indicator-{{$item.id}}">, {{$item.list_unseen_txt}}{{/if}}</span></button></div>{{if $item.unseen_comments}}<div class="unseen-wall-indicator-{{$item.id}} btn-group"><button class="btn btn-default btn-sm" title="{{$item.markseen}}" onclick="markItemRead({{$item.id}}); return false;"><i class="icon-check"></i></div>{{/if}}
{{if $item.like_count}}