Q:

Magento $_collection custom sorting new problems

i am loading my collection like this , inside a custom list.phtml that will load an extension
    $_productCollection=$this->getLoadedProductCollection();
        $_helper = $this->helper('catalog/output');
        $listHelper = Mage::helper('customodule);

?>
<?php if(!$_productCollection->count()): ?>

how i can call also sorting in collection with this method?
i know how to do it with another method but i need to use the 1st
other method:
<?php  $todayDate  = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);

$_productCollection = Mage::getModel('catalog/product')

                    ->getCollection()
                    ->addCategoryFilter(Mage::getModel('catalog/category')->load(4))
                    ->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))
                    ->addAttributeToFilter('news_to_date', array('or'=> array(
                        0 => array('date' => true, 'from' => $todayDate),
                        1 => array('is' => new Zend_Db_Expr('null')))
                    ), 'left')
                    ->addAttributeToSort('news_from_date', 'desc')
                    ->addAttributeToSelect(array('name','url','small_image','price'))
                        ->setPage(1, 10) 
                    ->addAttributeToSort('created_at', 'desc')

                   ?>

<?php if(!$_productCollection->count()): ?>

A:

Assuming Mage_Catalog_Product_List::getLoadedProductCollection() is used for the first collection, than the difference between those two collections is, that the first one usually will have its products already been loaded, so trying to SQL filter/sort them afterwards would be pretty pointless.
In standard Magento the call stack of this method roughly looks like this:
Mage_Catalog_Product_List::getLoadedProductCollection()
Mage_Catalog_Product_List::_getProductCollection()
Mage_Catalog_Model_Layer::getProductCollection()

That means, you'd need to override Mage_Catalog_Model_Layer::getProductCollection(), if you want to change the SQL filtering/sorting the way you want it.
Alternatively you could also put your collection into some array first and sort it using PHP. 

