coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Permissions & Access Rights => Topic started by: opulence on April 17, 2005, 10:09:29 PM

Title: Only registered users can view actual gallery pics, everyone else can view thumb
Post by: opulence on April 17, 2005, 10:09:29 PM
Is there a way to make it so that only registered users can view the actual gallery pics, but everyone else can view thumbnails, searh, film strip, etc?
Title: Re: Only registered users can view actual gallery pics, everyone else can view thumb
Post by: krkeegan on April 18, 2005, 04:16:40 AM
This is not in the design of coppermine. You could modify the display image page but it would require some php coding and it could still be curcumnavigated by someone who knew what they were doing.

Kevin
Title: Re: Only registered users can view actual gallery pics, everyone else can view t
Post by: opulence on April 18, 2005, 04:42:52 AM
I wouldn't mind if someone who knew what they were doing could access the pics.

I just want to give incentive for someone to actually register, while at least letting them be able to see thumbnails/etc as a tease...
Title: Re: Only registered users can view actual gallery pics, everyone else can view thumb
Post by: krkeegan on April 18, 2005, 05:05:22 AM
Okay then you will need to modify the php code for the displayimage page to require the registered user group. Sorry I don't have any use for this on my site so I have not looked farther, but I think it should be pretty easy.

Kevin
Title: Re: Only registered users can view actual gallery pics, everyone else can view t
Post by: opulence on April 18, 2005, 07:43:22 AM
Does anyone know how I may edit displayimage.php in order to require the registered user group? :S
Title: Re: Only registered users can view actual gallery pics, everyone else can view thumb
Post by: gaxxia on April 18, 2005, 10:09:17 AM
Edit displayimage.php and add

if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);

just before
/**************************************************************************
* Local functions definition
**************************************************************************/



Title: Re: Only registered users can view actual gallery pics, everyone else can view t
Post by: kegobeer on April 18, 2005, 10:42:55 AM
The above post came directly from the FAQ.  Always good to check out the resources available.
Title: Re: Only registered users can view actual gallery pics, everyone else can view t
Post by: opulence on April 18, 2005, 05:27:19 PM
Thanks for the help guys, but strangely, it didn't work

I did manage to previously find this in the FAQ:

"How can I prevent unregistered user from viewing the gallery?

edit
displayimage.php and index.php and search.php and thumbnails.php
and search for

require('include/init.inc.php');


and add after it

if (USER_ID){

} else {
{
   $redirect = $redirect . "login.php";
   header("Location: $redirect");

   exit();
        }
}"

Which I only added to displayimage.php

I tried with that, didn't work, I tried seperately with the code listed above, didn't work, and I tried both of them together and it still didn't work.

(And yes, I remembered to be logged out each time!)
Title: Re: Only registered users can view actual gallery pics, everyone else can view t
Post by: Joachim Müller on April 22, 2005, 08:16:54 AM
as suggested above: http://coppermine.sourceforge.net/faq.php#viewThumbnailsOnly
Title: Re: Only registered users can view actual gallery pics, everyone else can view t
Post by: opulence on April 22, 2005, 09:37:50 PM
Quote from: GauGau on April 22, 2005, 08:16:54 AM
as suggested above: http://coppermine.sourceforge.net/faq.php#viewThumbnailsOnly

That one worked! thanks much, sorry for not being able to see this myself