Most Downloaded Files

Phoca Download - download manager
Hottinger
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 09 Oct 2012, 09:03

Most Downloaded Files

Post by Hottinger »

Hello, I have in Version 2.1.7 activated Most Downloaded Files, but I don't see the Files in my Kategoryview.
Thank you for help.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Most Downloaded Files

Post by Jan »

Hi, most downloaded files are displayed only in Categories View (see the description of this parameter)

Jan
If you find Phoca extensions useful, please support the project
escalderon
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 20 Feb 2013, 17:37

Re: Most Downloaded Files

Post by escalderon »

Is there a way to point the link directly to the file instead of the category?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Most Downloaded Files

Post by Jan »

Hi, then you need to customize the link:

instead of: PhocaDownloadHelperRoute::getCategoryRoute in
components\com_phocadownload\views\categories\tmpl\default.php
you should add the link directly to file.

Jan
If you find Phoca extensions useful, please support the project
brentwilliams2
Phoca Member
Phoca Member
Posts: 26
Joined: 23 Aug 2009, 01:22

Re: Most Downloaded Files

Post by brentwilliams2 »

"you should add the link directly to file."

Jan, what is the code to link directly to the file?

Thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Most Downloaded Files

Post by Jan »

Hi, directly means - you just copy the link from frontend and you will paste it there as link. Or you can try to change it to File view, from PhocaDownloadHelperRoute::getCategoryRoute to PhocaDownloadHelperRoute::getFileRoute (but File View needs to be enabled) and of course it depends on if the file should be displayed in file view or should be directly downloaded.

Jan
If you find Phoca extensions useful, please support the project
brentwilliams2
Phoca Member
Phoca Member
Posts: 26
Joined: 23 Aug 2009, 01:22

Re: Most Downloaded Files

Post by brentwilliams2 »

Hi Jan,

Thanks, that got me part of the way.

I changed this:

Code: Select all

JRoute::_(PhocaDownloadHelperRoute::getCategoryRoute($value->categoryid,$value->categoryalias))
To this:

Code: Select all

JRoute::_(PhocaDownloadHelperRoute::getFileRoute($value->id,$value->alias))
The only thing that does not seem to work is the alias part. Any ideas?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Most Downloaded Files

Post by Jan »

Hi, the second parameter is not alias but category id, see the function:
function getFileRoute($id, $catid = 0, $idAlias = '', $catidAlias = '', $sectionid = 0, $type = 'file')
1 ... file id
2 ... category id
3 ... file alias
4 ... category alias
5 ... 0 (set null as this is obsolete parameter) or leave empty
6 ... 'file' or leave empty

Jan
If you find Phoca extensions useful, please support the project
brentwilliams2
Phoca Member
Phoca Member
Posts: 26
Joined: 23 Aug 2009, 01:22

Re: Most Downloaded Files

Post by brentwilliams2 »

Thanks! I changed it to this and it worked:

Code: Select all

JRoute::_(PhocaDownloadHelperRoute::getFileRoute($value->id,$value->categoryid,$value->alias))
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Most Downloaded Files

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply