aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-06-23 05:19:28 -0700
committerfriendica <info@friendica.com>2014-06-23 05:19:28 -0700
commit0cfcb023118444bac29014e06a14fc1af2d0cf75 (patch)
tree5f63da84a1ee111cd68481a184c314ae5407c8fd /include
parentd43227a730927c88745c5c35029fd57562265e3e (diff)
downloadvolse-hubzilla-0cfcb023118444bac29014e06a14fc1af2d0cf75.tar.gz
volse-hubzilla-0cfcb023118444bac29014e06a14fc1af2d0cf75.tar.bz2
volse-hubzilla-0cfcb023118444bac29014e06a14fc1af2d0cf75.zip
ability to like things
Diffstat (limited to 'include')
-rw-r--r--include/identity.php4
-rw-r--r--include/taxonomy.php16
2 files changed, 17 insertions, 3 deletions
diff --git a/include/identity.php b/include/identity.php
index b086da94f..1cbe43b1e 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1044,10 +1044,12 @@ function advanced_profile(&$a) {
$things = get_things($a->profile['profile_guid'],$a->profile['profile_uid']);
- logger('mod_profile: things: ' . print_r($things,true), LOGGER_DATA);
+// logger('mod_profile: things: ' . print_r($things,true), LOGGER_DATA);
return replace_macros($tpl, array(
'$title' => t('Profile'),
+ '$canlike' => (($profile['canlike'])? true : false),
+ '$likethis' => t('Like this thing'),
'$profile' => $profile,
'$things' => $things
));
diff --git a/include/taxonomy.php b/include/taxonomy.php
index 4f2b5e8fd..803e1ae0a 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -322,9 +322,21 @@ function get_things($profile_hash,$uid) {
foreach($v as $k => $foo)
$things[$k] = null;
foreach($r as $rr) {
+
+ $l = q("select xchan_name, xchan_url from likes left join xchan on likee = xchan_hash where
+ target_type = '%s' and target_id = '%s' and channel_id = %d",
+ dbesc(ACTIVITY_OBJ_THING),
+ dbesc($rr['term_hash']),
+ intval($uid)
+ );
+
+ for($x = 0; $x < count($l); $x ++)
+ $l[$x]['xchan_url'] = zid($l[$x]['xchan_url']);
+
if(! $things[$rr['obj_verb']])
$things[$rr['obj_verb']] = array();
- $things[$rr['obj_verb']][] = array('term' => $rr['term'],'url' => $rr['url'],'img' => $rr['imgurl'], 'profile' => $rr['profile_name']);
+ $things[$rr['obj_verb']][] = array('term' => $rr['term'],'url' => $rr['url'],'img' => $rr['imgurl'], 'profile' => $rr['profile_name'],'term_hash' => $rr['term_hash'], 'likes' => $l,'like_count' => count($l),'like_label' => tt('Like','Likes',count($l),'noun'));
+
}
$sorted_things = array();
if($things) {
@@ -335,7 +347,7 @@ function get_things($profile_hash,$uid) {
}
}
}
-
+//logger('things: ' . print_r($sorted_things,true));
return $sorted_things;
} \ No newline at end of file