Change message for logged out users Change message for logged out users
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Change message for logged out users

Started by zac, January 08, 2008, 10:11:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zac

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

Nibbler

Use anycontent.php with an if.


<?php

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

zac

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

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();

Nibbler


zac

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

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();

}