jDownloadsownloads.com


Author Topic: Category list: how is it sorted?  (Read 4550 times)

0 Members and 1 Guest are viewing this topic.

Offline HerKle

  • Newbie
  • *
  • Posts: 23
Category list: how is it sorted?
« on: 24.08.2013 16:45:05 »
Hi,
I want to list the 5 "hottest" downloads of a single category.
So far I can just choose between the five hottest of all categories or the ID of one category.

Is it possible to combine these two features, something like {jd_file category==1 hottest==5}?

This would require some function "jd_file_category_hottest" in the sourcecode. Unfortunately I don't know how to write the correct code for this.
Is there anyone who could help with this?

Thanks in advance!
Regards,
Herbert

Offline Arno

  • Administrator
  • ***
  • Posts: 12.271
    • jDownloads.com
Re: Category list: how is it sorted?
« Reply #1 on: 25.08.2013 10:05:16 »
Hi Herbert,
the content plugin is basicly not develop from me.
So i can not say, whether this is possible or not.
But i think you must use this syntax to get it:
Code: [Select]
{jd_file category==1} {jd_file hottest==5}
See pic from older developer page.

[gelöscht durch Administrator]
« Last Edit: 25.08.2013 10:07:38 by Arno »
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline HerKle

  • Newbie
  • *
  • Posts: 23
Re: Category list: how is it sorted?
« Reply #2 on: 25.08.2013 11:41:20 »
Hi Arno,

but this doesn't work. This code shows all downloads of the defined category (ignoring the number "5"), sorted by their id.

Thanks anyway for the attempt.

Regards,
Herbert

Offline Arno

  • Administrator
  • ***
  • Posts: 12.271
    • jDownloads.com
Re: Category list: how is it sorted?
« Reply #3 on: 25.08.2013 11:46:57 »
Hm...
are then the first viewed downloads the 'hottest' ? So the sort order is correct?  ::)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline HerKle

  • Newbie
  • *
  • Posts: 23
Re: Category list: how is it sorted?
« Reply #4 on: 25.08.2013 11:59:08 »
No, as I wrote, they are sorted ascending by their id number.

Offline HerKle

  • Newbie
  • *
  • Posts: 23
Re: Category list: how is it sorted?
« Reply #5 on: 25.08.2013 13:58:49 »
Ok. I found a solution:

In plugins/content/jdownloads/jdownloads.php

I added to the
Code: [Select]
switch ($jdf_whatcontent)
a new case 'cat_hottest':

Code: [Select]
    case 'cat_hottest':
      $id_result = jd_file_cat_hottest($matches);
      break;

and copied the function jd_file_createcategory into the new function jd_file_cat_hottest.

There I replaced the string 'ORDER BY ordering' into 'ORDER BY downloads DESC'.

So now in the frontend/backend article you have to fill in e.g.
Code: [Select]
{jd_file cat_hottest==1 count==5}if you wish to show the five most downloaded downloads in category id number one.

Hope that helps!

Regards,
Herbert

Offline Arno

  • Administrator
  • ***
  • Posts: 12.271
    • jDownloads.com
Re: Category list: how is it sorted?
« Reply #6 on: 27.08.2013 19:14:40 »
Hi Herbert,
nice modification. I think i will also add this also in public release.  ;) 8)

Edit:
okay i have it added now and published - also added the new parameter: cat_latest

See pic with example.

[gelöscht durch Administrator]
« Last Edit: 28.08.2013 00:03:58 by Arno »
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline xxx83

  • Newbie
  • *
  • Posts: 1
    • Kapıda ödeme Alışveriş
Re: Category list: how is it sorted?
« Reply #7 on: 26.01.2014 01:29:36 »
thank you very much