Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Corners not in proper place on boxes.


everyth5

Recommended Posts

I have installed a test site in a subdirectory of my live site and added a template. For some reason the corners don't show up properly. Some are in the middle of the header part of the box.

 

Where do I look to fix this? I have been searching through all the logical places that I think they should be but cannot find it.

 

This is My Site.

 

Thanks.

 

Kelvin

Link to comment
Share on other sites

Your corners are dictate in 2 places, the boxes/[individualbox.php] and classes/boxes.php, judging by the fact that the corners are misplaced all across the site, i would say that you have been playing around with classes/boxes.php, and more specifically, the infoboxheading class...try looking there first

Menou and unome

Link to comment
Share on other sites

Your corners are dictate in 2 places, the boxes/[individualbox.php] and classes/boxes.php, judging by the fact that the corners are misplaced all across the site, i would say that you have been playing around with classes/boxes.php, and more specifically, the infoboxheading class...try looking there first

 

Yes, I have been playing around with the boxes.php file. Just by adding this template. This is the way that the code looks in it. Does something seem out of place or incorrect???

 

<?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 = '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('pixel_trans.gif', '100%', '1')));
  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'] : '')));
  }
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  return $this->tableBox($info_box_contents);
}
 }

 class infoBoxHeading extends tableBox {
function infoBoxHeading($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' => 'height="14" class="infoBoxHeading"',
									 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),
							   array('params' => 'height="14" class="infoBoxHeading" width="100%"',
									 'text' => $contents[0]['text']),
							   array('params' => 'height="14" class="infoBoxHeading"',
									 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif')));

  $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 = '1';
  $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 contentBoxHeading extends tableBox {
function contentBoxHeading($contents) {
  $this->table_width = '100%';
  $this->table_cellpadding = '0';

  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
									 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),
							   array('params' => 'height="14" class="infoBoxHeading" width="100%"',
									 'text' => $contents[0]['text']),
							   array('params' => 'height="14" class="infoBoxHeading"',
									 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif')));

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

 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 for the help

 

Kelvin

Link to comment
Share on other sites

it looks normal to me(maybe i am wrong)

post the code for one of the affected boxes here

The following is the code for the catalog/includes/boxes/catagories.php file

 

<?php
/*
 $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

for ($i=0; $i<$tree[$counter]['level']; $i++) {
  $categories_string .= "  ";
}
// Begin of Code snippet: 

if (tep_has_category_subcategories($counter)) {
	if ( ($id) && (in_array($counter, $id)) ) {
	  $categories_string .= '<img src="images/cat_arrow_down.gif" align="absmiddle"> ';
	} else {
	  $categories_string .= '<img src="images/cat_arrow_right.gif" align="absmiddle"> ';
	}
} else {
  $categories_string .= '<img src="images/cat_arrow_other.gif" align="absmiddle"> ';
}

// End of code snippet
$categories_string .= '<a href="';

if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '<b>';
}

// display category name
$categories_string .= $tree[$counter]['name'];

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '</b>';
}

if (tep_has_category_subcategories($counter)) {
  $categories_string .= '';
}

$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= ' (' . $products_in_category . ')';
  }
}

$categories_string .= '<br>';

if ($tree[$counter]['next_id'] != false) {
  tep_show_category($tree[$counter]['next_id']);
}
 }
?>
<!-- categories //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 //$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 new infoBoxHeading($info_box_contents, false, false);

 $categories_string = '';
 $tree = array();

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
 while ($categories = tep_db_fetch_array($categories_query))  {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
											'parent' => $categories['parent_id'],
											'level' => 0,
											'path' => $categories['categories_id'],
											'next_id' => false);

if (isset($parent_id)) {
  $tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
  $first_element = $categories['categories_id'];
}
 }

 //------------------------
 if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
  unset($parent_id);
  unset($first_id);
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
  if (tep_db_num_rows($categories_query)) {
	$new_path .= $value;
	while ($row = tep_db_fetch_array($categories_query)) {
	  $tree[$row['categories_id']] = array('name' => $row['categories_name'],
										   'parent' => $row['parent_id'],
										   'level' => $key+1,
										   'path' => $new_path . '_' . $row['categories_id'],
										   'next_id' => false);

	  if (isset($parent_id)) {
		$tree[$parent_id]['next_id'] = $row['categories_id'];
	  }

	  $parent_id = $row['categories_id'];

	  if (!isset($first_id)) {
		$first_id = $row['categories_id'];
	  }

	  $last_id = $row['categories_id'];
	}
	$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
	$tree[$value]['next_id'] = $first_id;
	$new_path .= '_';
  } else {
	break;
  }
}
 }
 tep_show_category($first_element); 

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

 new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- categories_eof //-->

 

Kelvin

Link to comment
Share on other sites

<?php

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

the third line has been commented......try uncommenting and maybe your problem will be solved

Menou and unome

Link to comment
Share on other sites

<?php

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

the third line has been commented......try uncommenting and maybe your problem will be solved

That did it. Thanks a million.

 

Kelvin

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...