mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:55:19 +00:00
fix link to photo album and make sure that small photos are not overwritten by body text.
This commit is contained in:
parent
df57c90d2d
commit
776bc51172
2 changed files with 4 additions and 4 deletions
|
@ -296,7 +296,7 @@ function photo_upload($channel, $observer, $args) {
|
|||
|
||||
$photo_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . t('a new photo') . '[/zrl]';
|
||||
|
||||
$album_link = '[zrl=' . z_root() . '/photos/album/' . bin2hex($album) . ']' . $album . '[/zrl]';
|
||||
$album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) . ']' . $album . '[/zrl]';
|
||||
|
||||
$activity_format = sprintf(t('%1$s posted %2$s to %3$s','photo_upload'), $author_link, $photo_link, $album_link);
|
||||
|
||||
|
|
|
@ -1444,7 +1444,7 @@ function prepare_body(&$item,$attach = false) {
|
|||
|
||||
call_hooks('prepare_body_init', $item);
|
||||
|
||||
|
||||
$s = '';
|
||||
$photo = '';
|
||||
$is_photo = ((($item['verb'] === ACTIVITY_POST) && ($item['obj_type'] === ACTIVITY_OBJ_PHOTO)) ? true : false);
|
||||
|
||||
|
@ -1454,7 +1454,7 @@ function prepare_body(&$item,$attach = false) {
|
|||
|
||||
// if original photo width is <= 640px prepend it to item body
|
||||
if($object['link'][0]['width'] && $object['link'][0]['width'] <= 640) {
|
||||
$s = '<div class="inline-photo-item-wrapper"><a href="' . zid(rawurldecode($object['id'])) . '" target="_blank"><img class="inline-photo-item" style="max-width:' . $object['link'][0]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][0]['href'])) . '"></a></div>' . $s;
|
||||
$s .= '<div class="inline-photo-item-wrapper"><a href="' . zid(rawurldecode($object['id'])) . '" target="_blank"><img class="inline-photo-item" style="max-width:' . $object['link'][0]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][0]['href'])) . '"></a></div>' . $s;
|
||||
}
|
||||
|
||||
// if original photo width is > 640px make it a cover photo
|
||||
|
@ -1464,7 +1464,7 @@ function prepare_body(&$item,$attach = false) {
|
|||
}
|
||||
}
|
||||
|
||||
$s = prepare_text($item['body'],$item['mimetype'], false);
|
||||
$s .= prepare_text($item['body'],$item['mimetype'], false);
|
||||
|
||||
$event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event($item['object']) : false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue