smithveg Posted April 3, 2010 Share Posted April 3, 2010 Hi, I notice in almost all the boxes file, such as currencies, shopping cart, languages, etc. The code below give me a big gaps (empty spacing on top and bottom padding) new infoBox($info_box_contents); May i know which file should i go to change this style? **** Hello World! ^.^ I'm a Internet naive. Browse my working profile Malaysia Web Services - OPerion Website Marketing System Link to comment Share on other sites More sharing options...
germ Posted April 3, 2010 Share Posted April 3, 2010 /catalog/includes/classes/boxes.php If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
smithveg Posted April 4, 2010 Author Share Posted April 4, 2010 Hi, you have point me to the right location. But i have difficulties to understand this part of oscommerce coding.. How should i remove that <tr> row (that i mark as blue arrow) in ../includes/classes/boxes.php Below is the file for ../includes/boxes/currencies.php <!-- currencies //--> <tr> <td> <?php /* I have commented the box header */ //$info_box_contents = array(); //$info_box_contents[] = array('text' => BOX_HEADING_CURRENCIES); //new infoBoxHeading($info_box_contents, false, false); 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); } } $info_box_contents = array(); $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'), 'align' => 'center', 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%; background:url(images/input_bground.jpg) repeat; margin-top:0; padding-top:0;"') . $hidden_get_variables . tep_hide_session_id()); new infoBox($info_box_contents); ?> </td> </tr> <!-- currencies_eof //--> Below is the code in ../includes/classes/boxes.php that i try to red color the background for debugging purpose // 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 .= ' style="background:#FF0000;">' . "\n"; ; Could you please advise me which line to modify? **** Hello World! ^.^ I'm a Internet naive. Browse my working profile Malaysia Web Services - OPerion Website Marketing System Link to comment Share on other sites More sharing options...
npn2531 Posted April 4, 2010 Share Posted April 4, 2010 In that file includes/classes/boxes.php look further down about line 100 and find this: 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' => $left_corner), array('params' => 'width="100%" height="14" class="infoBoxHeading"', 'text' => $contents[0]['text']), array('params' => 'height="14" class="infoBoxHeading" nowrap', 'text' => $right_corner)); $this->tableBox($info_box_contents, true); } There are two things that might be causing that gap. 1) Note height="14". Try making that "0". 2) Note the class "infoBoxHeading". Find that class in the stylesheet.css and adjust the parameters, esp height. 3) Try renaming the images in images/infobox (corner_left.gif, corner_right.gif, etc) , or make them 1px high and see what happens. Also note in your code this: style="background:#FF0000; This should ideally be in the stylesheet.css and not in the box class. Look just above that section and find this: var $table_row_parameters = ''; change it to this: var $table_row_parameters = 'boxclass'; Then add this to the stylesheet: .boxclass{ background: #FF0000; } Then delete from classes/boxes.php: style="background:#FF0000; Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
smithveg Posted April 4, 2010 Author Share Posted April 4, 2010 I have try a lot on stylesheet.css TD.infoBoxHeading { font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; background: #bbc3d3; color: #ffffff; height:1px } Also, below is my boxes.php code, the adjustment value doesn't seems take effect on my website. <?php class tableBox { var $table_border = '1'; var $table_width = '100%'; 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 .= ' style="background:#FF0000;">' . "\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']) . '"'; // BOF: Product Listing in Columns if (isset($contents[$i][$x]['valign']) && tep_not_null($contents[$i][$x]['valign'])) $tableBox_string .= ' valign="' . $contents[$i][$x]['valign'] . '"'; // EOF: Product Listing in Columns 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/Xcorner_left.gif'); } else { $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/Xcorner_right_left.gif'); } if ($right_arrow == true) { $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/Xarrow_right.gif', ICON_ARROW_RIGHT) . '</a>'; } else { $right_arrow = ''; } if ($right_corner == true) { $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/Xcorner_right.gif'); } else { $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '1', '1'); } $info_box_contents = array(); $info_box_contents[] = array(array('params' => 'height="1" class="infoBoxHeading"', 'text' => $left_corner), array('params' => 'width="100%" height="1" class="infoBoxHeading"', 'text' => $contents[0]['text']), array('params' => 'height="1" class="infoBoxHeading" nowrap', 'text' => $right_corner)); $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="1" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/Xcorner_left.gif')), array('params' => 'height="1" class="infoBoxHeading" width="100%"', 'text' => $contents[0]['text']), array('params' => 'height="1" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/Xcorner_right_left.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); } } ?> **** Hello World! ^.^ I'm a Internet naive. Browse my working profile Malaysia Web Services - OPerion Website Marketing System Link to comment Share on other sites More sharing options...
germ Posted April 4, 2010 Share Posted April 4, 2010 If I had a link to the site I could probably help more. As it is, what you're asking is just like calling your doctor and saying, "Doc, I'm sick. What's wrong?", and not telling him any more. He couldn't help and neither can I. :huh: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
smithveg Posted April 4, 2010 Author Share Posted April 4, 2010 If I had a link to the site I could probably help more. As it is, what you're asking is just like calling your doctor and saying, "Doc, I'm sick. What's wrong?", and not telling him any more. He couldn't help and neither can I. :huh: Hi, Germ, thank for your prompt response. I really appreciated to your help. Found below for my website link and the file package. www.jimshara.com/nukleus/includes.rar www.nukleusshop.com/demo **** Hello World! ^.^ I'm a Internet naive. Browse my working profile Malaysia Web Services - OPerion Website Marketing System Link to comment Share on other sites More sharing options...
germ Posted April 4, 2010 Share Posted April 4, 2010 In this 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('pixel_trans.gif', '100%', '1'))); Change the last line to this: // $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1'))); BACKUP the file before editing it. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
npn2531 Posted April 4, 2010 Share Posted April 4, 2010 Hi, Germ, thank for your prompt response. I really appreciated to your help. Found below for my website link and the file package. www.jimshara.com/nukleus/includes.rar www.nukleusshop.com/demo Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
npn2531 Posted April 4, 2010 Share Posted April 4, 2010 I have posted the code from your shopping cart box below . The html is jumbled up. Note the <div> tags. The pair of div tags with a class of 'box_content' is interlocked, ie doesn't close, before a pair of td tags with a class of 'boxtext' starts. You will probably find the html for the div tags in includes/boxes/shopping_cart.php, fix that first. Those div tags are not found in a vanilla OSC cart, and have been added incorrectly, is my guess. The code in include/classes/boxes.php has little in it that will affect those div tags. <!-- shopping_cart //--> <tr> <td> <table border="1" width="100%" cellspacing="0" cellpadding="1" class="infoBox" style="background:#FF0000;"> <tr> <td> <table border="1" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents" style="background:#FF0000;"> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td> </tr> <tr> <td class="boxText"> <div class="box_header"><a href="shopping_cart.php" title="Shopping Cart">Shopping Cart</a></div> <div class="box_content"> <div style="padding-left:8px;">0 items</div> </td> </tr> <tr> <td class="boxText"></div></td> </tr> </table> </td> </tr> </table> </td> </tr> <!-- shopping_cart_eof //--> Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
smithveg Posted April 4, 2010 Author Share Posted April 4, 2010 Finally, i got the solution. In the file ../includes/classes/boxes.php 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%', '2'))); 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); } Change to: 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%', '2'))); 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); } **** Hello World! ^.^ I'm a Internet naive. Browse my working profile Malaysia Web Services - OPerion Website Marketing System Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.