aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/blog/lib/blog.php13
-rw-r--r--mod/blog/start.php6
-rw-r--r--mod/blog/views/default/blog/sidebar.php2
-rw-r--r--mod/blog/views/default/blog/sidebar/archives.php10
4 files changed, 23 insertions, 8 deletions
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 590547a8c..286fe1832 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -187,11 +187,16 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
$now = time();
- $user = get_user($owner_guid);
+ $owner = get_entity($owner_guid);
elgg_set_page_owner_guid($owner_guid);
- $crumbs_title = $user->name;
- elgg_push_breadcrumb($crumbs_title, "blog/owner/{$user->username}");
+ $crumbs_title = $owner->name;
+ if (elgg_instanceof($owner, 'user')) {
+ $url = "blog/owner/{$owner->username}";
+ } else {
+ $url = "blog/group/$owner->guid/all";
+ }
+ elgg_push_breadcrumb($crumbs_title, $url);
elgg_push_breadcrumb(elgg_echo('blog:archives'));
if ($lower) {
@@ -209,7 +214,7 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
);
if ($owner_guid) {
- $options['owner_guid'] = $owner_guid;
+ $options['container_guid'] = $owner_guid;
}
// admin / owners can see any posts
diff --git a/mod/blog/start.php b/mod/blog/start.php
index 53a4dcadf..90a800799 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -136,7 +136,11 @@ function blog_page_handler($page) {
$params = blog_get_page_content_edit($page_type, $page[1], $page[2]);
break;
case 'group':
- $params = blog_get_page_content_list($page[1]);
+ if ($page[2] == 'all') {
+ $params = blog_get_page_content_list($page[1]);
+ } else {
+ $params = blog_get_page_content_archive($page[1], $page[3], $page[4]);
+ }
break;
case 'all':
$params = blog_get_page_content_list();
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 = '<ul class="blog-archives">';
- foreach($dates as $date) {
+ foreach ($dates as $date) {
$timestamplow = mktime(0, 0, 0, substr($date,4,2) , 1, substr($date, 0, 4));
$timestamphigh = mktime(0, 0, 0, ((int) substr($date, 4, 2)) + 1, 1, substr($date, 0, 4));
- $link = elgg_get_site_url() . 'blog/archive/' . $page_owner->username . '/' . $timestamplow . '/' . $timestamphigh;
+ $link = elgg_get_site_url() . $url_segment . '/' . $timestamplow . '/' . $timestamphigh;
$month = elgg_echo('date:month:' . substr($date, 4, 2), array(substr($date, 0, 4)));
$content .= "<li><a href=\"$link\" title=\"$month\">$month</a></li>";
}