aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-11 01:31:04 -0700
committerFriendika <info@friendika.com>2011-04-11 01:31:04 -0700
commit9133a2384aecd61f8ee59b380d82dc2d58660703 (patch)
tree06b9b6f03b14c9a945a9df8d6057d7f0350a3002 /include/conversation.php
parent2dc7882f7424b0350296ca0d030fabbe400d96e6 (diff)
downloadvolse-hubzilla-9133a2384aecd61f8ee59b380d82dc2d58660703.tar.gz
volse-hubzilla-9133a2384aecd61f8ee59b380d82dc2d58660703.tar.bz2
volse-hubzilla-9133a2384aecd61f8ee59b380d82dc2d58660703.zip
all conversations unified except photos
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php41
1 files changed, 29 insertions, 12 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 52c11fff5..76bb8b6af 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -18,6 +18,17 @@ function conversation(&$a,$r, $mode, $update) {
$writable = can_write_wall($a,$profile_owner);
}
+ if($mode === 'display') {
+ $profile_owner = $a->profile['uid'];
+ $writable = can_write_wall($a,$profile_owner);
+ }
+
+
+
+ if($update)
+ $return_url = $_SESSION['return_url'];
+ else
+ $return_url = $_SESSION['return_url'] = $a->cmd;
// find all the authors involved in remote conversations
@@ -38,9 +49,10 @@ function conversation(&$a,$r, $mode, $update) {
if(count($r)) {
- if($mode === 'network-new') {
+ if($mode === 'network-new' || $mode === 'search') {
- // "New Item View" - just loop through the items and format them minimally for display
+ // "New Item View" on network page or search page results
+ // - just loop through the items and format them minimally for display
$tpl = load_view_file('view/search_item.tpl');
$droptpl = load_view_file('view/wall_fake_drop.tpl');
@@ -52,6 +64,15 @@ function conversation(&$a,$r, $mode, $update) {
$owner_photo = '';
$owner_name = '';
$sparkle = '';
+
+ if($mode === 'search') {
+ if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
+ && ($item['id'] != $item['parent']))
+ continue;
+ $nickname = $item['nickname'];
+ }
+ else
+ $nickname = $a->user['nickname'];
$profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
$profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
@@ -110,7 +131,7 @@ function conversation(&$a,$r, $mode, $update) {
'$owner_photo' => $owner_photo,
'$owner_name' => $owner_name,
'$drop' => $drop,
- '$conv' => '<a href="' . $a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $item['id'] . '">' . t('View in context') . '</a>'
+ '$conv' => '<a href="' . $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'] . '">' . t('View in context') . '</a>'
));
}
@@ -243,10 +264,6 @@ function conversation(&$a,$r, $mode, $update) {
}
}
- if($update)
- $return_url = $_SESSION['return_url'];
- else
- $return_url = $_SESSION['return_url'] = $a->cmd;
$likebuttons = '';
@@ -264,8 +281,8 @@ function conversation(&$a,$r, $mode, $update) {
if($item['last-child']) {
$comment = replace_macros($cmnt_tpl,array(
'$return_path' => '',
- '$jsreload' => '', // $_SESSION['return_url'],
- '$type' => 'net-comment',
+ '$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
+ '$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
'$id' => $item['item_id'],
'$parent' => $item['parent'],
'$profile_uid' => $profile_owner,
@@ -274,7 +291,7 @@ function conversation(&$a,$r, $mode, $update) {
'$myphoto' => $a->contact['thumb'],
'$comment' => t('Comment'),
'$submit' => t('Submit'),
- '$ww' => $commentww
+ '$ww' => (($mode === 'network') ? $commentww : '')
));
}
}
@@ -341,8 +358,8 @@ function conversation(&$a,$r, $mode, $update) {
$tmp_item = replace_macros($template,array(
'$id' => $item['item_id'],
- '$linktitle' => t('View $name\'s profile'),
- '$olinktitle' => t('View $owner_name\'s profile'),
+ '$linktitle' => sprintf( t('View %s\'s profile'), $profile_name),
+ '$olinktitle' => sprintf( t('View %s\'s profile'), $owner_name),
'$to' => t('to'),
'$wall' => t('Wall-to-Wall'),
'$vwall' => t('via Wall-To-Wall:'),