From b0f8cd5fe684d5c03419838c2859a11ea6d6f8a0 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 12 Jul 2010 00:49:06 -0700 Subject: [PATCH] facebook style comments --- include/main.js | 8 ++++++++ mod/profile.php | 19 ++++++++++--------- view/comment_item.tpl | 6 +++--- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/include/main.js b/include/main.js index 4fb92c774a..8d364ebceb 100644 --- a/include/main.js +++ b/include/main.js @@ -7,6 +7,14 @@ document.getElementById(theID).style.display = "block" } } + function openMenu(theID) { document.getElementById(theID).style.display = "block" } + + function closeMenu(theID) { + document.getElementById(theID).style.display = "none" + } + + + diff --git a/mod/profile.php b/mod/profile.php index 832618c911..45bac146ef 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -216,16 +216,17 @@ dbg(2); $tpl = file_get_contents('view/wall_item.tpl'); if(count($r)) { - foreach($r as $rr) { + for($x = 0; $x < count($r); $x ++) { + $rr = $r[$x]; + $comment = ''; if(can_write_wall($a,$a->profile['profile_uid'])) { - $comment = replace_macros($template,array( - '$id' => $rr['item_id'], - '$parent' => $rr['parent'], - '$profile_uid' => $a->profile['profile_uid'] - )); - } - else { - $comment = ''; + if((($x + 1) < count($r)) && ($r[$x+1]['parent'] != $rr['parent'])) { + $comment = replace_macros($template,array( + '$id' => $rr['item_id'], + '$parent' => $rr['parent'], + '$profile_uid' => $a->profile['profile_uid'] + )); + } } $o .= item_display($a,$rr,$tpl,$comment); } diff --git a/view/comment_item.tpl b/view/comment_item.tpl index 3ca190ba5b..f617bc1a0e 100644 --- a/view/comment_item.tpl +++ b/view/comment_item.tpl @@ -1,14 +1,14 @@
Comments
-