From da7c5b19b1a29a577598f41d4ba736d7f380c8f2 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Wed, 19 Sep 2012 21:31:26 -0600 Subject: [PATCH] allow hidden comments phrase to be accessed separately as number and text --- include/conversation.php | 2 ++ mod/content.php | 2 ++ object/Item.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/include/conversation.php b/include/conversation.php index 1d927d2016..cf5b0fe088 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -685,6 +685,8 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr $item_result = $arr['output']; if($firstcollapsed) { $item_result['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children ); + $item_result['hidden_comments_num'] = $total_children; + $item_result['hidden_comments_text'] = tt('comment', 'comments', $total_children); $item_result['hide_text'] = t('show more'); } diff --git a/mod/content.php b/mod/content.php index e6789860db..d827b5b57b 100644 --- a/mod/content.php +++ b/mod/content.php @@ -584,6 +584,8 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { if (!$comments_collapsed){ $threads[$threadsid]['num_comments'] = sprintf( tt('%d comment','%d comments',$comments[$item['parent']]),$comments[$item['parent']] ); + $threads[$threadsid]['hidden_comments_num'] = $comments[$item['parent']]; + $threads[$threadsid]['hidden_comments_text'] = tt('comment', 'comments', $comments[$item['parent']]); $threads[$threadsid]['hide_text'] = t('show more'); $comments_collapsed = true; $comment_firstcollapsed = true; diff --git a/object/Item.php b/object/Item.php index 7fa3fed2d3..d40a384f56 100644 --- a/object/Item.php +++ b/object/Item.php @@ -254,6 +254,8 @@ class Item extends BaseObject { if(($nb_children > 2) || ($thread_level > 1)) { $result['children'][0]['comment_firstcollapsed'] = true; $result['children'][0]['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children ); + $result['children'][0]['hidden_comments_num'] = $total_children; + $result['children'][0]['hidden_comments_text'] = tt('comment', 'comments', $total_children); $result['children'][0]['hide_text'] = t('show more'); if($thread_level > 1) { $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;