Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: integrating code for home page  (Read 4506 times)

0 Members and 1 Guest are viewing this topic.

stock

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
integrating code for home page
« on: August 20, 2005, 08:59:13 pm »

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

?>
« Last Edit: August 21, 2005, 08:55:58 am by GauGau »
Logged

stock

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
Re: integrating code for home page
« Reply #1 on: August 20, 2005, 09:00:54 pm »

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

thanks

Stock
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: integrating code for home page
« Reply #2 on: August 20, 2005, 09:28:07 pm »

Code: [Select]
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();

?>
« Last Edit: August 20, 2005, 11:03:51 pm by kegobeer »
Logged
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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
Re: integrating code for home page
« Reply #3 on: August 20, 2005, 09:38:02 pm »

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
Logged

Nibbler

  • Guest
Re: integrating code for home page
« Reply #4 on: August 20, 2005, 09:49:24 pm »

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

stock

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
Re: integrating code for home page
« Reply #5 on: August 20, 2005, 09:53:59 pm »

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

Stock
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: integrating code for home page
« Reply #6 on: August 20, 2005, 11:04:09 pm »

That's what I get when I copy and paste too quickly!   ;D
Logged
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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
Re: integrating code for home page
« Reply #7 on: August 21, 2005, 12:33:49 am »

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

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: integrating code for home page
« Reply #8 on: August 21, 2005, 12:36:50 am »

If you mean you want a different table header for logged in/not logged in...

Code: [Select]
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();
?>
Logged
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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
Re: integrating code for home page
« Reply #9 on: August 21, 2005, 12:44:55 am »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.