Adding the "abstract" element to the imported feed
This commit is contained in:
parent
dfcf1b1e6f
commit
14b56ce0cc
1 changed files with 16 additions and 3 deletions
|
@ -356,11 +356,20 @@ class Feed {
|
||||||
if (empty($body)) {
|
if (empty($body)) {
|
||||||
$body = trim(XML::getFirstNodeValue($xpath, 'content:encoded/text()', $entry));
|
$body = trim(XML::getFirstNodeValue($xpath, 'content:encoded/text()', $entry));
|
||||||
}
|
}
|
||||||
if (empty($body)) {
|
|
||||||
$body = trim(XML::getFirstNodeValue($xpath, 'description/text()', $entry));
|
$summary = trim(XML::getFirstNodeValue($xpath, 'atom:summary/text()', $entry));
|
||||||
|
|
||||||
|
if (empty($summary)) {
|
||||||
|
$summary = trim(XML::getFirstNodeValue($xpath, 'description/text()', $entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($body)) {
|
if (empty($body)) {
|
||||||
$body = trim(XML::getFirstNodeValue($xpath, 'atom:summary/text()', $entry));
|
$body = $summary;
|
||||||
|
$summary = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($body == $summary) {
|
||||||
|
$summary = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the content of the title if it is identically to the body
|
// remove the content of the title if it is identically to the body
|
||||||
|
@ -411,6 +420,10 @@ class Feed {
|
||||||
$item["object-type"] = ACTIVITY_OBJ_BOOKMARK;
|
$item["object-type"] = ACTIVITY_OBJ_BOOKMARK;
|
||||||
unset($item["attach"]);
|
unset($item["attach"]);
|
||||||
} else {
|
} else {
|
||||||
|
if (!empty($summary)) {
|
||||||
|
$item["body"] = '[abstract]' . HTML::toBBCode($summary, $basepath) . '[/abstract]' . $item["body"];
|
||||||
|
}
|
||||||
|
|
||||||
if ($contact["fetch_further_information"] == 3) {
|
if ($contact["fetch_further_information"] == 3) {
|
||||||
if (!empty($tags)) {
|
if (!empty($tags)) {
|
||||||
$item["tag"] = $tags;
|
$item["tag"] = $tags;
|
||||||
|
|
Loading…
Reference in a new issue