From db75ac642a6ff62e814929af99e7c9af4d492706 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 4 Sep 2010 13:40:39 -0700 Subject: Use the title of the root album as the site title for all RSS feeds. Fixes ticket #1307. --- modules/comment/helpers/comment_rss.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/comment/helpers') diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index 26d98d21..cc4180bf 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -57,13 +57,19 @@ class comment_rss_Core { "thumb_height" => $item->thumb_height, "thumb_width" => $item->thumb_width, "item_uri" => url::abs_site("{$item->type}s/$item->id"), - "title" => html::purify($item->title), + "title" => ( + ($item->id == item::root()->id) ? + html::purify($item->title) : + t("%site_title - %item_title", + array("site_title" => item::root()->title, + "item_title" => $item->title))), "author" => html::clean($comment->author_name())), ArrayObject::ARRAY_AS_PROPS); } $feed->max_pages = ceil($comments->count_all() / $limit); - $feed->title = htmlspecialchars(t("Recent Comments")); + $feed->title = html::purify(t("%site_title - Recent Comments", + array("site_title" => item::root()->title))); $feed->uri = url::abs_site("albums/" . (empty($id) ? "1" : $id)); $feed->description = t("Recent comments"); -- cgit v1.2.3 From 3e3098956c2cd20bef7f1861e58cbe98f9b9de63 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 16 Sep 2010 14:19:28 -0700 Subject: Convert the guest_url ORM validation failure back to the url form parameter and put in a message requiring a valid url. Fixes ticket --- modules/comment/controllers/comments.php | 1 + modules/comment/helpers/comment.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/comment/helpers') diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index ff0e9ce1..ded9743e 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -45,6 +45,7 @@ class Comments_Controller extends Controller { switch ($key) { case "guest_name": $key = "name"; break; case "guest_email": $key = "email"; break; + case "guest_url": $key = "url"; break; } $form->add_comment->inputs[$key]->add_error($error, 1); } diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index 7aa007cb..958f2f3d 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -38,7 +38,8 @@ class comment_Core { ->error_messages("invalid", t("You must enter a valid email address")); $group->input("url") ->label(t("Website (hidden)")) - ->id("g-url"); + ->id("g-url") + ->error_messages("url", t("You must enter a valid url")); $group->textarea("text") ->label(t("Comment")) ->id("g-text") -- cgit v1.2.3