diff options
Diffstat (limited to 'include/taxonomy.php')
-rw-r--r-- | include/taxonomy.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php index 4f2b5e8fd..92003328f 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -266,7 +266,7 @@ function obj_verb_selector($current = '') { $o .= '<select class="obj-verb-selector" name="verb" >'; foreach($verbs as $k => $v) { $selected = (($k == $current) ? ' selected="selected" ' : ''); - $o .= '<option value="' . urlencode($k) . '"' . $selected . '>' . $v[0] . '</option>'; + $o .= '<option value="' . urlencode($k) . '"' . $selected . '>' . $v[1] . '</option>'; } $o .= '</select>'; return $o; @@ -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 |