jDownloadsownloads.com


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

0 Members and 1 Guest are viewing this topic.

Offline Nyx

  • Jr. Member
  • **
  • Posts: 97
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.422
    • 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.845
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

  • Jr. Member
  • **
  • Posts: 97
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

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