Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

infobox resize error


xlilo

Recommended Posts

hi everybody,

 

i know that i can change thesize of the infobox in boxes.php in the classes dir by adding a width tag, however when i do change the width my headers disaline, i have three images on my info box headers onen the left, midle and right, the one on the right is the one with the hyperlink and thats the one that goes wrong when imake my info box smaller in width, the image will move up slitly, its almost like there is a clear image in there, can anyone help me plase?

 

web page is http://www.homeofbathrooms.co.uk

 

Thanks

Link to comment
Share on other sites

You don't need to touch the tableBox class, you just change the width in application_top.php

 

// customization for the design layout
 define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

Link to comment
Share on other sites

i have changed t info box to show you whati mean, if yo loo now th box is the width need it, i did this via editing the code in includes/classes/boxes.php in the code bellow i edited the the left and right images and arrow image, then added a width tag:

 

}

 

class infoBoxHeading extends tableBox {

function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = true) {

$this->table_cellpadding = '0';

 

if ($left_corner == true) {

$left_corner = tep_image(DIR_WS_IMAGES . 'navandbuttons/sub/catleft.jpg');

} else {

$left_corner = tep_image(DIR_WS_IMAGES . 'navandbuttons/sub/catleft.jpg');

}

if ($right_arrow == true) {

$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'navandbuttons/sub/catright.jpg', ICON_ARROW_RIGHT) . '</a>';

} else {

$right_arrow = '';

}

if ($right_corner == true) {

$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif');

} else {

$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');

}

 

$info_box_contents = array();

$info_box_contents[] = array(array('params' => 'width="22" height="34" class="infoBoxHeading"',

'text' => $left_corner),

array('params' => 'width="22" height="34" class="infoBoxHeading"',

'text' => $contents[0]['text']),

array('params' => 'width="22" height="34" class="infoBoxHeading" nowrap',

'text' => $right_corner));

 

$this->tableBox($info_box_contents, true);

}

 

only problem is that now my arrow image on the right has moved up about 5 pixels or so, i cant fiqure out why or how to fix it.

Link to comment
Share on other sites

It has worked as the boxes are lined up to the headers now. The problem is, in the cart box you have a pixel_trans.gif at width="1" and height="1" and the header images line up but in the others, that pixel_trans.gif is set at width="11" and height="14"

 

In the code you posted for boxes.php, try setting:

 

 $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');

 

to:

 

 $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '1', '1');

 

That may be a quick fix.

Link to comment
Share on other sites

that worked a treat, thanks so much, i changed one of them lines must of forgot to do the other line. been up all night lol.

 

maybe you could help me with another small (maybe simple) problem i have, i would like to get a backround image in the header on the new product this month on the index page, i have searched the forum and looked at codes on loads of pages tryed hundreds of things but its no good, how can i do this?

Link to comment
Share on other sites

maybe you could help me with another small (maybe simple) problem i have, i would like to get a backround image in the header on the new product this month on the index page, i have searched the forum and looked at codes on loads of pages tryed hundreds of things but its no good, how can i do this?

 

Well, in index.php, the new products are called from this:

 

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

 

 

Add a new row above it and you can add an image for a header:

 

		  <tr>
		<td>Image in here</td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>

 

 

Then in includes/modules/new_products.php, remove the header by commenting out this code, like this:

 

//  new contentBoxHeading($info_box_contents);

Link to comment
Share on other sites

i have just done it the normal way via the style sheet, there was no point in doing any proper programing as the other header backrounds are static images, it was just easyer to do it via the style sheet,

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...