Tweak CSS output of rss sidebar plugin

This commit is contained in:
Garvin Hicking 2007-12-12 10:37:41 +00:00
parent 6822e4e287
commit 098e569950
2 changed files with 26 additions and 4 deletions

View File

@ -3,6 +3,10 @@
Version 1.3 () Version 1.3 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Add more verbose CSS classes to remote RSS sidebar plugin, also
only encapsulate the first XML-Item as link. All following
items are only encapsulated in <span>s. (garvinhicking)
* Make browser compatibility plugin bail out for IE7. Thanks to * Make browser compatibility plugin bail out for IE7. Thanks to
Freudi from the forums. Freudi from the forums.

View File

@ -379,7 +379,7 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
case 'displaydate': case 'displaydate':
$propbag->add('type', 'boolean'); $propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_REMOTERSS_DISPLAYDATE); $propbag->add('name', PLUGIN_REMOTERSS_DISPLAYDATE);
$propbag->add('description', PLUGIN_REMOTERSS_BLAHBLAH); $propbag->add('description', PLUGIN_REMOTERSS_DISPLAYDATE_BLAHBLAH);
$propbag->add('default', 'true'); $propbag->add('default', 'true');
break; break;
@ -480,24 +480,41 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
continue; continue;
} }
echo '<div class="rss_item">';
if ($use_rss_link) { if ($use_rss_link) {
$content .= '<a href="' . htmlspecialchars($this->decode($item['link'])) . '" ' . (!empty($target) ? 'target="'.$target.'"' : '') . '>'; $content .= '<div class="rss_link"><a href="' . htmlspecialchars($this->decode($item['link'])) . '" ' . (!empty($target) ? 'target="'.$target.'"' : '') . '>';
} }
if (!empty($bulletimg)) { if (!empty($bulletimg)) {
$content .= '<img src="' . $bulletimg . '" border="0" alt="*" /> '; $content .= '<img src="' . $bulletimg . '" border="0" alt="*" /> ';
} }
$is_first = true;
foreach($rss_elements AS $rss_element) { foreach($rss_elements AS $rss_element) {
$rss_element = trim($rss_element); $rss_element = trim($rss_element);
if (!$is_first) {
$content .= '<span class="rss_' . preg_replace('@[^a-z0-9]@imsU', '', $rss_element) . '">';
}
if ($escape_rss) { if ($escape_rss) {
$content .= $this->decode($item[$rss_element]); $content .= $this->decode($item[$rss_element]);
} else { } else {
$content .= htmlspecialchars($this->decode($item[$rss_element])); $content .= htmlspecialchars($this->decode($item[$rss_element]));
} }
if (!$is_first) {
$content .= '</span>';
}
if ($is_first && $use_rss_link) {
$content .= '</a></div>'; // end of first linked element
}
$is_first = false;
} }
if ($use_rss_link) { if ($is_first && $use_rss_link) {
// No XML element has been configured.
$content .= '</a>'; $content .= '</a>';
} }
@ -506,9 +523,10 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
if (!($item['timestamp'] == -1) AND ($displaydate == 'true')) { if (!($item['timestamp'] == -1) AND ($displaydate == 'true')) {
$content .= '<div class="serendipitySideBarDate">' $content .= '<div class="serendipitySideBarDate">'
. htmlspecialchars(serendipity_formatTime($dateformat, $item['timestamp'], false)) . htmlspecialchars(serendipity_formatTime($dateformat, $item['timestamp'], false))
. '</div><br />'; . '</div>';
} }
echo '</div>'; // end of rss_item
++$i; ++$i;
} }