coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: jman0948 on August 23, 2004, 08:58:06 AM

Title: Possible login message?
Post by: jman0948 on August 23, 2004, 08:58:06 AM
Hey everyone.

I have my albums set as hidden until you log in. So on the index page is showing just "Powered by Coppermine Photo Gallery" below the header with the links and logos.

Is there any way possible to add text to the body saying something along the lines of logging in to see galleries?

Thanks in advance.
Title: Re: Possible login message?
Post by: Joachim Müller on August 23, 2004, 09:09:39 AM
use anycontent.php - see http://coppermine.sourceforge.net/manual.php#changing and take a look at the demo. Thanks for reading the docs and searching the board before posting next time.

GauGau
Title: Re: Possible login message?
Post by: jman0948 on August 23, 2004, 09:24:52 AM
I read the docs. I read through the docs to change several things. I am so sorry that I missed that and you had to take a few seconds of your time changing shit you probably know how to do blindfolded.

I did search the board and did not find anything. You tell me a good search string. I might be a "newbie" to the Coppermine forums, but I'm not a newbie to forum etiquette. The standards set here are those of which I haven't seen elsewhere. This is NOT a hotline, that's for damn sure. A quick look in the dictionary would tell you that much.
Title: Re: Possible login message?
Post by: Joachim Müller on August 23, 2004, 09:32:58 PM
You're welcome to stay here and make things different. If you don't like my attitude, why don't you teach me how proper support is being done? I'm sure I could learn a lot from you.

GauGau
Title: Re: Possible login message?
Post by: jman0948 on August 23, 2004, 09:59:13 PM
I don't want to argue with you anymore. If you're going to have an attitude, I don't care. Just keep it away from me, as I haven't done anything to provoke you.

So let's just drop the aforementioned stuff and get on with it. With that being said,

I was asking for a login message, sorry for not being more clear on the subject. I am really looking for a way to have it so that when the user is logged in, it will say "Welcome, <username>!", but when they are logged out the table text will display "please login to see galeries".... Does this make any sense now?
Title: Re: Possible login message?
Post by: Joachim Müller on August 23, 2004, 10:06:19 PM
like I said: use anycontent.php - build in an if/then switch, check if the referer is the login page / the logout page and wether a user is logged in at that time.

GauGau
Title: Re: Possible login message?
Post by: jman0948 on August 23, 2004, 10:11:28 PM
Ah ok, I'll give that a shot.

Thank you.
Title: Re: Possible login message?
Post by: mstralka on August 23, 2004, 11:52:17 PM
jman0948, don't private message a person with a question if you've also asked the same question on the board.  It's annoying and I won't answer you again.
But here you go. 
If a user is not logged in, this will display a welcome message, asking the user to log in. 
It will also hide any other content until the user logs in. 
It only works if the user is at index.php.  If they can get to some other page (displayimage.php, thumbnails.php, etc) it won't help.  (You could add a line to init.inc.php to check for USER_ID, if not found, redirect the user to index.php automatically)

Make sure anycontent is in your Main Page config

index.php
FIND:

            case 'anycontent':
                if ($cat == 0) {
                    include('anycontent.php');
                }
                flush();
                break;

Replace with:

            case 'anycontent':
                if ($cat == 0 && !USER_ID) {
                    include('anycontent.php');
                }
                flush();
                break;


For each of the blocks you are displaying on your Main Page (breadcrumb, catlist, topn, etc), Find the block in index.php and put a wrapper around it to check that the user is logged in.
FIND:

            case 'catlist':
                if ($breadcrumb != '' || count($cat_data) > 0) theme_display_cat_list($breadcrumb, $cat_data, $statistics);
                if (isset($cat) && $cat == USER_GAL_CAT) list_users();
                flush();
                break;

Replace with:

            case 'catlist':
if (USER_ID) {
if ($breadcrumb != '' || count($cat_data) > 0) theme_display_cat_list($breadcrumb, $cat_data, $statistics);
if (isset($cat) && $cat == USER_GAL_CAT) list_users();
flush();
}
                break;
Title: Re: Possible login message?
Post by: quake101 on August 24, 2004, 12:35:31 AM
Hey, jman0948
I hope the code I wrote for you works good. :) I'm glad I could help you out!
Title: Re: Possible login message?
Post by: Casper on August 24, 2004, 07:25:04 PM
You could also use this easy hack, http://forum.coppermine-gallery.net/index.php?topic=3503.0, to force users to login before seeing the gallery.