aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog/views')
-rw-r--r--mod/blog/views/default/blog/sidebar_menu.php46
1 files changed, 33 insertions, 13 deletions
diff --git a/mod/blog/views/default/blog/sidebar_menu.php b/mod/blog/views/default/blog/sidebar_menu.php
index d4f67ec98..bd348c7e6 100644
--- a/mod/blog/views/default/blog/sidebar_menu.php
+++ b/mod/blog/views/default/blog/sidebar_menu.php
@@ -23,23 +23,43 @@ All blogs:
Owned blogs;
Archives
-
-
-
*/
$loggedin_user = get_loggedin_user();
$page_owner = page_owner_entity();
- // include a view for plugins to extend
- echo elgg_view("blogs/sidebar", array("object_type" => 'blog'));
+// include a view for plugins to extend
+echo elgg_view("blogs/sidebar", array("object_type" => 'blog'));
+
+// fetch & display latest comments on all blog posts
+$comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc");
+echo elgg_view('annotation/latest_comments', array('comments' => $comments));
+
+if ($dates = get_entity_dates('object', 'blog', page_owner())) {
+ echo elgg_view_title(elgg_echo('blog:archives'));
+
+ echo '<ul>';
+ 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));
+
+ if (!isset($page_owner)) $page_owner = page_owner_entity();
+ $link = $CONFIG->wwwroot . 'pg/blog/' . $page_owner->username . '/archive/' . $timestamplow . '/' . $timestamphigh;
+ //add_submenu_item(sprintf(elgg_echo('date:month:' . substr($date,4,2)), substr($date, 0, 4)), $link, 'filter');
+ $month = sprintf(elgg_echo('date:month:' . substr($date,4,2)), substr($date, 0, 4));
+ echo "<li><a href=\"$link\" title=\"$month\">$month</a><li>";
+ }
+
+ echo '</ul>';
+}
+
- // fetch & display latest comments on all blog posts
- $comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc");
- echo elgg_view('annotation/latest_comments', array('comments' => $comments));
+// temporarily force tag-cloud display
+$tags = display_tagcloud(0, 100, 'tags');
+echo <<<___END
+<h3>Tagcloud</h3>
+<div class="tagcloud sidebar">$tags</div>
+<a href="{$vars['url']}mod/tagcloud/tagcloud.php">All site tags</a>
+___END;
- // temporarily force tag-cloud display
- echo "<h3>Tagcloud</h3>";
- echo "<div class='tagcloud sidebar'>".display_tagcloud(0, 100, 'tags')."</div>";
- echo "<a href=\"{$vars['url']}mod/tagcloud/tagcloud.php\">All site tags</a>";
-?>
+?> \ No newline at end of file