Page 1 of 1
how to allow Only registred users to access the slideshow
Posted: 20 Jul 2010, 13:28
by WebSamir
I tried to do it by myself but it takes mee too much time til now
i want to display the images to everybody (registred/ not registred) , but, when a not registred user clik on the thumbnail , he will be asked to login to view the highslide. And of corse registred users can access the highslide.
I'm using phocagallery 2.7.2 and the JAK LIGHTBOX.
Any help ?
Re: how to allow Only registred users to access the slidesho
Posted: 26 Jul 2010, 11:02
by WebSamir
Any idea please?
Re: how to allow Only registred users to access the slidesho
Posted: 26 Jul 2010, 17:36
by Jan
Hi, sorry I don't understand. This is a default settings that all images can be displayed for everyone, so just set the settings to default.
Jan
Re: how to allow Only registred users to access the slidesho
Posted: 28 Jul 2010, 15:45
by wolkmx
Hi there, i think that i understand, you need a customization, you want that everybody can see the thumbnails, but when they clic the thumbnail, only the registered user can see the large image.
try to search the code that open the new window, the pop up and add a simple if ( ), sentence at the start of the metod.
like:
Code: Select all
$user0 =& JFactory::getUser();
$idd=$user0->id;
if( $idd != null ) {
normal code
}
else {
write somethin like a message or a redirect to the login page
}
I hope that this help you a little.
Re: how to allow Only registred users to access the slidesho
Posted: 03 Aug 2010, 16:51
by WebSamir
it's exactly what i want wolkmx.
i will try to search that famous link that open the jak slideshow

Re: how to allow Only registred users to access the slidesho
Posted: 05 Aug 2010, 22:24
by wolkmx
Hi again WebSamir
I don“t know if you solved your problem, i don't have time to search the code and help you, but i know how you need to put code to works , but whit the option called no popup.
I think that you only need to check in other files, like the model or controller if you want to this works whit JAK LIGHTBOX.
So you need to modify the file called default.php
is in ..\components\com_phocagallery\views\detail\tmpl\
so you need to put this code starting to paste in the line 7 like this:
Code: Select all
//New Code
$user0 =& JFactory::getUser();
$idd=$user0->id;
if( $idd != null ) {
//New Code
and add a
At the end of the file.
Whit this and whit the option not popup the image don't show if the user is not login, so you can add a else whit code showing the registration form, or redirect to the login form.
So i hope that this help you.
Re: how to allow Only registred users to access the slidesho
Posted: 10 Aug 2010, 11:44
by WebSamir
Itried your issue wolkmx, and it hides the large image for 'No popup'.
i still have 2 problems:
1- how to redirect to the login page?
2- how to do the same thing with the JAK LIGHTBOX because i really prefer it
Thank's a lot for your help

Re: how to allow Only registred users to access the slidesho
Posted: 11 Aug 2010, 17:52
by wolkmx
Hi sorry if i don't writte before, but i was working trying to modify my own phoca gallery and i have problems whit google maps, but well, the code to redirect to the login page could be some like this:
Code: Select all
else{
echo "To see the Large Image please Log In or Register";
sleep(5);
header('Location: index.html'); //change to the address of your login page must be like http://www.yourweb.com/index.php?option=com_user&view=register
}
try whit this, of course i think that is better whit java script code, but now i don't have time to check it sorry, but you only need to search in google redirection with php or javascript, i hope that this help you.