myideal Posted December 30, 2004 Posted December 30, 2004 Hi, Something which I can't figure out and I have been trying for weeks to find out how to do and it doesnt seem to happen for me. Is there a way in which I can remove the formating, by this I mean the border, background colour and title from an info box - only leaving the contents of the box on the page. What I am trying to do can be seen here http://www.eu.my-ideal.com with the language box - I would like the flags just to sit there without the boxing around it. All help would be great, i've become stuck on this one. :blush: Mark
Guest Posted December 31, 2004 Posted December 31, 2004 By default, the languages are in an infobox. You can change all of the infoboxes' attributes in stylesheet.css. If you only want to change it for the Languages, you'll have to take them out of the infobox format. That's a bit beyond me.
Guest Posted December 31, 2004 Posted December 31, 2004 Here is what to do: 1. Back up your includes/boxes/languages.php 2. Open the includes/boxes/languages.php file with your .php editor 3. Replace ALL existing codes with the following. <?php /* $Id: languages.php,v 1.15 2003/06/09 22:10:48 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- languages //--> <tr> <td> <?php class langBox extends tableBox { function langBox($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); } } $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES); new infoBoxHeading($info_box_contents, false, false); if (!isset($lng) || (isset($lng) && !is_object($lng))) { include(DIR_WS_CLASSES . 'language.php'); $lng = new language; } $languages_string = ''; reset($lng->catalog_languages); while (list($key, $value) = each($lng->catalog_languages)) { $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $languages_string); new langBox($info_box_contents); ?> </td> </tr> <!-- languages_eof //--> 4. Save your new language.php file. Let me know how you get on. :thumbsup:
Guest Posted December 31, 2004 Posted December 31, 2004 If you want to remove the Heading as well, use this. <?php /* $Id: languages.php,v 1.15 2003/06/09 22:10:48 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- languages //--> <tr> <td> <?php class langBox extends tableBox { function langBox($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); } } $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES); //new infoBoxHeading($info_box_contents, false, false); if (!isset($lng) || (isset($lng) && !is_object($lng))) { include(DIR_WS_CLASSES . 'language.php'); $lng = new language; } $languages_string = ''; reset($lng->catalog_languages); while (list($key, $value) = each($lng->catalog_languages)) { $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $languages_string); new langBox($info_box_contents); ?> </td> </tr> <!-- languages_eof //-->
myideal Posted December 31, 2004 Author Posted December 31, 2004 Worked first time - thank you for that. I looked at this file before however I wasnt sure if the stylesheet was the area I should have been looking. Thank you for that once again. Mark
Guest Posted December 31, 2004 Posted December 31, 2004 Worked first time - thank you for that. I looked at this file before however I wasnt sure if the stylesheet was the area I should have been looking. Thank you for that once again. Mark <{POST_SNAPBACK}> Anytime, Mark. :thumbsup:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.