summaryrefslogtreecommitdiff
path: root/modules/rss
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rss')
-rw-r--r--modules/rss/controllers/rss.php8
-rw-r--r--modules/rss/helpers/rss_block.php (renamed from modules/rss/helpers/rss_theme.php)41
-rw-r--r--modules/rss/views/feed.mrss.php6
-rw-r--r--modules/rss/views/rss_block.html.php2
4 files changed, 34 insertions, 23 deletions
diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php
index 015d6032..1ecec9af 100644
--- a/modules/rss/controllers/rss.php
+++ b/modules/rss/controllers/rss.php
@@ -52,12 +52,14 @@ class Rss_Controller extends Controller {
$view->feed = $feed;
$view->pub_date = date("D, d M Y H:i:s T");
- $feed->uri = url::abs_site(Router::$current_uri);
+ $feed->uri = url::abs_site(str_replace("&", "&", url::merge($_GET)));
if ($page > 1) {
- $feed->previous_page_uri = url::abs_site(url::merge(array("page" => $page - 1)));
+ $feed->previous_page_uri =
+ url::abs_site(str_replace("&", "&", url::merge(array("page" => $page - 1))));
}
if ($page < $feed->max_pages) {
- $feed->next_page_uri = url::abs_site(url::merge(array("page" => $page + 1)));
+ $feed->next_page_uri =
+ url::abs_site(str_replace("&", "&amp;", url::merge(array("page" => $page + 1))));
}
rest::http_content_type(rest::RSS);
diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_block.php
index 3d1b9a29..8da45e98 100644
--- a/modules/rss/helpers/rss_theme.php
+++ b/modules/rss/helpers/rss_block.php
@@ -17,24 +17,33 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class rss_theme_Core {
- static function sidebar_blocks($theme) {
- $block = new Block();
- $block->css_id = "gRss";
- $block->title = t("Available RSS Feeds");
- $block->content = new View("rss_block.html");
- $block->content->feeds = array();
- foreach (module::active() as $module) {
- $class_name = "{$module->name}_rss";
- if (method_exists($class_name, "available_feeds")) {
- $block->content->feeds = array_merge(
- $block->content->feeds,
- call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag()));
+class rss_block_Core {
+ static function get_site_list() {
+ return array("rss_feeds" => t("Available RSS feeds"));
+ }
+
+ static function get($block_id, $theme) {
+ $block = "";
+ switch ($block_id) {
+ case "rss_feeds":
+ $feeds = array();
+ foreach (module::active() as $module) {
+ $class_name = "{$module->name}_rss";
+ if (method_exists($class_name, "available_feeds")) {
+ $feeds = array_merge($feeds,
+ call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag()));
+ }
}
+ if (!empty($feeds)) {
+ $block = new Block();
+ $block->css_id = "g-rss";
+ $block->title = t("Available RSS feeds");
+ $block->content = new View("rss_block.html");
+ $block->content->feeds = $feeds;
+ }
+ break;
}
- if ($block->content->feeds) {
- return $block;
- }
+ return $block;
}
}
diff --git a/modules/rss/views/feed.mrss.php b/modules/rss/views/feed.mrss.php
index 3612cbc0..5fce8699 100644
--- a/modules/rss/views/feed.mrss.php
+++ b/modules/rss/views/feed.mrss.php
@@ -26,11 +26,12 @@
<link><?= url::abs_site("{$child->type}s/{$child->id}") ?></link>
<guid isPermaLink="true"><?= url::abs_site("{$child->type}s/{$child->id}") ?></guid>
<pubDate><?= date("D, d M Y H:i:s T", $child->created); ?></pubDate>
+ <description><?= html::purify($child->description) ?></description>
<content:encoded>
<![CDATA[
<span><?= html::purify($child->description) ?></span>
<p>
- <? if ($child->type == "photo" || $child->type == "album"): ?>
+ <? if ($child->type == "photo"): ?>
<img alt="" src="<?= $child->resize_url(true) ?>"
title="<?= html::purify($child->title)->for_html_attr() ?>"
height="<?= $child->resize_height ?>" width="<?= $child->resize_width ?>" /><br />
@@ -45,12 +46,11 @@
]]>
</content:encoded>
<media:thumbnail url="<?= $child->thumb_url(true) ?>"
- fileSize="<?= @filesize($child->thumb_path()) ?>"
height="<?= $child->thumb_height ?>"
width="<?= $child->thumb_width ?>"
/>
<media:group>
- <? if ($child->type == "photo" || $child->type == "album"): ?>
+ <? if ($child->type == "photo"): ?>
<media:content url="<?= $child->resize_url(true) ?>"
fileSize="<?= @filesize($child->resize_path()) ?>"
type="<?= $child->mime_type ?>"
diff --git a/modules/rss/views/rss_block.html.php b/modules/rss/views/rss_block.html.php
index 737731b6..210c72a5 100644
--- a/modules/rss/views/rss_block.html.php
+++ b/modules/rss/views/rss_block.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<ul id="gFeeds">
+<ul id="g-feeds">
<? foreach($feeds as $url => $title): ?>
<li style="clear: both;">
<span class="ui-icon-left">