diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/activities.php | 2 | ||||
-rw-r--r-- | include/event.php | 2 | ||||
-rwxr-xr-x | include/items.php | 18 | ||||
-rw-r--r-- | include/photos.php | 5 |
4 files changed, 19 insertions, 8 deletions
diff --git a/include/activities.php b/include/activities.php index 73180eae0..4502b758e 100644 --- a/include/activities.php +++ b/include/activities.php @@ -24,6 +24,8 @@ function profile_activity($changed, $value) { $arr['item_flags'] = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP; $arr['verb'] = ACTIVITY_UPDATE; $arr['obj_type'] = ACTIVITY_OBJ_PROFILE; + + $arr['$plink'] = z_root() . '/channel/' . $self['channel_address'] . '/?f=&mid=' . $arr['mid']; $A = '[url=' . z_root() . '/channel/' . $self['channel_address'] . ']' . $self['channel_name'] . '[/url]'; diff --git a/include/event.php b/include/event.php index 20c5de09c..08b94dafa 100644 --- a/include/event.php +++ b/include/event.php @@ -337,6 +337,8 @@ function event_store($arr) { $item_arr['obj_type'] = ACTIVITY_OBJ_EVENT; $item_arr['body'] = format_event_bbcode($arr); + $item_arr['plink'] = z_root() . '/channel/' . $z[0]['channel_address'] . '/?f=&mid=' . $item_arr['mid']; + $x = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($arr['event_xchan']) ); diff --git a/include/items.php b/include/items.php index d5eea1e6f..9a1e5f81b 100755 --- a/include/items.php +++ b/include/items.php @@ -243,6 +243,12 @@ function post_activity_item($arr) { $arr['comment_policy'] = map_scope($channel['channel_w_comment']); + + if ((! $arr['plink']) && ($arr['item_flags'] & ITEM_THREAD_TOP)) { + $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid']; + } + + // for the benefit of plugins, we will behave as if this is an API call rather than a normal online post $_REQUEST['api_source'] = 1; @@ -1602,14 +1608,10 @@ function item_store($arr,$allow_exec = false) { $arr['llink'] = z_root() . '/display/' . $arr['mid']; - if((! $arr['plink'])) { - if (local_user() && ($arr['item_flags'] & ITEM_THREAD_TOP)) { - $channel = get_app()->get_channel(); - $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?mid=' . $arr['mid']; - } else { - $arr['plink'] = $arr['llink']; - } - } + if(! $arr['plink']) + $arr['plink'] = $arr['llink']; + + if($arr['parent_mid'] === $arr['mid']) { $parent_id = 0; diff --git a/include/photos.php b/include/photos.php index e4367bf95..5c03b2cdb 100644 --- a/include/photos.php +++ b/include/photos.php @@ -216,6 +216,9 @@ function photo_upload($channel, $observer, $args) { $arr['deny_gid'] = $str_group_deny; $arr['verb'] = ACTIVITY_POST; + $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid']; + + $arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . '[zmg]' . z_root() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/zmg]' . '[/zrl]'; @@ -407,6 +410,8 @@ function photos_create_item($channel, $creator_hash, $photo, $visible = false) { $arr['allow_gid'] = $photo['allow_gid']; $arr['deny_cid'] = $photo['deny_cid']; $arr['deny_gid'] = $photo['deny_gid']; + + $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid']; $arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . '[zmg]' . z_root() . '/photo/' . $photo['resource_id'] . '-' . $photo['scale'] . '[/zmg]' |