[add] snippet and via input in RSS and ATOM
This commit is contained in:
parent
5aafc4f292
commit
b19dda6112
1 changed files with 6 additions and 3 deletions
|
@ -943,7 +943,9 @@ function showRSS()
|
||||||
// If user wants permalinks first, put the final link in description
|
// If user wants permalinks first, put the final link in description
|
||||||
if ($usepermalinks===true) $descriptionlink = '(<a href="'.$absurl.'">Link</a>)';
|
if ($usepermalinks===true) $descriptionlink = '(<a href="'.$absurl.'">Link</a>)';
|
||||||
if (strlen($link['description'])>0) $descriptionlink = '<br>'.$descriptionlink;
|
if (strlen($link['description'])>0) $descriptionlink = '<br>'.$descriptionlink;
|
||||||
echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$descriptionlink.']]></description>'."\n</item>\n";
|
$via = '<br>via '.text2clickable(htmlspecialchars($link['via']));
|
||||||
|
$snippet = '<br><code>'.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['snippet'])))).'</code>';
|
||||||
|
echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$snippet.$via.$descriptionlink.']]></description>'."\n</item>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
echo '</channel></rss><!-- Cached version of '.pageUrl().' -->';
|
echo '</channel></rss><!-- Cached version of '.pageUrl().' -->';
|
||||||
|
@ -1003,8 +1005,9 @@ function showATOM()
|
||||||
// If user wants permalinks first, put the final link in description
|
// If user wants permalinks first, put the final link in description
|
||||||
if ($usepermalinks===true) $descriptionlink = htmlspecialchars('(<a href="'.$absurl.'">Link</a>)');
|
if ($usepermalinks===true) $descriptionlink = htmlspecialchars('(<a href="'.$absurl.'">Link</a>)');
|
||||||
if (strlen($link['description'])>0) $descriptionlink = '<br>'.$descriptionlink;
|
if (strlen($link['description'])>0) $descriptionlink = '<br>'.$descriptionlink;
|
||||||
|
$via = htmlspecialchars('</br> via '.(text2clickable(htmlspecialchars($link['via']))));
|
||||||
$entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink."</content>\n";
|
$snippet = htmlspecialchars('</br><code>'.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['snippet'])))).'</code>');
|
||||||
|
$entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$snippet.$via.$descriptionlink."</content>\n";
|
||||||
if ($link['tags']!='') // Adding tags to each ATOM entry (as mentioned in ATOM specification)
|
if ($link['tags']!='') // Adding tags to each ATOM entry (as mentioned in ATOM specification)
|
||||||
{
|
{
|
||||||
foreach(explode(' ',$link['tags']) as $tag)
|
foreach(explode(' ',$link['tags']) as $tag)
|
||||||
|
|
Reference in a new issue