Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Change message for logged out users  (Read 3114 times)

0 Members and 1 Guest are viewing this topic.

zac

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 153
Change message for logged out users
« on: January 08, 2008, 10:11:46 am »

Hi.. I am wondering how I could have a different message or home page for users who are not logged in.  My gallery is to be used strictly for portrait customers so if you are not logged in there is just a message telling you to log in.  The way I have it now this message just sits in the category description and is always there.  I would like to make it so the message changes or disappears after a user logs in.  Can someone give me a pointer on how to achieve this?   I have  searched around for a while but I need to get some sleep :P
« Last Edit: January 08, 2008, 08:08:35 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Change message for logged out users
« Reply #1 on: January 08, 2008, 11:04:09 am »

Use anycontent.php with an if.

Code: [Select]
<?php

if (!USER_ID){
// some content here
}
Logged

zac

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 153
Re: Change message for logged out users
« Reply #2 on: January 08, 2008, 07:13:00 pm »

Thanks Nibbler.. That is sort of it.. however I kind of want the opposite a message that is there when you are not logged in and disappears when you are.    For example I tried

Code: [Select]
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
starttable("100%", "Welcome");
echo "<tr><td class=\"table\" ><a href=\"http://www.otherdomain/some_gallery/".USER_ID."\">Open your gallery, ".USER_NAME.".</a></td></tr>";
endtable();
if (USER_ID) {
starttable("100%", "");
echo "<tr><td class=\"table\" ></td></tr>";
endtable();
Logged

Nibbler

  • Guest
Re: Change message for logged out users
« Reply #3 on: January 08, 2008, 07:22:56 pm »

You missed out the negation (!).
Logged

zac

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 153
Re: Change message for logged out users
« Reply #4 on: January 08, 2008, 07:54:52 pm »

Got it!  Thanks Nibbler ... I need PHP 101  :-\

Code: [Select]
if (USER_ID) {
starttable("100%", "nothing to see here");
echo "<tr><td class=\"table\" >&nbsp;</td></tr>";
endtable();
}
else {
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
starttable("100%", "Welcome");
echo "<tr><td class=\"table\" ><a href=\"http://www.otherdomain/some_gallery/".USER_ID."\">Open your gallery, ".USER_NAME.".</a></td></tr>";
endtable();

}
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.