Page 1 of 1
'Continue Reading' and Syndication
Posted: Sun Oct 10, 2004 10:01 pm
by Dominic White
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.
Posted: Sun Oct 10, 2004 10:44 pm
by Little Hamster
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.
Posted: Sun Oct 10, 2004 11:00 pm
by Dominic White
That's fine and you are welcome to that. But I for one know it is annoying reading posts in a blog aggregator and having to click extended entry and then go and read the rest of the entry.
I am just advocating choice, not one over the other.
Posted: Mon Oct 11, 2004 1:11 am
by randybrown
It does seem that the majority of feeds are complete feeds, not teasers. So creating the options seems reasonable.
Posted: Mon Oct 11, 2004 8:43 am
by romulus
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.
Posted: Mon Oct 11, 2004 11:20 am
by garvinhicking
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.
Even though romulus points out a valid workaround, that would affect display on the homepage as well.
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 : */
?>
Posted: Mon Oct 11, 2004 5:15 pm
by randybrown
Quick response! Thanks.