diff --git a/include/conversation.php b/include/conversation.php index 1d927d201..fc4b85e79 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -350,6 +350,7 @@ function visible_activity($item) { return true; } + /** * Recursively prepare a thread for HTML */ @@ -629,6 +630,10 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr $body = prepare_body($item,true); + list($categories, $folders) = get_cats_and_terms($item); + + + $tmp_item = array( // collapse comments in template. I don't like this much... 'comment_firstcollapsed' => $firstcollapsed, @@ -640,6 +645,8 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr 'tags' => template_escape($tags), 'hashtags' => template_escape($hashtags), 'mentions' => template_escape($mentions), + 'categories' => $categories, + 'folders' => $folders, 'body' => template_escape($body), 'text' => strip_tags(template_escape($body)), 'id' => $item['item_id'], @@ -685,6 +692,8 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr $item_result = $arr['output']; if($firstcollapsed) { $item_result['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children ); + $item_result['hidden_comments_num'] = $total_children; + $item_result['hidden_comments_text'] = tt('comment', 'comments', $total_children); $item_result['hide_text'] = t('show more'); } @@ -890,6 +899,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $body = prepare_body($item,true); + list($categories, $folders) = get_cats_and_terms($item); //$tmp_item = replace_macros($tpl,array( $tmp_item = array( 'template' => $tpl, @@ -906,6 +916,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'tags' => template_escape($tags), 'hashtags' => template_escape($hashtags), 'mentions' => template_escape($mentions), + 'categories' => $categories, + 'folders' => $folders, 'text' => strip_tags(template_escape($body)), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), @@ -983,6 +995,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $o = replace_macros($page_template, array( '$baseurl' => $a->get_baseurl($ssl_state), + '$remove' => t('remove'), '$mode' => $mode, '$user' => $a->user, '$threads' => $threads, diff --git a/include/text.php b/include/text.php index c1e01343a..9b55078cb 100644 --- a/include/text.php +++ b/include/text.php @@ -1016,35 +1016,8 @@ function prepare_body($item,$attach = false) { } $s .= '
'; } - $matches = false; - $cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER); - if($cnt) { -// logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG); - foreach($matches as $mtch) { - if(strlen($x)) - $x .= ','; - $x .= xmlify(file_tag_decode($mtch[1])) - . ((local_user() == $item['uid']) ? ' ' . t('[remove]') . '' : ''); - } - if(strlen($x)) - $s .= '
' . t('Categories:') . ' ' . $x . '
'; - } - $matches = false; - $x = ''; - $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); - if($cnt) { -// logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG); - foreach($matches as $mtch) { - if(strlen($x)) - $x .= '   '; - $x .= xmlify(file_tag_decode($mtch[1])) . ' ' . t('[remove]') . ''; - } - if(strlen($x) && (local_user() == $item['uid'])) - $s .= '
' . t('Filed under:') . ' ' . $x . '
'; - } - // Look for spoiler $spoilersearch = '
'; @@ -1098,6 +1071,72 @@ function prepare_text($text) { }} +/** + * returns + * [ + * //categories [ + * { + * 'name': 'category name', + * 'removeurl': 'url to remove this category', + * 'first': 'is the first in this array? true/false', + * 'last': 'is the last in this array? true/false', + * } , + * .... + * ], + * // folders [ + * 'name': 'folder name', + * 'removeurl': 'url to remove this folder', + * 'first': 'is the first in this array? true/false', + * 'last': 'is the last in this array? true/false', + * } , + * .... + * ] + * ] + */ +function get_cats_and_terms($item) { + $a = get_app(); + $categories = array(); + $folders = array(); + + $matches = false; $first = true; + $cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $categories[] = array( + 'name' => xmlify(file_tag_decode($mtch[1])), + 'url' => "#", + 'removeurl' => ((local_user() == $item['uid'])?$a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&cat=' . xmlify(file_tag_decode($mtch[1])):""), + 'first' => $first, + 'last' => false + ); + $first = false; + } + } + if (count($categories)) $categories[count($categories)-1]['last'] = true; + + + + $matches = false; $first = true; + $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $folders[] = array( + 'name' => xmlify(file_tag_decode($mtch[1])), + 'url' => "#", + 'removeurl' => ((local_user() == $item['uid'])?$a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])):""), + 'first' => $first, + 'last' => false + ); + $first = false; + } + } + + if (count($folders)) $folders[count($folders)-1]['last'] = true; + + return array($categories, $folders); +} + + /** * return atom link elements for all of our hubs */ diff --git a/mod/content.php b/mod/content.php index e6789860d..d827b5b57 100644 --- a/mod/content.php +++ b/mod/content.php @@ -584,6 +584,8 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { if (!$comments_collapsed){ $threads[$threadsid]['num_comments'] = sprintf( tt('%d comment','%d comments',$comments[$item['parent']]),$comments[$item['parent']] ); + $threads[$threadsid]['hidden_comments_num'] = $comments[$item['parent']]; + $threads[$threadsid]['hidden_comments_text'] = tt('comment', 'comments', $comments[$item['parent']]); $threads[$threadsid]['hide_text'] = t('show more'); $comments_collapsed = true; $comment_firstcollapsed = true; diff --git a/object/Item.php b/object/Item.php index 7fa3fed2d..04d52a896 100644 --- a/object/Item.php +++ b/object/Item.php @@ -143,10 +143,20 @@ class Item extends BaseObject { $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate)); $tags=array(); + $hashtags = array(); + $mentions = array(); foreach(explode(',',$item['tag']) as $tag){ $tag = trim($tag); - if ($tag!="") $tags[] = bbcode($tag); - } + if ($tag!="") { + $t = bbcode($tag); + $tags[] = $t; + if($t[0] == '#') + $hashtags[] = $t; + elseif($t[0] == '@') + $mentions[] = $t; + } + + } $like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : ''); $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : ''); @@ -195,11 +205,17 @@ class Item extends BaseObject { $body = prepare_body($item,true); + list($categories, $folders) = get_cats_and_terms($item); + $tmp_item = array( 'template' => $this->get_template(), 'type' => implode("",array_slice(explode("/",$item['verb']),-1)), 'tags' => $tags, + 'hashtags' => $hashtags, + 'mentions' => $mentions, + 'categories' => $categories, + 'folders' => $folders, 'body' => template_escape($body), 'text' => strip_tags(template_escape($body)), 'id' => $this->get_id(), @@ -254,6 +270,8 @@ class Item extends BaseObject { if(($nb_children > 2) || ($thread_level > 1)) { $result['children'][0]['comment_firstcollapsed'] = true; $result['children'][0]['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children ); + $result['children'][0]['hidden_comments_num'] = $total_children; + $result['children'][0]['hidden_comments_text'] = tt('comment', 'comments', $total_children); $result['children'][0]['hide_text'] = t('show more'); if($thread_level > 1) { $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true; @@ -264,6 +282,11 @@ class Item extends BaseObject { } } + if ($this->is_toplevel()) { + $result['total_comments_num'] = $total_children; + $result['total_comments_text'] = tt('comment', 'comments', $total_children); + } + $result['private'] = $item['private']; $result['toplevel'] = ($this->is_toplevel() ? 'toplevel_item' : ''); diff --git a/util/typo.php b/util/typo.php index bb2fc67c9..a8055c841 100644 --- a/util/typo.php +++ b/util/typo.php @@ -25,6 +25,13 @@ echo $file . "\n"; include_once($file); } + + echo "Directory: object\n"; + $files = glob('object/*.php'); + foreach($files as $file) { + echo $file . "\n"; + include_once($file); + } echo "Directory: addon\n"; $dirs = glob('addon/*'); diff --git a/view/theme/smoothly/match.tpl b/view/theme/smoothly/match.tpl deleted file mode 100644 index 244b243ec..000000000 --- a/view/theme/smoothly/match.tpl +++ /dev/null @@ -1,13 +0,0 @@ -
-
- - $name - -
- $name$inttxt
$tags
-
- {{ if $connlnk }} - - {{ endif }} -
-
\ No newline at end of file diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 90de5a4f2..b502dd5b0 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -3,7 +3,7 @@ Smoothly Created by Anne Walk and Devlon Duthie on 2011-09-24 - Modified by alex@friendica.pixelbits.de on 2012-09-17 + Modified by alex@friendica.pixelbits.de on 2012-09-20 ** Colors ** @@ -20,7 +20,6 @@ Orange - #fec01d body { margin: 0 auto; padding-bottom: 3em; - /*position: relative;*/ width: 960px; font-family: "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif; font-size: 15px; @@ -1122,7 +1121,7 @@ profile-jot-banner-wrapper { .wall-item-outside-wrapper { max-width: 100%; border-bottom: 1px solid #dedede; - margin-top: 20px; + /*margin-top: 20px;*/ margin-bottom: 20px; padding-right: 10px; padding-left: 12px; @@ -1445,7 +1444,7 @@ profile-jot-banner-wrapper { overflow: auto; margin-top: 20px; float: right; - width: 230px; + width: 250px; } /* ============ */ @@ -1457,9 +1456,19 @@ profile-jot-banner-wrapper { color: #898989; margin-left: 60px; } - + +.tread-wrapper { + border: 0px solid #CDCDCD; + border-radius: 5px 5px 5px 5px; + margin-bottom: 20px; + background-color: #E2E2E2; +} + +.collapsed-comments, +.hide-comments-outer, .wall-item-outside-wrapper.comment { - margin-left: 70px; + margin-left: 30px; + margin-bottom: 20px; } .wall-item-outside-wrapper.comment .wall-item-photo { @@ -1504,7 +1513,7 @@ profile-jot-banner-wrapper { .comment-wwedit-wrapper, .comment-edit-wrapper { - margin: 0px 0px 0px 80px; + margin: 0px 0px 5px 0px; } .comment-wwedit-wrapper img, @@ -1516,7 +1525,7 @@ profile-jot-banner-wrapper { .comment-edit-photo-link { float: left; - width: 40px; + width: 30px; } .comment-edit-text-empty { @@ -3485,6 +3494,7 @@ footer { clear: both; } +#profile-jot-text-loading, #profile-jot-text { height: 20px; color: #cccccc; @@ -3795,7 +3805,7 @@ ul.menu-popup { } .qcomment { - opacity: 0; + opacity: 0.8; filter: alpha(opacity=0); } diff --git a/view/theme/smoothly/theme.php b/view/theme/smoothly/theme.php index 14c40a2ea..7b39ec53a 100644 --- a/view/theme/smoothly/theme.php +++ b/view/theme/smoothly/theme.php @@ -3,7 +3,7 @@ /* * Name: Smoothly * Description: Like coffee with milk. Theme works fine with iPad[2]. - * Version: Version 0.9.19-4 + * Version: Version 0.9.20-3 * Author: Alex * Maintainer: Alex * Screenshot: Screenshot