]> git.mxchange.org Git - friendica.git/blobdiff - include/bbcode.php
Merge pull request #3975 from tobiasd/20171127-tagcloud
[friendica.git] / include / bbcode.php
index a611605471d7d2fd5bbb27369332c5dee8eb7ce7..196c3ca3c1578e76bf3954ecf542aa53b6ec24b5 100644 (file)
@@ -1,17 +1,17 @@
 <?php
 
 use Friendica\App;
+use Friendica\Content\Smilies;
 use Friendica\Core\Cache;
 use Friendica\Core\System;
 use Friendica\Core\Config;
+use Friendica\Object\Contact;
 
 require_once 'include/oembed.php';
 require_once 'include/event.php';
 require_once 'include/map.php';
 require_once 'mod/proxy.php';
-require_once 'include/Contact.php';
 require_once 'include/plaintext.php';
-require_once 'include/Smilies.php';
 
 function bb_PictureCacheExt($matches) {
        if (strpos($matches[3], "data:image/") === 0) {
@@ -52,7 +52,10 @@ 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"] = "";
        }
@@ -492,9 +495,9 @@ function bb_ShareAttributes($share, $simplehtml) {
        // We only call this so that a previously unknown contact can be added.
        // This is important for the function "get_contact_details_by_url".
        // This function then can fetch an entry from the contact table.
-       get_contact($profile, 0);
+       Contact::getIdForURL($profile, 0);
 
-       $data = get_contact_details_by_url($profile);
+       $data = Contact::getDetailsByURL($profile);
 
        if (isset($data["name"]) && ($data["name"] != "") && isset($data["addr"]) && ($data["addr"] != ""))
                $userid_compact = $data["name"]." (".$data["addr"].")";