Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Banner issues and code placement


Platinum Games

Recommended Posts

Hello all,

 

Just a few little questions that seen to be straight forward.

 

As you can see in the image i have included in this post, i have marked the areas in red that need to be changed.

 

1) What i would like to do is use the code (HTML) i have added to the header.php file in a banner style, the code includes image and a few links. the way i have done this at the moment has made a mess with the SID'd. I don't know where to put the banner manager code to have this work correctley and just a little bit unsure how to write the code itself. I have read the KB about using the BM but i still cant get this to work.

 

2) i would like to move the default banner from the footer to just under the main text on the index template, can someone tell me what code to move and where to put it

 

screen-dump.gif

 

Thanking you all for your patience.

Thanks in advance!

 

Ben

Link to comment
Share on other sites

ok i have worked out how to use the html in the banner mgr and all works fine.

 

now how do i include the banner in the header.php file???

 

i have the following code.

 

<?php

if ($banner = tep_banner_exists('dynamic', '770x100')) {

?>

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>

</tr>

</table>

 

is this the right code and where do i put it

??

Thanks in advance!

 

Ben

Link to comment
Share on other sites

That is the right code and you put it wherever you want the banner to show up

 

But, the place where I think you are showing you want to put the banner is actually on the index.php file, not in the header so how you do it will depend on if you want it to show up only on the index page or on every single page throughout your website.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

That is the right code and you put it wherever you want the banner to show up

 

But, the place where I think you are showing you want to put the banner is actually on the index.php file, not in the header so how you do it will depend on if you want it to show up only on the index page or on every single page throughout your website.

 

 

Wendy,

 

Thanks for your reply,

 

i would like to put the main banner in the header.php so it is on every page, like i have it now, but at the moment i have just html code mixed in with the header.php code, now i think this has mixed up the SID's. so i would like to remove the html in the header.php and include it via the banner manager. when i put the banner manager code in the header.php i always get errors so i was not sure if i was doing correctly or not.

 

also i would like to just add a info banner (game adverts) on the index.php like the one in the footer.php.

 

have a look if you like www.platinumgames.com.au

 

thanks again.

Thanks in advance!

 

Ben

Link to comment
Share on other sites

Adding html code for your header image and links should not effect anything and I am still at a loss how using it via the banner manager would accomplish anything different than just placing it on the page.

 

To add the banners to the index.php on JUST the front page look for

<?php echo tep_customer_greeting(); ?>

 

and place the code

 

<?php

if ($banner = tep_banner_exists('dynamic', '468x50')) {

?>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>

</tr>

</table>

<?php

}

?>

 

above it, inside of the td tag so it would look something like

 

<td class="main"><?php

if ($banner = tep_banner_exists('dynamic', '468x50')) {

?>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>

</tr>

</table>

<?php

}

?><br><?php echo tep_customer_greeting(); ?></td>

 

May want to add another <br> or remove the <br> depending on how it looks.

 

Good luck.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Wendy,

 

Thanks for your prompt reply,

 

i will give that a shot for the index.php banner. (if i wanted the banner to show on all pages what file do i change???)

 

i think with the main banner, because i have html links in it it has messed up the SID's, and i thought if the banner was included via the banner mgr the session id would stay intact. as the BM does not show php links. just a wild guess.

 

any input from yourself would be great.

Thanks in advance!

 

Ben

Link to comment
Share on other sites

If you want it to show up on all pages then you will have to edit all of the main files to have it showing up where you want it on the page.

 

To make links that do not lose the session ID you just have to alter the code a bit.

 

Instead of just saying <a href="link.php">Link</a>

 

if you are adding it to the header or footer you would use

 

<a href="<?php echo tep_href_link('link.php')?>">Link</a>

 

if it is to a direct page or something like

<a href="<?php echo tep_href_link('index.php', 'cPath=21')?>">Womens Wear</a>

cpath being the link to whatever catagory you want to go to which you can find out by looking in the browser url

 

 

Atleast that has always worked for me.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

If you are linking to outside of osc you will lose any oscid once they leave the site anyhow. Atleast i think that is what you are talking about when you say SID... the numbers at the end of the url, right?

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Nope, i sure don't but I put some items in my cart and then wandered around clicking links and the items stay there so i don't see a problem.

 

As long as items stay in my cart i don't worry about the oscids, personally. Someone else may feel differently about them though.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Nope, i sure don't but I put some items in my cart and then wandered around clicking links and the items stay there so i don't see a problem.

 

As long as items stay in my cart i don't worry about the oscids, personally. Someone else may feel differently about them though.

 

 

cool thanks Wendy

Thanks in advance!

 

Ben

Link to comment
Share on other sites

hello Wendy

I see how you help this other person and wondering if you can help me

 

I put this code in my header.. I want it next to my store logo.

 

I put in

<?php

  if ($banner = tep_banner_exists('dynamic', '468x50')) {

?>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

  <tr>

    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>

  </tr>

</table>

and get this error

 

Parse error: parse error, unexpected $ in /home2/elle1/public_html/catalog/includes/header.php on line 116

 

than you

noppie

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...