how to allow Only registred users to access the slideshow

Phoca Gallery - image gallery extension
WebSamir
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 20 Jul 2010, 11:33

how to allow Only registred users to access the slideshow

Post 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 ?
WebSamir
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 20 Jul 2010, 11:33

Re: how to allow Only registred users to access the slidesho

Post by WebSamir »

Any idea please?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49299
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how to allow Only registred users to access the slidesho

Post 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. :idea:

Jan
If you find Phoca extensions useful, please support the project
wolkmx
Phoca Member
Phoca Member
Posts: 32
Joined: 13 Jul 2010, 22:22
Location: For now Venezuela but soul in Mexico

Re: how to allow Only registred users to access the slidesho

Post 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.
WebSamir
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 20 Jul 2010, 11:33

Re: how to allow Only registred users to access the slidesho

Post by WebSamir »

it's exactly what i want wolkmx.
i will try to search that famous link that open the jak slideshow :idea:
wolkmx
Phoca Member
Phoca Member
Posts: 32
Joined: 13 Jul 2010, 22:22
Location: For now Venezuela but soul in Mexico

Re: how to allow Only registred users to access the slidesho

Post 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

Code: Select all

}
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.
WebSamir
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 20 Jul 2010, 11:33

Re: how to allow Only registred users to access the slidesho

Post 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 :)
wolkmx
Phoca Member
Phoca Member
Posts: 32
Joined: 13 Jul 2010, 22:22
Location: For now Venezuela but soul in Mexico

Re: how to allow Only registred users to access the slidesho

Post 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.
Post Reply