Permalink
Browse files

Changed name of get_entry function to get_entries

  • Loading branch information...
postpostmodern committed Jun 29, 2008
1 parent 9d8ae33 commit 208f693701e11731e263487b343b3f0586131a36
Showing with 7 additions and 7 deletions.
  1. +6 −6 app/load.php
  2. +1 −1 public/index.php
View
@@ -44,14 +44,16 @@ function get_month($month_number) {
return $config['month_names'][ltrim($month_number, '0')];
}
- function get_entry() {
+ function get_entries($date) {
global $config;
global $years;
- if(isset($_GET['date'])) {
- if(preg_match("/\d{4}-\d{2}-\d{2}/", $_GET['date']) == 0) {
+ if(empty($date)) {
+ return "Please choose and entry.";
+ } else {
+ if(preg_match("/\d{4}-\d{2}-\d{2}/", $date) == 0) {
return "<h1>Invalid Date</h1>";
} else {
- list($y, $m, $d) = explode('-', $_GET['date']);
+ list($y, $m, $d) = explode('-', $date);
$html = "<h1>Entries for ".date("l, F j, Y", strtotime("$y-$m-$d"))."</h1>";
foreach($years[$y][$m][$d] as $entry => $path) {
$time = date('g:i:s a', $entry);
@@ -60,8 +62,6 @@ function get_entry() {
}
return $html;
}
- } else {
- return "Please choose and entry.";
}
}
View
@@ -46,7 +46,7 @@
</ul>
</div>
<div id="entries">
- <?php echo get_entry(); ?>
+ <?php echo get_entries($_GET['date']); ?>
</div>
</div><!--end #main-->
<div id="footer">

0 comments on commit 208f693

Please sign in to comment.