Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Centering Banner Image


timmle

Recommended Posts

I have put my entire site into two div tables. One for the header down to that navbar thing, and one for the rest of the page. Now i want to comletely centralize my image banner which runs accross the entire top of the site.

 

This as you know is the line of code to the image banner.

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'fresh_logo2.gif', STORE_NAME ) . '</a>'; ?>

 

How would i make that sit dead centre in my div box??

Link to comment
Share on other sites

i think you just need to add <div> align="center"> for that div that you created.. i dont know too much about div.. i usually use tables instead, but i am pretty sure that would work just fine

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

lindsayanng - I love your idea for the contribution that your looking for - please post this if you ever find one.

 

Cheers

Leeanne. ;-)

Link to comment
Share on other sites

someone is working on one right now.. It was an idea that i knew there was NO WAY i could do it.. I am NOT a programmer in any way, i just can a "repair person" :)

 

Anyways.. keep an eye on the contribution developement section.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

i think you just need to add <div> align="center"> for that div that you created.. i dont know too much about div.. i usually use tables instead, but i am pretty sure that would work just fine

 

Aloomst there:

 

<div align="center">

 

Remember to close with </div> too

Link to comment
Share on other sites

hah.. i WAS CLOSE!!!

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

can i see a link to your site so i know what is happening

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

For what it's worth...

:blush:

 

I haven't used div's much, but as it stands using tables, you'll not get the logo centered until you put it on it's own <tr>

 

As the code stands now, it shares the same <tr> with the other 3 little images in the lower right of the header.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

In that case, all you need to do to center the banner is change this:

 

<td valign="middle">

to

 

<td align="center" valign="middle">

in the HTML preceding the PHP code you posted.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I just tried what you have said here, and absolutely nothing happens whatsoever???

 

<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'fresh_logo2.gif',.....

 

I changed the (<td valign="middle">) to (<td align="center" valign="middle">) in that part just before my banner image, and it doesn't do anything atall.

 

 

Anybody Know what's happening?

 

 

In that case, all you need to do to center the banner is change this:

 

<td valign="middle">

to

 

<td align="center" valign="middle">

in the HTML preceding the PHP code you posted.

)

Link to comment
Share on other sites

You have it on the wrong line.

 

The HTML says this:

 

<tr class="header">
<td valign="middle"><a href="http://nitrotoysandhobbies.com/oscommerce/index.php"><img src="images/nitrobanner.jpg" alt="Nitro Banner" title=" Nitro Banner " border="0" height="140" width="1005"></a></td>
<td align="center" valign="bottom">
 </td></tr>

It should be:

 

<tr class="header">
<td align="center" valign="middle"><a href="http://nitrotoysandhobbies.com/oscommerce/index.php"><img src="images/nitrobanner.jpg" alt="Nitro Banner" title=" Nitro Banner " border="0" height="140" width="1005"></a></td>
</tr>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Slighty confused me, because you have used html for all the image content, links etc, but this is what i have... i can't see how it is different yo the example you ahve shown...

 

 

<tr class="header">
   <td align="center" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'fresh_logo2.gif', STORE_NAME ) . '</a>'; ?></td>
   <td align="right" valign="bottom"><?php // echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>

You have it on the wrong line.

 

The HTML says this:

 

<tr class="header">
<td valign="middle"><a href="http://nitrotoysandhobbies.com/oscommerce/index.php"><img src="images/nitrobanner.jpg" alt="Nitro Banner" title=" Nitro Banner " border="0" height="140" width="1005"></a></td>
<td align="center" valign="bottom">
 </td></tr>

It should be:

 

<tr class="header">
<td align="center" valign="middle"><a href="http://nitrotoysandhobbies.com/oscommerce/index.php"><img src="images/nitrobanner.jpg" alt="Nitro Banner" title=" Nitro Banner " border="0" height="140" width="1005"></a></td>
</tr>

Link to comment
Share on other sites

That's not how it comes out in your HTML source.

 

The PHP should look like this:

 

<tr class="header">
<td align="center" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'fresh_logo2.gif', STORE_NAME ) . '</a>'; ?></td>
</tr>

Until you can get it as I posted, it won't be centered.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Now I've really screwed something up. I was trying to change my index.php page from what comes on default through english.php. I changed what it had in the TEXT_MAIN and now my site doesn't work at all. When I view the site it's just a white page. HELP!!

Link to comment
Share on other sites

What's wrong here??

define('TEXT_MAIN', 'This is a default setup of the osCommerce project, products shown are for demonstrational purposes, <b>any products purchased will not be delivered nor will the customer be billed.</b> Any information seen on these products is to be treated as fictional.
'<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>

Link to comment
Share on other sites

define('TEXT_MAIN', 'The trick in working with TEXT_MAIN is the \' (single tick mark).<br>
PHP doesn\'t know what to do with them unless you put the backslash in front of it.<br>
I guess it can\'t figure out what you want, so it doesn\'t display anything.<br>
<br>
I hope this demo hasn\'t been in vain.');

This is virgin TEXT_MAIN:

 

define('TEXT_MAIN', 'This is a default setup of the osCommerce project, products shown are for demonstrational purposes, <b>any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Error Messages</b><br><br>If there are any error or warning messages shown above, please correct them first before proceeding.<br><br>Error messages are displayed at the very top of the page with a complete <span class="messageStackError">background</span> color.<br><br>Several checks are performed to ensure a healthy setup of your online store - these checks can be disabled by editing the appropriate parameters at the bottom of the includes/application_top.php file.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be modified in the following file, on each language basis:<br><br><nobr class="messageStackSuccess">[path to catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or via the Administration Tool with the <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr> or <nobr class="messageStackSuccess">Tools->File Manager</nobr> modules.<br><br>The text is set in the following manner:<br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text highlighted in green may be modified - it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>More information concerning the PHP define() function can be read <a href="http://www.php.net/define" target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Securing The Administration Tool</b><br><br>It is important to secure the Administration Tool as there is currently no security implementation available.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main" valign="top"><b>Online Documentation</b><br><br>Online documentation can be read at the <a href="http://www.oscommerce.info" target="_blank"><u>osCommerce Knowledge Base</u></a> site.<br><br>Community support is available at the <a href="http://www.oscommerce.com/forums" target="_blank"><u>osCommerce Community Support Forums</u></a> site.</td></tr></table><br>If you wish to download the solution powering this shop, or if you wish to contribute to the osCommerce project, please visit the <a href="http://www.oscommerce.com" target="_blank"><u>support site of osCommerce</u></a>. This shop is running on osCommerce version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.');

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Let this be a lesson.

 

Before you edit anything, MAKE A BACKUP COPY OF IT.

 

A file that doesn't work quite like you want is better than one that won't work at all.

 

I've learned this lesson the hard way more than once....

:blush:

 

And if anyone asks....

 

I'm "butter-rum"!

:lol:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I see no code change at all in your header.

:huh:

 

I can't tell if you're not making the changes correctly, or not getting the altered file to the right place on the server.

:blink:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Hmm, well you said it had to be like this;

 

It should be:

 

CODE

<tr class="header">

<td align="center" valign="middle"><a href="http://nitrotoysandhobbies.com/oscommerce/index.php"><img src="images/nitrobanner.jpg" alt="Nitro Banner" title=" Nitro Banner " border="0" height="140" width="1005"></a></td>

</tr>

 

so i changed mine so it now looks like this;

 

<tr class="header">
   <td align="center" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'fresh_logo2.gif', STORE_NAME ) . '</a>'; ?></td>

 </tr>

 

And by looking at those together, they look absolutely identicle, except from the fact mine is php and yours is html.

 

 

???

Link to comment
Share on other sites

READ MY LIPS:

 

THE REVISED CODE ISN'T GETTING TO YOUR WEB SITE.

 

CLEAR?

:unsure:

 

That's why nothing changes.

:huh:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

On this banner... how do I set the width to 100% so the banner will fit on any size screen? Thanks!

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'nitrobanner.jpg', 'Nitro Banner') . '</a>'; ?></td>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...