Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Support callbacks in head of both rss and atom feeds
It would be nice if plugins were able to add information to the head of both RSS and ATOM feed. It could be stuff like <image>, <language>, <copyright> etc
Patch that has been tested and it works:
Index: atom.php
===================================================================
--- atom.php (revision 2503)
+++ atom.php (working copy)
@@ -56,6 +56,7 @@
$auth[] = tag(hu,'uri');
$out[] = tag(n.t.t.join(n.t.t,$auth).n,'author');
+ $out[] = callback_event('atom_head');
if (!$area or $area=='article') {
Index: rss.php
===================================================================
--- rss.php (revision 2503)
+++ rss.php (working copy)
@@ -32,6 +32,7 @@
$out[] = tag(doSpecial($site_slogan),'description');
$last = fetch('unix_timestamp(val)','txp_prefs','name','lastmod');
$out[] = tag(safe_strftime('rfc822',$last),'pubDate');
+ $out[] = callback_event('rss_head');
$articles = array();
Offline
Re: Support callbacks in head of both rss and atom feeds
Looks okay. Can someone with good knowledge of the atom/rss specs have a look at this and confirm that this can be used within those specs.
Offline
#3 2007-08-24 09:09:02
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Support callbacks in head of both rss and atom feeds
Ruud: it’s fine. It means that any plugin author is responsible for making sure the tag(s) they add are valid for that format.
Offline
Re: Support callbacks in head of both rss and atom feeds
Mary wrote:
Ruud: it’s fine. It means that any plugin author is responsible for making sure the tag(s) they add are valid for that format.
Will this mean that the patch will land?
And in 4.0.x or 4.1?
Offline
Re: Support callbacks in head of both rss and atom feeds
Commited to the 4.0.x branch: SVN revision 2538
I’ll merge this in 4.1 as well when I merge my other 4.0.x patches.
Offline
Re: Support callbacks in head of both rss and atom feeds
Committed to the crockery/4.1 branch in SVN revision 2571
Offline