Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with changing banner


bggashnik

Recommended Posts

Now here's the problem:

I installed oscommerce and set some template with 2 banners(banner1.jpg and banner2.jpg).When i try to edit header.php and put my own and only banner i get image disordering...I guess that the problem is in wrong file editing.Here i post my header.php and footer.php.I hope you edit it for me so it has only one and bigger banner.

 

header.php

<?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');
 }
?>
<!-- start -->
<table cellpadding="0" cellspacing="0" border="0" class="main_1">
<tr>
	<td align="center">	
		<table cellpadding="0" cellspacing="0" border="0" style="width:718px">
			<tr>
				<td style="height:102px">
					<table cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td style="width:345px; padding:16px 0px 0px 0px;">
								<a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'logo.jpg')?></a>
							</td>
							<td style="width:220px; padding:45px 0px 0px 0px;"><?php
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
}
$languages_string = '';
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
$languages_string .= '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a>  ';
}
echo $languages_string;
?><?php
echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');
reset($currencies->currencies);
$currencies_array = array();
while (list($key, $value) = each($currencies->currencies)) {
  $currencies_array[] = array('id' => $key, 'text' => $value['title']);
}
$hidden_get_variables = '';
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
  if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
	$hidden_get_variables .= tep_draw_hidden_field($key, $value);
  }
}
echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="jamp"') . $hidden_get_variables . tep_hide_session_id();
echo '</form>';
?>
							</td>
							<td style="padding:37px 0px 0px 0px;">
								<table cellpadding="0" cellspacing="0" border="0">
									<tr>
										<td><?php echo tep_image(DIR_WS_IMAGES.'hp.jpg')?></td>
										<td style="width:100%; padding:4px 0px 0px 0px;"><h1><?php echo BOX_HEADING_SHOPPING_CART?>: <br /><a href="<?php echo tep_href_link('shopping_cart.php')?>"><?php echo $cart->count_contents()?> <?php echo BOX_SHOPPING_CART_EMPTY?></a></h1></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style="height:184px">
					<a href="<?php echo tep_href_link('shipping.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'banner1.jpg')?></a><a href="<?php echo tep_href_link('index.php?cPath=3')?>"><?php echo tep_image(DIR_WS_IMAGES.'banner2.jpg')?></a>
				</td>
			</tr>
			<tr>
				<td style="height:73px" align="center">
					<table cellpadding="0" cellspacing="0" border="0" style=" width:1px;">
						<tr><td><a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image_button('m1.jpg')?></a><a href="<?php echo tep_href_link('products_new.php')?>"><?php echo tep_image_button('m2.jpg')?></a><a href="<?php echo tep_href_link('specials.php')?>"><?php echo tep_image_button('m3.jpg')?></a><a href="<?php echo tep_href_link('account.php')?>"><?php echo tep_image_button('m4.jpg')?></a><a href="<?php echo tep_href_link('contact_us.php')?>"><?php echo tep_image_button('m5.jpg')?></a></td></tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style="padding:0px 3px 5px 5px;">
<!-- 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
 }
?>
<!-- start -->

<!-- end -->

<?php 
define(MAX_DESCR_1,'80');

define(MAX_DESCR_NAME,'35');
define(MAX_DESCR_NAME_SHOPPCART,'35');
define(MAX_DESCR_BESTS,'19');
define(MAX_DESCR_REVIEWS,'50');
define(MAX_DESCR_NAME_BOX,'15');
?>

 

footer.php

<?php
/*
 $Id: footer.php,v 1.26 2003/02/10 22:30:54 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require(DIR_WS_INCLUDES . 'counter.php');
?>
	</td>
</tr>
<tr>
	<td class="footer">
		<table cellpadding="0" cellspacing="0" border="0" style="width:718px" align="center">
			<tr>
				<td style="padding:11px 0px 0px 13px;">

					<table cellpadding="0" cellspacing="0" border="0"><tr>
					<td><?php echo tep_image(DIR_WS_IMAGES.'fp.jpg','','','',' align="left" style="margin-right:31px;"')?></td>
					<td width="100%">
					<a href="<?php echo tep_href_link('reviews.php')?>"><?php echo BOX_HEADING_REVIEWS?></a>  |  <a href="<?php echo tep_href_link('advanced_search.php')?>"><?php echo BOX_SEARCH_ADVANCED_SEARCH?></a>  | <? if (tep_session_is_registered('customer_id')) { 
?>  | <a href="<?php echo tep_href_link('account.php')?>"><?php echo HEADER_TITLE_MY_ACCOUNT?></a>  | <? } else 
{ ?><a href="<?php echo tep_href_link('create_account.php')?>"><?php echo HEADER_TITLE_CREATE_ACCOUNT?></a><? } 
?>  |  <? if (tep_session_is_registered('customer_id')) { 
?><a href="<?php echo tep_href_link('logoff.php')?>"><?php echo HEADER_TITLE_LOGOFF?></a><? } else 
{ ?><a href="<?php echo tep_href_link('login.php')?>"><?php echo HEADER_TITLE_LOGIN?></a><? } 
?><br style="line-height:1px;"><br style="line-height:5px;"><?php echo FOOTER_TEXT_BODY?>  |  <a href="<?php echo tep_href_link('privacy.php')?>"><?php echo BOX_INFORMATION_PRIVACY?></a></td></tr></table>
				</td>
			</tr>
		</table>
	</td>
</tr>
</table>

<?php
 if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td align="center"><?php /*  echo tep_display_banner('static', $banner);  */ ?></td>
 </tr>
</table>
<?php
 }
?>

Link to comment
Share on other sites

are you saying that the images or distorted or disordered? I am confused?

 

can you post a link to your site?

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

Here's the site so you can see clearly the problem.And here's the edited header.php by me.You can see that i put header.jpg for one and only banner.

 

<?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');
 }
?>
<!-- start -->
<table cellpadding="0" cellspacing="0" border="0" class="main_1">
<tr>
	<td align="center">	
		<table cellpadding="0" cellspacing="0" border="0" style="width:718px">
			<tr>
				<td style="height:102px">
					<table cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td style="width:345px; padding:16px 0px 0px 0px;">
								<a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'logo.jpg')?></a>
							</td>
							<td style="width:220px; padding:45px 0px 0px 0px;"><?php
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
}
$languages_string = '';
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
$languages_string .= '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a>  ';
}
echo $languages_string;
?><?php
echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');
reset($currencies->currencies);
$currencies_array = array();
while (list($key, $value) = each($currencies->currencies)) {
  $currencies_array[] = array('id' => $key, 'text' => $value['title']);
}
$hidden_get_variables = '';
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
  if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
	$hidden_get_variables .= tep_draw_hidden_field($key, $value);
  }
}
echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="jamp"') . $hidden_get_variables . tep_hide_session_id();
echo '</form>';
?>
							</td>
							<td style="padding:37px 0px 0px 0px;">
								<table cellpadding="0" cellspacing="0" border="0">
									<tr>
										<td><?php echo tep_image(DIR_WS_IMAGES.'hp.jpg')?></td>
										<td style="width:100%; padding:4px 0px 0px 0px;"><h1><?php echo BOX_HEADING_SHOPPING_CART?>: <br /><a href="<?php echo tep_href_link('shopping_cart.php')?>"><?php echo $cart->count_contents()?> <?php echo BOX_SHOPPING_CART_EMPTY?></a></h1></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style="height:184px">
					<a href="<?php echo tep_href_link('shipping.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'header.jpg')?></a>
			</tr>
			<tr>
				<td style="height:73px" align="center">
					<table cellpadding="0" cellspacing="0" border="0" style=" width:1px;">
						<tr><td><a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image_button('m1.jpg')?></a><a href="<?php echo tep_href_link('products_new.php')?>"><?php echo tep_image_button('m2.jpg')?></a><a href="<?php echo tep_href_link('specials.php')?>"><?php echo tep_image_button('m3.jpg')?></a><a href="<?php echo tep_href_link('account.php')?>"><?php echo tep_image_button('m4.jpg')?></a><a href="<?php echo tep_href_link('contact_us.php')?>"><?php echo tep_image_button('m5.jpg')?></a></td></tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style="padding:0px 3px 5px 5px;">
<!-- 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
 }
?>
<!-- start -->

<!-- end -->

<?php 
define(MAX_DESCR_1,'80');

define(MAX_DESCR_NAME,'35');
define(MAX_DESCR_NAME_SHOPPCART,'35');
define(MAX_DESCR_BESTS,'19');
define(MAX_DESCR_REVIEWS,'50');
define(MAX_DESCR_NAME_BOX,'15');
?>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...