]> git.mxchange.org Git - friendica.git/blobdiff - include/dfrn.php
Fixes E_WARNING from foreach() because count() seem to return TRUE even when $r is...
[friendica.git] / include / dfrn.php
index 17ef541cd3e7aa0c485ef1baf33a17d9027eae41..ad04a91295da29f4932024a9efee0c3f4bf4b549 100644 (file)
@@ -18,6 +18,7 @@ require_once("include/event.php");
 require_once("include/text.php");
 require_once("include/oembed.php");
 require_once("include/html2bbcode.php");
+require_once("include/bbcode.php");
 
 /**
  * @brief This class contain functions to create and send DFRN XML files
@@ -95,7 +96,7 @@ class dfrn {
 
                $sql_extra = " AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = '' ";
 
-               $r = q("SELECT `contact`.*, `user`.`uid` AS `user_uid`, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`
+               $r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`
                        FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
                        WHERE `contact`.`self` = 1 AND `user`.`nickname` = '%s' LIMIT 1",
                        dbesc($owner_nick)
@@ -105,7 +106,7 @@ class dfrn {
                        killme();
 
                $owner = $r[0];
-               $owner_id = $owner['user_uid'];
+               $owner_id = $owner['uid'];
                $owner_nick = $owner['nickname'];
 
                $sql_post_table = "";
@@ -483,7 +484,7 @@ class dfrn {
                                        "media:width" => 175, "media:height" => 175, "href" => $owner['photo']);
                xml_add_element($doc, $author, "link", "", $attributes);
 
-               $birthday = feed_birthday($owner['user_uid'], $owner['timezone']);
+               $birthday = feed_birthday($owner['uid'], $owner['timezone']);
 
                if ($birthday)
                        xml_add_element($doc, $author, "dfrn:birthday", $birthday);
@@ -498,7 +499,7 @@ class dfrn {
                        FROM `profile`
                                INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
                                WHERE `profile`.`is-default` AND NOT `user`.`hidewall` AND `user`.`uid` = %d",
-                       intval($owner['user_uid']));
+                       intval($owner['uid']));
                if ($r) {
                        $profile = $r[0];
                        xml_add_element($doc, $author, "poco:displayName", $profile["name"]);
@@ -720,6 +721,9 @@ class dfrn {
                else
                        $body = $item['body'];
 
+               // Remove the abstract element. It is only locally important.
+               $body = remove_abstract($body);
+
                if ($type == 'html') {
                        $htmlbody = $body;