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
Access full-size image only for registered
-
GetRich
- Phoca Newbie

- Posts: 5
- Joined: 03 Sep 2009, 13:18
-
GetRich
- Phoca Newbie

- Posts: 5
- Joined: 03 Sep 2009, 13:18
Re: Access full-size image only for registered
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.
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.
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Access full-size image only for registered
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
Jan
If you find Phoca extensions useful, please support the project
-
GetRich
- Phoca Newbie

- Posts: 5
- Joined: 03 Sep 2009, 13:18
Re: Access full-size image only for registered
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
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
-
GetRich
- Phoca Newbie

- Posts: 5
- Joined: 03 Sep 2009, 13:18
Re: Access full-size image only for registered
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)
-
GetRich
- Phoca Newbie

- Posts: 5
- Joined: 03 Sep 2009, 13:18
Re: Access full-size image only for registered
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
also you have put 2.2 code in Jumi component.
Second thing is download icon.
replace code on line ~266
2.3
with
2.4
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)
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
Code: Select all
echo ' href="'. $value->link.'"';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)"';
}
Second thing is download icon.
replace code on line ~266
2.3
Code: Select all
if ($value->displayicondownload > 0 ) {2.4
Code: Select all
$user =& JFactory::getUser();
if ($value->displayicondownload > 0 && $user->id > 0 ) {That's it! Simple but working solution. I am not sure is it secure (As I wrote before I am not coder)
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Access full-size image only for registered
Ok, thanks for this guide.
Jan
Jan
If you find Phoca extensions useful, please support the project