[add] snippet and via input in RSS and ATOM

This commit is contained in:
Knah Tsaeb 2013-04-30 15:30:28 +02:00
parent 5aafc4f292
commit b19dda6112

View file

@ -943,7 +943,9 @@ function showRSS()
// If user wants permalinks first, put the final link in description
if ($usepermalinks===true) $descriptionlink = '(<a href="'.$absurl.'">Link</a>)';
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++;
}
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 ($usepermalinks===true) $descriptionlink = htmlspecialchars('(<a href="'.$absurl.'">Link</a>)');
if (strlen($link['description'])>0) $descriptionlink = '&lt;br&gt;'.$descriptionlink;
$entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink."</content>\n";
$via = htmlspecialchars('</br> via '.(text2clickable(htmlspecialchars($link['via']))));
$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)
{
foreach(explode(' ',$link['tags']) as $tag)