I'm at a bit of a loss on this one. I'm using the AheadWorks blog extension to add event posts for the current calendar year to my page. The extension also creates a feed of these posts, which I am feeding to Google Calendar. It is because of this that I use the dates of the events as the created dates, so they feed correctly to the Google Calendar. However, I can't figure out how to get Magento to display all posts; it only dislpays those with created dates from either the current day or sooner. I understand this is the default; how can I work around it so that all posts regardless of the created_time show?
I've seen several suggestions about changing the store time, and some that mention editing the created.php file, but I'm really not sure where to begin?
Could someone please give me an idea of what needs to be done?
Here's the app/code/community/AW/Blog/Block/Blog.php:
<?php
/**
* aheadWorks Co.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://ecommerce.aheadworks.com/AW-LICENSE.txt
*
* =================================================================
* MAGENTO EDITION USAGE NOTICE
* =================================================================
* This software is designed to work with Magento community edition and
* its use on an edition other than specified is prohibited. aheadWorks does not
* provide extension support in case of incorrect edition use.
* =================================================================
*
* @category AW
* @package AW_Blog
* @version 1.3.4
* @copyright Copyright (c) 2010-2012 aheadWorks Co. (http://www.aheadworks.com)
* @license http://ecommerce.aheadworks.com/AW-LICENSE.txt
*/
class AW_Blog_Block_Blog extends AW_Blog_Block_Abstract
{
public function getPosts()
{
$collection = parent::_prepareCollection();
$tag = $this->getRequest()->getParam('tag');
if ($tag) {
$collection->addTagFilter(urldecode($tag));
}
parent::_processCollection($collection);
return $collection;
}
protected function _prepareLayout()
{
if ($this->isBlogPage() && ($breadcrumbs = $this->getCrumbs())) {
parent::_prepareMetaData(self::$_helper);
$tag = $this->getRequest()->getParam('tag', false);
if ($tag) {
$tag = urldecode($tag);
$breadcrumbs->addCrumb(
'blog',
array(
'label' => self::$_helper->getTitle(),
'title' => $this->__('Return to ' . self::$_helper- >getTitle()),
'link' => $this->getBlogUrl(),
)
);
$breadcrumbs->addCrumb(
'blog_tag',
array(
'label' => $this->__('Tagged with "%s"', self::$_helper->convertSlashes($tag)),
'title' => $this->__('Tagged with "%s"', $tag),
)
);
} else {
$breadcrumbs->addCrumb('blog', array('label' => self::$_helper->getTitle()));
}
}
}
}
Here's the app/design/frontend/[theme]/[theme]/template/aw_blog/blog.phtml:
<?php
/**
* aheadWorks Co.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://ecommerce.aheadworks.com/AW-LICENSE.txt
*
* =================================================================
* MAGENTO EDITION USAGE NOTICE
* =================================================================
* This software is designed to work with Magento community edition and
* its use on an edition other than specified is prohibited. aheadWorks does not
* provide extension support in case of incorrect edition use.
* =================================================================
*
* @category AW
* @package AW_Blog
* @version 1.3.4
* @copyright Copyright (c) 2010-2012 aheadWorks Co. (http://www.aheadworks.com)
* @license http://ecommerce.aheadworks.com/AW-LICENSE.txt
*/
?><?php $posts = $this->getPosts(); ?>
<div id="messages_product_view">
<?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?>
<?php echo Mage::app()->getLayout()->getMessagesBlock()->getGroupedHtml(); ?>
</div>
<?php echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>
<?php foreach ($posts as $post): ?>
<div class="postWrapper">
<div class="postTitle">
<h2><a href="<?php echo $post->getAddress(); ?>" ><?php echo $post->getTitle(); ?></a></h2>
<h3><?php echo $post->getCreatedTime(); ?></h3>
</div>
<div class="postContent">
<?php echo $post->getPostContent(); ?>
</div>
<?php echo $this->getBookmarkHtml($post) ?>
<div class="tags"><?php echo $this->getTagsHtml($post) ?></div>
<div class="postDetails">
<?php if ($this->getCommentsEnabled()): ?>
<?php echo $post->getCommentCount(); ?> <a href="<?php echo $post->getAddress(); ?>#commentBox" > <?php echo Mage::helper('blog')->__('Comments'); ?></a> |
<?php endif; ?>
<?php $postCats = $post->getCats(); ?>
<?php if (!empty($postCats)): ?>
<?php echo Mage::helper('blog')->__('Posted in'); ?>
<?php foreach ($postCats as $data): ?>
<a href="<?php echo $data['url']; ?>"><?php echo $data['title']; ?></a>
<?php endforeach; ?>
<?php else: ?>
<?php echo Mage::helper('blog')->__('Posted'); ?>
<?php endif; ?><?php echo $this->__("By"); ?> <?php echo $post->getUser(); ?></div>
</div>
<?php endforeach; ?>
<?php echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>