aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-11 20:34:10 -0700
committerFriendika <info@friendika.com>2011-04-11 20:34:10 -0700
commit4cb21fc60b343ccb77937f669951b05feb9cdcff (patch)
tree0c6c99a6a29c5dd76c2439321a5a73af8eba773a /include
parent0ed2d19ac8e0b624dd4c971dd3f053f7b02b04d4 (diff)
downloadvolse-hubzilla-4cb21fc60b343ccb77937f669951b05feb9cdcff.tar.gz
volse-hubzilla-4cb21fc60b343ccb77937f669951b05feb9cdcff.tar.bz2
volse-hubzilla-4cb21fc60b343ccb77937f669951b05feb9cdcff.zip
cleanup
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php44
1 files changed, 27 insertions, 17 deletions
diff --git a/include/conversation.php b/include/conversation.php
index d81142bca..839afc481 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -198,7 +198,10 @@ function conversation(&$a, $items, $mode, $update) {
if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile')) {
$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;" >';
+ $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 {
@@ -219,8 +222,10 @@ function conversation(&$a, $items, $mode, $update) {
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
if(! $comments_collapsed) {
- $o .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent'] . '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\');" >' . sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>';
- $o .= '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
+ $o .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
+ . '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\');" >'
+ . sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>'
+ . '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
$comments_collapsed = true;
}
}
@@ -228,8 +233,6 @@ function conversation(&$a, $items, $mode, $update) {
$o .= '</div>';
}
-
-
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
@@ -243,10 +246,14 @@ function conversation(&$a, $items, $mode, $update) {
$osparkle = '';
- if(($item['parent'] == $item['item_id']) && (! $item['self']) && ($mode !== 'profile')) {
+ if(($toplevelpost) && (! $item['self']) && ($mode !== 'profile')) {
if($item['type'] === 'wall') {
- // I do. Put me on the left of the wall-to-wall notice.
+
+ // On the network page, I am the owner. On the display page it will be the profile owner.
+ // This will have been stored in $a->page_contact by our calling page.
+ // Put this person on the left of the wall-to-wall notice.
+
$owner_url = $a->page_contact['url'];
$owner_photo = $a->page_contact['thumb'];
$owner_name = $a->page_contact['name'];
@@ -254,7 +261,9 @@ function conversation(&$a, $items, $mode, $update) {
$commentww = 'ww';
}
if(($item['type'] === 'remote') && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) {
+
// Could be anybody.
+
$owner_url = $item['owner-link'];
$owner_photo = $item['owner-avatar'];
$owner_name = $item['owner-name'];
@@ -273,7 +282,7 @@ function conversation(&$a, $items, $mode, $update) {
$likebuttons = '';
if($page_writeable) {
- if($item['id'] == $item['parent']) {
+ if($toplevelpost) {
$likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array(
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
@@ -301,9 +310,10 @@ function conversation(&$a, $items, $mode, $update) {
}
}
- $edpost = '';
- if(($profile_owner == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
- $edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
+ $edpost = ((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1))
+ ? '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id']
+ . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>'
+ : '');
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
$photo = $item['photo'];
@@ -311,7 +321,7 @@ function conversation(&$a, $items, $mode, $update) {
// Post was remotely authored.
- $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
+ $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
$profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb);
@@ -343,8 +353,10 @@ function conversation(&$a, $items, $mode, $update) {
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
$dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
- $location = (($item['location']) ? '<a target="map" title="' . $item['location'] . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
- $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord'] . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
+ $location = (($item['location']) ? '<a target="map" title="' . $item['location']
+ . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
+ $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord']
+ . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
if($coord) {
if($location)
$location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
@@ -352,13 +364,11 @@ function conversation(&$a, $items, $mode, $update) {
$location = '<span class="smalltext">' . $coord . '</span>';
}
- $indent = (($item['parent'] != $item['item_id']) ? ' comment' : '');
+ $indent = (($toplevelpost) ? '' : ' comment');
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$indent .= ' shiny';
-
-
// Build the HTML
$tmp_item = replace_macros($template,array(