Page 1 of 1
Navigation error
Posted: Wed Sep 09, 2009 7:46 am
by genierose
I am new using php, so please excuse me for my lack of knowledge. That said, I am having a problem with the following code. The error is in the last line; I don't know what to put in the last ().
// navigation history
if (tep_session_is_registered('navigation')) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
}
} else {
tep_session_register('navigation');
$navigation = new navigationHistory;
}
$navigation->add_current_page();
Can anyone help me with this? I am so frustrated and you would be doing me a kindness if you can help.
Re: Navigation error
Posted: Wed Sep 09, 2009 8:35 am
by cpetercarter
You need to tell us a lot more before anyone can help you.
The code creates an instance of a class called navigationHistory, and gives it the name $navigation. $navigation appears to have a method add_current_page(). It may be necessary to pass a value to the method (by putting something between the brackets), but not necessarily - it may be OK just to leave the brackets empty. (add_current_page() may simply compute the page from information in the URL). It depends on what navigationHistory::add_current_page() expects. You could dig around in the code and see if you can find something called 'class navigationHistory', and then within the class find the function 'add_current_page()' , and post that to see if someone can help you further.
Re: Navigation error
Posted: Wed Sep 09, 2009 9:56 am
by genierose
Thank you for your reply. This is the error message that I received:
Fatal error: Call to a member function add_current_page() on a non-object in /home/amish/public_html/includes/application_top.php on line 312
I looked for "class" and this is what I found:
// include navigation history class
require(DIR_WS_CLASSES . 'navigation_history.php');
Well, that's it for the clues that I can give right now! Does that help you to help me?
Re: Navigation error
Posted: Thu Sep 10, 2009 8:10 am
by cpetercarter
Afraid that doesn't help much. The error message says that there is no object $navigation, which may mean that the relevant file containing the class navigationHistory has not loaded). You seem to be looking for a needle in a very big haystack (called, I think, osCommerce). Would it not be better to ask for help on the
osCommerce Forum?