Page 1 of 1
Access full-size image only for registered
Posted: 03 Sep 2009, 13:42
by GetRich
Dear Phoca Gallery Team,
First of all, I would like to say thank you for so great component. Everything works fine from first minute of install.
I am searching for one feature in gallery. Is it possible to make access for full-size images (and also download) only for registered users?
I mean, if user is not registered, he can watch gallery, but only thumbnails. After user register to system, then he can watch full-size images and download them.
If there is no such feature, maybe someone already have any hack?
Thank you in advance
Re: Access full-size image only for registered
Posted: 03 Sep 2009, 14:22
by GetRich
I have idea about, how it is possible to do. The only problem I am not coder
For example, maybe it is possible to write code:
if user is registered show full-size image
if user not registered instead of link to full-size image redirect user to registratiom page"
here I will put virtuemart registration link"
and same code repeat for download picture button
If someone will help me make that feature I think it will also be useful for other phoca users.
Re: Access full-size image only for registered
Posted: 04 Sep 2009, 18:20
by Jan
Hi, for such solution, it is better to add some shopping solution as the images can be accessed from the web, so you should add e.g. watermarks to images which should be displayed and zip the original images and supply them in some shop solution.
Jan
Re: Access full-size image only for registered
Posted: 04 Sep 2009, 19:57
by GetRich
Dear Jan,
Thank you for advice, but in my situation it is not such important what full size images will be accessible through search engine. Images in gallery, they are free and not part of my art jobs.
I just want, what user register to my site. At the moment I am searching php code which will help me make little modification.
In category view default.php file I found place, which can help me realize what I want.
line ~ 108 echo ' href="'. $value->link.'"';
If user registered in joomla, than he get original $value->link, but if not instead of that link I will put link to user registration page.
If I will found solution, I also post it here. Maybe someone else would like to get such modification

Re: Access full-size image only for registered
Posted: 06 Sep 2009, 20:23
by GetRich
I am almost found solution. Maybe someone know how to check if user is registered or not in phoca gallery (joomla). This code is not working if( $my->id > 0)
Re: Access full-size image only for registered
Posted: 06 Sep 2009, 22:05
by GetRich
Finally I found solution!
Together with Jumi component (helps import joomla variables) and little modification, now user can view or download full-size images only if they registered (to joomla or VirtueMart ).
So, as I promise, here is solution:
1)First of all install component from
http://jumi.vedeme.cz/index.php?option= ... info&id=54
2)Now you need to find and edit such file:
components/com_phocagallery/views/category/tmpl/default.php
in line ~ 108 replace:
2.1
with:
2.2
Code: Select all
$user =& JFactory::getUser();
if ($user->id > 0) {
echo ' href="'. $value->link.'"';
}
else {
echo ' href="images/here will be image for not registered users (please register or something else)"';
}
also you have put 2.2 code in Jumi component.
Second thing is download icon.
replace code on line ~266
2.3
Code: Select all
if ($value->displayicondownload > 0 ) {
with
2.4
Code: Select all
$user =& JFactory::getUser();
if ($value->displayicondownload > 0 && $user->id > 0 ) {
also put code 2.4 into Jumi component
That's it! Simple but working solution. I am not sure is it secure (As I wrote before I am not coder)
Re: Access full-size image only for registered
Posted: 08 Sep 2009, 20:07
by Jan
Ok, thanks for this guide.
Jan