forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: zac 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
-
Use anycontent.php with an if.
<?php
if (!USER_ID){
// some content here
}
-
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();
-
You missed out the negation (!).
-
Got it! Thanks Nibbler ... I need PHP 101 :-\
if (USER_ID) {
starttable("100%", "nothing to see here");
echo "<tr><td class=\"table\" > </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();
}