X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=object%2FItem.php;h=b693520b93d8cb2e932af589a6b5da94cb51a46a;hb=07faa14361f46b744e4b135d161ad491baa93809;hp=e60344f7d331558aa12b66d3c0d19dd20936b1f9;hpb=dfc2c1f805b775cf69418051965890da32e16a23;p=friendica.git diff --git a/object/Item.php b/object/Item.php index e60344f7d3..b693520b93 100644 --- a/object/Item.php +++ b/object/Item.php @@ -38,9 +38,9 @@ class Item extends BaseObject { $this->set_template('wall'); $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); - if(is_array($_SESSION['remote'])) { - foreach($_SESSION['remote'] as $visitor) { - if($visitor['cid'] == $this->get_data_value('contact-id')) { + if (is_array($_SESSION['remote'])) { + foreach ($_SESSION['remote'] as $visitor) { + if ($visitor['cid'] == $this->get_data_value('contact-id')) { $this->visiting = true; break; } @@ -287,32 +287,6 @@ class Item extends BaseObject { localize_item($item); - if ($item["postopts"] and !get_config("system", "suppress_language")) { - //$langdata = explode(";", $item["postopts"]); - //$langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)"; - $langstr = ""; - if (substr($item["postopts"], 0, 5) == "lang=") { - $postopts = substr($item["postopts"], 5); - - $languages = explode(":", $postopts); - - if (sizeof($languages) == 1) { - $languages = array(); - $languages[] = $postopts; - } - - foreach ($languages as $language) { - $langdata = explode(";", $language); - if ($langstr != "") { - $langstr .= ", "; - } - - //$langstr .= $langdata[0]." (".round($langdata[1]*100, 1)."%)"; - $langstr .= round($langdata[1]*100, 1)."% ".$langdata[0]; - } - } - } - $body = prepare_body($item,true); list($categories, $folders) = get_cats_and_terms($item); @@ -334,7 +308,9 @@ class Item extends BaseObject { } // Disable features that aren't available in several networks - if (($item["item_network"] != NETWORK_DFRN) AND isset($buttons["dislike"])) { + + /// @todo Add NETWORK_DIASPORA when it will pass this information + if (!in_array($item["item_network"], array(NETWORK_DFRN)) AND isset($buttons["dislike"])) { unset($buttons["dislike"],$isevent); $tagger = ''; } @@ -347,17 +323,13 @@ class Item extends BaseObject { unset($buttons["like"]); } - // Diaspora isn't able to do likes on comments - but red does + // Diaspora isn't able to do likes on comments - but Hubzilla does + /// @todo When Diaspora will pass this information we will remove these lines if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment') AND - !diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) { + !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) { unset($buttons["like"]); } - // Diaspora doesn't has multithreaded comments - if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment')) { - unset($comment); - } - // Facebook can like comments - but it isn't programmed in the connector yet. if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"])) { unset($buttons["like"]); @@ -422,7 +394,6 @@ class Item extends BaseObject { 'previewing' => ($conv->is_preview() ? ' preview ' : ''), 'wait' => t('Please wait'), 'thread_level' => $thread_level, - 'postopts' => $langstr, 'edited' => $edited, 'network' => $item["item_network"], 'network_name' => network_to_name($item['item_network'], $profile_link),