Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Additional images boxes.php question


jpmad4it

Recommended Posts

Posted

Hello everyone,

 

I have a heavily modified version of osCommerce. I have used Beyond Compare to view the changes in my files but I am having trouble with the catalog/includes/classes/boxes.php file.

 

Can anyone explain what this file does......especially the additional images code snippet for this file........it may help me understand a little better.

 

At first I simply added the additional images code to the bottom of the boxes.php file and it seemed ok until I tried to access the URL www.mysite.com/account.php. I then got the following error:

 

Warning: Cannot modify header information - headers already sent by (output started at /htdocs/includes/classes/boxes.php:725) in /htdocs/includes/functions/general.php on line 33

 

Here is the code I need to add to the boxes.php file:

 

// BOF: Additional Images
 class imagesBox extends tableBox {	  
function imagesBox($contents) {		
  $info_box_contents = array();		
  $info_box_contents[] = array('text' => $this->imagesBoxContents($contents));		
  $this->table_cellpadding = '1';		
  $this->tableBox($info_box_contents, true);	  
 }
function imagesBoxContents($contents) {
  $this->table_cellpadding = '4';
  $this->table_parameters = 'class="imagesBoxContents"';
  return $this->tableBox($contents);
}
 }
 // EOF: Additional Images

 

And here is the code from my modified version of 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 (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class tableBox {
var $table_border = '0';
var $table_width = '';
var $table_cellspacing = '0';
var $table_cellpadding = '0';
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;
}
 }
 // ------------------ infoBoxHeading ----------
 class infoBoxHeading extends tableBox {
function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
  $this->table_cellpadding = '0';
  $this->table_parameters = ' class="box_header_txt"';
  if ($left_corner == true) {
	$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
  } else {
	$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');
  }
  if ($right_arrow == true) {
	$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
  } else {
	$right_arrow = '';
  }
  if ($right_corner == true) {
	$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');
  } else {
	$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
  }

  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => '',
									 'text' => ''.$contents[0]['text'].''));

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

 // ------------------ infoBox ----------
 class infoBox extends tableBox {
function infoBox($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
  $this->table_cellpadding = '0';
  $this->table_parameters = '  style="border-bottom:2px solid #000000;"';
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '0';
  $this->table_parameters = ' class="box_body"';
  $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' => ' style="border:1px solid #282828; border-width:12px 10px 12px 17px;"',
									   'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').''));
  }

  return $this->tableBox($info_box_contents);
}
 }
 // ------------------ infoBoxHeading1 ----------
 class infoBoxHeading1 extends tableBox {
function infoBoxHeading1($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
  $this->table_cellpadding = '0';

  if ($left_corner == true) {
	$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
  } else {
	$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');
  }
  if ($right_arrow == true) {
	$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
  } else {
	$right_arrow = '';
  }
  if ($right_corner == true) {
	$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');
  } else {
	$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
  }

  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => ' class="box_header_txt1"',
									 'text' => ''.$contents[0]['text'].''));

  $this->tableBox($info_box_contents, true);
}
 } 
 // ------------------ infoBox1 ----------
 class infoBox1 extends tableBox {
function infoBox1($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
  $this->table_cellpadding = '0';
  $this->table_parameters = '  style="border-bottom:8px solid #ffffff;"';
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '0';
  $this->table_parameters = ' style="background:#F4F6DE;border:1px solid #F4F6DE; border-width:0px 11px 15px 11px;" class="box_body"';
  $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' => '',
									   'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').''));
  }

  return $this->tableBox($info_box_contents);
}
 }
 // ------------------ infoBox2 ----------
 class infoBox2 extends tableBox {
function infoBox2($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
  $this->table_cellpadding = '0';
  $this->table_parameters = '  style="border-bottom:2px solid #000000;"';
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '0';
  $this->table_parameters = '';
  $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' => '',
									   'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').''));
  }

  return $this->tableBox($info_box_contents);
}
 }
 //----------------------------------------------- tableBox_output ----------------------------------
class tableBox_output {
var $table_border = '0';
var $table_width = '';
var $table_cellspacing = '0';
var $table_cellpadding = '0';
var $table_parameters = ' ';
var $table_row_parameters = '';
var $table_data_parameters = '';

// class constructor
function tableBox_output($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";


	 if ($i != 0) { $tableBox_string .= '';} 

	$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'])) {




			if ($x >= 1){

				if($i == 0) {$tableBox_string .= '';}
				else		{ 



			  $tableBox_string .= '';} 
										}
$color=' class="product2"';
 if ($i %2) { $color = '';}  

			$tableBox_string .= '	<td'.$color;  
		  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;
}
 }
//---------------- tableBox_output --------------------- 
 class contentBox extends tableBox_output {
function contentBox($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
  $this->table_cellpadding = '0';
  $this->table_parameters = ' class="box_width_cont product"';
  $this->tableBox_output($info_box_contents, true);
}

function contentBoxContents($contents) {
  $this->table_cellpadding = '0';
  $this->table_parameters = 'class=""';
  return $this->tableBox_output($contents);
}
 }
// ------------------ contentBoxHeading ---------------------------------------------------------
 class contentBoxHeading extends tableBox {
function contentBoxHeading($contents) {

  $this->table_cellpadding = '0';
  $this->table_parameters = '';
  $info_box_contents = array();
  $info_box_contents[] = array( array('params' => ' class="cont_header_txt"',
									 'text' => ''.$contents[0]['text'].''));

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

//---------------- contentBoxHeading_WHATS_NEW --------------------- 
 class contentBoxHeading_WHATS_NEW extends tableBox {
function contentBoxHeading_WHATS_NEW($contents) {

  $this->table_cellpadding = '0';
  $this->table_parameters = '';
  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => ' class="cont_header_txt"',
									 'text' => ''.BOX_HEADING_WHATS_NEW.''));

  $this->tableBox($info_box_contents, true);
}
 }
//---------------- contentBoxHeading_ProdNew --------------------- 
 class contentBoxHeading_ProdNew extends tableBox {
function contentBoxHeading_ProdNew($contents) {

  $this->table_cellpadding = '0';
  $this->table_parameters = '';
  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => ' class="cont_header_txt"',
									 'text' => ''.HEADING_TITLE.''));

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

 class errorBox extends tableBox {
function errorBox($contents) {
  $this->table_data_parameters = 'class="errorBox"';
  $this->tableBox($contents, true);
}
 }


//---------------- tableBox_shopping_cart --------------------- 
class tableBox_shopping_cart {
var $table_border = '0';
var $table_width = '';
var $table_cellspacing = '0';
var $table_cellpadding = '0';
var $table_parameters = '';
var $table_row_parameters = '';
var $table_data_parameters = '';

// class constructor
function tableBox_shopping_cart($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";
   if ($i >= 2) { $tableBox_string .= '


					<tr><td style="background:#000000;height:1px;" colspan="4">'.tep_draw_separator('spacer.gif', '1', '1').'</td></tr>							  
						  ';}

	$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'])) {
		  if ($x >= 1) $tableBox_string .= '';

			  $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 ($i == 0)  $tableBox_string .= tep_draw_shop_top();
			else $tableBox_string .= tep_draw_shop_top();
		  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>';
		  if ($i == 0)  $tableBox_string .= tep_draw_shop_bottom();
		  else $tableBox_string .= tep_draw_shop_bottom();

		  $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 .= '>'.tep_draw_shop_top_1() . $contents[$i]['text'] . tep_draw_shop_bottom_1().'</td>' . "\n";
	}

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

/*  if ($i >= 2) {  */
$tableBox_string .= '

';
/*  }  */		

	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 productListingBox extends tableBox_shopping_cart {
function productListingBox($contents) {
  $this->table_parameters = ' class="box_width_cont shop_cart"';
  $this->tableBox_shopping_cart($contents, true);
}
 }

// -------------------------------------- --------------------------  
 function tep_draw_heading_top()
 {
			/*  require(DIR_WS_BOXES . 'panel_top.php');  */ 
 echo '
				  <table cellpadding="0" cellspacing="0" border="0" style="background:#444642;border:4px solid #313130;">
					<tr><td>
 ';
 }
// -------------------------------------- --------------------------  
function tep_draw_heading_bottom()
{

echo '
					</td></tr>
				</table>
				<table cellpadding="0" cellspacing="0" border="0"><tr><td height="2"></td></tr></table>
';
}
// -------------------------------------- --------------------------
// -------------------------------------- --------------------------  
 function tep_draw_heading_top_1()
 {
 echo '
					  <table cellpadding="0" cellspacing="0" border="0">
						<tr><td style="border:0px solid #444642;border-width:0px 13px 10px 13px;">
 ';

 }
// -------------------------------------- --------------------------  
function tep_draw_heading_bottom_1()
{

echo ' 

						</td></tr>
					</table>
';
}
// -------------------------------------- --------------------------
// -------------------------------------- --------------------------   
 function tep_draw_heading_top_2()
 {

 echo '
<table cellpadding="0" cellspacing="0" border="0">  
<tr><td>'.tep_draw_separator('spacer.gif', '15', '1').'</td>
	<td width="100%">

';
 }
// -------------------------------------- --------------------------  
function tep_draw_heading_bottom_2()
{

echo '

</td><td>'.tep_draw_separator('spacer.gif', '25', '1').'</td></tr>
</table> ';
} 
// -------------------------------------- --------------------------
// -------------------------------------- --------------------------  
 function tep_draw_heading_top_3()
 {
 echo '
					  <table cellpadding="0" cellspacing="0" border="0">
						<tr><td style="background:#4E4F4C;border:0px solid #ffffff;border-width:0px 0px 0px 0px;">
 ';

 }
// -------------------------------------- --------------------------  
function tep_draw_heading_bottom_3()
{

echo ' 

						</td></tr>
					</table>
';
}
// -------------------------------------- --------------------------
// -------------------------------------- --------------------------
 function  tep_draw_prod_top()
 {
 return $table = '';
 }
// -------------------------------------- --------------------------
 function  tep_draw_prod_bottom()
 {
  return $table =  '';
 }
 // -------------------------------------- --------------------------
 function  tep_draw_shop_top()
 {
 return $table = '';
 }
// -------------------------------------- --------------------------
 function  tep_draw_shop_bottom()
 {
  return $table =  '';
 }
 // -------------------------------------- --------------------------
 function  tep_draw_shop_top_1()
 {
 return $table = '';
 }
// -------------------------------------- --------------------------
 function  tep_draw_shop_bottom_1()
 {
  return $table =  '';
 }
// -------------------------------------- --------------------------  
 function tep_draw_result_top()
 {
 echo '';
 }
// -------------------------------------- --------------------------  
function tep_draw_result_bottom()
{
echo '';
}
// -------------------------------------- --------------------------  
function tep_draw_separate()
{
echo '
		<table cellpadding="0" cellspacing="0"><tr><td height="3"></td></tr></table>
';
}
// -------------------------------------- --------------------------  
  // ------------------ infoBox_77 ----------
class infoBox_77 extends tableBox {
function infoBox_77($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
  $this->table_cellpadding = '0';
  $this->table_parameters = 'class=""';
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '0';
  $this->table_parameters = ' class=""';
  $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' => '',
									   'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').''));
  }

  return $this->tableBox($info_box_contents);
}
}
// ------------------ infoBox_78 ----------
class infoBox_78 extends tableBox {
function infoBox_78($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
  $this->table_cellpadding = '0';
  $this->table_cellspacing = '1';
  $this->table_parameters = 'class="infoBox"';
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '0';
   $this->table_cellspacing = '15';
  $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="main"',
									   'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').''));
  }

  return $this->tableBox($info_box_contents);
}
}

 //----------------------------------------------- tableBox_output1 ----------------------------------
class tableBox_output1 {
var $table_border = '0';
var $table_width = '';
var $table_cellspacing = '0';
var $table_cellpadding = '0';
var $table_parameters = ' ';
var $table_row_parameters = '';
var $table_data_parameters = '';

// class constructor
function tableBox_output1($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";


	 if ($i != 0) { $tableBox_string .= '

				<tr><td colspan="3" class="bg_gg">'.tep_draw_separator('spacer.gif', '1', '1').'</td></tr>			 
				 ';} 

	$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'])) {




			if ($x >= 1){

				if($i == 0) {$tableBox_string .= '
										<td class="bg_vv">'.tep_draw_separator('spacer.gif', '1', '1').'</td>
										';}
				else		{ 



			  $tableBox_string .= '
										<td class="bg_vv">'.tep_draw_separator('spacer.gif', '1', '1').'</td>
										';} 
										}

		  $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;
}
 }
//---------------- tableBox_output1 --------------------- 
 class contentBox1 extends tableBox_output1 {
function contentBox1($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
  $this->table_cellpadding = '0';
  $this->table_parameters = ' class="box_width_cont product"';
  $this->tableBox_output1($info_box_contents, true);
}

function contentBoxContents($contents) {
  $this->table_cellpadding = '0';
  $this->table_parameters = 'class=""';
  return $this->tableBox_output1($contents);
}
 }	?>

 

 

If anyone could help me integrate the code from the 2 files together, I would be very grateful. The code differences are best viewed using beyond compare or a similar file comparison software.

 

Thanks in advance.

Jp

Archived

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

×
×
  • Create New...