Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_remoterss
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13769/plugins/serendipity_plugin_remoterss
Modified Files:
serendipity_plugin_remoterss.php
Log Message:
patch from the forums:
* display date toggle
* bullet image
* skip headlines that are blank
Index: serendipity_plugin_remoterss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- serendipity_plugin_remoterss.php 22 Jun 2004 13:45:49 -0000 1.4
+++ serendipity_plugin_remoterss.php 20 Aug 2004 07:44:37 -0000 1.5
@@ -20,6 +20,11 @@
@define('PLUGIN_REMOTERSS_CACHETIME_BLAHBLAH', 'Die Inhalte des fremden Feeds werden gecached. Sobald der Cache älter ist als X Minuten wird er aktualisiert (Standard: 3 Stunden)');
@define('PLUGIN_REMOTERSS_FEEDTYPE', 'Typ des Feeds');
@define('PLUGIN_REMOTERSS_FEEDTYPE_BLAHBLAH', 'Wählen Sie das Format des einzubindenden Feeds');
+ @define('PLUGIN_REMOTERSS_BULLETIMG', 'Bullet Image');
+ @define('PLUGIN_REMOTERSS_BULLETIMG_BLAHBLAH', 'Image to display before each headline.');
+ @define('PLUGIN_REMOTERSS_DISPLAYDATE', 'Display Date');
+ @define('PLUGIN_REMOTERSS_DISPLAYDATE_BLAHBLAH', 'Display the date below the headline?');
+
break;
case 'en':
@@ -40,6 +45,10 @@
@define('PLUGIN_REMOTERSS_CACHETIME_BLAHBLAH', 'The contents of a feed are stored in a cache which will be updated as soon as its older than X minutes (Default: 3 hours)');
@define('PLUGIN_REMOTERSS_FEEDTYPE', 'Feedtype');
@define('PLUGIN_REMOTERSS_FEEDTYPE_BLAHBLAH', 'Choose the format of the remote Feed');
+ @define('PLUGIN_REMOTERSS_BULLETIMG', 'Bullet Image');
+ @define('PLUGIN_REMOTERSS_BULLETIMG_BLAHBLAH', 'Image to display before each headline.');
+ @define('PLUGIN_REMOTERSS_DISPLAYDATE', 'Display Date');
+ @define('PLUGIN_REMOTERSS_DISPLAYDATE_BLAHBLAH', 'Display the date below the headline?');
break;
}
@@ -263,7 +272,7 @@
function introspect(&$propbag) {
$propbag->add('name', PLUGIN_REMOTERSS_TITLE);
$propbag->add('description', PLUGIN_REMOTERSS_BLAHBLAH);
- $propbag->add('configuration', array('number', 'dateformat', 'sidebartitle', 'rssuri', 'target', 'cachetime', 'feedtype', 'markup'));
+ $propbag->add('configuration', array('number', 'displaydate', 'dateformat', 'sidebartitle', 'rssuri', 'target', 'cachetime', 'feedtype', 'bulletimg', 'markup'));
}
function introspect_config_item($name, &$propbag) {
@@ -326,6 +335,21 @@
$propbag->add('default', 10800);
break;
+ case 'bulletimg':
+ $propbag->add('type', 'string');
+ $propbag->add('name', PLUGIN_REMOTERSS_BULLETIMG);
+ $propbag->add('description', PLUGIN_REMOTERSS_BULLETIMG_BLAHBLAH);
+ $propbag->add('default', '');
+ break;
+
+
+ case 'displaydate':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', PLUGIN_REMOTERSS_DISPLAYDATE);
+ $propbag->add('description', PLUGIN_REMOTERSS_BLAHBLAH);
+ $propbag->add('default', 'true');
+ break;
+
default:
return false;
}
@@ -336,6 +360,7 @@
global $serendipity;
$number = $this->get_config('number');
+ $displaydate = $this->get_config('displaydate','true');
$dateformat = $this->get_config('dateformat');
$sidebartitle = $this->get_config('sidebartitle');
$rssuri = $this->get_config('rssuri');
@@ -343,6 +368,7 @@
$cachetime = $this->get_config('cachetime');
$feedtype = $this->get_config('feedtype', 'rss');
$markup = $this->get_config('markup', 'false');
+ $bulletimg = $this->get_config('bulletimg');
$title = $sidebartitle;
@@ -376,9 +402,16 @@
$i = 0;
$content = '';
while (($showAll || ($i < $number)) && ($item = $c->getNextItem())) {
- $content .= '<a href="' . $item['link'] . '" target="'.$target.'">' . $item['title'] . "</a><br>\n";
+ if (empty($item['title'])) {
+ continue;
+ }
+ $content .= '<a href="' . $item['link'] . '" target="'.$target.'">';
+ if (!empty($bulletimg)) {
+ $content .= '<img src="' . $bulletimg . '" border="0" alt="*" /> ';
+ }
+ $content .= $item['title'] . "</a><br>\n";
$item['timestamp'] = strtotime(isset($item['pubdate']) ? $item['pubdate'] : $item['dc:date']);
- if (!($item['timestamp'] == -1)) {
+ if (!($item['timestamp'] == -1) AND ($displaydate == 'true')) {
$content .= '<div class="serendipitySideBarDate">'
. htmlspecialchars(serendipity_formatTime($dateformat, $item['timestamp']))
. '</div><br />';
@@ -480,4 +513,4 @@
}
/* vim: set sts=4 ts=4 expandtab : */
-?>
\ No newline at end of file
+?>
|