Hello, I hope someone can help.
I'm trying to have a welcome come up on my home page, with different text once you have logged in, all with a table. I can do this without a table okay but when I try and incorporate the table code in, it all shows regardless of logged in or not.
I'd be very grateful if someone could tell me what is wrong here (this is on http://www.stockshoots.co.uk but this may be offline when this is read:
starttable("100%", "Welcome");
?>
<tr><td class="tableb">
if (USER_ID) {print 'Click on a lorum ipsum below.<br />
Lorum ipsum lorum ipsum lorum ipsum here.<br /><br /><br />'
} else {
print 'Welcome to Stockshoots image library<br />
A new source of original film and digital right-managed imagery.<br 1/>
Click on the subject roundups below or use the seach tool on the right.<br />
You may need to login or register to see the images.<br /><br /><br />';
}
</td></tr>
<?php
endtable();
?>
just to clarify my last post, the page starts with <?php and the commented out Coppermine gallery bit.
thanks
Stock
starttable("100%", "Welcome");
echo '<tr><td class="tableb">';
if (USER_ID) {print 'Click on a lorum ipsum below.<br />
Lorum ipsum lorum ipsum lorum ipsum here.<br /><br /><br />';
} else {
print 'Welcome to Stockshoots image library<br />
A new source of original film and digital right-managed imagery.<br 1/>
Click on the subject roundups below or use the seach tool on the right.<br />
You may need to login or register to see the images.<br /><br /><br />';
}
echo '</td></tr>';
endtable();
?>
Kegobeer,
many thanks for the help and speedy, but that code shows a parse error - it quotes the line that contains
} else {
is there something I have missed?
Thanks very much
Stock
You are missing a semicolon at the end of the line before that.
Many many thanks Nibbler. I should have spotted that!
Regards
Stock
That's what I get when I copy and paste too quickly! ;D
I hate to be cheeky regarding this, but is it possible to tell me to add a line that opens up the table again the second time so you can have different bar wording when you go back to the home page as a logged in user. I know this is a coding query re changing the theme and hope you don't mind. I have tried and am learning php but I'm not there yet!
thanks, Stock
Existing code:
starttable("100%", "A new source of rights-managed images");
echo '<tr><td class="tablehome">';
if (USER_ID) {
print 'Click on a lorum ipsum below.<br />
Lorum ipsum lorum ipsum lorum ipsum here.<br /><br /><br />';
} else {
print '<STRONG><FONT SIZE=+2>Welcome to Stockshoots lorum impus</STRONG></FONT><br />
A new lorum ipsum etc of original film and digital right-managed imagery.<br 1/>
Click on the subject roundups below or use the seach tool on the right.<br />
You may need to login or register to see the images.<br /><br /><br />';
}
echo '</td></tr>';
endtable();
?>
If you mean you want a different table header for logged in/not logged in...
if (USER_ID) {
starttable("100%", "A new source of rights-managed images");
echo '<tr><td class="tablehome">';
print 'Click on a lorum ipsum below.<br />
Lorum ipsum lorum ipsum lorum ipsum here.<br /><br /><br />';
} else {
starttable("100%", "You are not logged in");
echo '<tr><td class="tablehome">';
print '<STRONG><FONT SIZE=+2>Welcome to Stockshoots lorum impus</STRONG></FONT><br />
A new lorum ipsum etc of original film and digital right-managed imagery.<br 1/>
Click on the subject roundups below or use the seach tool on the right.<br />
You may need to login or register to see the images.<br /><br /><br />';
}
echo '</td></tr>';
endtable();
?>
kegobeer
that is exactly it. thanks very very very much. I did try something like that but got all tongue tied.
Stock
if you want you can close this now. cheers again.