Page 1 of 1

Download rights in phoca gallery

Posted: 23 Mar 2012, 13:41
by jojo12
Hi,
using joomla 2.5.3 and phoca gallery 3.2.0 beta.
How can I do the following:
All guests can see pictures/photos, but only registered or higher can download them.

Re: Download rights in phoca gallery

Posted: 31 Mar 2012, 11:42
by Tee shot
hi
it does not exist in the options. Must be modified in default_images.php com_phocagallery \ views \ category \ tmpl
search

Code: Select all

if ($value->displayicondownload > 0) {
				// Direct Download but not if there is a youtube

						if ($value->displayicondownload == 2 && $value->videocode == '') {

							echo ' <a title="'. JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD').'"'

								.' href="'.JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$value->catslug.'&id='.$value->slug. $this->tmpl['tmplcom'].'&phocadownload='.$value->displayicondownload.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'"';

						} else { 

							echo ' <a class="'.$value->buttonother->methodname.'" title="'.JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD').'"'

								.' href="'.JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$value->catslug.'&id='.$value->slug. $this->tmpl['tmplcom'].'&phocadownload='.(int)$value->displayicondownload.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'"';

								

							echo PhocaGalleryRenderFront::renderAAttributeOther($this->tmpl['detailwindow'], $value->buttonother->options, $this->tmpl['highslideonclick'], $this->tmpl['highslideonclick2']);

						}

						echo ' >';

						echo JHtml::_('image', 'components/com_phocagallery/assets/images/icon-download.'.$this->tmpl['formaticon'], JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD'));

						echo '</a>';

					}
and replace

Code: Select all

if ($value->displayicondownload > 0) {
				$user =& JFactory::getUser();
 
					if (!$user->guest) {
					// Direct Download but not if there is a youtube

						if ($value->displayicondownload == 2 && $value->videocode == '') {

							echo ' <a title="'. JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD').'"'

								.' href="'.JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$value->catslug.'&id='.$value->slug. $this->tmpl['tmplcom'].'&phocadownload='.$value->displayicondownload.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'"';

						} else { 

							echo ' <a class="'.$value->buttonother->methodname.'" title="'.JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD').'"'

								.' href="'.JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$value->catslug.'&id='.$value->slug. $this->tmpl['tmplcom'].'&phocadownload='.(int)$value->displayicondownload.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'"';

								

							echo PhocaGalleryRenderFront::renderAAttributeOther($this->tmpl['detailwindow'], $value->buttonother->options, $this->tmpl['highslideonclick'], $this->tmpl['highslideonclick2']);

						}

						echo ' >';

						echo JHtml::_('image', 'components/com_phocagallery/assets/images/icon-download.'.$this->tmpl['formaticon'], JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD'));

						echo '</a>';

					}

				}
@+