X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdisplay.php;h=0d347882e2b16c95120a5fcbd4f16e5c146d96ab;hb=e515c20cbc016e8606a6c96991f1adde8a1acffd;hp=adbe7c67614c82ad444e08f962a9d36f39fb1c6b;hpb=d61a4a67db0ccd428ae5b5e870027d462e44e730;p=friendica.git diff --git a/mod/display.php b/mod/display.php index adbe7c6761..0d347882e2 100644 --- a/mod/display.php +++ b/mod/display.php @@ -1,5 +1,9 @@ argc > 1) ? $a->argv[1] : ''); $profiledata = array(); + if ($a->argc == 3) { + if (substr($a->argv[2], -5) == '.atom') { + $item_id = substr($a->argv[2], 0, -5); + $xml = dfrn::itemFeed($item_id); + if ($xml == '') { + http_status_exit(500); + } + header("Content-type: application/atom+xml"); + echo $xml; + killme(); + } + } + // If there is only one parameter, then check if this parameter could be a guid if ($a->argc == 2) { $nick = ""; @@ -57,7 +74,7 @@ function display_init(App $a) { WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated` AND `id` = %d", $r[0]["parent"]); } - if (($itemuid != local_user()) AND local_user()) { + if (($itemuid != local_user()) && local_user()) { // Do we know this contact but we haven't got this item? // Copy the wohle thread to our local storage so that we can interact. // We really should change this need for the future since it scales very bad. @@ -106,7 +123,6 @@ function display_init(App $a) { } profile_load($a, $nick, 0, $profiledata); - } function display_fetchauthor($a, $item) { @@ -128,11 +144,11 @@ function display_fetchauthor($a, $item) { // Skip if it isn't a pure repeated messages // Does it start with a share? - if (!$skip AND strpos($body, "[share") > 0) { + if (!$skip && strpos($body, "[share") > 0) { $skip = true; } // Does it end with a share? - if (!$skip AND (strlen($body) > (strrpos($body, "[/share]") + 8))) { + if (!$skip && (strlen($body) > (strrpos($body, "[/share]") + 8))) { $skip = true; } if (!$skip) { @@ -208,9 +224,6 @@ function display_content(App $a, $update = 0) { $o = ''; - $a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'), array()); - - if ($update) { $nick = $_REQUEST['nick']; } else { @@ -264,7 +277,7 @@ function display_content(App $a, $update = 0) { } } - if ($item_id AND !is_numeric($item_id)) { + if ($item_id && !is_numeric($item_id)) { $r = qu("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), intval($a->profile['uid'])); if (dbm::is_result($r)) { @@ -280,6 +293,16 @@ function display_content(App $a, $update = 0) { return; } + // We are displaying an "alternate" link if that post was public. See issue 2864 + $items = q("SELECT `id` FROM `item` WHERE `id` = %d AND NOT `private` AND `wall`", intval($item_id)); + if (dbm::is_result($items)) { + $alternate = App::get_baseurl().'/display/'.$nick.'/'.$item_id.'.atom'; + } else { + $alternate = ''; + } + + $a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'), + array('$alternate' => $alternate)); $groups = array(); @@ -420,7 +443,7 @@ function display_content(App $a, $update = 0) { $title = trim(html2plain(bbcode($r[0]["title"], false, false), 0, true)); $author_name = $r[0]["author-name"]; - $image = $a->remove_baseurl($r[0]["thumb"]); + $image = $a->remove_baseurl($r[0]["author-thumb"]); if ($title == "") { $title = $author_name;