how to allow anonymous to see catagories/albums but do not grant access? SOLVED how to allow anonymous to see catagories/albums but do not grant access? SOLVED
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

how to allow anonymous to see catagories/albums but do not grant access? SOLVED

Started by marky, July 06, 2004, 02:39:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

marky

I looked around for similar post...but couldn't find anything via search, etc.  I would like to allow anonymous users to see catagories or albums but when they try to click on them to enter...they get directed to a "you need to register to view this" page or to the login page.

The only setting I can see is under album management and is the "Album can be viewed by "Members of the 'Registered' group", which doesn't allow unregistered users to even see that the album exists.

Updated: ok, i figured out the option to yes in "Show private album Icon to unlogged user" thnx...

jamurillo

I get it doing this in cpg1.3.2. :

1- Open thumbnails.php
find;
Code:
require('include/init.inc.php');


Add after;
Code:
if (USER_ID){

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

   exit();
}}

2- In  the " Configuration " :
The content of the main page : breadcrumb/anycontent/alblist
Nothing else, so unlogged users can not go in through the thumbnails.

You can see it at www.jamurillo.com/stock

Casper

You should always have catlist in the list of contents of mainpage.

You should also put the if/else switch in displayimage.php.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

jamurillo

Thanks Casper !

What do you means by :

You should also put the if/else switch in displayimage.php.  ???

Explain us, please !

Casper

You just need to do the same thing in displayimage.php as you did in thumbnails.php.

This is explained in this mod, http://forum.coppermine-gallery.net/index.php?topic=3503.msg15506#msg15506, which makes all users log in.  For what you want, do this mod, but not to the index.php.

Then all visitors will see the cats and sub cats, but not be able to go into the albums and see the pics.  You will still be able to show random and lastup thumbs on the front page.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

irishblue

do you mean to paste the same code in thumbnails.php into displayimage.php?
*edit: got it to work. Thanks! :)

fourhour

I tried this and you do not need to put the extra code into the thumbnails.php. If you do, when someone logs on they will see "User already logged on". Just put the code in the displayimage.php and you'll get the desired result. ;D

blackhat

I'm trying this hack but cant get it to work
http://coppermine.sourceforge.net/faq.php?q=registeredUsersOnly#registeredUsersOnly

I get this error message if I'm logged out and trying to access the gallery url:
Quote
gallery.librarium-online.comhttp could not be found. Please check the name and try again.
I tried accessing the gallery without using the subdomain, but got the same error message. I'm also using the latest version of coppermine..

Thanks