X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=95792640e3b64484738c73401d40c27dc68a1397;hb=660bd39efad52b1c69bd8dd0ca27141b81f84ca5;hp=36ac57f17d5d938213723e03ba576d4ccf08d27b;hpb=dbf51229d9014089eba0da41a55f23c507f7e2ea;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index 36ac57f17d..95792640e3 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -377,6 +377,18 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $page_writeable = false; $live_update_div = ''; + $arr_blocked = null; + + if(local_user()) { + $str_blocked = get_pconfig(local_user(),'system','blocked'); + if($str_blocked) { + $arr_blocked = explode(',',$str_blocked); + for($x = 0; $x < count($arr_blocked); $x ++) + $arr_blocked[$x] = trim($arr_blocked[$x]); + } + + } + $previewing = (($preview) ? ' preview ' : ''); if($mode === 'network') { @@ -475,7 +487,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $alike = array(); $dlike = array(); - // array with html for each thread (parent+comments) $threads = array(); $threadsid = -1; @@ -493,6 +504,20 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $tpl = 'search_item.tpl'; foreach($items as $item) { + + if($arr_blocked) { + $blocked = false; + foreach($arr_blocked as $b) { + if($b && link_compare($item['author-link'],$b)) { + $blocked = true; + break; + } + } + if($blocked) + continue; + } + + $threadsid++; $comment = ''; @@ -533,13 +558,13 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $tag["url"] = $searchpath.strtolower($tag["term"]); if ($tag["type"] == TERM_HASHTAG) { - $hashtags[] = "#".$tag["term"].""; + $hashtags[] = "#".$tag["term"].""; $prefix = "#"; } elseif ($tag["type"] == TERM_MENTION) { - $mentions[] = "@".$tag["term"].""; + $mentions[] = "@".$tag["term"].""; $prefix = "@"; } - $tags[] = $prefix."".$tag["term"].""; + $tags[] = $prefix."".$tag["term"].""; } /*foreach(explode(',',$item['tag']) as $tag){ @@ -595,7 +620,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $likebuttons = false; $shareable = false; - $body = prepare_body($item,true); + $body = prepare_body($item,true, $preview); list($categories, $folders) = get_cats_and_terms($item); @@ -624,6 +649,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $tmp_item = array( 'template' => $tpl, 'id' => (($preview) ? 'P0' : $item['item_id']), + 'network' => $item['item_network'], 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), 'profile_url' => $profile_link, 'item_photo_menu' => item_photo_menu($item), @@ -659,7 +685,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'like' => '', 'dislike' => '', 'comment' => '', - 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), + //'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), + 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/'.$item['guid'], 'title'=> t('View in context'))), 'previewing' => $previewing, 'wait' => t('Please wait'), 'thread_level' => 1, @@ -669,10 +696,10 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { call_hooks('display_item', $arr); $threads[$threadsid]['id'] = $item['item_id']; + $threads[$threadsid]['network'] = $item['item_network']; $threads[$threadsid]['items'] = array($arr['output']); } - } else { @@ -691,6 +718,21 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $threads = array(); foreach($items as $item) { + if($arr_blocked) { + $blocked = false; + foreach($arr_blocked as $b) { + + if($b && link_compare($item['author-link'],$b)) { + $blocked = true; + break; + } + } + if($blocked) + continue; + } + + + // Can we put this after the visibility check? like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike'); @@ -714,6 +756,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { } $threads = $conv->get_template_data($alike, $dlike); + if(!$threads) { logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); $threads = array(); @@ -1001,13 +1044,18 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { } } - if($mail_enabled) { - $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); - $jotnets .= '
' . t("Post to Email") . '
'; - } + if (!$a->user['hidewall']) { + if($mail_enabled) { + $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); + $jotnets .= '
' . t("Post to Email") . '
'; + } + + call_hooks('jot_networks', $jotnets); + } else + $jotnets .= sprintf(t('Connectors disabled, since "%s" is enabled.'), + t('Hide your profile details from unknown viewers?')); call_hooks('jot_tool', $jotplugins); - call_hooks('jot_networks', $jotnets); if($notes_cid) $jotnets .= '';