acrylic-display Posted November 16, 2005 Posted November 16, 2005 Hello, I keep getting this error message when trying to access my about us page etc Fatal error: Cannot redeclare tep_show_category() in /home/acrylic/public_html/catalog/includes/boxes/categories.php on line 13 Does anyone know how to fix this. Thanks Adam
WillBoss Posted November 16, 2005 Posted November 16, 2005 I had the exact same problem as you. The problem just came from nowhere and I could not sort it out. I had to do a reinstall. Of course when I did the reinstall a MOD suggested a solution below is what he suggested. Its curious that you get this error when you select an option, but it is not the direct cause of your problem. You have a modification in your /includes/header.php which declares the following function: function tep_show_category($counter) { global $tree, $categories_string, $cPath_array; for ($i=0; $i<$tree[$counter]['level']; $i++) { $categories_string .= " "; } $categories_string .= '<font size="2"><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 .= tep_image(DIR_WS_ICONS . 'arrow.gif') . ' ' . $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></font>'; if ($tree[$counter]['next_id'] != false) { tep_show_category($tree[$counter]['next_id']); } } This function is taken from /includes/boxes/categories.php I would suggest renaming the function in header.php - eg 'tep_show category2' - I suggest renaming it rather than removing the one in categories.php as the one in the header is probably modified - don't forget to rename tep_show_category at the bottom of the function also and wherever else it is referenced in your header. Matti I hope this helps you out and I would appreciate it if you let me know if it works or if you find another solution. Regards Will Regards Will
JazzMan_Jay Posted November 16, 2005 Posted November 16, 2005 Hi, well it seems that the function/class is 2 times incuded. So mostly by the first include "declared", by the second one generating an error. I have not a copy of OSC here, but try to look for the file name in wich this function is declared, once you find it, look to the file where the message appear (about_us.php), and if you find a double include, delete one, other wise try the include_once(). Hope this help first. JazzMan_Jay
Recommended Posts
Archived
This topic is now archived and is closed to further replies.