[geeklog-cvs] Geeklog-1.x/system lib-syndication.php,1.39,1.40
Dirk Haun
dhaun at qs1489.pair.com
Sun Feb 17 10:02:38 EST 2008
Update of /cvsroot/geeklog/Geeklog-1.x/system
In directory qs1489.pair.com:/tmp/cvs-serv57500/system
Modified Files:
lib-syndication.php
Log Message:
Added an Atom self-link to RSS feeds (patch by Mike)
Index: lib-syndication.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-syndication.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** lib-syndication.php 2 Sep 2007 07:50:56 -0000 1.39
--- lib-syndication.php 17 Feb 2008 15:02:36 -0000 1.40
***************
*** 3,7 ****
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
! // | Geeklog 1.4 |
// +---------------------------------------------------------------------------+
// | lib-syndication.php |
--- 3,7 ----
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
! // | Geeklog 1.5 |
// +---------------------------------------------------------------------------+
// | lib-syndication.php |
***************
*** 9,13 ****
// | Geeklog syndication library. |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2003-2006 by the following authors: |
// | |
// | Authors: Dirk Haun - dirk AT haun-online DOT de |
--- 9,13 ----
// | Geeklog syndication library. |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2003-2008 by the following authors: |
// | |
// | Authors: Dirk Haun - dirk AT haun-online DOT de |
***************
*** 436,440 ****
$format = explode( '-', $A['format'] );
$feed = $factory->writer( $format[0], $format[1] );
!
if( $feed )
{
--- 436,440 ----
$format = explode( '-', $A['format'] );
$feed = $factory->writer( $format[0], $format[1] );
!
if( $feed )
{
***************
*** 519,524 ****
}
}
! $feed->extensions = PLG_getFeedExtensionTags($A['type'], $format[0], $format[1], $A['topic'], $fid);
! $feed->articles = $content;
if( !empty( $A['filename'] ))
--- 519,531 ----
}
}
!
! /* Inject the namespace for Atom into RSS feeds. Illogical?
! * Well apparantly not:
! * http://feedvalidator.org/docs/warning/MissingAtomSelfLink.html
! */
! if( $format[0] == 'RSS' )
! {
! $feed->namespaces[] = 'xmlns:atom="http://www.w3.org/2005/Atom"';
! }
if( !empty( $A['filename'] ))
***************
*** 532,535 ****
--- 539,555 ----
}
$feed->url = SYND_getFeedUrl( $filename );
+
+ $feed->extensions = PLG_getFeedExtensionTags($A['type'], $format[0], $format[1], $A['topic'], $fid, $feed);
+
+ /* Inject the self reference for Atom into RSS feeds. Illogical?
+ * Well apparantly not:
+ * http://feedvalidator.org/docs/warning/MissingAtomSelfLink.html
+ */
+ if( $format[0] == 'RSS' )
+ {
+ $feed->extensions[] = '<atom:link href="' . $feed->url .'" rel="self" type="application/rss+xml" />';
+ }
+ $feed->articles = $content;
+
$feed->createFeed( SYND_getFeedPath( $filename ));
}
More information about the geeklog-cvs
mailing list