Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed name of get_entry function to get_entries

  • Loading branch information...
commit 208f693701e11731e263487b343b3f0586131a36 1 parent 9d8ae33
@postpostmodern authored
Showing with 7 additions and 7 deletions.
  1. +6 −6 app/load.php
  2. +1 −1  public/index.php
View
12 app/load.php
@@ -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
2  public/index.php
@@ -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">
Please sign in to comment.
Something went wrong with that request. Please try again.