special product display in magento

make special.php file into catalog/block/product/view/ and call block bye type product/view_special
for example
<block type="product/view_special" temaplate="catalog/product/list.phtml"/>
 
<?php
//Code
class Mage_Catalog_Block_Product_Special extends Mage_Catalog_Block_Product_List
{
   function get_prod_count()
   {
      //unset any saved limits
      Mage::getSingleton('catalog/session')->
unsLimitPage();
      return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 12;
   }// get_prod_count

   function get_cur_page()
   {
      return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
   }// get_cur_page

   /**
    * Retrieve loaded category collection
    *
    * @return Mage_Eav_Model_Entity_Collection_Abstract
   **/
   protected function _getProductCollection()
   {
      $todayDate = date('m/d/y');
      $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));
      $tomorrowDate = date('m/d/y', $tomorrow);


           
        $collection = Mage::getResourceModel('catalogsearch/advanced_collection')
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addMinimalPrice()
            ->addStoreFilter();
      
        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
      
        $collection->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
            ->addAttributeToFilter('special_to_date', array('or'=> array(
            0 => array('date' => true, 'from' => $tomorrowDate),
            1 => array('is' => new Zend_Db_Expr('null')))
            ), 'left');


      $this->setProductCollection($collection);

      return $collection;
   }



   public function getLoadedProductCollection()
    {
        return $this->_getProductCollection();
    }
}



<!-- and then put _special into block type -->

Comments