Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

SJ Mega K2 News and Sort Order By
(1 viewing) (1) Guest

TOPIC: SJ Mega K2 News and Sort Order By

Re: SJ Mega K2 News and Sort Order By 12 years ago #5939

  • loitt
  • OFFLINE
  • Platinum Boarder
  • Posts: 2222
  • Karma: 48
Dear Mohammed Elmak,

Please check your ticket again.

Thanks
Ticket System | Join our Clubs to download our extensions and templates

Re: SJ Mega K2 News and Sort Order By 12 years ago #5946

Please see my ticket again.

Thanks.

Re: SJ Mega K2 News and Sort Order By 11 years, 12 months ago #6024

Please see my ticket .

Thanks.

Re: SJ Mega K2 News and Sort Order By 11 years, 12 months ago #6055

  • loitt
  • OFFLINE
  • Platinum Boarder
  • Posts: 2222
  • Karma: 48
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
Ticket System | Join our Clubs to download our extensions and templates
Last Edit: 11 years, 12 months ago by loitt.
Time to create page: 0.30 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes