hooch 
Coppermine novice

Posts: 28
|
 |
« on: November 09, 2004, 10:42:13 pm » |
|
Hi!
I have a text in anycontent who says hello and welcome blabla.. register to see the pictures.. but i dont want this to be seen if you already are logged in, then i want another text..
how do i do this? with come kind of if-thing but how do it wkow if im logged in or not?
/Gustav
|
|
|
|
« Last Edit: November 10, 2004, 12:25:55 pm by GauGau »
|
Logged
|
|
|
|
|
Joachim Müller
|
 |
« Reply #1 on: November 10, 2004, 07:27:49 am » |
|
Put this code into anycontent.php <?php if (USER_ID) { // do nothing - a user is logged in // we could print out anything here to say welcome to the logged in user } else { print 'You\'re not logged in. If you were, you could do so many things you currently can\'t.<br />Click <a href="login.php">login</a> if you already have an account for this site or <a href="register.php">register</a> to sign up for a new account.'; } ?> Joachim
|
|
|
|
|
Logged
|
|
|
|
hooch 
Coppermine novice

Posts: 28
|
 |
« Reply #2 on: November 10, 2004, 08:57:17 am » |
|
worked perfectly! thank you GauGau!! 
|
|
|
|
|
Logged
|
|
|
|
fareforce
Coppermine regular visitor
 
Gender: 
Posts: 66
Who are you calling a weasel?
|
 |
« Reply #3 on: December 12, 2004, 08:18:09 pm » |
|
Quick question about this. This is what I put in for the script <?php if (USER_ID) { print 'Welcome to AlaskaStudio.com, and thank you for logging in. As a member
of AlaskaStudio.com you have full access to all functions of this site. We
recently added <b>ecards</b>! Please tell your freinds about this site by
sending them an ecard.'; // do nothing - a user is logged in // we could print out anything here to say welcome to the logged in user } else { print 'You\'re not logged in. If you were, you could do so many things you
currently can\'t.<br />Click <a href="login.php">login</a> if you already have
an account for this site or <a href="register.php">register</a> to sign up for
a new account.'; } ?> Is there a way to make it say Welcome "username"?
|
|
|
|
|
Logged
|
|
|
|
|
Nibbler
|
 |
« Reply #4 on: December 13, 2004, 01:14:27 pm » |
|
Yes, use the constant USER_NAME.
|
|
|
|
|
Logged
|
I don't care about what they say, I won't live or die that way.
|
|
|
|
bbt2993
Coppermine newbie
Posts: 4
|
 |
« Reply #5 on: January 07, 2005, 10:35:21 am » |
|
where and how do you use the "constant USER_NAME"
|
|
|
|
|
Logged
|
|
|
|
|
Joachim Müller
|
 |
« Reply #6 on: January 07, 2005, 10:38:14 am » |
|
where and how do you use the "constant USER_NAME"
Not at all if you're no PHP coder. Joachim
|
|
|
|
|
Logged
|
|
|
|
|
bbt2993
Coppermine newbie
Posts: 4
|
 |
« Reply #7 on: January 07, 2005, 10:45:30 am » |
|
Hi In starttable("100%", "Velkommen"); after "Velkommen" <?php // ------------------------------------------------------------------------- // // CVS version: $Id: anycontent.php,v 1.5 2004/07/24 15:03:52 gaugau Exp $ // ------------------------------------------------------------------------- //
starttable("100%", "Velkommen");
?> <tr><td class="tableb" > <?php if (USER_ID) { // do nothing - a user is logged in // we could print out anything here to say welcome to the logged in user } else { print 'Du er ikke loget ind. Hvis du var kunne du sċ meget mere end du kan nu.<br />Klik <a href="login.php">log ind</a> hvis du allerede er oprettet som bruger eller <a href="register.php">opret bruger</a> for at oprette en konto.'; } ?> </td></tr> <?php endtable();
?>
|
|
|
|
|
Logged
|
|
|
|
tomrock
Coppermine novice

Gender: 
Posts: 29
|
 |
« Reply #8 on: April 06, 2005, 03:35:01 pm » |
|
where and how do you use the "constant USER_NAME"
Something like echo USER_NAME . " thanks for logging in.";
|
|
|
|
|
Logged
|
|
|
|
|
simplyzen
Coppermine newbie
Posts: 16
|
 |
« Reply #9 on: April 19, 2005, 03:25:25 pm » |
|
In the theme.php can we use php code? i.e. will it work if it's place in a $template_main_menu1 = <<<EOT EOT; section?
|
|
|
|
|
Logged
|
|
|
|
|
Nibbler
|
 |
« Reply #10 on: April 19, 2005, 03:36:54 pm » |
|
No. If you want to add php then stop the heredoc, add your code, and resume it.
|
|
|
|
|
Logged
|
I don't care about what they say, I won't live or die that way.
|
|
|
|
qt4eva
Coppermine newbie
Posts: 14
|
 |
« Reply #11 on: April 23, 2005, 04:14:07 am » |
|
where and how do you use the "constant USER_NAME"
Something like echo USER_NAME . " thanks for logging in.";
is there a way to change so that it said. Thanks fo loggin in [Username]. I tried to do " Thanks for logging in" echo USER_NAME; but it not working. <?php if (USER_ID) { // do nothing - a user is logged in // we could print out anything here to say welcome to the logged in user } else { print 'You\'re not logged in. If you were, you could do so many things you currently can\'t.<br />Click <a href="login.php">login</a> if you already have an account for this site or <a href="register.php">register</a> to sign up for a new account.'; } ?>
How do i align this so that this is set to the right of the page? TIA for help. Sorry am a noob at php.
|
|
|
|
|
Logged
|
|
|
|
stock
Coppermine frequent poster
  
Posts: 109
|
 |
« Reply #12 on: August 15, 2005, 12:36:30 am » |
|
Could someone help.
Does one put this code: <?php /************************* COPPERMINE BIT HERE TAKEN OUT FOR CLARITY, IGNORE **********************************************/
starttable("100%", "Welcome");
?> <tr><td class="tableb" > <?php if (USER_ID) { // do nothing - a user is logged in // we could print out anything here to say welcome to the logged in user } else { print 'You\'re not logged in. <br />Click <a href="login.php">login</a> if you already have an account for this site or <a href="register.php">register</a> to sign up for a new account.'; } ?> </td></tr> <?php endtable();
?>
Into anycontent.php then do something else to make a box come up before they can access the site? This is what I want to do if possible. Thanks for any help
|
|
|
|
|
Logged
|
|
|
|
|
|
stock
Coppermine frequent poster
  
Posts: 109
|
 |
« Reply #14 on: August 15, 2005, 08:35:32 pm » |
|
many thanks, I did try and find this an apologies that I hadn't. It works perfectly.
Stock
|
|
|
|
|
Logged
|
|
|
|
|