[SOLVED] Problem using Phoca D. File Module with GDrive link

Phoca modules - support for all Phoca modules except Phoca Gallery modules
Mentos
Phoca Member
Phoca Member
Posts: 24
Joined: 15 Oct 2011, 16:03

Re: Problem using Phoca Download File Module with GDrive lin

Post by Mentos »

Is this file in PD 2? Because I can't find it
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem using Phoca Download File Module with GDrive lin

Post by Jan »

Hi, no, the file I have added is Phoca Download 3 file, this is the place where you can remove the checking.

Jan
If you find Phoca extensions useful, please support the project
Mentos
Phoca Member
Phoca Member
Posts: 24
Joined: 15 Oct 2011, 16:03

Re: Problem using Phoca Download File Module with GDrive lin

Post by Mentos »

And in PD 2, how can I do it?
Mentos
Phoca Member
Phoca Member
Posts: 24
Joined: 15 Oct 2011, 16:03

Re: Problem using Phoca Download File Module with GDrive lin

Post by Mentos »

I solved using this code in com_phocadownload/helpers/phocadownload.php from line 50

Code: Select all

$errorAllowed 		= preg_match("/PhocaError/i", $allowedMimeType);
$errorDisallowed	= preg_match("/PhocaError/i", $disallowedMimeType);
			
$errorAllowed 		= false;
$errorDisallowed 	= true;
But for the Feed RSS/Atom, the feed item link is not the download link but is is the category link. Is there a way for setting the download link?
Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem using Phoca Download File Module with GDrive lin

Post by Jan »

Hi, as written above, for PD this needs to be customized (as example how it works in PD 3, I have pasted the file here)

Jan
If you find Phoca extensions useful, please support the project
Mentos
Phoca Member
Phoca Member
Posts: 24
Joined: 15 Oct 2011, 16:03

Re: Problem using Phoca Download File Module with GDrive lin

Post by Mentos »

Ok solved. I edited the com_phocadownload/views/feed/view.feed.php, replacing the code with the following:

Code: Select all

$link = JRoute::_( PhocaDownloadHelperRoute::getFileRoute( $valueDoc->id, $valueDoc->categoryid, $valueDoc->alias, $valueDoc->categoryalias, $valueDoc->sectionid ) );
				
$item->link 		= $link;
if you want the download link you should use instead:

Code: Select all

$link  = JRoute::_( PhocaDownloadHelperRoute::getFileRoute( $valueDoc->id, $valueDoc->categoryid, $valueDoc->alias, $valueDoc->categoryalias, $valueDoc->sectionid, 'download' ) );
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [SOLVED] Problem using Phoca D. File Module with GDrive

Post by Jan »

Ok, thank you for the guide.

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