]> git.mxchange.org Git - friendica.git/blobdiff - mod/share.php
added spaces + some curly braces + some usage of dbm::is_result()
[friendica.git] / mod / share.php
index f67dd3d200c96aa74c37602e2a360cc439db4638..ed9b5f9d17c49ac48b06d870f599b0fce4d03cba 100644 (file)
@@ -23,10 +23,11 @@ function share_init(App $a) {
        } else {
                $o = share_header($r[0]['author-name'], $r[0]['author-link'], $r[0]['author-avatar'], $r[0]['guid'], $r[0]['created'], $r[0]['plink']);
 
-               if ($r[0]['title'])
+               if ($r[0]['title']) {
                        $o .= '[b]'.$r[0]['title'].'[/b]'."\n";
+               }
                $o .= $r[0]['body'];
-               $o.= "[/share]";
+               $o .= "[/share]";
        }
 
        echo $o;
@@ -34,17 +35,17 @@ function share_init(App $a) {
 }
 
 function share_header($author, $profile, $avatar, $guid, $posted, $link) {
-       $header = "[share author='".str_replace(["'", "[", "]"], ["'", "[", "]"], $author).
-               "' profile='".str_replace(["'", "[", "]"], ["'", "[", "]"], $profile).
-               "' avatar='".str_replace(["'", "[", "]"], ["'", "[", "]"], $avatar);
+       $header = "[share author='" . str_replace(["'", "[", "]"], ["'", "[", "]"], $author).
+               "' profile='" . str_replace(["'", "[", "]"], ["'", "[", "]"], $profile).
+               "' avatar='" . str_replace(["'", "[", "]"], ["'", "[", "]"], $avatar);
 
        if ($guid) {
-               $header .= "' guid='".str_replace(["'", "[", "]"], ["'", "[", "]"], $guid);
+               $header .= "' guid='" . str_replace(["'", "[", "]"], ["'", "[", "]"], $guid);
        }
        if ($posted) {
-               $header .= "' posted='".str_replace(["'", "[", "]"], ["'", "[", "]"], $posted);
+               $header .= "' posted='" . str_replace(["'", "[", "]"], ["'", "[", "]"], $posted);
        }
-       $header .= "' link='".str_replace(["'", "[", "]"], ["'", "[", "]"], $link)."']";
+       $header .= "' link='" . str_replace(["'", "[", "]"], ["'", "[", "]"], $link)."']";
 
        return $header;
 }