]> git.mxchange.org Git - friendica.git/blobdiff - include/bbcode.php
Merge pull request #2336 from stieben/move-div-pause
[friendica.git] / include / bbcode.php
index 100c3b93061c9515f13df2c5a060cc31278b1512..6a44e19ec446e87bcef9b83f53cab95d4af85299 100644 (file)
@@ -3,6 +3,7 @@ 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');
 
 function bb_PictureCacheExt($matches) {
        if (strpos($matches[3], "data:image/") === 0)
@@ -301,14 +302,12 @@ function bb_onelinecode_cb($match) {
 }
 
 function tryoembed($match){
-       //$url = ((count($match)==2)?$match[1]:$match[2]);
        $url = $match[1];
 
        // Always embed the SSL version
        $url = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"),
                                array("https://www.youtube.com/", "https://player.vimeo.com/"), $url);
 
-       //logger("tryoembed: $url");
 
        $o = oembed_fetch_url($url);
 
@@ -318,7 +317,7 @@ function tryoembed($match){
        if ($o->type=="error") return $match[0];
 
        $html = oembed_format_object($o);
-       return $html; //oembed_iframe($html,$o->width,$o->height);
+       return $html;
 
 }
 
@@ -543,8 +542,23 @@ function bb_ShareAttributes($share, $simplehtml) {
                $reldate = (($posted) ? " " . relative_date($posted) : '');
        }
 
-       $userid = GetProfileUsername($profile,$author, false);
-       $userid_compact = GetProfileUsername($profile,$author, true);
+       $data = get_contact_details_by_url($profile);
+
+       if (isset($data["name"]) AND isset($data["addr"]))
+               $userid_compact = $data["name"]." (".$data["addr"].")";
+       else
+               $userid_compact = GetProfileUsername($profile,$author, true);
+
+       if (isset($data["addr"]))
+               $userid = $data["addr"];
+       else
+               $userid = GetProfileUsername($profile,$author, false);
+
+       if (isset($data["name"]))
+               $author = $data["name"];
+
+       if (isset($data["photo"]))
+               $avatar = $data["photo"];
 
        $preshare = trim($share[1]);