Skip to content

Commit

Permalink
Change all-time to 30 days and fix canonical url issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kalenjordan committed Jan 21, 2015
1 parent 47d7185 commit 8622a1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/Controller/PostList.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ protected function _getPosts()

if (! isset($_GET['period']) || $_GET['period'] != 'all-time') {
$select->where("posts.created_at > DATE_SUB(NOW(), INTERVAL $recentTimePeriod)");
} else {
$select->where("posts.created_at > DATE_SUB(NOW(), INTERVAL 1 MONTH)");
}

$postRows = $this->_getContainer()->LocalConfig()->database()->fetchAll($select);
Expand Down
2 changes: 2 additions & 0 deletions template/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
{% block additional_head %} {% endblock %}
<meta name="description" content="Latest news from Magento developers across the globe."</meta>
<meta name="robots" content="index,follow">
<!-- commenting out for now - this needs to be updated for post url's
<link rel="canonical" href="http://magehero.com" />
-->
<link rel="icon" href="/favicon.ico" type="image/x-icon"/>
{% endblock %}
</head>
Expand Down
2 changes: 1 addition & 1 deletion template/post_list.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'base.html.twig' %}

{% block content %}
<h2 title="All MageHero posts from the last 7 day rolling period">This Week <span class="filter"><a href="/?period=all-time">all time</a></span></h2>
<h2 title="All MageHero posts from the last 7 day rolling period">This Week <span class="filter"><a href="/?period=all-time">last 30 days</a></span></h2>
<ul class="listing">
{% for post in posts %}
<li class="listing-post">
Expand Down

0 comments on commit 8622a1a

Please sign in to comment.