Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Extraneous padding in header. Possible html or php error.


Aunt Clara

Recommended Posts

I have a shop that serves two different websites in two different languages. Because of this I need a different header for each different language, but when I added the code to switch images and urls on changing a language some strange padding was added to those rows. :angry:

 

I am adding the header code and a link so you can see what I am talking about:

http://shop.dominicancooking.com/index.php?language=en

http://shop.dominicancooking.com/index.php?language=es

 

<?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
*/

// 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 style="height:15px; "></div>
<div align="center">
 <center>
<table width="758"  border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
	<tr>
	  <td width="94%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
		<tr>
		  <td align="center">
		 <img src="<?php echo DIR_WS_IMAGES  ?>/topbannershop.gif" width="758" height="90">
		</td>
		</tr>
		<tr>
		  <td align="center">
		   <?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?><img src="<?php echo DIR_WS_IMAGES  ?>/header_and_navcut5.gif" width="758" height="160">
						<?
					}
					else
					{
						?>
						 <img src="<?php echo DIR_WS_IMAGES  ?>/header_and_navcut5es.gif" width="758" height="160">			
						<?
					}
				 ?></td>
		</tr>
		<tr>
		  <td>
		  <div align="center">
			<center>
		  <table width="100%"  border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="46">
			<tr>
			  <td width="100%" background="<?php echo DIR_WS_IMAGES  ?>theme/bg.gif">
			  <div align="center">
				<center>
				<table border="0" cellpadding="0" cellspacing="0" height="24" style="border-collapse: collapse" bordercolor="#111111" width="758" id="AutoNumber1" background="<?php echo DIR_WS_IMAGES  ?>theme/headerbg1.gif">
				  <tr>
					<td width="24" align="center"> </td>
					<td align="center"><span class="top" style="color: none">			  
					<?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?><a href="http://www.dominicancooking.com"><img src="images/theme/menu.jpg" width="112" height="24" border="0"></a>
					<?
					}
					else
					{
						?><a href="http://www.cocinadominicana.com"><img src="images/theme/menues.jpg" width="112" height="24" border="0"></a>
					<?
					}
				 ?></td>
					<td align="center">
				   <?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?><a href="http://www.dominicancooking.com/dominican-recipes/"><img src="images/theme/menu1.jpg" width="112" height="24" border="0"></a>
					<?
					}
					else
					{
						?><a href="http://www.cocinadominicana.com/recetas-dominicanas/"><img src="images/theme/menu1es.jpg" width="112" height="24" border="0"></a>
					<?
					}
				 ?></td>
				 <td align="center">
				   <?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?><a href="http://www.dominicancooking.com/section-articles.html"><img src="images/theme/menu2.jpg" width="112" height="24" border="0"></a>
					<?
					}
					else
					{
						?><a href="http://www.cocinadominicana.com/pagina-articulos.html"><img src="images/theme/menu2es.jpg" width="112" height="24" border="0"></a>
					<?
					}
				 ?></td>
				 <td align="center">
				   <?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?><a href="http://www.dominicancooking.com/section-aboutus.html"><img src="images/theme/menu5.jpg" width="112" height="24" border="0"></a>
					<?
					}
					else
					{
						?><a href="http://www.cocinadominicana.com/pagina-nosotros.html"><img src="images/theme/menu5es.jpg" width="112" height="24" border="0"></a>
					<?
					}
				 ?></td>
				  <td align="center">
				   <?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?><a href="http://www.dominicancooking.com/forums/forums.php"><img src="images/theme/menu3.jpg" width="112" height="24" border="0"></a>
					<?
					}
					else
					{
						?><a href="http://www.cocinadominicana.com/foros/foros.php"><img src="images/theme/menu3es.jpg" width="112" height="24" border="0"></a>
					<?
					}
				 ?></td>
				 <td align="center">
				   <?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?><a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><img src="images/theme/menu4.jpg" width="112" height="24" border="0"></a>
					<?
					}
					else
					{
						?><a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><img src="images/theme/menu4es.jpg" width="112" height="24" border="0"></a>
					<?
					}
				 ?><td width="24" align="center"> </td>
				  </tr>
				</table>
				</center>
			  </div>
			  </td>
			</tr>




 <tr>
			  <td width="758" height="46" align="center" background="<?php echo DIR_WS_IMAGES  ?>theme/headerbg2.gif">

		   <div align="center">
			 <center>
			 <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="70%" id="AutoNumber3">
			   <tr>
				 <td align="center">
				 <img border="0" src="images/theme/testtopnavbarbg.gif" width="10" height="22"></td>
				 <td align="center"><span class="style6">
				 <?
				 	$lang_id=$_SESSION['languages_id'];
					if($lang_id==1)
					{
						?>
						 <a href="index.php?language=es" class="top" style="color:#fa723e; text-decoration:none">Espa?ol</a></td>			
						<?
					}
					else
					{
						?>
						 <a href="index.php?language=en" class="top" style="color:#fa723e; text-decoration:none">English</a></td>			
						<?
					}
				 ?>
				 <td align="center">
				 <img border="0" src="images/theme/testtopnavbarbg.gif" width="10" height="22"></td><td align="center"><span class="style6">					 
				<?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF); ?>" class="top" style="color:#818158; text-decoration:none">Log Off</a> <?php } ?>
				<?php echo ( (!tep_session_is_registered('customer_id') and (!strstr($PHP_SELF,FILENAME_LOGIN) and !strstr($PHP_SELF,'create')) ) ? ('<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"' . ' " class="top" style="color:#818158; text-decoration:none">' .HEADER_TITLE_LOGIN. '</a>  ') : ''); ?></td>
				 <td align="center">				
				 <img border="0" src="images/theme/testtopnavbarbg.gif" width="10" height="22"></td>
				 <td align="center"><span class="style6">
				 <?
				 if($lang_id==1)
					{
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH); ?>" class="top" style="color:#818158; text-decoration:none">Search</a></td>			
				 <? 
				 }
				 else
				 {
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH); ?>" class="top" style="color:#818158; text-decoration:none">Buscar</a></td>			
				 <?
				 } 
				 ?>
				 <td align="center">
				<img border="0" src="images/theme/testtopnavbarbg.gif" width="10" height="22"></td>
				 <td align="center"><span class="style6">
				 <?
				 if($lang_id==1)
					{
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="top" style="color:#818158; text-decoration:none">Check Out</a></td>
				  <? 
				 }
				 else
				 {
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="top" style="color:#818158; text-decoration:none">Hacer Pedido</a></td>
				 <?
				 } 
				 ?>
				 <td align="center">
				 <img border="0" src="images/theme/testtopnavbarbg.gif" width="10" height="22"></td>
				 <td align="center"><span class="style6">
				 <?
				 if($lang_id==1)
					{
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_SHIPPING); ?>" class="top" style="color:#818158; text-decoration:none">Shipping</a></td>
				 <? 
				 }
				 else
				 {
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_SHIPPING); ?>" class="top" style="color:#818158; text-decoration:none">Env?os</a></td>
				 <?
				 } 
				 ?> 
				 <td align="center">
				 <img border="0" src="images/theme/testtopnavbarbg.gif" width="10" height="22"></td>
				 <td align="center"><span class="style6">
				 <?
				 if($lang_id==1)
					{
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_CONTACT_US); ?>" class="top" style="color:#818158; text-decoration:none">Contact Us</a></td>
				 <? 
				 }
				 else
				 {
				 ?>
				 <a href="<?php echo tep_href_link(FILENAME_CONTACT_US); ?>" class="top" style="color:#818158; text-decoration:none">Cont?ctenos</a></td>
				 <?
				 } 
				 ?>
				 <td align="center">
				 <img border="0" src="images/theme/testtopnavbarbg.gif" width="10" height="22"></td>
			   </tr>
			   <tr>
				 <td align="center" colspan="13" height="10">
				 </td>
			   </tr>
			   </table>
			 </center>
		   </div>
			  </td>
			</tr>
</table>
		  <div align="center">
			<center>
<table border="0" width="758" cellspacing="0" cellpadding="10" background="bodybg.gif" height="40" style="border-collapse: collapse" bordercolor="#111111">

 <tr>
<td width="100%" align="left" class=boxText>  <?php echo $breadcrumb->trail(' » '); ?></td>
</tr>
</table>

			</center>
		  </div>

		  </center>
		  </div>
		  </td>
		</tr>
	  </table></td>
	</tr>
</table>

 </center>
</div>

<?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
 }
?>

Thanks for your help

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...