aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-06-22 22:16:26 -0700
committerfriendica <info@friendica.com>2014-06-22 22:16:26 -0700
commitc4c1c37bd3388cf2be3f57bc29492e73644bc4ec (patch)
tree4870a148b2a257b8f32d867960c434008016f6c0 /include
parent535aa28526177c0a4acffc3b4f9b5c17119ad8f5 (diff)
downloadvolse-hubzilla-c4c1c37bd3388cf2be3f57bc29492e73644bc4ec.tar.gz
volse-hubzilla-c4c1c37bd3388cf2be3f57bc29492e73644bc4ec.tar.bz2
volse-hubzilla-c4c1c37bd3388cf2be3f57bc29492e73644bc4ec.zip
profile likes
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php5
-rw-r--r--include/identity.php19
2 files changed, 23 insertions, 1 deletions
diff --git a/include/conversation.php b/include/conversation.php
index a2cca1c77..0ca3e88f0 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -95,7 +95,10 @@ function localize_item(&$item){
if(! $item['object'])
return;
-
+
+ if($item['item_flags'] & ITEM_THREAD_TOP)
+ return;
+
$obj = json_decode_plus($item['object']);
if((! $obj) && ($item['object'])) {
logger('localize_item: failed to decode object: ' . print_r($item['object'],true));
diff --git a/include/identity.php b/include/identity.php
index 4352f026a..b086da94f 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -951,6 +951,25 @@ function advanced_profile(&$a) {
if($a->profile['gender']) $profile['gender'] = array( t('Gender:'), $a->profile['gender'] );
+ $ob_hash = get_observer_hash();
+ if($ob_hash && perm_is_allowed($a->profile['profile_uid'],$ob_hash,'post_wall')) {
+ $profile['canlike'] = true;
+ $profile['likethis'] = t('Like this channel');
+ $profile['profile_guid'] = $a->profile['profile_guid'];
+ }
+
+ $likers = q("select liker, xchan.* from likes left join xchan on liker = xchan_hash where channel_id = %d and target_type = '%s' and verb = '%s'",
+ intval($a->profile['profile_uid']),
+ dbesc(ACTIVITY_OBJ_PROFILE),
+ dbesc(ACTIVITY_LIKE)
+ );
+ $profile['likers'] = array();
+ $profile['like_count'] = count($likers);
+ $profile['like_button_label'] = tt('Like','Likes',$profile['like_count'],'noun');
+ if($likers) {
+ foreach($likers as $l)
+ $profile['likers'][] = array('name' => $l['xchan_name'],'url' => zid($l['xchan_url']));
+ }
if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) {