aboutsummaryrefslogtreecommitdiffstats
path: root/mod/subthread.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/subthread.php')
-rwxr-xr-xmod/subthread.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/mod/subthread.php b/mod/subthread.php
index f8918e25d..11b7236fb 100755
--- a/mod/subthread.php
+++ b/mod/subthread.php
@@ -7,15 +7,15 @@ require_once('include/items.php');
function subthread_content(&$a) {
- if(! local_user() && ! remote_user()) {
+ if((! local_user()) && (! remote_user())) {
return;
}
$activity = ACTIVITY_FOLLOW;
- $item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
+ $item_id = ((argc() > 1) ? notags(trim(argv(1))) : 0);
- $r = q("SELECT * FROM `item` WHERE `parent` = '%s' OR `parent-uri` = '%s' and parent = id LIMIT 1",
+ $r = q("SELECT * FROM `item` WHERE `parent` = '%s' OR `parent_mid` = '%s' and parent = id LIMIT 1",
dbesc($item_id),
dbesc($item_id)
);
@@ -84,7 +84,7 @@ function subthread_content(&$a) {
return;
}
- $uri = item_message_id();
+ $mid = item_message_id();
$post_type = (($item['resource_id']) ? t('photo') : t('status'));
$objtype = (($item['resource_id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
@@ -96,7 +96,7 @@ function subthread_content(&$a) {
<object>
<type>$objtype</type>
<local>1</local>
- <id>{$item['uri']}</id>
+ <id>{$item['mid']}</id>
<link>$link</link>
<title></title>
<content>$body</content>
@@ -109,7 +109,7 @@ EOT;
$arr = array();
- $arr['uri'] = $uri;
+ $arr['mid'] = $mid;
$arr['uid'] = $owner_uid;
$arr['contact-id'] = $contact['id'];
$arr['type'] = 'activity';
@@ -117,8 +117,8 @@ EOT;
$arr['origin'] = 1;
$arr['gravity'] = GRAVITY_LIKE;
$arr['parent'] = $item['id'];
- $arr['parent-uri'] = $item['uri'];
- $arr['thr_parent'] = $item['uri'];
+ $arr['parent-mid'] = $item['mid'];
+ $arr['thr_parent'] = $item['mid'];
$arr['owner-name'] = $remote_owner['name'];
$arr['owner-link'] = $remote_owner['url'];
$arr['owner-avatar'] = $remote_owner['thumb'];
@@ -126,9 +126,9 @@ EOT;
$arr['author-link'] = $contact['url'];
$arr['author-avatar'] = $contact['thumb'];
- $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
- $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
- $plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
+ $ulink = '[zrl=' . $contact['url'] . ']' . $contact['name'] . '[/zrl]';
+ $alink = '[zrl=' . $item['author-link'] . ']' . $item['author-name'] . '[/zrl]';
+ $plink = '[zrl=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/zrl]';
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
$arr['verb'] = $activity;
@@ -142,7 +142,8 @@ EOT;
$arr['unseen'] = 1;
$arr['last-child'] = 0;
- $post_id = item_store($arr);
+ $post = item_store($arr);
+ $post_id = $post['item_id'];
if(! $item['visible']) {
$r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1",