+ } elseif (($a->argc == 3) && ($nick == 'feed-item')) {
+ $r = dba::fetch_first("SELECT `id`, `parent`, `author-name`, `author-link`,
+ `author-avatar`, `network`, `body`, `uid`, `owner-link`
+ FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
+ AND NOT `private` AND `uid` = 0
+ AND `id` = ? LIMIT 1", $a->argv[2]);
+ }
+
+ if (DBM::is_result($r)) {
+ if (strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
+ logger('Directly serving XML for id '.$r["id"], LOGGER_DEBUG);
+ displayShowFeed($r["id"], false);
+ }
+
+ if ($r["id"] != $r["parent"]) {
+ $r = dba::fetch_first("SELECT `id`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid`, `owner-link` FROM `item`
+ WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
+ AND `id` = ?", $r["parent"]);
+ }
+
+ $profiledata = display_fetchauthor($a, $r);
+
+ if (strstr(normalise_link($profiledata["url"]), normalise_link(System::baseUrl()))) {
+ $nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"]));
+
+ if (($nickname != $a->user["nickname"])) {
+ $r = dba::fetch_first("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+ INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
+ $nickname
+ );
+ if (DBM::is_result($r)) {
+ $profiledata = $r;
+ }
+ $profiledata["network"] = NETWORK_DFRN;
+ } else {
+ $profiledata = array();
+ }
+ }