]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
more enotify
[friendica.git] / include / conversation.php
index d8adb27c3c37107512a7fc7b815a2dc0dd0ddd78..fae57c5655a76352c0835204ca95961508ba6400 100644 (file)
@@ -208,8 +208,11 @@ function conversation(&$a, $items, $mode, $update) {
                                }
                                else
                                        $nickname = $a->user['nickname'];
+                               
                        
                                $profile_name   = ((strlen($item['author-name']))   ? $item['author-name']   : $item['name']);
+                               if($item['author-link'] && (! $item['author-name']))
+                                       $profile_name = $item['author-link'];
 
                                $sp = false;
                                $profile_link = best_link_url($item,$sp);
@@ -291,7 +294,8 @@ function conversation(&$a, $items, $mode, $update) {
                                $arr = array('item' => $item, 'output' => $tmp_item);
                                call_hooks('display_item', $arr);
 
-                               $threads[$threadsid] .= $arr['output'];
+                               $threads[$threadsid]['id'] = $item['item_id'];
+                               $threads[$threadsid]['html'] .= $arr['output'];
 
                        }
 
@@ -374,7 +378,9 @@ function conversation(&$a, $items, $mode, $update) {
                                        $comments_collapsed = false;
                                        
                                        $threadsid++;
-                                       $threads[$threadsid] = "";
+                                       $threads[$threadsid]['id'] = $item['item_id'];
+                                       $threads[$threadsid]['html'] = "";
+
                                }
                                else {
                                        // prevent private email from leaking into public conversation
@@ -393,7 +399,7 @@ function conversation(&$a, $items, $mode, $update) {
                                                // IMPORTANT: the closing </div> in the hide_comments template
                                                // is supplied below in code. 
 
-                                               $threads[$threadsid] .= replace_macros($hide_comments_tpl,array(
+                                               $threads[$threadsid]['html'] .= replace_macros($hide_comments_tpl,array(
                                                        '$id' => $item['parent'],
                                                        '$num_comments' => sprintf( tt('%d comment','%d comments',$comments[$item['parent']]),
                                                                $comments[$item['parent']]),
@@ -404,7 +410,7 @@ function conversation(&$a, $items, $mode, $update) {
                                        }
                                }
                                if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
-                                       $threads[$threadsid] .= '</div>';
+                                       $threads[$threadsid]['html'] .= '</div>';
                                }
 
                                $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
@@ -527,6 +533,10 @@ function conversation(&$a, $items, $mode, $update) {
 
                                $profile_name   = (((strlen($item['author-name']))   && $diff_author) ? $item['author-name']   : $item['name']);
 
+                               if($item['author-link'] && (! $item['author-name']))
+                                       $profile_name = $item['author-link'];
+
+
                                $sp = false;
                                $profile_link = best_link_url($item,$sp);
                                if($sp)
@@ -621,17 +631,12 @@ function conversation(&$a, $items, $mode, $update) {
                                $arr = array('item' => $item, 'output' => $tmp_item);
                                call_hooks('display_item', $arr);
 
-                               $threads[$threadsid] .= $arr['output'];
+                               $threads[$threadsid]['html'] .= $arr['output'];
                        }
                }
        }
 
 
-       // if author collapsing is in force but didn't get closed, close it off now.
-
-       /*if($blowhard_count >= 3)
-               $threads[$threadsid] .= '</div>';*/
-
        $page_template = get_markup_template("conversation.tpl");
        $o .= replace_macros($page_template, array(
                '$threads' => $threads,