Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31717
Modified Files:
Tag: branch-smarty
NEWS rss.php serendipity_functions.inc.php
serendipity_sidebar_items.php
Log Message:
allow users to toggle RSS fullFeed (body+extended), without links to their pages
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.214.2.29
retrieving revision 1.214.2.30
diff -u -d -r1.214.2.29 -r1.214.2.30
--- NEWS 7 Oct 2004 14:01:57 -0000 1.214.2.29
+++ NEWS 11 Oct 2004 09:21:06 -0000 1.214.2.30
@@ -3,6 +3,9 @@
Version 0.8 ()
------------------------------------------------------------------------
+ * Syndication plugin offers to show full feed including extended
+ entry (garvinhicking)
+
* serendipity_event_entryproperties now supports entry caching to
pregenerate the full article and display that instead of
assigning event plugins time and again (garvinhicking)
Index: serendipity_sidebar_items.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v
retrieving revision 1.84.2.6
retrieving revision 1.84.2.7
diff -u -d -r1.84.2.6 -r1.84.2.7
--- serendipity_sidebar_items.php 7 Oct 2004 10:40:44 -0000 1.84.2.6
+++ serendipity_sidebar_items.php 11 Oct 2004 09:21:15 -0000 1.84.2.7
@@ -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: rss.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/rss.php,v
retrieving revision 1.28.2.1
retrieving revision 1.28.2.2
diff -u -d -r1.28.2.1 -r1.28.2.2
--- rss.php 8 Oct 2004 11:08:25 -0000 1.28.2.1
+++ rss.php 11 Oct 2004 09:21:06 -0000 1.28.2.2
@@ -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
retrieving revision 1.419.2.47
diff -u -d -r1.419.2.46 -r1.419.2.47
--- serendipity_functions.inc.php 10 Oct 2004 00:39:08 -0000 1.419.2.46
+++ serendipity_functions.inc.php 11 Oct 2004 09:21:06 -0000 1.419.2.47
@@ -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 = '';
|