jDownloadsownloads.com


Author Topic: Show All Downloads Sort by Hits as a URL / Link?  (Read 717 times)

0 Members and 1 Guest are viewing this topic.

Offline Nyx

  • Full Member
  • ***
  • Posts: 102
Show All Downloads Sort by Hits as a URL / Link?
« on: 04.03.2019 16:51:11 »
Hello,

I want make a button in the Module "Top downloads" for a Link to show All Downloads Sort by Hits.
The default Sort from jDownloads is by Date.

e.g. http://www.jdownloads.com/index.php/downloads/all.html

Sort only for this Link by "Hits" and not the default Sort from the jdownloads config.

e.g.:

Code: [Select]
echo $html = '<a href="/all" onclick="Joomla.tableOrdering('downloads','asc','');return false;" class="hasTip" title="" data-content="" data-placement="top" data-original-title="Downloads">Alle Top Downloads</a>';

Code: [Select]
$topfiles_url   = JRoute::_('index.php?option=com_jdownloads&view=downloads&type=top&Itemid='.$root_itemid);

echo $html = '<a href="'.$topfiles_url.'">Alle Top Downloads</a>';

but this codes are don't work for a button / link.

Any ideas?
« Last Edit: 04.03.2019 16:55:09 by Nyx »

Offline Arno

  • Administrator
  • ***
  • Posts: 12.476
    • jDownloads.com
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #1 on: 05.03.2019 12:29:13 »
Hm,
are not sure that I understand you correctly but the url seems to be okay for me. What get you as result?


Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline ColinM

  • Moderator
  • *
  • Posts: 3.975
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #2 on: 05.03.2019 17:18:14 »
Hi
I am also confused! :(

By 'hits' do you mean the number of times a Download has been downloaded? 
Hits are the Number of times the file in a Download has beed downloaded

The Top Module shows the Downloads ordered  by hits .  If you leave the Category blank in the module setup then it shows the ordered list for all Downloads. Editted

Colin
« Last Edit: 05.03.2019 17:30:21 by ColinM »

Offline Nyx

  • Full Member
  • ***
  • Posts: 102
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #3 on: 08.03.2019 14:53:27 »
Thanks for the Answers!

For better understanding:

i have the Module "jDownloads Top" that shows the title of the top 10 Downloads of all Categorys.

Now i want make a "show more" butten at the end oft the 10 Downloads in the Module.

If you click this, the should go to the Downloadsite, with all Downloads / items, sort by Hits/ Top downloads
e.g. http://www.jdownloads.com/index.php/downloads/all.html

This is the code of the sort button from Jdownloads (Order files by)
Code: [Select]
echo $html = '<a href="/all" onclick="Joomla.tableOrdering("downloads","asc","");return false;" class="hasTip" title="" data-content="" data-placement="top" data-original-title="Downloads">Alle Top Downloads</a>';

When i make a link with this code in the Top module, the echo command have a problem with the , or ;.

Quote
syntax error, unexpected 'downloads' (T_STRING), expecting ',' or ';'

and this modified code:

Code: [Select]
echo $html = '<a href="/all" onclick="Joomla.tableOrdering("downloads"\,"asc"\,"");return false;" class="hasTip" title="" data-content="" data-placement="top" data-original-title="Downloads">Alle Top Downloads</a>';
When i click the button, it will go to the url: https://xxx.com/all without errors.
But the File Order is the default File order and not, by "top/hits"


The second Code, i have from "/xxx/components/com_jdownloads/views/downloads/tmpl/default.php"

Code: [Select]
$topfiles_url   = JRoute::_('index.php?option=com_jdownloads&view=downloads&type=top&Itemid='.$root_itemid);

echo $html = '<a href="'.$topfiles_url.'">Alle Top Downloads</a>';

When i click the button, it will go to the url: https://xxx.com/all?type=top without errors.
But the File Order is the default File order and not, by "top/hits".


« Last Edit: 08.03.2019 15:00:28 by Nyx »

Offline Nyx

  • Full Member
  • ***
  • Posts: 102
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #4 on: 17.04.2019 10:11:24 »
Any Idea?
@Arno: Or should i explain in german for better understanding?

Offline Nyx

  • Full Member
  • ***
  • Posts: 102
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #5 on: 24.06.2019 11:30:31 »
Hello again,

maybe i found a way to do this.
I need a link, that will show all Downloads sort by Top Downloads/Hits.

I can make a new menu link for this, but there is no option for sort by top downloads /hits.
See the attachment.

Maybe as a new feature in the next release?

Offline ColinM

  • Moderator
  • *
  • Posts: 3.975
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #6 on: 25.06.2019 11:08:40 »
Nyx,
Think the best scheme is for you make a suggestion that jD supports 'sort by hits' as well as existing sort options.  Think that might be usefull to many people
Another suggestion could be that the jD modules have a show next button.Both involve quite a bit of work.
ColinPS you could also make the number shown in the list longer!

Offline ColinM

  • Moderator
  • *
  • Posts: 3.975
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #7 on: 25.06.2019 14:30:36 »
Nyx
jD does support searching by Hits - I had forgotten!!  You can also add navigation at the top and bottom.

One can set up a menu item 'Show All Downloads' and in that select order by Most Hits.  Also one can set the number of Downloads listed per pageColin

Offline Nyx

  • Full Member
  • ***
  • Posts: 102
Re: Show All Downloads Sort by Hits as a URL / Link?
« Reply #8 on: 25.06.2019 15:11:54 »
One can set up a menu item 'Show All Downloads' and in that select order by Most Hits.  Also one can set the number of Downloads listed per pageColin

Maybe in german it's call "Beliebteste zuerst" ?

but, i can't test it - I have the Bug / Error 0 -> http://www.jdownloads.com/index.php/support-forum.html?topic=11646.0