From c583d1620955b8d170b8cbf7a106cefeecad56c8 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jan 2012 14:27:00 -0800 Subject: fix reference variable effects on sorting --- include/conversation.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index f4432bfd9..1b1d09d6b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -911,9 +911,13 @@ function conv_sort($arr,$order) { $parents[$p]['children'][] = $x; } } - foreach($parents as $x) - if(count($x['children'])) - usort($x['children'],'sort_thr_created_rev'); + foreach($parents as $k => $v) { + if(count($parents[$k]['children'])) { + $y = $parents[$k]['children']; + usort($y,'sort_thr_created_rev'); + $parents[$k]['children'] = $y; + } + } $ret = array(); foreach($parents as $x) { -- cgit v1.2.3 From 969cd145ce0e717399dbfff6cbc1a45342206e1a Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jan 2012 17:29:07 -0800 Subject: suggestion notifications --- include/conversation.php | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 1b1d09d6b..a30a78271 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -902,29 +902,35 @@ function conv_sort($arr,$order) { elseif(stristr($order,'commented')) usort($parents,'sort_thr_commented'); - foreach($parents as $x) - $x['children'] = array(); + if(count($parents)) + foreach($parents as $x) + $x['children'] = array(); foreach($arr as $x) { if($x['id'] != $x['parent']) { $p = find_thread_parent_index($parents,$x); - $parents[$p]['children'][] = $x; + if($p !== false) + $parents[$p]['children'][] = $x; } } - foreach($parents as $k => $v) { - if(count($parents[$k]['children'])) { - $y = $parents[$k]['children']; - usort($y,'sort_thr_created_rev'); - $parents[$k]['children'] = $y; - } + if(count($parents)) { + foreach($parents as $k => $v) { + if(count($parents[$k]['children'])) { + $y = $parents[$k]['children']; + usort($y,'sort_thr_created_rev'); + $parents[$k]['children'] = $y; + } + } } $ret = array(); - foreach($parents as $x) { - $ret[] = $x; - if(count($x['children'])) - foreach($x['children'] as $y) - $ret[] = $y; + if(count($parents)) { + foreach($parents as $x) { + $ret[] = $x; + if(count($x['children'])) + foreach($x['children'] as $y) + $ret[] = $y; + } } return $ret; @@ -947,4 +953,5 @@ function find_thread_parent_index($arr,$x) { foreach($arr as $k => $v) if($v['id'] == $x['parent']) return $k; + return false; } \ No newline at end of file -- cgit v1.2.3 From 47edaf9ad79b59d96f908b4501d564e5e63cc210 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Jan 2012 18:03:09 -0800 Subject: dynamic title input box - via fabrixxm --- include/conversation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a30a78271..ec1fd4152 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -812,7 +812,8 @@ function status_editor($a,$x, $notes_cid = 0) { '$audurl' => t("Please enter an audio link/URL:"), '$term' => t('Tag term:'), '$whereareu' => t('Where are you right now?'), - '$title' => t('Enter a title for this item') + '$title' => t('Enter a title for this item'), + '$addtitle' => t('click here to add a title') )); @@ -880,6 +881,8 @@ function status_editor($a,$x, $notes_cid = 0) { '$acl' => $x['acl'], '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], + '$addtitle' => t('click here to add a title') + )); return $o; -- cgit v1.2.3