Possible login message? Possible login message?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Possible login message?

Started by jman0948, August 23, 2004, 08:58:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jman0948

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.
Woo...

Joachim Müller

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

jman0948

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.
Woo...

Joachim Müller

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

jman0948

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?
Woo...

Joachim Müller

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

jman0948

Ah ok, I'll give that a shot.

Thank you.
Woo...

mstralka

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;
GO IRISH

quake101

Hey, jman0948
I hope the code I wrote for you works good. :) I'm glad I could help you out!

Casper

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