diff options
author | Friendika <info@friendika.com> | 2011-03-27 20:37:44 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-03-27 20:37:44 -0700 |
commit | 7defb1768bff1c3da7ea63957cf8c7c928d379ab (patch) | |
tree | a166fdc574e1f2222c81b149e0f5c88e58bf1efb | |
parent | b57214cb783ca2f741760a2ccfbd01babfbd165b (diff) | |
download | volse-hubzilla-7defb1768bff1c3da7ea63957cf8c7c928d379ab.tar.gz volse-hubzilla-7defb1768bff1c3da7ea63957cf8c7c928d379ab.tar.bz2 volse-hubzilla-7defb1768bff1c3da7ea63957cf8c7c928d379ab.zip |
collapse posts by same author (but not you).
-rw-r--r-- | mod/network.php | 21 | ||||
-rw-r--r-- | mod/profile.php | 2 |
2 files changed, 21 insertions, 2 deletions
diff --git a/mod/network.php b/mod/network.php index 08bc5af4c..21b818f9c 100644 --- a/mod/network.php +++ b/mod/network.php @@ -325,6 +325,7 @@ function network_content(&$a, $update = 0) { } + $comments = array(); foreach($r as $rr) { if(intval($rr['gravity']) == 6) { @@ -341,9 +342,11 @@ function network_content(&$a, $update = 0) { } $comments_collapsed = false; + $blowhard = 0; + $blowhard_count = 0; + foreach($r as $item) { - $comment = ''; $template = $tpl; $commentww = ''; @@ -354,6 +357,20 @@ function network_content(&$a, $update = 0) { continue; if($item['id'] == $item['parent']) { + if($blowhard == $item['cid'] && (! $item['self'])) { + $blowhard_count ++; + if($blowhard_count == 3) { + $o .= '<div class="icollapse-wrapper fakelink" id="icollapse-wrapper-' . $item['parent'] . '" onclick="openClose(' . '\'icollapse-' . $item['parent'] . '\');" >' . t('See more posts like this') . '</div>' . '<div class="icollapse" id="icollapse-' . $item['parent'] . '" style="display: none;" >'; + } + } + else { + $blowhard = $item['cid']; + if($blowhard_count > 3) { + $blowhard_count = 0; + $o .= '</div>'; + } + } + $comments_seen = 0; $comments_collapsed = false; } @@ -369,7 +386,7 @@ function network_content(&$a, $update = 0) { } } if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) { - $o .= '</div></div>'; + $o .= '</div>'; } $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; diff --git a/mod/profile.php b/mod/profile.php index 8fb483007..1101c6998 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -328,6 +328,8 @@ function profile_content(&$a, $update = 0) { like_puller($a,$item,$dlike,'dislike'); } + $comments_collapsed = false; + foreach($r as $item) { $sparkle = ''; |