The concept of syndication seems to be at odds with the idea of an extended entry. However there are obvious benefits. Can an option be added to make it possible for the feeds to contain the whole post not just the teaser?
I am willing to modify the plugin, but wanted to hear what the developers have to say about it.
'Continue Reading' and Syndication
-
Little Hamster
- Regular
- Posts: 62
- Joined: Thu Oct 07, 2004 3:16 pm
Actually, I like how it is syndicated now. If someone has a very long entry, I don't want to get a news feed of the whole article, but only the teaser the blogger thought important enough to put on the front page. The continue link is displayed at the end, so it isn't a problem to find the rest of the entry.
-
Dominic White
-
randybrown
- Regular
- Posts: 27
- Joined: Sun Oct 10, 2004 10:05 pm
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Even though romulus points out a valid workaround, that would affect display on the homepage as well.romulus wrote:When you wanto to feed the whole article why don't you put your article in the normal body entry? Then the whole article is delivered with the feed.
So I did think it was a valid feature request and added it to our latest CVS.
Here's a diff for patching it into the 0.7 version:
Code: Select all
Index: rss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/rss.php,v
retrieving revision 1.28.2.1
diff -u -u -r1.28.2.1 rss.php
--- rss.php 8 Oct 2004 11:08:25 -0000 1.28.2.1
+++ rss.php 11 Oct 2004 09:17:02 -0000
@@ -78,6 +78,7 @@
$title = serendipity_utf8_encode(htmlspecialchars($title));
$description = serendipity_utf8_encode(htmlspecialchars($description));
+$fullFeed = false;
include_once(S9Y_INCLUDE_PATH . 'serendipity_plugin_api.php');
$plugins = serendipity_plugin_api::enum_plugins();
@@ -88,6 +89,7 @@
if (preg_match('|@serendipity_syndication_plugin|', $plugin_data['name'])) {
$plugin =& serendipity_plugin_api::load_plugin($plugin_data['name']);
$additional_fields = $plugin->generate_rss_fields($title, $description, $entries);
+ $fullFeed = $plugin->get_config('fullfeed', false);
break;
}
}
@@ -219,7 +221,7 @@
die("Invalid RSS version specified\n");
}
-serendipity_printEntries_rss($entries, $version, $comments);
+serendipity_printEntries_rss($entries, $version, $comments, $fullFeed);
switch ($version) {
case '0.91':
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.419.2.46
diff -u -u -r1.419.2.46 serendipity_functions.inc.php
--- serendipity_functions.inc.php 10 Oct 2004 00:39:08 -0000 1.419.2.46
+++ serendipity_functions.inc.php 11 Oct 2004 09:17:08 -0000
@@ -1558,7 +1558,7 @@
return preg_replace($p, $r, $html);
}
-function serendipity_printEntries_rss($entries, $version, $comments = false) {
+function serendipity_printEntries_rss($entries, $version, $comments = false, $fullFeed = false) {
global $serendipity;
if (is_array($entries)) {
@@ -1572,7 +1572,9 @@
}
// Embed a link to extended entry, if existing
- if ($entry['exflag']) {
+ if ($fullFeed) {
+ $entry['body'] .= ' ' . $entry['extended'];
+ } elseif ($entry['exflag']) {
$ext = '<br /><a href="' . $guid . '#extended">' . sprintf(VIEW_EXTENDED_ENTRY, htmlspecialchars($entry['title'])) . '</a>';
} else {
$ext = '';
Index: serendipity_sidebar_items.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v
retrieving revision 1.84.2.6
diff -u -u -r1.84.2.6 serendipity_sidebar_items.php
--- serendipity_sidebar_items.php 7 Oct 2004 10:40:44 -0000 1.84.2.6
+++ serendipity_sidebar_items.php 11 Oct 2004 09:17:10 -0000
@@ -382,6 +382,7 @@
$propbag->add('name', SYNDICATION);
$propbag->add('description', SHOWS_RSS_BLAHBLAH);
$propbag->add('configuration', array(
+ 'fullfeed',
'show_0.91',
'show_1.0',
'show_2.0',
@@ -406,6 +407,13 @@
function introspect_config_item($name, &$propbag)
{
switch($name) {
+ case 'fullfeed':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', SYNDICATION_PLUGIN_FULLFEED);
+ $propbag->add('description', '');
+ $propbag->add('default', false);
+ break;
+
case 'show_0.91':
$propbag->add('type', 'boolean');
$propbag->add('name', SYNDICATION_PLUGIN_091);
Index: lang/serendipity_lang_en.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/lang/serendipity_lang_en.inc.php,v
retrieving revision 1.79.2.4
diff -u -u -r1.79.2.4 serendipity_lang_en.inc.php
--- lang/serendipity_lang_en.inc.php 27 Sep 2004 10:13:39 -0000 1.79.2.4
+++ lang/serendipity_lang_en.inc.php 11 Oct 2004 09:17:11 -0000
@@ -551,5 +551,6 @@
@define('COMMENTS_FILTER_APPROVED_ONLY', 'Only approved');
@define('COMMENTS_FILTER_NEED_APPROVAL', 'Pending approval');
@define('RSS_IMPORT_BODYONLY', 'Put all imported text in the "body" section and do not split up into "extended entry" section.');
+@define('SYNDICATION_PLUGIN_FULLFEED', 'Show full articles with extended body inside RSS feed');
/* vim: set sts=4 ts=4 expandtab : */
?>
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/