Booking it Posted January 22, 2005 Posted January 22, 2005 Don't know what the problem is or how to go back! I installed the following catgories file and got the following error: 1054 - Unknown column 'c.status' in 'where clause' select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where c.status = '1' and c.parent_id = 0 and c.categories_id = cd.categories_id and cd.language_id='1' order by sort_order, cd.categories_name [TEP STOP] file: <?php /* $Id: categories.php,v 1.17 2002/03/07 20:53:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2001 osCommerce Released under the GNU General Public License */ // Categories_tree written by Gideon Romm from Symbio Technologies, LLC function tep_show_category($cid, $cpath, $COLLAPSABLE) { global $categories_string, $languages_id, $HTTP_GET_VARS; global $level; $selectedPath = array(); // Get all of the categories on this level $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.status = '1' and c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; } $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1; // Add category link to $categories_string for ($a=1; $a<$level{$categories['categories_id']}; $a++) { $categories_string .= " "; } $categories_string .= '<a href="'; $cPath_new = $cpath; if ($level{$categories['parent_id']} > 0) { $cPath_new .= "_"; } $cPath_new .= $categories['categories_id']; $cPath_new_text = "cPath=" . $cPath_new; $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text); $categories_string .= '">'; if ($HTTP_GET_VARS['cPath']) { $selectedPath = split("_", $HTTP_GET_VARS['cPath']); } if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '<b>'; } if ($level{$categories['categories_id']} == 1) { $categories_string .= '<u>'; } $categories_string .= $categories['categories_name']; if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string .= ' ->'; } if ($level{$categories['categories_id']} == 1) { $categories_string .= '</u>'; } if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '</b>'; } $categories_string .= '</a>'; if (SHOW_COUNTS) { $products_in_category = tep_count_products_in_category($categories['categories_id']); if ($products_in_category > 0) { $categories_string .= ' (' . $products_in_category . ')'; } } $categories_string .= '<br>'; // If I have subcategories, get them and show them if (tep_has_category_subcategories($categories['categories_id'])) { if ($COLLAPSABLE) { if (in_array($categories['categories_id'], $selectedPath)) { tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE); } } else { tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE); } } } } ?> <!-- categories //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES ); new infoBoxHeading($info_box_contents, true, false); $categories_string = ''; // tep_show_category(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>) tep_show_category(0,'',0); $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => $categories_string ); new infoBox($info_box_contents); ?> </td> </tr> <!-- categories_eof //--> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.