The existing option changes the URL specified in the /rss/channel/image/url tag (that's an XPath) of the RSS feed. The patch I have changes the image shown in the sidebar's HTML when someone views the blog itself. It basically replaces the hardcoding of 'img/xml.gif' in the call to serendipity_getTemplateFile().
Unfortunately I haven't had time to test it on 1.2-beta1, because Firefox won't take s9y's cookies. (Although Opera and Konqueror do. Official Fx 2.0.0.[34] binaries, all on Linux.)
Code: Select all
diff -Nur serendipity-1.1.2-pristine/include/plugin_internal.inc.php pawprints/include/plugin_internal.inc.php
--- serendipity-1.1.2-pristine/include/plugin_internal.inc.php 2007-01-14 09:56:22.000000000 -0500
+++ pawprints/include/plugin_internal.inc.php 2007-06-07 23:39:40.000000000 -0400
@@ -691,6 +691,7 @@
'field_ttl',
'field_pubDate',
'seperator',
+ 'iconURL',
'bannerURL',
'bannerWidth',
'bannerHeight',
@@ -839,6 +840,13 @@
$propbag->add('default', true);
break;
+ case 'iconURL':
+ $propbag->add('type', 'string');
+ $propbag->add('name', SYNDICATION_PLUGIN_ICONURL);
+ $propbag->add('description', SYNDICATION_PLUGIN_ICONURL_DESC);
+ $propbag->add('default', 'img/xml.gif');
+ break;
+
case 'bannerURL':
$propbag->add('type', 'string');
$propbag->add('name', SYNDICATION_PLUGIN_BANNERURL);
@@ -900,11 +908,12 @@
global $serendipity;
$title = $this->get_config('title');
+ $icon = serendipity_getTemplateFile($this->get_config('iconURL', 'img/xml.gif'));
if (serendipity_db_bool($this->get_config('show_0.91', true))) {
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="XML" style="border: 0px" /></a>
+ <a class="rssimg" href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss', 'serendipityHTTPPath') ?>"><img src="<?php echo $icon; ?>" alt="XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss', 'serendipityHTTPPath') ?>">RSS 0.91 feed</a>
</div>
<?php
@@ -913,7 +922,7 @@
if (serendipity_db_bool($this->get_config('show_1.0', true))) {
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss1', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="XML" style="border: 0px" /></a>
+ <a class="rssimg" href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss1', 'serendipityHTTPPath') ?>"><img src="<?php echo $icon; ?>" alt="XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss1', 'serendipityHTTPPath') ?>">RSS 1.0 feed</a>
</div>
<?php
@@ -922,7 +931,7 @@
if (serendipity_db_bool($this->get_config('show_2.0', true))) {
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss2', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="XML" style="border: 0px" /></a>
+ <a class="rssimg" href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss2', 'serendipityHTTPPath') ?>"><img src="<?php echo $icon; ?>" alt="XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/index.rss2', 'serendipityHTTPPath') ?>">RSS 2.0 feed</a>
</div>
<?php
@@ -931,7 +940,7 @@
if (serendipity_db_bool($this->get_config('show_atom0.3', true))) {
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/atom03.xml', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="ATOM/XML" style="border: 0px" /></a>
+ <a class="rssimg" href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/atom03.xml', 'serendipityHTTPPath') ?>"><img src="<?php echo $icon; ?>" alt="ATOM/XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/atom03.xml', 'serendipityHTTPPath') ?>">ATOM 0.3 feed</a>
</div>
<?php
@@ -940,7 +949,7 @@
if (serendipity_db_bool($this->get_config('show_atom1.0', true))) {
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/atom10.xml', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="ATOM/XML" style="border: 0px" /></a>
+ <a class="rssimg" href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/atom10.xml', 'serendipityHTTPPath') ?>"><img src="<?php echo $icon; ?>" alt="ATOM/XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/atom10.xml', 'serendipityHTTPPath') ?>">ATOM 1.0 feed</a>
</div>
<?php
@@ -949,7 +958,7 @@
if (serendipity_db_bool($this->get_config('show_2.0c', true))) {
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/comments.rss2', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="XML" style="border: 0px" /></a>
+ <a class="rssimg" href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/comments.rss2', 'serendipityHTTPPath') ?>"><img src="<?php echo $icon; ?>" alt="XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/comments.rss2', 'serendipityHTTPPath') ?>"><span style="white-space: nowrap">RSS 2.0 <?php echo COMMENTS; ?></span></a>
</div>
<?php
@@ -958,7 +967,7 @@
if (serendipity_db_bool($this->get_config('show_opml1.0', false))) {
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/opml.xml', 'serendipityHTTPPath') ?>"><img src="<?php echo serendipity_getTemplateFile('img/xml.gif'); ?>" alt="XML" style="border: 0px" /></a>
+ <a class="rssimg" href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/opml.xml', 'serendipityHTTPPath') ?>"><img src="<?php echo $icon; ?>" alt="XML" style="border: 0px" /></a>
<a href="<?php echo serendipity_rewriteURL(PATH_FEEDS .'/opml.xml', 'serendipityHTTPPath') ?>">OPML 1.0 feed</a>
</div>
<?php
@@ -973,7 +982,7 @@
}
?>
<div style="padding-bottom: 2px;">
- <a href="<?php echo $url; ?>"<?php if (strlen($alt) > 0) echo " title=\"$alt\""; ?>><img src="<?php echo $img; ?>" alt="" style="border:0"/></a>
+ <a class="rssimg" href="<?php echo $url; ?>"<?php if (strlen($alt) > 0) echo " title=\"$alt\""; ?>><img src="<?php echo $img; ?>" alt="" style="border:0"/></a>
<?php
$mytitle = $this->get_config('fb_title');
if (strlen($mytitle) > 0) { ?>
diff -Nur serendipity-1.1.2-pristine/lang/serendipity_lang_en.inc.php pawprints/lang/serendipity_lang_en.inc.php
--- serendipity-1.1.2-pristine/lang/serendipity_lang_en.inc.php 2006-11-22 05:30:13.000000000 -0500
+++ pawprints/lang/serendipity_lang_en.inc.php 2007-06-07 23:39:18.000000000 -0400
@@ -227,6 +227,8 @@
@define('SYNDICATION_PLUGIN_ATOM03', 'ATOM 0.3 feed');
@define('SYNDICATION_PLUGIN_MANAGINGEDITOR', 'Field "managingEditor"');
@define('SYNDICATION_PLUGIN_WEBMASTER', 'Field "webMaster"');
+@define('SYNDICATION_PLUGIN_ICONURL', 'Image for the XML icon');
+@define('SYNDICATION_PLUGIN_ICONURL_DESC', 'Image shown in place of the default "XML" sign, relative to your template; e.g. "img/feed-icon-12x12.png"');
@define('SYNDICATION_PLUGIN_BANNERURL', 'Image for the RSS feed');
@define('SYNDICATION_PLUGIN_BANNERWIDTH', 'Image width');
@define('SYNDICATION_PLUGIN_BANNERHEIGHT', 'Image height');
diff -Nur serendipity-1.1.2-pristine/lang/UTF-8/serendipity_lang_en.inc.php pawprints/lang/UTF-8/serendipity_lang_en.inc.php
--- serendipity-1.1.2-pristine/lang/UTF-8/serendipity_lang_en.inc.php 2006-12-04 04:20:14.000000000 -0500
+++ pawprints/lang/UTF-8/serendipity_lang_en.inc.php 2007-06-07 23:39:29.000000000 -0400
@@ -227,6 +227,8 @@
@define('SYNDICATION_PLUGIN_ATOM03', 'ATOM 0.3 feed');
@define('SYNDICATION_PLUGIN_MANAGINGEDITOR', 'Field "managingEditor"');
@define('SYNDICATION_PLUGIN_WEBMASTER', 'Field "webMaster"');
+@define('SYNDICATION_PLUGIN_ICONURL', 'Image for the XML icon');
+@define('SYNDICATION_PLUGIN_ICONURL_DESC', 'Image shown in place of the default "XML" sign, relative to your template; e.g. "img/feed-icon-12x12.png"');
@define('SYNDICATION_PLUGIN_BANNERURL', 'Image for the RSS feed');
@define('SYNDICATION_PLUGIN_BANNERWIDTH', 'Image width');
@define('SYNDICATION_PLUGIN_BANNERHEIGHT', 'Image height');