Page 1 of 1

"Direct Download" Button on the Download Details page

Posted: 01 Mar 2012, 14:40
by Waldeck
Phoca Gallery 2.8.1 on Joomla 1.5.25

Hello togehter,

I am using the Poca Gallery on our site and its really a nice component, easy to use and stylish.

But now I have this slight problem, that I was not able to customize, yet. I hope someone can help me with it:


I know, that in the configuration, you can set the Download Button to "appear" or to "appear as Direct Download". But I want to use it this way, that in the configuration I set the Download Button to appear. So when someone clicks on it in the category view, the Download Details page shows up. So far so good.

On the Download Details page I am able to edit the Download Text (JTEXT), so I can put in a kind of Disclaimer, before the Picture can be downloaded.

What I didn't like, was the option, that then someone has to go the way for saving a picture wit "Right click and save as...".

So I would like to implement the Direct Download Button just into this Download Details page, after the Disclaimer text. So can anyone tell me, what would be the code for the Direct Download button? Is there a JHTML code for it?

Thanks in advance,

Julian

Re: "Direct Download" Button on the Download Details page

Posted: 02 Mar 2012, 00:03
by Jan
Hi, this needs to be customized in the code, you can find the code in category view:

components/com_phocagallery/views/category ... folder

and implement it to detail window:

components/com_phocagallery/views/detail

Jan

Re: "Direct Download" Button on the Download Details page

Posted: 05 Mar 2012, 13:40
by Waldeck
Hello Jan,

thank you for your quick reply!

With your information, I was able to locate the code for the Direct Download and edited the code-phrase in the "default_download.php" like this:

Code: Select all

echo '<div id="download-box"><div style="overflow:scroll;width:'.$this->tmpl['boxlargewidth'].'px;height:'.$this->tmpl['boxlargeheight'].'px;margin:0px;padding:0px;">' . $imgLink. '</div>';
	echo '<div id="download-msg"><div>'
		.'<table width="750" height="560">'
		.'<tr><td align="left">' . JText::_('Image Format') . ': </td><td>'.$this->item->imagesize.'</td><td colspan="2" align="left"><a title="'. JText::_('Image Download').'" href="'.JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$this->category->slug.'&id='.$value->slug. $tmplCom.'&phocadownload='.$value->displayicondownload.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'">'.'Download* '.JHTML::_('image', 'components/com_phocagallery/assets/images/icon-download.gif'.$this->tmpl['formaticon'], JText::_('Image Download')).'</a></td></tr>'
		.'<tr><td align="left">' . JText::_('Image Size') . ': </td><td>'.$this->item->filesize.'</td></tr>'
		.'<tr><td colspan="3" align="left"><small>' . JText::_('Download Image') . '</small></td></tr>';
		
		if ($this->tmpl['detailwindow'] == 4 || $this->tmpl['detailwindow'] == 5 || $this->tmpl['detailwindow'] == 7) {
		} else {
			echo '<tr><td>&nbsp;</td><td align="right">'.str_replace("%onclickclose%", $this->tmpl['detailwindowclose'], $this->item->closetext).'</td></tr>';
		}
	echo '</table>';
	echo '</div></div>';
}
Now I get the Download-Button with the correct Icon displayed in the opening Box. But it seems like it is not able to manage exactly WHICH image was requested. It just creates follwing link:

Code: Select all

http://www.bott.de/de/detail/index.html?phocadownload=
A click on this link just forwards to a page telling, that "It is not allowed to see the ressource". As far as I can see, it doesn't get the information (ItemID?), of the requested picture? Right? How can I give this information, so the Download will work?

I can also post the whole code of "default_download.php" if this will help any further?

Re: "Direct Download" Button on the Download Details page

Posted: 06 Mar 2012, 23:34
by Jan
Hi, you need to get the Id of the file and of course it needs to be checked for accessing rights - and all the params you need to add to the urls, just see the code for similar behaviour. I am not on my pc now so cannot give any specific advice directly for the code. :-(

Jan