diff options
author | redmatrix <git@macgirvin.com> | 2016-02-01 17:42:53 -0800 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-02-01 17:42:53 -0800 |
commit | 723a49cceecf92a87eb34243e824b8deb900f184 (patch) | |
tree | 9a1895d0d556f8fd6cff6376b598dcddd13c1b90 | |
parent | ff487a02710c2a4833c78e0b015465810c3a7987 (diff) | |
download | volse-hubzilla-723a49cceecf92a87eb34243e824b8deb900f184.tar.gz volse-hubzilla-723a49cceecf92a87eb34243e824b8deb900f184.tar.bz2 volse-hubzilla-723a49cceecf92a87eb34243e824b8deb900f184.zip |
add photos to the profile "likes this" dropdowns
-rw-r--r-- | include/identity.php | 2 | ||||
-rwxr-xr-x | include/items.php | 1 | ||||
-rw-r--r-- | include/taxonomy.php | 7 | ||||
-rwxr-xr-x | view/tpl/profile_advanced.tpl | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/include/identity.php b/include/identity.php index e1e79394a..11b80a46d 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1267,7 +1267,7 @@ function advanced_profile(&$a) { $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'])); + $profile['likers'][] = array('name' => $l['xchan_name'],'photo' => zid($l['xchan_photo_s']), 'url' => zid($l['xchan_url'])); } if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) { diff --git a/include/items.php b/include/items.php index b38049e70..5361a5fde 100755 --- a/include/items.php +++ b/include/items.php @@ -3438,6 +3438,7 @@ function check_item_source($uid, $item) { if(! $r[0]['src_patt']) return true; + require_once('include/html2plain.php'); $text = prepare_text($item['body'],$item['mimetype']); $text = html2plain($text); diff --git a/include/taxonomy.php b/include/taxonomy.php index 0bf89a7c1..5ef106938 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -398,16 +398,17 @@ function get_things($profile_hash,$uid) { $things[$k] = null; foreach($r as $rr) { - $l = q("select xchan_name, xchan_url from likes left join xchan on likee = xchan_hash where + $l = q("select xchan_name, xchan_photo_s, 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['obj_obj']), intval($uid) ); - for($x = 0; $x < count($l); $x ++) + for($x = 0; $x < count($l); $x ++) { $l[$x]['xchan_url'] = zid($l[$x]['xchan_url']); - + $l[$x]['xchan_photo_s'] = zid($l[$x]['xchan_photo_s']); + } if(! $things[$rr['obj_verb']]) $things[$rr['obj_verb']] = array(); diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl index a4413e536..a027a7c2e 100755 --- a/view/tpl/profile_advanced.tpl +++ b/view/tpl/profile_advanced.tpl @@ -4,7 +4,7 @@ {{if $profile.like_count}} <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" id="profile-like">{{$profile.like_count}} {{$profile.like_button_label}}</button> {{if $profile.likers}} - <ul class="dropdown-menu" role="menu" aria-labelledby="profile-like">{{foreach $profile.likers as $liker}}<li role="presentation"><a href="{{$liker.url}}">{{$liker.name}}</a></li>{{/foreach}}</ul> + <ul class="dropdown-menu" role="menu" aria-labelledby="profile-like">{{foreach $profile.likers as $liker}}<li role="presentation"><a href="{{$liker.url}}"><img class="dropdown-menu-img-xs" src="{{$liker.photo}}" alt="{{$liker.name}}" /> {{$liker.name}}</a></li>{{/foreach}}</ul> {{/if}} {{/if}} {{if $profile.canlike}} @@ -215,7 +215,7 @@ <div class="btn-group"> <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="thing-like-{{$item.term_hash}}">{{$item.like_count}} {{$item.like_label}}</button> {{if $item.likes}} - <ul class="dropdown-menu" role="menu" aria-labelledby="thing-like-{{$item.term_hash}}">{{foreach $item.likes as $liker}}<li role="presentation"><a href="{{$liker.xchan_url}}">{{$liker.xchan_name}}</a></li>{{/foreach}}</ul> + <ul class="dropdown-menu" role="menu" aria-labelledby="thing-like-{{$item.term_hash}}">{{foreach $item.likes as $liker}}<li role="presentation"><a href="{{$liker.xchan_url}}"><img class="dropdown-menu-img-xs" src="{{$liker.xchan_photo_s}}" alt="{{$liker.name}}" /> {{$liker.xchan_name}}</a></li>{{/foreach}}</ul> {{/if}} </div> {{/if}} |