Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need Help To Remove Small InfoBox Problem


Guest

Recommended Posts

Posted

Hi, I have been editing my infoboxes to remove the stock heading images completely and replaced them with a custom header image for each box.

 

I have edited my stylesheet to change the border colors (i have a black border left, right & bottom and a border colored to match the header image).

 

I have also changed my background color.

 

All of these edits have worked but I have noticed 1 problem. below the header image and 1pixel below the top border of the infobox the is a white line 1 pixel high. I have searched to find the problem and so far I have not found it.

 

When I view the page source I see the following:

 

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

<tr>

<td width="100%" height="20" class="infoBoxHeading"><img src="images/infobox/categories.png" alt="Browse Our Products"></td>

</tr>

</table>

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

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">

<tr>

<td><img src="images/" border="0" alt="" width="100%" height="1"></td>

</tr>

<tr>

<td class="boxText"><a href="http://www.coolnquiet.co.uk/index.php?cPath=22">Intel CPU Coolers</a>

 

This is the page source code from where my categories box starts to the point after the first category is displayed - I have highlighted in red what I believe is the problem.

 

I just can not find where this problem is being invoked within the code.

 

If anyone can help then please let me know what code you need to inspect and i'll paste it here but if it helps I am pasting the entire contents of includes/classes/boxes.php

<?php

/*

$Id: boxes.php,v 1.33 2003/06/09 22:22:50 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class tableBox {

var $table_border = '0';

var $table_width = '100%';

var $table_cellspacing = '0';

var $table_cellpadding = '2';

var $table_parameters = '';

var $table_row_parameters = '';

var $table_data_parameters = '';

 

// class constructor

function tableBox($contents, $direct_output = false) {

$tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';

if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;

$tableBox_string .= '>' . "\n";

 

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";

$tableBox_string .= ' <tr';

if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;

if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];

$tableBox_string .= '>' . "\n";

 

if (isset($contents[$i][0]) && is_array($contents[$i][0])) {

for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {

if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {

$tableBox_string .= ' <td';

if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';

if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {

$tableBox_string .= ' ' . $contents[$i][$x]['params'];

} elseif (tep_not_null($this->table_data_parameters)) {

$tableBox_string .= ' ' . $this->table_data_parameters;

}

$tableBox_string .= '>';

if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];

$tableBox_string .= $contents[$i][$x]['text'];

if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';

$tableBox_string .= '</td>' . "\n";

}

}

} else {

$tableBox_string .= ' <td';

if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';

if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {

$tableBox_string .= ' ' . $contents[$i]['params'];

} elseif (tep_not_null($this->table_data_parameters)) {

$tableBox_string .= ' ' . $this->table_data_parameters;

}

$tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";

}

 

$tableBox_string .= ' </tr>' . "\n";

if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";

}

 

$tableBox_string .= '</table>' . "\n";

 

if ($direct_output == true) echo $tableBox_string;

 

return $tableBox_string;

}

}

 

class infoBox extends tableBox {

function infoBox($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->infoBoxContents($contents));

$this->table_cellpadding = '1';

$this->table_parameters = 'class="infoBox"';

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

}

 

function infoBoxContents($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

$info_box_contents[] = array(array('text' => tep_draw_separator('')));

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),

'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),

'params' => 'class="boxText"',

'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));

}

 

return $this->tableBox($info_box_contents);

}

}

 

class infoBoxHeading extends tableBox {

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

$this->table_cellpadding = '0';

 

/* if ($left_corner == true) {

$left_corner = tep_image(DIR_WS_IMAGES . '');

} else {

$left_corner = tep_image(DIR_WS_IMAGES . '');

}

if ($right_arrow == true) {

$right_arrow = '';

} else {

$right_arrow = '';

}

if ($right_corner == true) {

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

} else {

$right_corner = $right_arrow . tep_draw_separator('');

} */

 

$info_box_contents = array();

$info_box_contents[] = array(array('params' => 'width="100%" height="20" class="infoBoxHeading"',

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

 

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

}

}

 

class contentBox extends tableBox {

function contentBox($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->contentBoxContents($contents));

$this->table_cellpadding = '0';

$this->table_parameters = 'class="infoBox"';

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

}

 

function contentBoxContents($contents) {

$this->table_cellpadding = '4';

$this->table_parameters = 'class="infoBoxContents"';

return $this->tableBox($contents);

 

}

}

 

class errorBox extends tableBox {

function errorBox($contents) {

$this->table_data_parameters = 'class="errorBox"';

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

}

}

 

class productListingBox extends tableBox {

function productListingBox($contents) {

$this->table_parameters = 'class="productListing"';

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

}

}

?>

 

Thanks so much.

Posted
<tr>

<td><img src="images/" border="0" alt="" width="100%" height="1"></td>

</tr>

 

Thanks Lloyd for your reply.

 

What you highlighted is the problem shown when viewing the page source. I do realize that this is the problem but this code does not appear as this in my code. This is code after it's been handled by the server and displayed on my pc.

 

The actual problem is within the php code (I believe) but I don't know where.

 

Any more thoughts would be great.

 

Thanks again.

Posted

Check this out:

page - 'catalog/includes/classes/boxes.php' line - 88

 

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

Lloyd

Posted
Check this out:

page - 'catalog/includes/classes/boxes.php' line - 88

 

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

Thanks again for the reply.

I have deleted that line but it hasn't solved the problem.

 

Thanks again.

Posted

There is another of the same just below it on line 95. Rather than delete it, you might try just commenting it out. such as adding two slashes '//':

// $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

Lloyd

Posted

Thanks, I have that deleted already so unfortunately the problem remains.

 

Would it help if I pasted some other code?

 

Thanks again.

Posted

Yeah, that's it exactly. The infoboxes in column left & column right.

 

see here My Website

 

Cheers Again.

Posted

Look at your code:

function infoBoxContents($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

$info_box_contents[] = array(array('text' => tep_draw_separator('')));

 

try commenting out the last part, such as:

function infoBoxContents($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

//$info_box_contents[] = array(array('text' => tep_draw_separator('')));

Lloyd

Posted

This is the code from my classes/boxes.php

 

<?php

/*

$Id: boxes.php,v 1.33 2003/06/09 22:22:50 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

class tableBox {

var $table_border = '0';

var $table_width = '100%';

var $table_cellspacing = '0';

var $table_cellpadding = '2';

var $table_parameters = '';

var $table_row_parameters = '';

var $table_data_parameters = '';

 

// class constructor

function tableBox($contents, $direct_output = false) {

$tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';

if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;

$tableBox_string .= '>' . "\n";

 

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";

$tableBox_string .= ' <tr';

if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;

if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];

$tableBox_string .= '>' . "\n";

 

if (isset($contents[$i][0]) && is_array($contents[$i][0])) {

for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {

if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {

$tableBox_string .= ' <td';

if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';

if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {

$tableBox_string .= ' ' . $contents[$i][$x]['params'];

} elseif (tep_not_null($this->table_data_parameters)) {

$tableBox_string .= ' ' . $this->table_data_parameters;

}

$tableBox_string .= '>';

if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];

$tableBox_string .= $contents[$i][$x]['text'];

if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';

$tableBox_string .= '</td>' . "\n";

}

}

} else {

$tableBox_string .= ' <td';

if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';

if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {

$tableBox_string .= ' ' . $contents[$i]['params'];

} elseif (tep_not_null($this->table_data_parameters)) {

$tableBox_string .= ' ' . $this->table_data_parameters;

}

$tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";

}

 

$tableBox_string .= ' </tr>' . "\n";

if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";

}

 

$tableBox_string .= '</table>' . "\n";

 

if ($direct_output == true) echo $tableBox_string;

 

return $tableBox_string;

}

}

 

class infoBox extends tableBox {

function infoBox($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->infoBoxContents($contents));

$this->table_cellpadding = '1';

$this->table_parameters = 'class="infoBox"';

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

}

 

function infoBoxContents($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

 

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),

'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),

'params' => 'class="boxText"',

'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));

}

 

return $this->tableBox($info_box_contents);

}

}

 

class infoBoxHeading extends tableBox {

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

$this->table_cellpadding = '0';

 

$info_box_contents = array();

$info_box_contents[] = array(array('params' => 'width="100%" height="20" class="infoBoxHeading"',

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

 

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

}

}

?>

 

Compared to the stock version there isn't much left. I have deleted just about as much as I can think of but the problem still exists.

 

Thanks Lloyd

Archived

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

×
×
  • Create New...