aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-09 22:08:25 -0700
committerfriendica <info@friendica.com>2012-07-09 22:08:25 -0700
commit4b066e04f619c2c6f8d383daee9ceab49f39acdc (patch)
treec9f3376ffce342333b60d848430ee13b3329d903 /include/conversation.php
parent8855cb9c286eb66ad96b3388d85ccc57434a6db3 (diff)
downloadvolse-hubzilla-4b066e04f619c2c6f8d383daee9ceab49f39acdc.tar.gz
volse-hubzilla-4b066e04f619c2c6f8d383daee9ceab49f39acdc.tar.bz2
volse-hubzilla-4b066e04f619c2c6f8d383daee9ceab49f39acdc.zip
making tags work
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php37
1 files changed, 25 insertions, 12 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 240cd374f..f81a7e7d2 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -611,13 +611,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false);
if($page_writeable) {
-/* if($toplevelpost) { */
- $likebuttons = array(
- 'like' => array( t("I like this \x28toggle\x29"), t("like")),
- 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")),
- );
- if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
-/* } */
+ $likebuttons = array(
+ 'like' => array( t("I like this \x28toggle\x29"), t("like")),
+ 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")),
+ );
+ if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
+
$qc = $qcomment = null;
@@ -739,10 +738,11 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$tags=array();
- foreach(explode(',',$item['tag']) as $tag){
- $tag = trim($tag);
- if ($tag!="") $tags[] = bbcode($tag);
- }
+ $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);
+
// Build the HTML
@@ -1102,13 +1102,26 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
}
-function conv_sort($arr,$order) {
+function conv_sort($arr,$tags,$order) {
if((!(is_array($arr) && count($arr))))
return array();
$parents = array();
+
+ for($x = 0; $x < count($arr); $x ++) {
+ if(count($tags)) {
+ foreach($tags as $t) {
+ if($t['oid'] == $arr[$x]['item_id']) {
+ if(! is_array($arr[$x]['term']))
+ $arr[$x]['term'] = array();
+ $arr[$x]['term'][] = $t;
+ }
+ }
+ }
+ }
+
foreach($arr as $x)
if($x['id'] == $x['parent'])
$parents[] = $x;