Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Repeating background in table


lindsayanng

Recommended Posts

Posted

I made a simple little rectangular image that i would LIKE to have repeat across the top of the site where the account info is upon log in. (if you want to log in, use eamil: [email protected] password: testing) to see what i am talking about

 

So i want the basic orange bar to be a repeating graphic.

 

I looked at the code again and saw that it called for <td class="headerNavigation"....

 

so went to the stylesheet and added to it

background-image=url(images/navbartable.gif);

background-repeat=repeat;

 

but NOTHING HAS WORKED

 

am i coding the background image wrong? I have never done this. I dont use a lot of images as backgrounds..Any help is appreciated

 

Here is my HEADER CODE:

<?php
/*
 $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

##################################################################
IMPORTANT NOTE:
 This is not part of the official osC distribution
 but an add-on contributed to the osC community. Please
 read the README document that are provided
 with this file for further information and installation notes.

 This puts a login request in a box with a login button.
 If already logged in, will not show anything.

 Modified to utilize SSL to bypass Security Alert

 LoginboxV5.4_header http://avzwebdesign.nl/oscommerce/
##################################################################
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
  $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
}
 }

// check if the configure.php file is writeable
 if (WARN_CONFIG_WRITEABLE == 'true') {
if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
  $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
}
 }

// check if the session folder is writeable
 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
if (STORE_SESSIONS == '') {
  if (!is_dir(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
  } elseif (!is_writeable(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
  }
}
 }

// check session.auto_start is disabled
 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
if (ini_get('session.auto_start') == '1') {
  $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
}
 }

 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
if (!is_dir(DIR_FS_DOWNLOAD)) {
  $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
}
 }

 if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
 }
?>
<div id="header">
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
<td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
<?php
// added for loginbox
 if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) !=  FILENAME_CREATE_ACCOUNT) && !tep_session_is_registered('customer_id')) {
 if (!tep_session_is_registered('customer_id')) {

?>
<!-- loginbox //-->
<td align="right"><?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?>   
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
<td align="right" class="smallText"><?php echo BOX_LOGINBOXH_EMAIL; ?>
<?php echo tep_draw_input_field('email_address'); ?>

<?php echo BOX_LOGINBOXH_PASSWORD; ?>
		<?php echo tep_draw_password_field('password'); ?>
		  <?php echo tep_image_submit('button_go.gif', IMAGE_BUTTON_LOGIN); ?>
<?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . BOX_LOGINBOXH_FORGOT_PASSWORD . '</a>'; ?>
<?php echo BOX_LOGINBOXH_TEXT_NEW . ' ' . '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . BOX_LOGINBOXH_NEW . '</a>'; ?></td>
 </tr>
</table></td>
  </tr>
 </table></form></td>

<?php
  } // close tep_session_is_registered
 } else {
// If you want something to show in place of the loginbox when logge in or on login or create account page,
// place that code between the <td align="left"></td> below
?>
<td align="right"></td>
<?php
} // close if
// end loginbox
?>
<table border="0" width="100%" cellspacing="1" cellpadding="0">

 <tr class="header">
<?php
// added for loginbox

// end loginbox
?>
<td width="100%" align="right" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'furryfamilylogo.jpg', 'furryfamilylogo') . '</a>                    ' ?></td>
<td align="right"><table border="2px" width="175px" cellspacing="0" cellpadding="3">
  <tr>
	<td class="headerCart" align="center"><b><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerCart"><?php echo 'Your Cart Contents'; ?></a></b><br><?php echo $cart->count_contents() . ' Items'; ?><br><?php echo 'SubTotal:' . $currencies->format($cart->show_total()); ?><br><a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"class="headerCart"><?php echo HEADER_TITLE_CHECKOUT;?></a> | <a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerCart"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></td>
  </tr>
</table></td>
 </tr>
<?php
// added for my account nav bar links for loginbox
if (tep_session_is_registered('customer_id')) {
?>
 <tr>
<td class="headerNavigation" align="center" colspan="3"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_new_account.png', LOGIN_BOX_PRODUCTS_NEW) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_my_account.png', LOGIN_BOX_MY_ACCOUNT) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_edit_account.png', LOGIN_BOX_ACCOUNT_EDIT) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_history_account.png', LOGIN_BOX_ACCOUNT_HISTORY) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_addresses_account.png', LOGIN_BOX_ADDRESS_BOOK) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_notification_account.png', LOGIN_BOX_PRODUCT_NOTIFICATIONS) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff_account.png', LOGIN_BOX_LOGOFF) . '</a>'; ?></td>
 </tr>
<?php
} // close if
// end my account nav bar links for loginbox
?>	
</table>
<? //---PayPal WPP Modification START ---// ?>
<?php
if (tep_session_is_registered('customer_id')) {
  $show_user_options = true;
  if (tep_paypal_wpp_enabled() && tep_session_is_registered('paypal_ec_temp')) {
//If this is a temp account that'll be deleted, don't show account information
if ($paypal_ec_temp) {
  $show_user_options = false;
}
 }
} else {
$show_user_options = false;
 }
?>

<? //---PayPal WPP Modification END ---// ?>
<?php
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerError">
<td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
 </tr>
</table>
<?php
 }

 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerInfo">
<td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
 </tr>
</table>
</table>
<?php
 }
?>
</div><div id="content">

 

 

here is my style sheet: (this is just a snippet of it) - also moved the background-image from the TD headerNavigation to teh TR headerNavigation

 

TR.header {
 background: #FFFFFF;
}

TR.headerNavigation {
 background: #e04d07;
 background-image: url(images/navbartable.gif);
}

TD.headerNavigation {
 font-family: Verdana, Arial, sans-serif;
 font-size: 12px;
  background: #e04d07;
 color: #ffffff;
 font-weight : bold;
}

A.headerNavigation { 
 color: #ffffff;
}

A.headerNavigation:hover {
 text-decoration: underline;
}

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!!

Posted

If I understand correctly you want it on the row that has the account links, new stuff, my account etc?

If so try this.

In this section, tha part where the pics for the account links are

<?php
// added for my account nav bar links for loginbox
if (tep_session_is_registered('customer_id')) {
?>
 <tr>
<td class="headerNavigation" align="center" colspan="3"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_new_account.png', LOGIN_BOX_PRODUCTS_NEW) . '</a>  ' .

Change the

<tr>

to

<tr class="account_links">

Then in your stylesheet add

.account_links {
 background-image: url(images/navbartable.gif);
 background-repeat: repeat;
}

Doing this will leave the TD.headerNavigation class alone since other parts of your store use that. Unless of course you want that image to show in every <td> that uses that class.

Posted

thats PERFECT!! thanks again BKTraiN! i owe you my first born by now. i will let you know how it all works

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!!

Posted

I just decided to give it a try and saw that it probably isn't going to work. If not then do it this way.

In the stylesheet add

.account_links {
 background-image: url(images/navbartable.gif);
 background-repeat: repeat;
 font-family: Verdana, Arial, sans-serif;
 font-size: 12px;
 color: #ffffff;
 font-weight : bold;
}

That will add in to handle any text navigation you may put in in the future.

Instead of changing the <tr> to

<tr class="account_links">

make it

<tr class="headerNavigation">

The <td> right below that change

<td class="account_links" align="center" colspan="2">

That should work atleast it does on mine.

Posted

awesome.. THANKS!! works perfectly, i just need to figure out how to make the .gif work so that there is no littlle bit of color between them, AND change the buttons and such,

 

THANKS!!

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!!

Posted

Ok Lindsay, You've been playing in here again?? First of I'm not sure if this is the fix you're after but find this section

<?php
} // close if
// end loginbox
?>
<table border="0" width="100%" cellspacing="1" cellpadding="0">

 <tr class="header">
<?php
// added for loginbox

// end loginbox
?>

Change the cellpadding to 0 here

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

I also noticed in the header that you posted above you are missing a </tr> and </table>

Right above the <table> you are making cellpadding change on should be a </tr></table> like so

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

Posted

hmm... i havent made ANY changes to the header since we worked on it.. It must have been something i missed throughout that lovely 15 page thread though..

 

Anyways, thanks again..

 

getting rid of the cell padding has still not gotten rid of the spaces between my images though..

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!!

Archived

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

×
×
  • Create New...