X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=object%2FItem.php;h=3ea970e7ff4496d2ec7eba55db955c110a08589b;hb=f533332ad58c31a9fdad1c3822d6f55b1e28205b;hp=575a28f58fdfcd63c16fc6d7d1f7d20d83897bfd;hpb=3bf560f22fdd0512bafa1ab0cafaf07af869b523;p=friendica.git diff --git a/object/Item.php b/object/Item.php index 575a28f58f..3ea970e7ff 100644 --- a/object/Item.php +++ b/object/Item.php @@ -32,7 +32,7 @@ class Item extends BaseObject { public function __construct($data) { $a = $this->get_app(); - + $this->data = $data; $this->set_template('wall'); $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); @@ -158,25 +158,6 @@ class Item extends BaseObject { $hashtags = array(); $mentions = array(); - if (!get_config('system','suppress_tags')) { - $taglist = q("SELECT `type`, `term`, `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` IN (%d, %d) ORDER BY `tid`", - intval(TERM_OBJ_POST), intval($item['id']), intval(TERM_HASHTAG), intval(TERM_MENTION)); - - foreach($taglist as $tag) { - - if ($tag["url"] == "") - $tag["url"] = $searchpath.strtolower($tag["term"]); - - if ($tag["type"] == TERM_HASHTAG) { - $hashtags[] = "#".$tag["term"].""; - $prefix = "#"; - } elseif ($tag["type"] == TERM_MENTION) { - $mentions[] = "@".$tag["term"].""; - $prefix = "@"; - } - $tags[] = $prefix."".$tag["term"].""; - } - } /*foreach(explode(',',$item['tag']) as $tag){ $tag = trim($tag); @@ -287,13 +268,33 @@ class Item extends BaseObject { $owner_name_e = $this->get_owner_name(); } + // Disable features that aren't available in several networks + if (($item["item_network"] != "dfrn") AND isset($buttons["dislike"])) { + unset($buttons["dislike"]); + $tagger = ''; + } + + if (($item["item_network"] == "feed") AND isset($buttons["like"])) + unset($buttons["like"]); + + if (($item["item_network"] == "mail") AND isset($buttons["like"])) + unset($buttons["like"]); + + if (($item["item_network"] == "dspr") AND ($indent == 'comment') AND isset($buttons["like"])) + unset($buttons["like"]); + + // Facebook can like comments - but it isn't programmed in the connector yet. + if (($item["item_network"] == "face") AND ($indent == 'comment') AND isset($buttons["like"])) + unset($buttons["like"]); + + $tmp_item = array( 'template' => $this->get_template(), 'type' => implode("",array_slice(explode("/",$item['verb']),-1)), - 'tags' => $tags, - 'hashtags' => $hashtags, - 'mentions' => $mentions, + 'tags' => $item['tags'], + 'hashtags' => $item['hashtags'], + 'mentions' => $item['mentions'], 'txt_cats' => t('Categories:'), 'txt_folders' => t('Filed under:'), 'has_cats' => ((count($categories)) ? 'true' : ''), @@ -318,6 +319,8 @@ class Item extends BaseObject { 'title' => $title_e, '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'])), + 'app' => $item['app'], + 'created' => relative_date($item['created']), 'lock' => $lock, 'location' => $location_e, 'indent' => $indent, @@ -341,7 +344,9 @@ class Item extends BaseObject { 'wait' => t('Please wait'), 'thread_level' => $thread_level, 'postopts' => $langstr, - 'edited' => $edited + 'edited' => $edited, + 'network' => $item["item_network"], + 'network_name' => network_to_name($item['item_network']), ); $arr = array('item' => $item, 'output' => $tmp_item); @@ -529,7 +534,7 @@ class Item extends BaseObject { */ public function get_data_value($name) { if(!isset($this->data[$name])) { - logger('[ERROR] Item::get_data_value : Item has no value name "'. $name .'".', LOGGER_DEBUG); +// logger('[ERROR] Item::get_data_value : Item has no value name "'. $name .'".', LOGGER_DEBUG); return false; }