function serendipity_printEntries_rss($entries, $version, $comments = false, $fullFeed = false, $showMail = true) {\r
global $serendipity;\r
\r
+ $options = array(\r
+ 'version' => $version,\r
+ 'comments' => $comments,\r
+ 'fullFeed' => $fullFeed,\r
+ 'showMail' => $showMail\r
+ );\r
+ serendipity_plugin_api::hook_event('frontend_entries_rss', $entries, $options);\r
+\r
if (is_array($entries)) {\r
foreach ($entries as $entry) {\r
$id = (isset($entry['entryid']) && !empty($entry['entryid']) ? $entry['entryid'] : $entry['id']);\r
// Embed a link to extended entry, if existing\r
if ($fullFeed) {\r
$entry['body'] .= ' ' . $entry['extended'];\r
+ $ext = '';\r
} elseif ($entry['exflag']) {\r
$ext = '<br /><a href="' . $guid . '#extended">' . sprintf(VIEW_EXTENDED_ENTRY, htmlspecialchars($entry['title'])) . '</a>';\r
} else {\r
\r
<id><?php echo $guid; ?></id>\r
<title mode="escaped" type="text/html"><?php echo serendipity_utf8_encode(htmlspecialchars($entry['title'])); ?></title>\r
+<?php if (!empty($entry['body'])) { ?>\r
<content type="application/xhtml+xml" xml:base="<?php echo $serendipity['baseURL']; ?>">\r
<div xmlns="http://www.w3.org/1999/xhtml">\r
<?php\r
</div>\r
</content>\r
<?php\r
+ }\r
$entry['display_dat'] = '';\r
serendipity_plugin_api::hook_event('frontend_display:atom-0.3:per_entry', $entry);\r
echo $entry['display_dat'];\r
?>\r
<id><?php echo $guid; ?></id>\r
<title type="html"><?php echo serendipity_utf8_encode(htmlspecialchars($entry['title'])); ?></title>\r
+<?php if (!empty($entry['body'])) { ?>\r
<content type="xhtml" xml:base="<?php echo $serendipity['baseURL']; ?>">\r
<div xmlns="http://www.w3.org/1999/xhtml">\r
<?php\r
</div>\r
</content>\r
<?php\r
+ }\r
$entry['display_dat'] = '';\r
serendipity_plugin_api::hook_event('frontend_display:atom-1.0:per_entry', $entry);\r
echo $entry['display_dat'];\r
}\r
?>\r
<author><?php echo serendipity_utf8_encode(htmlspecialchars($entry['email'])) . ' (' . serendipity_utf8_encode(htmlspecialchars($entry['author'])) . ')'; ?></author>\r
+<?php if (!empty($entry['body'])) { ?>\r
<content:encoded>\r
<?php\r
- echo serendipity_utf8_encode(htmlspecialchars($entry['body'].$ext));\r
+ echo serendipity_utf8_encode(htmlspecialchars($entry['body'].$ext));\r
?>\r
</content:encoded>\r
+<?php\r
+ }\r
+?> \r
<pubDate><?php echo date('r', serendipity_serverOffsetHour($entry['timestamp'])); ?></pubDate>\r
<guid isPermaLink="false"><?php echo $guid; ?></guid>\r
<?php\r
/*********** END 2.0 FEED EXTRAS *************/\r
} else {\r
/*********** BEGIN RSS 0.91 FEED EXTRAS *************/\r
+ if (!empty($entry['body'])) { ?>\r
?>\r
<description>\r
<?php echo serendipity_utf8_encode(htmlspecialchars($entry['body'] . $ext)); ?>\r
</description>\r
+<?php\r
+ }\r
+?>\r
</item>\r
<?php\r
/*********** END RSS 0.91 FEED EXTRAS *************/\r
<item rdf:about="<?php echo $guid; ?>">\r
<title><?php echo serendipity_utf8_encode(htmlspecialchars($entry['title'])); ?></title>\r
<link><?php echo $entryLink; ?></link>\r
+<?php if (!empty($entry['body'])) { ?>\r
<description>\r
<?php\r
echo serendipity_utf8_encode(htmlspecialchars($entry['body'].$ext));\r
?>\r
</description>\r
- <?php\r
- $entry['display_dat'] = '';\r
- serendipity_plugin_api::hook_event('frontend_display:rss-1.0:per_entry', $entry);\r
- echo $entry['display_dat'];\r
- ?>\r
+<?php\r
+ }\r
+\r
+ $entry['display_dat'] = '';\r
+ serendipity_plugin_api::hook_event('frontend_display:rss-1.0:per_entry', $entry);\r
+ echo $entry['display_dat'];\r
+?>\r
<dc:publisher><?php echo serendipity_utf8_encode(htmlspecialchars($serendipity['blogTitle'])); ?></dc:publisher>\r
<dc:creator><?php echo serendipity_utf8_encode(htmlspecialchars($entry['email'])) . ' (' . serendipity_utf8_encode(htmlspecialchars($entry['author'])) . ')'; ?></dc:creator>\r
<dc:subject><?php echo serendipity_utf8_encode(htmlspecialchars(implode(', ', $categories))); ?></dc:subject>\r
@define('PLUGIN_EVENT_ENTRYPROPERTIES_GROUPS_DESC', 'If enabled, you can define which users of a usergroup may be able to read entries. This option has a large impact on the performance of your article overview. Only enable this if you are really going to use this feature.');
@define('PLUGIN_EVENT_ENTRYPROPERTIES_USERS', 'Use user-based restrictions');
@define('PLUGIN_EVENT_ENTRYPROPERTIES_USERS_DESC', 'If enabled, you can define which specific users may be able to read entries. This option has a large impact on the performance of your article overview. Only enable this if you are really going to use this feature.');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS', 'Hide content in RSS');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS_DESC', 'If enabled, the content of this entry will not be shown inside the RSS feed(s).');
class serendipity_event_entryproperties extends serendipity_event
{
'backend_cache_entries' => true,
'backend_cache_purge' => true,
'backend_plugins_new_instance' => true,
- 'frontend_entryproperties_query' => true
+ 'frontend_entryproperties_query' => true,
+ 'frontend_entries_rss' => true
));
$propbag->add('groups', array('BACKEND_EDITOR'));
$propbag->add('configuration', array('cache', 'use_groups', 'use_users', 'default_read'));
}
function getSupportedProperties() {
- static $supported_properties = array('is_sticky', 'access', 'access_groups', 'access_users', 'cache_body', 'cache_extended', 'no_nl2br', 'no_frontpage');
+ static $supported_properties = array('is_sticky', 'access', 'access_groups', 'access_users', 'cache_body', 'cache_extended', 'no_nl2br', 'no_frontpage', 'hiderss');
return $supported_properties;
}
? 'checked="checked"'
: '';
+ $hiderss = (isset($eventData['properties']['ep_hiderss']) && serendipity_db_bool($eventData['properties']['ep_hiderss']))
+ || (isset($serendipity['POST']['properties']['hiderss']) && serendipity_db_bool($serendipity['POST']['properties']['hiderss']))
+ ? 'checked="checked"'
+ : '';
+
$access_values = array(
PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PRIVATE => 'private',
PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PUBLIC => 'public',
<label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR; ?>" for="properties_no_nl2br"> <?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR; ?> </label><br />
<?php } ?>
-
+ <input type="checkbox" name="serendipity[properties][hiderss]" id="properties_hiderss" value="true" <?php echo $hiderss; ?> />
+ <label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS_DESC; ?>" for="properties_hiderss"> <?php echo PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS; ?> </label><br />
+
<br />
<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS; ?>:<br />
<div style="margin-left: 10px">
return true;
break;
+ case 'frontend_entries_rss':
+ if (is_array($eventData)) {
+ foreach($eventData AS $idx => $entry) {
+ if (is_array($entry['properties']) && isset($entry['properties']['ep_hiderss']) && $entry['properties']['ep_hiderss']) {
+ unset($eventData[$idx]['body']);
+ unset($eventData[$idx]['extended']);
+ unset($eventData[$idx]['exflag']);
+ }
+ }
+ }
+ return true;
+ break;
+
case 'backend_plugins_new_instance':
// This hook will always push the entryproperties plugin as last in queue.
// Happens always when a new plugin is added.