aboutsummaryrefslogtreecommitdiffstats
path: root/mod/subthread.php
diff options
context:
space:
mode:
authorWave <wave72@users.noreply.github.com>2015-11-25 09:39:44 +0100
committerWave <wave72@users.noreply.github.com>2015-11-25 09:39:44 +0100
commit2de65ab39fc704fd8b7abcf9003ee98e3ffb1cc3 (patch)
tree783f90531c93f498609fb1dbd0e199ca65bb2cc0 /mod/subthread.php
parente785b723aad51d4f7202dbbb24a0e2245428cb5b (diff)
parent0559db9cf81267c34ca014fef1aebe1cf31de2ab (diff)
downloadvolse-hubzilla-2de65ab39fc704fd8b7abcf9003ee98e3ffb1cc3.tar.gz
volse-hubzilla-2de65ab39fc704fd8b7abcf9003ee98e3ffb1cc3.tar.bz2
volse-hubzilla-2de65ab39fc704fd8b7abcf9003ee98e3ffb1cc3.zip
Merge pull request #3 from redmatrix/master
Update branch
Diffstat (limited to 'mod/subthread.php')
-rwxr-xr-xmod/subthread.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/mod/subthread.php b/mod/subthread.php
index 162545a2f..74d742b6a 100755
--- a/mod/subthread.php
+++ b/mod/subthread.php
@@ -11,18 +11,24 @@ function subthread_content(&$a) {
return;
}
+ $item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0);
+
if(argv(1) === 'sub')
$activity = ACTIVITY_FOLLOW;
elseif(argv(1) === 'unsub')
$activity = ACTIVITY_UNFOLLOW;
- $item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0);
- $r = q("SELECT * FROM `item` WHERE `parent` = '%s' OR `parent_mid` = '%s' and parent = id LIMIT 1",
- dbesc($item_id),
+ $r = q("SELECT parent FROM item WHERE id = '%s'",
dbesc($item_id)
);
+ if($r) {
+ $r = q("select * from item where id = parent and id = %d limit 1",
+ dbesc($r[0]['parent'])
+ );
+ }
+
if((! $item_id) || (! $r)) {
logger('subthread: no item ' . $item_id);
return;