<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/spyc.php</filename>
    </added>
    <added>
      <filename>content/2008/06/29/1214718883</filename>
    </added>
    <added>
      <filename>content/2008/06/29/1214718999</filename>
    </added>
    <added>
      <filename>content/2008/06/29/1214719018</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,17 @@
 password: secret
 your_name: Trey Piepmeier
+
+ext: &quot;.markdown&quot;
+month_names:
+  1: January
+  2: February
+  3: March
+  4: April
+  5: May
+  6: June
+  7: July
+  8: August
+  9: September
+  10: October
+  11: November
+  12: December</diff>
      <filename>app/config.yaml</filename>
    </modified>
    <modified>
      <diff>@@ -3,39 +3,31 @@
 define('APP_DIR',     dirname(__FILE__).'/');
 define('PUBLIC_DIR',  dirname(__FILE__).'/../public/');
 define('CONTENT_DIR', dirname(__FILE__).'/../content/');
-define('EXT',         '.markdown');
 
-$month_names_en = array(
-	'1' =&gt; 'January',
-	'2' =&gt; 'February',
-	'3' =&gt; 'March',
-	'4' =&gt; 'April',
-	'5' =&gt; 'May',
-	'6' =&gt; 'June',
-	'7' =&gt; 'July',
-	'8' =&gt; 'August',
-	'9' =&gt; 'September',
-	'10' =&gt; 'October',
-	'11' =&gt; 'November',
-	'12' =&gt; 'December'
-	);
+require_once(APP_DIR.'spyc.php');
+$config = Spyc::YAMLLoad(APP_DIR.'config.yaml');
 
 require_once('markdown.php');
 
 foreach(scandir(CONTENT_DIR) as $year) {
 	$year_dir = CONTENT_DIR.$year;
-	if(is_dir($year_dir) &amp;&amp; preg_match(&quot;/\d\d\d\d/&quot;, $year)) {
+	if(preg_match(&quot;/\d\d\d\d/&quot;, $year) &amp;&amp; is_dir($year_dir)) {
 		$months = array();
-		foreach(scandir(CONTENT_DIR.$year) as $month) {
+		foreach(scandir($year_dir) as $month) {
 			$month_dir = $year_dir.'/'.$month;
-			if(is_dir($month_dir) &amp;&amp; preg_match(&quot;/\d\d/&quot;, $month)) {
+			if(preg_match(&quot;/\d\d/&quot;, $month) &amp;&amp; is_dir($month_dir)) {
 				$days = array();
-				foreach(scandir(CONTENT_DIR.$year.'/'.$month) as $file) {
-					$day = str_replace(EXT, '', $file);
-					$file_path = $month_dir.'/'.$file;
-					$date = &quot;$year-$month-$day&quot;;
-					if(is_file($file_path) &amp;&amp; preg_match(&quot;/\d\d/&quot;, $day)) {
-						$days[$day] = $date;
+				foreach(scandir($month_dir) as $day) {
+					$day_dir = $month_dir.'/'.$day;
+					if(preg_match(&quot;/\d\d/&quot;, $day) &amp;&amp; is_dir($day_dir)) {
+						$entries = array();
+						foreach(scandir($day_dir) as $entry) {
+							$entry_path = $day_dir.'/'.$entry;
+							if(is_file($entry_path) &amp;&amp; preg_match(&quot;/^\d{10,}$/&quot;, $entry)) {
+								$entries[$entry] = $entry_path;
+							}
+						}
+						$days[$day] = $entries;
 					}
 				}
 				$months[$month] = $days;
@@ -47,38 +39,28 @@ foreach(scandir(CONTENT_DIR) as $year) {
 
 // FUNCTIONS
 function get_month($month_number) {
-	global $month_names_en;
-	return $month_names_en[ltrim($month_number, '0')];
+	global $config;
+	return $config['month_names'][ltrim($month_number, '0')];
 }
 
-function get_entry() {
-	if(isset($_GET['date'])) {
-		if(!preg_match(&quot;/\d\d\d\d\-\d\d\-\d\d/&quot;, $date) === false) {
-			return &quot;No Entry Found&quot;;
+function get_entries($date) {
+	global $config;
+	global $years;
+	if(empty($date)) {
+		return &quot;Please choose and entry.&quot;;
+	} else {
+		if(preg_match(&quot;/\d{4}-\d{2}-\d{2}/&quot;, $date) == 0) {
+			return &quot;&lt;h1&gt;Invalid Date&lt;/h1&gt;&quot;;
 		} else {
-			$date_parts = explode('-', $_GET['date']);
-
-			$filelist = array();
-			$content = &quot;&lt;ul&gt;\n&quot;;
-			$url = $date_parts[0] . '/' . $date_parts[1] . '/' . $date_parts[2];
-			$dir = opendir(CONTENT_DIR . $url);
-			while ($file = readdir($dir)) {
-				if ( $file{0} == &quot;.&quot; )
-					continue;
-				$file = preg_replace('/(.*?)\.markdown/', '&lt;a href=&quot;/' . $url . '/\\1&quot;&gt;\\1&lt;/a&gt;', $file);
-				$content .= &quot;&lt;li&gt;$file&lt;/li&gt;\n&quot;;
-				array_push($filelist, $file);
+			list($y, $m, $d) = explode('-', $date);
+			$html = &quot;&lt;h1&gt;Entries for &quot;.date(&quot;l, F j, Y&quot;, strtotime(&quot;$y-$m-$d&quot;)).&quot;&lt;/h1&gt;&quot;;
+			foreach($years[$y][$m][$d] as $entry =&gt; $path) {
+				$time = date('g:i:s a', $entry);
+				$html .= &quot;&lt;h2 class='timestamp'&gt;$time&lt;/h2&gt;&quot;;
+				$html .= Markdown(file_get_contents($path));
 			}
-			closedir($dir);
-			$content .= &quot;&lt;/ul&gt;\n&quot;;
-
-			return $content;
-			// return Markdown(file_get_contents(CONTENT_DIR.$date_parts[0].'/'.$date_parts[1].'/'.$date_parts[2].EXT));
+			return $html;
 		}
-	} else {
-		return &quot;Please choose and entry.&quot;;
 	}
 }
-
-
 ?&gt;
\ No newline at end of file</diff>
      <filename>app/load.php</filename>
    </modified>
    <modified>
      <diff>@@ -34,8 +34,8 @@
           &lt;?php foreach($months as $month=&gt;$days) { ?&gt;
           &lt;li class=&quot;month&quot;&gt;&lt;?php echo get_month($month); ?&gt;
             &lt;ul&gt;
-              &lt;?php foreach($days as $day=&gt;$date) { ?&gt;
-              &lt;li class=&quot;day&quot;&gt;&lt;a href=&quot;/?date=&lt;?php echo $date; ?&gt;&quot;&gt;&lt;?php echo date(&quot;l, \\t\h\e dS&quot;, strtotime(&quot;$year-$month-$day&quot;)); ?&gt;&lt;/a&gt;&lt;/li&gt;
+              &lt;?php foreach($days as $day=&gt;$entries) { ?&gt;
+              &lt;li class=&quot;day&quot;&gt;&lt;a href=&quot;/?date=&lt;?php echo &quot;$year-$month-$day&quot;; ?&gt;&quot;&gt;&lt;?php echo date(&quot;l, \\t\h\e dS&quot;, strtotime(&quot;$year-$month-$day&quot;)); ?&gt;&lt;/a&gt;&lt;/li&gt;
               &lt;?php } ?&gt;
             &lt;/ul&gt;
           &lt;/li&gt;
@@ -46,7 +46,7 @@
     &lt;/ul&gt;
   &lt;/div&gt;
   &lt;div id=&quot;entries&quot;&gt;
-    &lt;?php echo get_entry(); ?&gt;
+    &lt;?php echo get_entries($_GET['date']); ?&gt;
   &lt;/div&gt;
 &lt;/div&gt;&lt;!--end #main--&gt;
 &lt;div id=&quot;footer&quot;&gt;</diff>
      <filename>public/index.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>403f9abf878a84eb575eb7affc45e6093a252075</id>
    </parent>
    <parent>
      <id>208f693701e11731e263487b343b3f0586131a36</id>
    </parent>
  </parents>
  <author>
    <name>Trey Piepmeier</name>
    <email>trey@sitening.com</email>
  </author>
  <url>http://github.com/trey/logbook/commit/05107714c2ac80e65cd302968fd4ba76cfc0e7dd</url>
  <id>05107714c2ac80e65cd302968fd4ba76cfc0e7dd</id>
  <committed-date>2008-06-29T11:31:24-07:00</committed-date>
  <authored-date>2008-06-29T11:31:24-07:00</authored-date>
  <message>Merge branch 'postpostmodern/master'

Conflicts:

	app/load.php</message>
  <tree>65e05df3a096098137e8cbeca62bb8e85b880ccf</tree>
  <committer>
    <name>Trey Piepmeier</name>
    <email>trey@sitening.com</email>
  </committer>
</commit>
