diff options
Diffstat (limited to 'mod/blog/views/default/blog/archive.php')
-rw-r--r-- | mod/blog/views/default/blog/archive.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mod/blog/views/default/blog/archive.php b/mod/blog/views/default/blog/archive.php new file mode 100644 index 000000000..76ae16696 --- /dev/null +++ b/mod/blog/views/default/blog/archive.php @@ -0,0 +1,22 @@ +<?php +//get blog archives +global $CONFIG; +if (!defined('everyoneblog') && page_owner()) { + echo "<div class='SidebarBox'>"; + echo "<h3>" . elgg_echo('blog:archive') ."</h3>"; + echo "<div class='ContentWrapper'><div id='Owner_Block_Links'><ul>"; + if ($dates = get_entity_dates('object','blog',page_owner())) { + 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; + //echo (sprintf(elgg_echo('date:month:'.substr($date,4,2)),substr($date,0,4)),$link,'filter'); + $year = substr($date,0,-2); + $month = date('F',mktime(0, 0, 0, substr($date,4,2), 1)); //substr($date,4,2); + $display_date = $month . " " . $year; + echo "<li><a href=\"{$link}\">" . $display_date . "</a></li>"; + } + } + echo "</ul></div></div></div>"; +}
\ No newline at end of file |