diff options
Diffstat (limited to 'mod/blog/views')
-rw-r--r-- | mod/blog/views/default/blog/group_module.php | 3 | ||||
-rw-r--r-- | mod/blog/views/default/blog/sidebar.php | 2 | ||||
-rw-r--r-- | mod/blog/views/default/blog/sidebar/archives.php | 10 | ||||
-rw-r--r-- | mod/blog/views/default/object/blog.php | 3 |
4 files changed, 14 insertions, 4 deletions
diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php index 028827178..6082cdafd 100644 --- a/mod/blog/views/default/blog/group_module.php +++ b/mod/blog/views/default/blog/group_module.php @@ -20,11 +20,12 @@ $options = array( 'type' => 'object', 'subtype' => 'blog', 'container_guid' => elgg_get_page_owner_guid(), + 'metadata_name_value_pairs' => array('name' => 'status', 'value' => 'published'), 'limit' => 6, 'full_view' => false, 'pagination' => false, ); -$content = elgg_list_entities($options); +$content = elgg_list_entities_from_metadata($options); elgg_pop_context(); if (!$content) { 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>"; } diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index 3525b3d48..aa8074a69 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -16,6 +16,9 @@ $owner = $blog->getOwnerEntity(); $container = $blog->getContainerEntity(); $categories = elgg_view('output/categories', $vars); $excerpt = $blog->excerpt; +if (!$excerpt) { + $excerpt = elgg_get_excerpt($blog->description); +} $owner_icon = elgg_view_entity_icon($owner, 'tiny'); $owner_link = elgg_view('output/url', array( |