diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-10-14 22:14:19 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-10-14 22:14:19 +0200 |
commit | b4e83b65375e62259671749c089d9cd7a2a2967a (patch) | |
tree | 3c4b8e18b2dc439530f9515147af4424e1726be1 /include/conversation.php | |
parent | d616099de6984ad8d45e3b8908367bf5a0b8ab31 (diff) | |
download | volse-hubzilla-b4e83b65375e62259671749c089d9cd7a2a2967a.tar.gz volse-hubzilla-b4e83b65375e62259671749c089d9cd7a2a2967a.tar.bz2 volse-hubzilla-b4e83b65375e62259671749c089d9cd7a2a2967a.zip |
allow photo-items to appear full width if large photos feature is enabled. in prepare_body() split off mentions, tags, categories folders and attachments from body for easier theming. some other little fixes.
Diffstat (limited to 'include/conversation.php')
-rw-r--r-- | include/conversation.php | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/include/conversation.php b/include/conversation.php index 0f6f8685b..0d357e2eb 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -629,11 +629,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ if($item['author-link'] && (! $item['author-name'])) $profile_name = $item['author-link']; - - $tags=array(); - $hashtags = array(); - $mentions = array(); - $sp = false; $profile_link = best_link_url($item,$sp); if($sp) @@ -678,14 +673,17 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $unverified = ''; - $tags=array(); - $terms = get_terms_oftype($item['term'],array(TERM_HASHTAG,TERM_MENTION,TERM_UNKNOWN)); - if(count($terms)) - foreach($terms as $tag) - $tags[] = format_term_for_display($tag); +// $tags=array(); +// $terms = get_terms_oftype($item['term'],array(TERM_HASHTAG,TERM_MENTION,TERM_UNKNOWN)); +// if(count($terms)) +// foreach($terms as $tag) +// $tags[] = format_term_for_display($tag); $body = prepare_body($item,true); + $is_photo = (($item['resource_type'] == 'photo') ? true : false); + $has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false); + $tmp_item = array( 'template' => $tpl, 'toplevel' => 'toplevel_item', @@ -699,10 +697,12 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'lock' => $lock, 'thumb' => $profile_avatar, 'title' => $item['title'], - 'body' => $body, - 'tags' => $tags, - 'hashtags' => $hashtags, - 'mentions' => $mentions, + 'body' => $body['html'], + 'tags' => $body['tags'], + 'categories' => $body['categories'], + 'mentions' => $body['mentions'], + 'attachments' => $body['attachments'], + 'folders' => $body['folders'], 'verified' => $verified, 'unverified' => $unverified, 'forged' => $forged, @@ -712,7 +712,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'has_folders' => ((count($folders)) ? 'true' : ''), 'categories' => $categories, 'folders' => $folders, - 'text' => strip_tags($body), + 'text' => strip_tags($body['html']), 'ago' => relative_date($item['created']), 'app' => $item['app'], 'str_app' => sprintf( t('from %s'), $item['app']), @@ -738,6 +738,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'previewing' => $previewing, 'wait' => t('Please wait'), 'thread_level' => 1, + 'is_photo' => $is_photo, + 'has_tags' => $has_tags, ); $arr = array('item' => $item, 'output' => $tmp_item); |