bingeboy Posted December 5, 2008 Share Posted December 5, 2008 Hi, I'm working on my first osCommerce site and was wondering if there is a good method to drop some of the tables and use div and lists instead. For example the boxes/categories.php seems to pull directly from the db and create a table on the fly. What would be a good method to make this a <ul/> or a div. Thanks Link to comment Share on other sites More sharing options...
web-project Posted December 5, 2008 Share Posted December 5, 2008 Web 2.0 is based on div. You can use better div instead of <ul/> Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here! 8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself. Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues. Any issues with oscommerce, I am here to help you. Link to comment Share on other sites More sharing options...
Kanie Posted December 5, 2008 Share Posted December 5, 2008 Huh? Alex, what you said made no sense. Getting osC to be valid XHTML is a fairly long process, but it's made easier by the two template systems available - STS and BTS. I'm a big BTS supporter (my posts here and here explain why), but there is a lot more support available for STS. Link to comment Share on other sites More sharing options...
ABCommerce! Posted December 6, 2008 Share Posted December 6, 2008 I did a contribution that converts all the left and right column boxes to CSS but I am not happy with it. That would take care of the boxes. The main content area is easy as you can just rip apart the pages or take a look at oscss.org and see what they have done. Link to comment Share on other sites More sharing options...
bingeboy Posted December 7, 2008 Author Share Posted December 7, 2008 Huh? Alex, what you said made no sense. Getting osC to be valid XHTML is a fairly long process, but it's made easier by the two template systems available - STS and BTS. I'm a big BTS supporter (my posts here and here explain why), but there is a lot more support available for STS. Thanks for the reply. I'm in need of a solution that that won't change the template completely. The client/developer isn't open to this idea. Looks like a good starting point though. The category box file and the right and left templates seem to have alot of tables that aren't necessary is there a way to keep the same file structure and use different syntax to load the content in lists? Link to comment Share on other sites More sharing options...
ABCommerce! Posted December 7, 2008 Share Posted December 7, 2008 For example the boxes/categories.php seems to pull directly from the db and create a table on the fly. What would be a good method to make this a <ul/> or a div. <?php /* $Id: categories.php 1739 2007-12-20 00:52:16Z hpdl $ 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 .= ""; } $categories_string .= ' <li><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 .= '</li> '; if ($tree[$counter]['next_id'] != false) { tep_show_category($tree[$counter]['next_id']); } } ?> <!-- categories //--> <div class="column"> <div class="column_header"> <div class="column_header_left"><h4><?php echo BOX_HEADING_CATEGORIES;?></h4></div> </div> <ul> <?php $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); echo $categories_string; ?> </ul> </div> <!-- categories_eof //--> Link to comment Share on other sites More sharing options...
bingeboy Posted December 7, 2008 Author Share Posted December 7, 2008 I just tried your download ABCommerce! And over wrote the i/b/categories.php and it took perfectly!!! :D Nice clean code just what I was looking for. Why are you not happy with it? Link to comment Share on other sites More sharing options...
ABCommerce! Posted December 7, 2008 Share Posted December 7, 2008 I just tried your download ABCommerce!And over wrote the i/b/categories.php and it took perfectly!!! :D Nice clean code just what I was looking for. Why are you not happy with it? I don't like the way the form is done for the search box in the contribution. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.