use Friendica\Core\Cache;
use Friendica\Core\System;
use Friendica\Core\Config;
-use Friendica\Object\Contact;
+use Friendica\Model\Contact;
+use Friendica\Util\Map;
require_once 'include/oembed.php';
require_once 'include/event.php';
-require_once 'include/map.php';
require_once 'mod/proxy.php';
require_once 'include/plaintext.php';
function bb_map_coords($match) {
// the extra space in the following line is intentional
- return str_replace($match[0], '<div class="map" >' . generate_map(str_replace('/', ' ', $match[1])) . '</div>', $match[0]);
+ return str_replace($match[0], '<div class="map" >' . Map::byCoordinates(str_replace('/', ' ', $match[1])) . '</div>', $match[0]);
}
function bb_map_location($match) {
// the extra space in the following line is intentional
- return str_replace($match[0], '<div class="map" >' . generate_named_map($match[1]) . '</div>', $match[0]);
+ return str_replace($match[0], '<div class="map" >' . Map::byLocation($match[1]) . '</div>', $match[0]);
}
function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {
$data["title"] = str_replace(array("http://", "https://"), "", $data["title"]);
}
- if (((strpos($data["text"], "[img=") !== false) || (strpos($data["text"], "[img]") !== false)) && ($data["image"] != "")) {
+ if (((strpos($data["text"], "[img=") !== false)
+ || (strpos($data["text"], "[img]") !== false)
+ || Config::get('system', 'always_show_preview'))
+ && ($data["image"] != "")) {
$data["preview"] = $data["image"];
$data["image"] = "";
}
return $string;
}
-if (! function_exists('bb_extract_images')) {
function bb_extract_images($body) {
$saved_image = array();
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
-}}
+}
-if (! function_exists('bb_replace_images')) {
function bb_replace_images($body, $images) {
$newbody = $body;
}
return $newbody;
-}}
+}
function bb_ShareAttributes($share, $simplehtml) {
$attributes = $share[2];