Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-21 20:31:36

gemal
Member
From: Copenhagen, Denmark
Registered: 2007-01-09
Posts: 107
Website

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

#2 2007-08-22 10:42:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#4 2007-08-24 09:12:04

gemal
Member
From: Copenhagen, Denmark
Registered: 2007-01-09
Posts: 107
Website

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

#5 2007-08-24 10:58:53

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#6 2007-08-31 12:39:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Support callbacks in head of both rss and atom feeds

Committed to the crockery/4.1 branch in SVN revision 2571

Offline

Board footer

Powered by FluxBB