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 #17703 by hollow_83
Ordering by field and newest date was created by hollow_83
Hi. I have modified the view.html.php file so i can see the ads i create sorted by a specific custom field. The code i have used is this:

$order = $app->getUserStateFromRequest('com_adsmanager.front_content.order','order',19,'int');

This is working perfectly but i would like the ads to be sorted by newest and not by the oldest.

What i mean.

Right i now it sorts the ads corectly based on what i have selected on the custom field but puts the older first.

So i want them to be sorted by the field i've create and also by newest date.

Thanks in advance.
More
10 years 9 months ago #17704 by hollow_83
Replied by hollow_83 on topic Ordering by field and newest date
Sorry for posting this at the wrong section.
More
10 years 9 months ago - 10 years 9 months ago #17710 by loic
Replied by loic on topic Ordering by field and newest date
Hello,

You need to add this line:
$orderdir = $app->getUserStateFromRequest('com_adsmanager.front_content.orderdir','orderdir','ASC');

Best regards.
Last edit: 10 years 9 months ago by loic.
More
10 years 9 months ago - 10 years 9 months ago #17719 by hollow_83
Replied by hollow_83 on topic Ordering by field and newest date
Doing this completely reverses the order.

Let me be more clear.

Field 19 is a member type field with three levels. (Simple, Gold, Platinum).

I want them to be sorted by member level (platinum's first) and each of them to be ordered by date.

for example right now my ordering configuration is the following:

Platinum 1 -> 20/12/2015
Platinum 2 -> 21/12/2015
Gold 1 -> 20/12/2015
Gold 2 -> 21/12/2015
Simple 1 -> 20/12/2015
Simple 2 -> 21/12/2015

I want the dates to be ordered from the new to the old.

Platinum 2 -> 21/12/2015
Platinum 1 -> 20/12/2015
Gold 2 -> 21/12/2015
Gold 1 -> 20/12/2015
Simple 2 -> 21/12/2015
Simple 1 -> 20/12/2015
Last edit: 10 years 9 months ago by hollow_83.
More
10 years 9 months ago #17754 by tompap
Replied by tompap on topic Ordering by field and newest date
If you order by field DESC

what happen

for platinum what value did you set (must be something like 2) then 1 for gold and simple 0.

Then I don't remember (I am not at office right now), but I think the second order by date is automatic if not in the components/models/content.php
there is a sqlfilterorder function that you will see do the SQL ordering
you should add something like $field DESC, id DESC
More
10 years 9 months ago #17943 by hollow_83
Replied by hollow_83 on topic Ordering by field and newest date
Hi i've tried making the change to make it order by date also (newest to oldest) but cannot find a solution.

Is there any easy way to do it?
Moderators: perry
Time to create page: 0.080 seconds
Powered by Kunena Forum