Dear Mohammed Elmak,
I have just updated this issue directly on your site.
Please check the "sort order by" feature of k2 modules again.
Guide: go to "plugins\system\sjcore\core\sjclass\components\k2.php", finding:
public function getItemsIn($cids, $params){
$db = &JFactory::getDbo();
$now = JFactory::getDate()->toMySQL();
$nulldate = $db->getNullDate();
if (is_array($cids)){
$category_filter_set = implode(',', $cids);
}
$query = "
SELECT e.id
FROM #__k2_items AS e
WHERE
e.published IN (1)
AND e.trash IN (0)
AND e.catid IN ($category_filter_set)
" . ($this->_getContentAccessFilter() ? 'AND '.$this->_getContentAccessFilter() : '') . " -- Access condition
AND (e.publish_up = {$db->quote($nulldate)} OR e.publish_up <= {$db->quote($now)})
AND (e.publish_down = {$db->quote($nulldate)} OR e.publish_down >= {$db->quote($now)})
AND e.language IN ({$db->quote(JFactory::getLanguage()->getTag())} , {$db->quote('*')})
{$this->_itemFilter($params)}
GROUP BY e.id
ORDER BY {$this->_itemOrders($params)}
{$this->_queryLimit($params)}
";
$db->setQuery($query);
$ids = $db->loadResultArray();
return $ids;
}
change to
public function getItemsIn($cids, $params){
$db = &JFactory::getDbo();
$now = JFactory::getDate()->toMySQL();
$nulldate = $db->getNullDate();
if (is_array($cids)){
$category_filter_set = implode(',', $cids);
}
$query = "
SELECT e.id
FROM #__k2_items AS e
WHERE
e.published IN (1)
AND e.trash IN (0)
AND e.catid IN ($category_filter_set)
" . ($this->_getContentAccessFilter() ? 'AND '.$this->_getContentAccessFilter() : '') . " -- Access condition
AND (e.publish_up = {$db->quote($nulldate)} OR e.publish_up <= {$db->quote($now)})
AND (e.publish_down = {$db->quote($nulldate)} OR e.publish_down >= {$db->quote($now)})
AND e.language IN ({$db->quote(JFactory::getLanguage()->getTag())} , {$db->quote('*')})
{$this->_itemFilter($params)}
ORDER BY {$this->_itemOrders($params)}
{$this->_queryLimit($params)}
";
$db->setQuery($query);
$ids = $db->loadResultArray();
return $ids;
}
Thanks