Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Should i center or not?


lindsayanng

Recommended Posts

Just look at what i have now.. I am pretty happy with it. Its not super CLEAN, but it LOOKS good..

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

  • Replies 75
  • Created
  • Last Reply

Ok so now all we need is to figure out why it is not centering in Internet Explorer. Hmmm I'll give a look tomorrow.

Link to comment
Share on other sites

its really not centering in IE?? CRAP!!! i was when i was at work earlier!

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'm looking desperately for a picture that looks good of one of my furballs. I'm hoping I can find one fast enough to make it to the web! They'll be famous! *laughing*. The only ones I've found are just silly...

 

You're site's centering for me just fine..I'm using firefox though.

Link to comment
Share on other sites

its really not centering in IE?? CRAP!!! i was when i was at work earlier!

In IE6, family logo is centred. Every to the left is aligned to the left.

 

This thread is going to rival War And Peace before it is done.

Link to comment
Share on other sites

hah.. it seems when my and bktrain get working on something, our threads get insanely long..

 

So i gotta figure out WHY IE isnt seeing the center, I have the newest IE version and it also is aligning left.. and yea, everything else is centered.

 

in edit:

I forgot to ask, does anyone have a smaller non-widescreen cpu that they could view this on. I tried to mess with the screen res. at home with my laptop, but i dont think i got REAL results as to what it would look like on a lower res. non-wide screen..

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

So i gotta figure out WHY IE isnt seeing the center, I have the newest IE version and it also is aligning left.. and yea, everything else is centered.

The problem is probably in the css aligning the body?? left instead of the text left.

Link to comment
Share on other sites

did you mean this?

BODY {
 background: #ffffff;
 color: #000000;
 margin: 0px;
 text-align: center;

change to this

BODY {
 background: #ffffff;
 color: #000000;
 margin: 0px;
 align: center;

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

did you mean this?

BODY {
 background: #ffffff;
 color: #000000;
 margin: 0px;
 text-align: center;

change to this

BODY {
 background: #ffffff;
 color: #000000;
 margin: 0px;
 align: center;

Hmm, not quite what I was thinking of. I had a similar problem a while ago and it was from memory that I posted (should have checked). It was something quirky with the stylesheet that I messed up during the course of making changes. However, your code is the same as mine except for the colours.

 

BTW, I used the Fixed Width Site With CSS addon to center my site. It works.

Link to comment
Share on other sites

The thing is, witht hose, it centers the whole site with the fixed width correct?? I wanted to header and footer to stretch 100% of the browser width and just center and fix the width of the main content.

 

if none of this works, i might just do that and work on tweeking the code a little to get what i want out of it.

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

The thing is, witht hose, it centers the whole site with the fixed width correct?? I wanted to header and footer to stretch 100% of the browser width and just center and fix the width of the main content.

 

if none of this works, i might just do that and work on tweeking the code a little to get what i want out of it.

Can you just add them to the header and footer, but do the header edit at the bottom of the file and the footer edit at the top of the file, if you get the drift?

Link to comment
Share on other sites

2 things

1 The fix you made in the articles box below your site search is wrong. at the nottom you have </tr></td> Should be </td></tr>.

2 I still think you are missing a </table> in the index file

 

This could be what is messing with your centering issue

Link to comment
Share on other sites

ok. I am going to go through it with a fine tooth comb. i with the error message would just pop up and TELL ME!! but if i can't find it, i will have to call on your guys help again.. but i will do my best first so you dont have to strain your eyes.

 

If i cant figure out the issue, i am going to try what coopco suggested and use the contribution's code to see what difference that makes. If no different, then well.. we'll see.

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

Ok I just saw why it is not centering in IE. Make the changes from the last pm and these 2 changes as well.

 

includes/header.php Change

<div id="header">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>

To

<div id="header">

 

includes/footer.php change

 </td>
</tr>

</table>
</div>

To

</div>

Removing that main table bit we did a week or so will let IE cneter the middle content.

Link to comment
Share on other sites

OMG i just accidentally deleted your PM when i was freeing up space in my inbox.. can yo send it again

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

Do the above to get it to center in IE.

 

catalog/index.php find around line 309 - 312

		  <tr> 
		 <td><?php include(DIR_WS_MODULES . FILENAME_MAIN_CATEGORIES); ?>
		</td> 
	  </tr>

Change to

			 <?php include(DIR_WS_MODULES . FILENAME_MAIN_CATEGORIES); ?>

Find around line 313 - 316

		  <tr>
		<td class="main"><?php echo TEXT_MAIN;
		echo MAIN_TABLE; ?></td>
	  </tr>

Change to

		  <tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo MAIN_TABLE; ?></td>
	  </tr>

 

To fix the problem with the border in your MAIN_TABLE section do the following.

 

catalog/stylesheet.css add this to this section

/*For Main table at center of pages above "new products" on home page*/

.main_table_border {
 border-style: solid;
 border-color: #e04d07;
 border-width: 5px;
}
.sub_main_table_border {
 border-style: solid;
 border-color: #f36f3a;
 border-width: 1px;
}

catalog/includes/languages/english.php in the define('MAIN_TABLE', ''); part find

<table width="100%" border="5" cellpadding="2" cellspacing="0" bordercolor="#e04d07">

Change to

<table width="100%" cellpadding="2" cellspacing="0" class="main_table_border">

Change all 4 instances of

<td bordercolor="#f36f3a">

To

<td class="sub_main_table_border">

 

Topics box in left column under your search box. You need to change at the bottom </tr></td> to </td></tr>.

Link to comment
Share on other sites

you are a GENIUS! and a really nice and giving person. Everything looks pretty good for me!! i dont have IE, but i am looking for that site that lets you view your wepage in different browsers.. anyways.. THANKS!

 

I'm still new at tables, so i'm glad you caught those.. i am kinda relieved that they werent the tables i made from scratch though. I am SOOO bad at them, that i check and double check when i make my own..

 

ANYWAYS.. all is well, i just cant get the GO button so submit. Weird because its exactly the same code as before. I must be missing something somewhere..

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

Actualy when you were playing around with the login box you took out part of the code.

 

In header.php find this part

<div id="header">
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation" colspan="3">

Change the <tr> part to

  <tr class="headerNavigation">

Right below that you should see

	<td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>

Right after that you are missing this

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

That entire section right below the <td> that has your breadcrumb should look like this

<?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 class="smallText"><?php echo BOX_LOGINBOXH_EMAIL; ?></td>
		  <td><?php echo tep_draw_input_field('email_address'); ?></td>
		  <td class="smallText"><?php echo BOX_LOGINBOXH_PASSWORD; ?></td>
		  <td><?php echo tep_draw_password_field('password'); ?></td>
		  <td><?php echo tep_image_submit('button_go.gif', IMAGE_BUTTON_LOGIN); ?></td>
		  <td align="center" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . BOX_LOGINBOXH_FORGOT_PASSWORD . '</a>'; ?></td>
		  <td align="center" class="smallText"><?php echo '<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
?>

Link to comment
Share on other sites

now it says unexpected $end on line 165.. but 165 is my closing </div>

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

ooops. got it. I missed the close session.

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

Just in case here is the entire header file again

<?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 class="smallText"><?php echo BOX_LOGINBOXH_EMAIL; ?></td>
		  <td><?php echo tep_draw_input_field('email_address'); ?></td>
		  <td class="smallText"><?php echo BOX_LOGINBOXH_PASSWORD; ?></td>
		  <td><?php echo tep_draw_password_field('password'); ?></td>
		  <td><?php echo tep_image_submit('button_go.gif', IMAGE_BUTTON_LOGIN); ?></td>
		  <td align="center" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . BOX_LOGINBOXH_FORGOT_PASSWORD . '</a>'; ?></td>
		  <td align="center" class="smallText"><?php echo '<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
?>
 </tr>
</table>
<table border="0" width="100%" cellspacing="1" cellpadding="0">
 <tr class="header">
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'furryfamilylogo.jpg', 'furryfamilylogo') . '</a>'; ?></td>
<td align="right" valign="top"><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_account.gif', LOGIN_BOX_PRODUCTS_NEW) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', LOGIN_BOX_MY_ACCOUNT) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', LOGIN_BOX_ACCOUNT_EDIT) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', LOGIN_BOX_ACCOUNT_HISTORY) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', LOGIN_BOX_ADDRESS_BOOK) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', LOGIN_BOX_PRODUCT_NOTIFICATIONS) . '</a>  ' .
																   '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', 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>
<?php
 }
?>
</div>
<div id="content">

Link to comment
Share on other sites

awesome.. THANKS SO MUCH.. the look of my store is REALLY coming along.. I'm SOO happy with the progress it has made!! And i have to say, i am a little proud of the progress i have made too.. remember, when i started, i didnt know what SERVER SIDE meant.

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

You're welcome. Glad we got it back together.

 

Just remember when using tables every <table><tr><td> must have a </td></tr></table> and they must follow that order. You must also account for the same number of <td> in each row of the table.

 

Example 1

<table>
 <tr>
<td></td>
<td></td>
 </tr>
 <tr>
<td></td>
<td></td>
 </tr>
</table>

Example 2

<table>
 <tr>
<td></td>
<td></td>
 </tr>
 <tr>
<td colspan="2"></td>
 </tr>
</table>

Link to comment
Share on other sites

I understand that.. i think my biggest issue is when there is kinda of a table within a table. If its a table that i made, i can understand it almost fully well, but if its a basic oscommerce table, or something someone else made, then i start getting lost.

 

thanks SOO MUCH

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

Archived

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

×
×
  • Create New...