Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / Ordering by field and newest date

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

Ordering by field and newest date

More
10 years 9 months ago #17965 by tompap
Replied by tompap on topic Ordering by field and newest date
in models/content.php

replace and tell me if it's working
function getFilterOrder($order,$orderdir = 'DESC')
    {
	    if ($order != 0)
		{
			$this->_db->setQuery( "SELECT f.name,f.sort_direction,f.type FROM #__adsmanager_fields AS f WHERE f.fieldid=".(int)$order." AND f.published = 1" );
			$sort = $this->_db->loadObject();
			if ($sort == null) {
				$filter_order = "a.date_created DESC ,a.id ";
			} else if (($sort->type == "number")||($sort->type == "price")) {
				$filter_order = "a.".$sort->name." * 1";
			}
			else {
				$filter_order = "a.".$sort->name;
			}
		}
		else 
		{
			//a.ordering DESC TODO
			//$filter_order = "a.ordering DESC, a.date_created ".$orderdir." ,a.id ";
            $filter_order = "a.date_created ".$orderdir." ,a.id ";
		}
		return $filter_order;
    }

by
function getFilterOrder($order,$orderdir = 'DESC')
    {
	    if ($order != 0)
		{
			$this->_db->setQuery( "SELECT f.name,f.sort_direction,f.type FROM #__adsmanager_fields AS f WHERE f.fieldid=".(int)$order." AND f.published = 1" );
			$sort = $this->_db->loadObject();
			if ($sort == null) {
				$filter_order = "a.date_created DESC ,a.id ";
			} else if (($sort->type == "number")||($sort->type == "price")) {
				$filter_order = "a.".$sort->name." * 1 $orderdir,a.date_created DESC ,a.id ";
			}
			else {
				$filter_order = "a.".$sort->name."  $orderdir,a.date_created DESC ,a.id ";
			}
		}
		else 
		{
			//a.ordering DESC TODO
			//$filter_order = "a.ordering DESC, a.date_created ".$orderdir." ,a.id ";
            $filter_order = "a.date_created ".$orderdir." ,a.id ";
		}
		return $filter_order;
    }
The following user(s) said Thank You: adarr
Moderators: perry
Time to create page: 0.045 seconds
Powered by Kunena Forum