public function _toHtml() { $keyword = $this->getRequest()->getParam("search_query"); $keyword = trim($keyword); $this->assign("keyword", $keyword); return parent::_toHtml(); }
public function _toHtml() { if (!$this->getConfig("enable_cmenumodule")) { return; } $menu = Mage::getModel("ves_blog/category")->getCollection()->addFieldToFilter('is_active', 1)->addFieldToFilter('parent_id', (int) $this->getConfig("cmenu_parent"))->setOrder("position", "DESC"); $this->assign('menus', $menu); return parent::_toHtml(); }
public function _toHtml() { if (!$this->getConfig("enable_latest_comment")) { return; } $collection = Mage::getModel('ves_blog/comment')->getCollection(); $store_id = Mage::app()->getStore()->getId(); if ($store_id) { $collection->addStoreFilter($store_id); } //$collection->addCategoriesFilter(0); $collection->setOrder('created', 'DESC'); $collection->setPageSize($this->getConfig("latest_comment_limit"))->setCurPage(1); $this->assign('comments', $collection); return parent::_toHtml(); }
public function _toHtml() { if (!$this->getConfig("enable_latestmodule")) { return; } $collection = Mage::getModel('ves_blog/post')->getCollection(); $collection->addCategoriesFilter(0); if ($this->getConfig("latest_typesource") == "hit") { $collection->setOrder('hits', 'DESC'); } else { $collection->setOrder('created', 'DESC'); } $collection->setPageSize($this->getConfig("limit_items"))->setCurPage(1); $this->assign('posts', $collection); return parent::_toHtml(); }
public function _toHtml() { $collection = Mage::getModel("ves_blog/post")->getCollection(); $collection->getSelect()->columns(array('YEAR(created) AS blog_year', 'MONTH(created) AS blog_month', 'COUNT(*) AS blog_total')); $collection->addFieldToFilter('is_active', 1); $collection->getSelect()->group(array('blog_year', 'blog_month')); $posts = array(); if (count($collection) > 0) { foreach ($collection as $child) { if (!isset($posts[$child->getBlogYear()])) { $posts[$child->getBlogYear()] = array(); } $tmp = array(); $tmp['month'] = $child->getBlogMonth(); $tmp['month_name'] = date("F", mktime(0, 0, 0, $tmp['month'], 10)); $tmp['total'] = $child->getBlogTotal(); $posts[$child->getBlogYear()][] = $tmp; } } $this->assign('posts', $posts); return parent::_toHtml(); }
public function _toHtml() { $collection = Mage::getModel('ves_blog/post')->getCollection(); $collection->addPostTagFilter(); $collection->setOrder('created', 'DESC'); $tags = array(); if (count($collection) > 0) { foreach ($collection as $item) { $tmp_tags = $item->getTags(); $tmp_array_tags = explode(",", $tmp_tags); if ($tmp_array_tags) { foreach ($tmp_array_tags as $tag) { $tag = trim($tag); if (!isset($tags[$tag])) { $tags[$tag] = 1; } else { $tags[$tag] += 1; } } } } } $this->assign('tags', $tags); return parent::_toHtml(); }