aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-26 15:34:18 -0700
committerfriendica <info@friendica.com>2014-10-26 15:34:18 -0700
commit5abd01f072675f392945a4a2f45599067c5a86a2 (patch)
treefb02c6138d11deafd0849185980ba7cbf8a762db
parent59e19a1f45a3502559dd1df33c453aa2f99cb995 (diff)
downloadvolse-hubzilla-5abd01f072675f392945a4a2f45599067c5a86a2.tar.gz
volse-hubzilla-5abd01f072675f392945a4a2f45599067c5a86a2.tar.bz2
volse-hubzilla-5abd01f072675f392945a4a2f45599067c5a86a2.zip
allow photos without comments to be liked
-rwxr-xr-xmod/like.php17
-rw-r--r--version.inc2
2 files changed, 16 insertions, 3 deletions
diff --git a/mod/like.php b/mod/like.php
index 916faf230..debd0b618 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -209,13 +209,17 @@ function like_content(&$a) {
}
else {
+ // this is used to like an item or comment
+
$item_id = ((argc() == 2) ? notags(trim(argv(1))) : 0);
logger('like: verb ' . $verb . ' item ' . $item_id, LOGGER_DEBUG);
+ // get the item. Allow linked photos (which are normally hidden) to be liked
- $r = q("SELECT * FROM item WHERE id = %d and item_restrict = 0 LIMIT 1",
- dbesc($item_id)
+ $r = q("SELECT * FROM item WHERE id = %d and (item_restrict = 0 or item_restrict = %d) LIMIT 1",
+ dbesc($item_id),
+ dbesc(ITEM_HIDDEN)
);
if(! $item_id || (! $r)) {
@@ -325,6 +329,15 @@ function like_content(&$a) {
if($item['item_flags'] & ITEM_WALL)
$item_flags |= ITEM_WALL;
+ // if this was a linked photo and was hidden, unhide it.
+
+ if($item['item_restrict'] & ITEM_HIDDEN) {
+ $r = q("update item set item_restrict = (item_restrict ^ %d) where id = %d limit 1",
+ intval(ITEM_HIDDEN),
+ intval($item['id'])
+ );
+ }
+
}
if($verb === 'like')
diff --git a/version.inc b/version.inc
index ae378dbba..46f490449 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-10-25.839
+2014-10-26.840