integrating code for home page integrating code for home page
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

integrating code for home page

Started by stock, August 20, 2005, 08:59:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stock

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

?>

stock

just to clarify my last post, the page starts with <?php and the commented out Coppermine gallery bit.

thanks

Stock

kegobeer

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

?>
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

stock

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

Nibbler

You are missing a semicolon at the end of the line before that.

stock

Many many thanks Nibbler.  I should have spotted that!
Regards

Stock

kegobeer

That's what I get when I copy and paste too quickly!   ;D
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

stock

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

kegobeer

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();
?>
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

stock

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.