quantrum Posted April 23, 2008 Share Posted April 23, 2008 Hi, I've just reinstalled a shop onto a new server for a client of ours and it was running perfectly on our server, then after copying all of the files across and installing etc...I seem to be constantly getting an error load up Fatal error: Call to undefined function: tep_show_category() in c:\websites\frederickscleveleys194\frederickscleveleys.com\oscommerce\includes\header.php on line 300 I don't get why its showing but its stopping any more of the page loading up. I've commented out the tep_show_category() in the file and then the page loads without displaying the categories...I've tried altering its name, changing it in the categories.php folder and all sorts of other stuff too..but nothing seems to be working, does anyone have any ideas as to how I may be able to sort this ? Below is my code from the includes/header.php file <?php /* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <!-- <? // ---- MANUFACTURERS $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { echo '<table cellspacing=0 cellpadding=0 width=177 align=center> '. tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get') .' <tr><td colspan=2><b>Search by manufacturers:</b></td></tr> <tr><td height=2 colspan=2></td></tr> <tr><td colspan=2> '; $manufacturers_array = array(); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers_name); } echo tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" class=se1') . tep_hide_session_id(); echo ' </td> </form> </table> '; } ?> --> <table cellspacing=0 cellpadding=0 width=733 align=center> <tr><td> <table cellspacing=0 cellpadding=0> <tr><td height=20 colspan=3></td></tr> <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/m08.gif width=194 height=63 border=0></a></td> <td width=99></td> <td background=images/m01.gif width=440 height=63> <table cellspacing=0 cellpadding=0> <tr><td width=31></td> <td width=83> <table cellspacing=0 cellpadding=0> <tr><td height=8></td></tr> <tr><td class=ch>Choose<br>your language</td></tr> <tr><td height=3></td></tr> <tr><td> <? // LANGUAGES 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> '; } echo $languages_string; ?> </td></tr> <tr><td height=10></td></tr> </table> </td> <td width=52></td> <td width=111> <table cellspacing=0 cellpadding=0> <tr><td height=8></td></tr> <tr><td class=ch>Currencies:</td></tr> <tr><td height=3></td></tr> <tr><td> <? // CURRENCIES echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); 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); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit(); " style="width:100px; font-size: 9px" ') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td></tr> <tr><td height=7></td></tr> </table> </td> <td width=27></td> <td width=136> <table cellspacing=0 cellpadding=0> <tr><td height=8></td></tr> <tr><td rowspan=2><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/m07.jpg width=35 height=42 border=0></a> </td><td valign=bottom><b><span class=ml>Shopping Cart</span></b></td></tr> <tr><td colspan=2 align=right valign=top><b> <a class=ml href=<?=tep_href_link('shopping_cart.php')?>><font color=#AF0000><?=$cart->count_contents()?> items</font></a></b></td></tr> </table> </td></tr> </table> </td></tr> </table> <table cellspacing=0 cellpadding=0> <tr><td height=5></td></tr> <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/m09.gif width=147 height=29 border=0></a><a href=<?=tep_href_link('products_new.php')?>><img src=images/m10.gif width=147 height=29 border=0></a><a class=ml href=<?=tep_href_link('account.php')?>><img src=images/m11.gif width=147 height=29 border=0></a><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/m12.gif width=147 height=29 border=0></a><a href=<?=tep_href_link('checkout_shipping.php')?>><img src=images/m13.gif width=147 height=29 border=0></a></td></tr> <tr><td height=5></td></tr> </table> <table cellspacing=0 cellpadding=0> <tr><td><img src=images/m14.gif width=6 height=31></td> <td width=287 bgcolor=#EFEFEF> <? // SEARCH ?> <table cellspacing=0 cellpadding=0 width=253 align=center> <?=tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get')?> <tr><td height=6 colspan=3></td></tr> <tr><td><img src=images/m16.gif width=48 height=18 border=0></td><td><?=tep_draw_input_field('keywords', '', 'size="20" maxlength="30" class=go') . ' ' . tep_hide_session_id()?></td><td><input type=image src=images/m02.gif width=27 height=17 border=0></td></tr> <tr><td height=4 colspan=3></td></tr> </form> </table> <? // END SEARCH ?> </td> <td><img src=images/m15.gif width=6 height=31></td> <td width=47></td> <td width=433> <table cellspacing=0 cellpadding=0> <tr><td height=6 colspan=2></td></tr> <tr> <td width=74><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('specials.php')?>>Specials</a></td> <td width=88><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('contact_us.php')?>>Contact Us </a></td> <td width=126><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('create_account.php')?>>Create an account</a></td> <td width=98><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('login.php')?>>Customer Login</a></td></tr> <tr><td height=6 colspan=2></td></tr> </table> </td></tr> <tr><td height=5 colspan=5></td></tr> </table> <table cellspacing=0 cellpadding=0> <tr><td><!--<img src=images/m18.gif width=733 height=3>--></td></tr> <tr><td class=bg> <table cellspacing=0 cellpadding=0> <tr><td width=209 valign=top> <table cellspacing=0 cellpadding=0 width=207 align=center height="100%"> <tr><td><a href=http://maps.google.co.uk/maps?f=l&hl=en&geocode=&q=fredericks&near=cleveleys&ie=UTF8&ll=53.877049,-3.039168&spn=0.005016,0.012048&z=17&iwloc=A&om=1 target=_blank><img src=images/m29.gif width=207 height=81 border=0></a></td></tr> <tr height="1"><td height=1 width=207 bgcolor=#E6E6E6></td></tr> <tr height="13"><td height=13></td></tr> <tr><td> <table cellspacing=0 cellpadding=0 width=175 align=center> <tr><td><img src=images/m30.gif width=175 height=16></td></tr> <tr><td height=5></td></tr> <tr><td align=center><font color=#BF0101>New!</font> - Gift Vouchers Now Available</td></tr> <tr><td height=3></td></tr> <tr><td align=center><font color=#22de3f><b>£5 - £10 - £20 - £50</b></font></td></tr> <tr><td height=3></td></tr> <tr><td align=center>All vouchers availalbe in store</td></tr> <tr><td height=11></td></tr> </table> </td></tr> <tr height="1"><td height=1 width=207 bgcolor=#E6E6E6></td></tr> <tr height="13"><td height=13></td></tr> <tr><td> <table cellspacing=0 cellpadding=0 width=169 align=center> <tr><td><img src=images/m31.gif width=169 height=19></td></tr> <tr><td height=7></td></tr> <? // ---- CATEGORIES define(TABLE_CATEGORIES, "categories"); define(TABLE_CATEGORIES_DESCRIPTION, "categories_description"); $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 ($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; } } } $categories_string .= ''; tep_show_category($first_element); $categories_string .= ''; echo $categories_string; ?> <tr><td height=15></td></tr> </table> </td></tr> <tr><td valign=bottom align=center><a href=<?=tep_href_link('index.php?cPath=27')?>><img src=images/m20.jpg width=197 height=74 border=0></a></td></tr> <tr height="5"><td height=5></td></tr> <tr><td valign=bottom align=center><!--<a href=<?=tep_href_link('product_info.php','products_id=128')?>>--><a href=<?=tep_href_link('shipping.php')?>><img src=images/m46.jpg width=197 height=144 border=0></a></td></tr> <tr height="5"><td height=5></td></tr> <tr><td valign=bottom align=center><img src=images/m47.jpg width=197 height=146 border=0></td></tr> </table> </td> <td width=524 valign=top> <table cellspacing=0 cellpadding=0 width=523 align=center> <tr><td align=center><!--<a href=<?=tep_href_link('product_info.php','products_id=128')?>>--><img src=images/m33.jpg width=183 height=173 border=0><img src=images/m34.jpg width=174 height=173 border=0><img src=images/m35.jpg width=158 height=173 border=0><!--</a>--></td></tr> <tr><td height=7></td></tr> <tr><td> Please anybody with any ideas please I'm willing to try anything atm Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 23, 2008 Share Posted April 23, 2008 See this thread. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
quantrum Posted April 23, 2008 Author Share Posted April 23, 2008 See this thread. Jack Thanks Jack, unfortunately it didnt work...its still displaying an error, except this time saying Fatal error: Call to undefined function: tep_show_category_template() in c:\websites\frederickscleveleys194\frederickscleveleys.com\oscommerce\includes\header.php on line 300 as I changed the function name as it says in the other thread any other ideas at all ? Mark Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 24, 2008 Share Posted April 24, 2008 I'm sorry. The link I gave you was for a duplciate error. You have a missing error. That error means the function can't be found. You will need to find that function in the includes/boxes/categories.php file, assuming it is still there, and copy into the header.php file before the first ?>. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
quantrum Posted April 24, 2008 Author Share Posted April 24, 2008 I'm sorry. The link I gave you was for a duplciate error. You have a missing error. That error means the function can't be found. You will need to find that function in the includes/boxes/categories.php file, assuming it is still there, and copy into the header.php file before the first ?>. Jack thanks very much Jack...I'll give it a go now Link to comment Share on other sites More sharing options...
quantrum Posted April 24, 2008 Author Share Posted April 24, 2008 This is gonna sound really stupid now, but what bit do I need to copy and where'd I need to put it I've added copies of both the header and catergories php pages, would you be able to just tell me which bit goes where please...sorry again, and thanks for the help jack Header.php <?php /* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <!-- <? // ---- MANUFACTURERS $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { echo '<table cellspacing=0 cellpadding=0 width=177 align=center> '. tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get') .' <tr><td colspan=2><b>Search by manufacturers:</b></td></tr> <tr><td height=2 colspan=2></td></tr> <tr><td colspan=2> '; $manufacturers_array = array(); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers_name); } echo tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" class=se1') . tep_hide_session_id(); echo ' </td> </form> </table> '; } ?> --> <table cellspacing=0 cellpadding=0 width=733 align=center> <tr><td> <table cellspacing=0 cellpadding=0> <tr><td height=20 colspan=3></td></tr> <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/m08.gif width=194 height=63 border=0></a></td> <td width=99></td> <td background=images/m01.gif width=440 height=63> <table cellspacing=0 cellpadding=0> <tr><td width=31></td> <td width=83> <table cellspacing=0 cellpadding=0> <tr><td height=8></td></tr> <tr><td class=ch>Choose<br>your language</td></tr> <tr><td height=3></td></tr> <tr><td> <? // LANGUAGES 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> '; } echo $languages_string; ?> </td></tr> <tr><td height=10></td></tr> </table> </td> <td width=52></td> <td width=111> <table cellspacing=0 cellpadding=0> <tr><td height=8></td></tr> <tr><td class=ch>Currencies:</td></tr> <tr><td height=3></td></tr> <tr><td> <? // CURRENCIES echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); 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); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit(); " style="width:100px; font-size: 9px" ') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td></tr> <tr><td height=7></td></tr> </table> </td> <td width=27></td> <td width=136> <table cellspacing=0 cellpadding=0> <tr><td height=8></td></tr> <tr><td rowspan=2><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/m07.jpg width=35 height=42 border=0></a> </td><td valign=bottom><b><span class=ml>Shopping Cart</span></b></td></tr> <tr><td colspan=2 align=right valign=top><b> <a class=ml href=<?=tep_href_link('shopping_cart.php')?>><font color=#AF0000><?=$cart->count_contents()?> items</font></a></b></td></tr> </table> </td></tr> </table> </td></tr> </table> <table cellspacing=0 cellpadding=0> <tr><td height=5></td></tr> <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/m09.gif width=147 height=29 border=0></a><a href=<?=tep_href_link('products_new.php')?>><img src=images/m10.gif width=147 height=29 border=0></a><a class=ml href=<?=tep_href_link('account.php')?>><img src=images/m11.gif width=147 height=29 border=0></a><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/m12.gif width=147 height=29 border=0></a><a href=<?=tep_href_link('checkout_shipping.php')?>><img src=images/m13.gif width=147 height=29 border=0></a></td></tr> <tr><td height=5></td></tr> </table> <table cellspacing=0 cellpadding=0> <tr><td><img src=images/m14.gif width=6 height=31></td> <td width=287 bgcolor=#EFEFEF> <? // SEARCH ?> <table cellspacing=0 cellpadding=0 width=253 align=center> <?=tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get')?> <tr><td height=6 colspan=3></td></tr> <tr><td><img src=images/m16.gif width=48 height=18 border=0></td><td><?=tep_draw_input_field('keywords', '', 'size="20" maxlength="30" class=go') . ' ' . tep_hide_session_id()?></td><td><input type=image src=images/m02.gif width=27 height=17 border=0></td></tr> <tr><td height=4 colspan=3></td></tr> </form> </table> <? // END SEARCH ?> </td> <td><img src=images/m15.gif width=6 height=31></td> <td width=47></td> <td width=433> <table cellspacing=0 cellpadding=0> <tr><td height=6 colspan=2></td></tr> <tr> <td width=74><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('specials.php')?>>Specials</a></td> <td width=88><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('contact_us.php')?>>Contact Us </a></td> <td width=126><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('create_account.php')?>>Create an account</a></td> <td width=98><img src=images/m03.gif width=4 height=4 align=absmiddle> <a class=ml href=<?=tep_href_link('login.php')?>>Customer Login</a></td></tr> <tr><td height=6 colspan=2></td></tr> </table> </td></tr> <tr><td height=5 colspan=5></td></tr> </table> <table cellspacing=0 cellpadding=0> <tr><td><!--<img src=images/m18.gif width=733 height=3>--></td></tr> <tr><td class=bg> <table cellspacing=0 cellpadding=0> <tr><td width=209 valign=top> <table cellspacing=0 cellpadding=0 width=207 align=center height="100%"> <tr><td><a href=http://maps.google.co.uk/maps?f=l&hl=en&geocode=&q=fredericks&near=cleveleys&ie=UTF8&ll=53.877049,-3.039168&spn=0.005016,0.012048&z=17&iwloc=A&om=1 target=_blank><img src=images/m29.gif width=207 height=81 border=0></a></td></tr> <tr height="1"><td height=1 width=207 bgcolor=#E6E6E6></td></tr> <tr height="13"><td height=13></td></tr> <tr><td> <table cellspacing=0 cellpadding=0 width=175 align=center> <tr><td><img src=images/m30.gif width=175 height=16></td></tr> <tr><td height=5></td></tr> <tr><td align=center><font color=#BF0101>New!</font> - Gift Vouchers Now Available</td></tr> <tr><td height=3></td></tr> <tr><td align=center><font color=#22de3f><b>£5 - £10 - £20 - £50</b></font></td></tr> <tr><td height=3></td></tr> <tr><td align=center>All vouchers availalbe in store</td></tr> <tr><td height=11></td></tr> </table> </td></tr> <tr height="1"><td height=1 width=207 bgcolor=#E6E6E6></td></tr> <tr height="13"><td height=13></td></tr> <tr><td> <table cellspacing=0 cellpadding=0 width=169 align=center> <tr><td><img src=images/m31.gif width=169 height=19></td></tr> <tr><td height=7></td></tr> <? // ---- CATEGORIES define(TABLE_CATEGORIES, "categories"); define(TABLE_CATEGORIES_DESCRIPTION, "categories_description"); $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 ($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; } } } $categories_string .= ''; tep_show_category($first_element); $categories_string .= ''; echo $categories_string; ?> <tr><td height=15></td></tr> </table> </td></tr> <tr><td valign=bottom align=center><a href=<?=tep_href_link('index.php?cPath=27')?>><img src=images/m20.jpg width=197 height=74 border=0></a></td></tr> <tr height="5"><td height=5></td></tr> <tr><td valign=bottom align=center><!--<a href=<?=tep_href_link('product_info.php','products_id=128')?>>--><a href=<?=tep_href_link('shipping.php')?>><img src=images/m46.jpg width=197 height=144 border=0></a></td></tr> <tr height="5"><td height=5></td></tr> <tr><td valign=bottom align=center><img src=images/m47.jpg width=197 height=146 border=0></td></tr> </table> </td> <td width=524 valign=top> <table cellspacing=0 cellpadding=0 width=523 align=center> <tr><td align=center><!--<a href=<?=tep_href_link('product_info.php','products_id=128')?>>--><img src=images/m33.jpg width=183 height=173 border=0><img src=images/m34.jpg width=174 height=173 border=0><img src=images/m35.jpg width=158 height=173 border=0><!--</a>--></td></tr> <tr><td height=7></td></tr> <tr><td> Categories.php <?php /* $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- categories //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES); new infoBoxHeading($info_box_contents, true, false); $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_categories($first_element); $info_box_contents = array(); $info_box_contents[] = array('text' => $categories_string); new infoBox($info_box_contents); ?> </td> </tr> <!-- categories_eof //--> Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 24, 2008 Share Posted April 24, 2008 This may not work since your code has obviously been changed but you can try this. In header.php, change ?> <!-- <? // ---- MANUFACTURERS to function tep_show_category($counter) { global $tree, $categories_string, $cPath_array; for ($i=0; $i<$tree[$counter]['level']; $i++) { $categories_string .= " "; } $categories_string .= '<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 .= '<br>'; if ($tree[$counter]['next_id'] != false) { tep_show_category($tree[$counter]['next_id']); } } ?> <!-- <? // ---- MANUFACTURERS Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
quantrum Posted April 24, 2008 Author Share Posted April 24, 2008 Jack, Dude...your ace, i just had to tweak it a tiny bit but it works again, thank you so much...thats sooooo awesome that its working again, thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.