Skip to content

Commit

Permalink
Homepage|Fixed: Indicating recent entries in news/blog post list
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed May 1, 2017
1 parent a75939d commit f223711
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web2/include/template.inc.php
Expand Up @@ -14,8 +14,8 @@ function starts_with($needle, $haystack)
function timestamp_from_date($date_text)
{
$date = date_parse($date_text);
$ts = mktime($date['hour'], $date['minute'], $date['second'],
$date['month'], $date['day'], $date['year']);
$ts = gmmktime($date['hour'], $date['minute'], $date['second'],
$date['month'], $date['day'], $date['year']);
return $ts;
}

Expand Down Expand Up @@ -231,8 +231,8 @@ function generate_blog_post_cached($post, $css_class)
$html = "<a class='blog-link' href='$post->url'>$post->title</a> "
."<time datetime='$post->date' pubdate>&middot; $nice_date</time>";
$itemclass = '';
if (time() - timestamp_from_date($post->date) < RECENT_THRESHOLD) {
$itemclas = 'recent';
if (time() - RECENT_THRESHOLD < timestamp_from_date($post->date)) {
$itemclass = 'recent';
}
cache_echo("<li class='$itemclass'>".$html.'</li>');
}
Expand Down

0 comments on commit f223711

Please sign in to comment.