diff options
author | friendica <info@friendica.com> | 2014-06-23 05:19:28 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-06-23 05:19:28 -0700 |
commit | 0cfcb023118444bac29014e06a14fc1af2d0cf75 (patch) | |
tree | 5f63da84a1ee111cd68481a184c314ae5407c8fd /mod | |
parent | d43227a730927c88745c5c35029fd57562265e3e (diff) | |
download | volse-hubzilla-0cfcb023118444bac29014e06a14fc1af2d0cf75.tar.gz volse-hubzilla-0cfcb023118444bac29014e06a14fc1af2d0cf75.tar.bz2 volse-hubzilla-0cfcb023118444bac29014e06a14fc1af2d0cf75.zip |
ability to like things
Diffstat (limited to 'mod')
-rwxr-xr-x | mod/like.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mod/like.php b/mod/like.php index aae96e753..ececb31c7 100755 --- a/mod/like.php +++ b/mod/like.php @@ -151,12 +151,12 @@ function like_content(&$a) { // second like of the same thing is "undo" for the first like - $z = q("select * from likes where channel_id = %d and liker = '%s' and verb = '%s' and target_type = '%s' and target = '%s' limit 1", + $z = q("select * from likes where channel_id = %d and liker = '%s' and verb = '%s' and target_type = '%s' and target_id = '%s' limit 1", intval($ch[0]['channel_id']), dbesc($observer['xchan_hash']), dbesc($activity), dbesc(($tgttype)?$tgttype:$objtype), - dbesc(json_encode(($target)?$target:$object)) + dbesc($obj_id) ); if($z) { @@ -328,6 +328,10 @@ function like_content(&$a) { $arr['body'] = sprintf( $bodyverb, $alink, $ulink, $plink ); + if($obj_type === 'thing' && $r[0]['imgurl']) { + $arr['body'] .= "\n\n[zmg=80x80]" . $r[0]['imgurl'] . '[/zmg]'; + } + $arr['verb'] = $activity; $arr['obj_type'] = $objtype; @@ -354,13 +358,14 @@ function like_content(&$a) { if($extended_like) { - $r = q("insert into likes (channel_id,liker,likee,iid,verb,target_type,target) values (%d,'%s','%s',%d,'%s','%s','%s')", + $r = q("insert into likes (channel_id,liker,likee,iid,verb,target_type,target_id,target) values (%d,'%s','%s',%d,'%s','%s','%s','%s')", intval($ch[0]['channel_id']), dbesc($observer['xchan_hash']), dbesc($ch[0]['channel_hash']), intval($post_id), dbesc($activity), dbesc(($tgttype)?$tgttype:$objtype), + dbesc($obj_id), dbesc(json_encode(($target)?$target:$object)) ); }; |