<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,6 +8,10 @@ $conf['dateprefix']   = '';           // prefix date to new entry IDs
 $conf['sortkey']      = 'cdate';      // sort key for blog entries
 $conf['sortorder']    = 'descending'; // ascending or descending
 
+$conf['showhistogram'] = 1;           // show histogramm in archive
+$conf['max_months']    = 100;         // max months to show in the histogram
+$conf['histogram_height'] = 50;       // height of the histogram in pixels
+
 $conf['excluded_pages'] = '!^blog:\d{4}(:\d{2})?$!'; // regex for pages to exclude from bloglisting
 
 // vim:ts=4:sw=4:et:enc=utf-8:</diff>
      <filename>conf/default.php</filename>
    </modified>
    <modified>
      <diff>@@ -15,4 +15,7 @@ $meta['sortorder']    = array('multichoice',
                          '_choices' =&gt; array('ascending', 'descending'));
 $meta['excluded_pages'] = array('string');
 
+$meta['showhistorgram'] = array('onoff');
+$meta['max_months'] = array('numeric');
+$meta['histogram_height'] = array('numeric');
 // vim:ts=4:sw=4:et:enc=utf-8:</diff>
      <filename>conf/metadata.php</filename>
    </modified>
    <modified>
      <diff>@@ -30,4 +30,7 @@ $lang['month_10'] = 'October';
 $lang['month_11'] = 'November';
 $lang['month_12'] = 'December';
 
+$lang['entries']       = 'entries';
+$lang['entry']         = 'entry';
+$lang['archive_title'] = 'Blog History';
 //Setup VIM: ex: et ts=2 enc=utf-8 :</diff>
      <filename>lang/en/lang.php</filename>
    </modified>
    <modified>
      <diff>@@ -28,4 +28,8 @@ $lang['sortorder_o_descending'] = 'descending';
 
 $lang['excluded_pages']         = 'exclude certain pages from blog listing (regular expression required)';
 
+$lang['showhistorgram']         = 'Display histogram on archive rendering';
+$lang['max_months']             = 'Max months to show in the histogram';
+$lang['histogram_height']       = 'Height of the histogram (in pixels)';
+
 // vim:ts=4:sw=4:et:enc=utf-8:</diff>
      <filename>lang/en/settings.php</filename>
    </modified>
    <modified>
      <diff>@@ -14,22 +14,27 @@ div.dokuwiki div.draft {
 }
 
 div.dokuwiki div.autoarchive_selector ul {
-    list-style-type: none;
-    clear: left;
-    margin: 0 0.5em 0 0;
+  list-style-type: none;
+  clear: left;
+  margin: 0 0.5em 0 0;
 }
 
 div.dokuwiki div.autoarchive_selector ul div.li {
-    float: left;
-    margin: 0 1em 0 0;
+  float: left;
+  margin: 0 1em 0 0;
 }
 
 div.dokuwiki div.autoarchive_selector ul ul {
-    float: left;
-    clear: none;
+  float: left;
+  clear: none;
 }
 
 div.dokuwiki div.autoarchive_selector ul ul div.li {
-    margin: 0;
+  margin: 0;
 }
 
+img.blog_archive_bar {
+  background-color: __border__;
+  width: 5px;
+  border: 0 none;
+}</diff>
      <filename>style.css</filename>
    </modified>
    <modified>
      <diff>@@ -114,26 +114,109 @@ class syntax_plugin_blog_archive extends DokuWiki_Syntax_Plugin {
         if (!$entries) return true; // nothing to display
 
         if ($mode == 'xhtml') {
+            // Configuration
+            $archive_mode = $this-&gt;getConf('archive_mode');
+            $max_months = $this-&gt;getConf('max_months');
+            $histogram_height = $this-&gt;getConf('histogram_height');
+
 
             // prevent caching for current month to ensure content is always fresh
             if (time() &lt; $end) $renderer-&gt;info['cache'] = false;
 
-            // let Pagelist Plugin do the work for us
-            if (plugin_isdisabled('pagelist')
-                    || (!$pagelist =&amp; plugin_load('helper', 'pagelist'))) {
-                msg($this-&gt;getLang('missing_pagelistplugin'), -1);
-                return false;
-            }
-            $pagelist-&gt;setFlags($flags);
-            $pagelist-&gt;startList();
-            foreach ($entries as $entry) {
-
-                // entry in the right date range?
-                if (($start &gt; $entry['date']) || ($entry['date'] &gt;= $end)) continue;
-
-                $pagelist-&gt;addPage($entry);
+            if ($this-&gt;getConf('showhistogram')) {
+                $current_year ='';
+                $current_month ='';
+                $ul_open = false;
+
+                $histogram = '';
+                $histogram_count = array();
+                $histogram_higher = 0;
+                $posts_count = 0;
+
+                $list = '';
+
+                // Generate posts list
+                foreach ($entries as $entry) {
+                    // entry in the right date range?
+                    if (($start &gt; $entry['date']) || ($entry['date'] &gt;= $end)) continue;
+
+                    if ($current_year != date('o',$entry['date'])) {
+                        if ($ul_open) {
+                            $list.=&quot;&lt;/ul&gt;&quot;;
+                            $ul_open = false;
+                        }
+                        $current_year = date('o',$entry['date']);
+                        $list.='&lt;h2&gt;'.$current_year.&quot;&lt;/h2&gt;&quot;;
+                    }
+                    if ($current_month != date('m',$entry['date'])) {
+                        if ($ul_open) {
+                            $list.=&quot;&lt;/ul&gt;&quot;;
+                        }
+                        $current_month = date('m',$entry['date']);
+                        $list.='&lt;h3 id=&quot;m'.date('o-m',$entry['date']).'&quot;&gt;'.$this-&gt;getLang('month_'.$current_month).&quot;&lt;/h3&gt;&lt;ul&gt;&quot;;
+                        $ul_open = true;
+                    }
+                    $posts_count += 1;
+                    $histogram_count[date('o-m',$entry['date'])] += 1;
+                    if ($histogram_higher &lt; $histogram_count[date('o-m',$entry['date'])]) {
+                        $histogram_higher = $histogram_count[date('o-m',$entry['date'])];
+                    }
+                    $list.='&lt;li&gt;'.date(&quot;d&quot;,$entry['date']).' - &lt;a href=&quot;'.wl($entry['id']).'&quot;&gt;'.$entry['title'].&quot;&lt;/a&gt;&lt;/li&gt;&quot;;
+                }
+                $list.=&quot;&lt;/ul&gt;&quot;;
+
+                if ($posts_count &gt; $max_posts) {
+                    $posts_count = $max_posts;
+                }
+                // Generate histogram
+                $histogram_count = array_reverse($histogram_count);
+                $month_count = 0;
+                foreach ($histogram_count as $key =&gt; $month_reference) {
+                    // Check the max_months parameter
+                    if ($month_count &gt;= $max_months) {
+                        break;
+                    }
+                    if ($month_reference &gt; 0) {
+                        // Height in &quot;px&quot;
+                        $current_height = $histogram_height / $histogram_higher * $month_reference;
+                    } else {
+                        // Height in &quot;px&quot;
+                        $current_height = 1;
+                    }
+                    // Generate the alt attribute
+                    $alt = $key.': '.$month_reference.' ';
+                    if ($month_reference &gt; 1) {
+                        $alt .= $this-&gt;getLang('entries');
+                    } else {
+                        $alt .= $this-&gt;getLang('entry');
+                    }
+                    $histogram .= '&lt;a href=&quot;#m'.$key.'&quot; title=&quot;#m'.$key.'&quot;&gt;';
+                    $histogram .= '&lt;img class=&quot;blog_archive_bar&quot; alt=&quot;'.$alt.'&quot; height=&quot;'.$current_height.&quot;\&quot; src=\&quot;/lib/images/blank.gif\&quot;/&gt;&lt;/a&gt;&quot; . DOKU_LF;
+                    $month_count += 1;
+                }
+                // Add histogram and posts list
+                $renderer-&gt;doc .= &quot;&lt;div class=\&quot;level1\&quot;&gt;&lt;h1&gt;&quot;.$this-&gt;getLang('archive_title').&quot;&lt;/h1&gt;&quot;.$histogram.'&lt;br/&gt;&lt;br/&gt;'.$list.'&lt;/div&gt;'; 
+            } else {
+                // prevent caching for current month to ensure content is always fresh
+                if (time() &lt; $end) $renderer-&gt;info['cache'] = false;
+
+                // let Pagelist Plugin do the work for us
+                if (plugin_isdisabled('pagelist')
+                        || (!$pagelist =&amp; plugin_load('helper', 'pagelist'))) {
+                    msg($this-&gt;getLang('missing_pagelistplugin'), -1);
+                    return false;
+                }
+                $pagelist-&gt;setFlags($flags);
+                $pagelist-&gt;startList();
+                foreach ($entries as $entry) {
+
+                    // entry in the right date range?
+                    if (($start &gt; $entry['date']) || ($entry['date'] &gt;= $end)) continue;
+
+                    $pagelist-&gt;addPage($entry);
+                }
+                $renderer-&gt;doc .= $pagelist-&gt;finishList();
             }
-            $renderer-&gt;doc .= $pagelist-&gt;finishList();
             return true;
 
             // for metadata renderer</diff>
      <filename>syntax/archive.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>848efc633e8cfab4382d551b74ef8f2e62edf598</id>
    </parent>
  </parents>
  <author>
    <name>Bernab&#233; Garc&#237;a</name>
    <email>dklight@gmail.com</email>
  </author>
  <url>http://github.com/dokufreaks/plugin-blog/commit/75115785100d87241ee3bd27a491fb9750654308</url>
  <id>75115785100d87241ee3bd27a491fb9750654308</id>
  <committed-date>2009-08-24T02:47:11-07:00</committed-date>
  <authored-date>2009-08-24T02:47:11-07:00</authored-date>
  <message>added histogram feature to archive</message>
  <tree>c662cfbbbf59438d65115d924ad35c32ee1f9072</tree>
  <committer>
    <name>Michael Klier</name>
    <email>chi@chimeric.de</email>
  </committer>
</commit>
