public static function renderURLHTML($url) { $favicon = "http://g.etfv.co/{$url}"; if (class_exists('UFCOE\\Elgg\\Url')) { $sniffer = new Url(); $guid = $sniffer->getGuid($url); if ($entity = get_entity($guid)) { $favicon = $entity->getIconURL('tiny'); if (elgg_instanceof($entity->user)) { $text = "@{$entity->username}"; } else { $text = isset($entity->name) ? $entity->name : $entity->title; } } } if (!$text) { $embedder = new Embedder($url); $meta = $embedder->extractMeta('oembed'); if ($meta->title) { $text = $meta->title; } else { $text = elgg_get_excerpt($url, 35); } } return elgg_view('output/url', array('text' => "<span class=\"favicon\" style=\"background-image:url({$favicon})\"></span><span class=\"link\">{$text}</span>", 'href' => $url, 'class' => 'extractor-link')); }
$upload = get_entity($upload_guid); $upload->description = $wall_post->description; $upload->origin = 'wall'; $upload->access_id = $wall_post->access_id; $upload->container_guid = $container->canWriteToContainer($poster->guid, 'object', 'file') ? $container->guid : ELGG_ENTITIES_ANY_VALUE; $upload->save(); add_entity_relationship($upload_guid, 'attached', $wall_post->guid); } } $wall_post->setLocation($location); if ($fp = curl_init($address)) { $wall_post->address = $address; } if ($wall_post->address && get_input('make_bookmark', false)) { $embedder = new Embedder($wall_post->address); $document = $embedder->extractMeta('iframely'); $bookmark = new ElggObject(); $bookmark->subtype = "bookmarks"; $bookmark->container_guid = $container->canWriteToContainer($poster->guid, 'object', 'bookmarks') ? $container->guid : ELGG_ENTITIES_ANY_VALUE; $bookmark->address = $wall_post->address; $bookmark->access_id = $access_id; $bookmark->origin = 'wall'; if (!$document) { $bookmark->title = $wall_post->title; $bookmark->description = $wall_post->description; $bookmark->tags = $wall_post->tags; } else { $bookmark->title = filter_tags($document->meta->title); $bookmark->description = filter_tags($document->meta->description); $bookmark->tags = string_to_tag_array(filter_tags($document->meta->keywords)); }