From b18e603a928801d5a3d9f2847e03a96307937e19 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 23 Dec 2011 23:01:08 -0500 Subject: Fixes #3751 adds a group blog archive page --- mod/blog/views/default/blog/sidebar.php | 2 +- mod/blog/views/default/blog/sidebar/archives.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'mod/blog/views') diff --git a/mod/blog/views/default/blog/sidebar.php b/mod/blog/views/default/blog/sidebar.php index 97a23c17e..0ae2b431c 100644 --- a/mod/blog/views/default/blog/sidebar.php +++ b/mod/blog/views/default/blog/sidebar.php @@ -18,7 +18,7 @@ if ($vars['page'] == 'all') { } // only users can have archives at present -if (elgg_instanceof(elgg_get_page_owner_entity(), 'user')) { +if ($vars['page'] == 'owner' || $vars['page'] == 'group') { echo elgg_view('blog/sidebar/archives', $vars); } diff --git a/mod/blog/views/default/blog/sidebar/archives.php b/mod/blog/views/default/blog/sidebar/archives.php index 3aa3db44f..3d8f28ca4 100644 --- a/mod/blog/views/default/blog/sidebar/archives.php +++ b/mod/blog/views/default/blog/sidebar/archives.php @@ -6,6 +6,12 @@ $loggedin_user = elgg_get_logged_in_user_entity(); $page_owner = elgg_get_page_owner_entity(); +if (elgg_instanceof($page_owner, 'user')) { + $url_segment = 'blog/archive/' . $page_owner->username; +} else { + $url_segment = 'blog/group/' . $page_owner->getGUID() . '/archive'; +} + // This is a limitation of the URL schema. if ($page_owner && $vars['page'] != 'friends') { $dates = get_entity_dates('object', 'blog', $page_owner->getGUID()); @@ -13,11 +19,11 @@ if ($page_owner && $vars['page'] != 'friends') { if ($dates) { $title = elgg_echo('blog:archives'); $content = '