Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problems restoring backup


Guest

Recommended Posts

I am new to oscommerce and I have been trying to add a contribution which I have failed to do. Before I added the item needed for the contribution I backed up my website and I have tried to restore it and its worked in the admin but I am now getting the following area in the online catalog which is preventing me from been able to see the online catalog. Any help would be greatly appreciated.

 

Parse error: syntax error, unexpected T_STRING in /user/web/mywebsite.com/catalog/includes/functions/html_output.php on line 362

Link to comment
Share on other sites

You'll have to post the code for anyone to help with this.

 

I wouldn't post the whole file.

 

Just lines 350 to 380 maybe (sometimes what PHP considers a "line" and what you think it is may differ).

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I meant post lines 340 to 380 from this file:

 

/catalog/includes/functions/html_output.php

 

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Oh right here you go, hope it helps.

 

function tep_draw_pull_multiselect_menu($name, $values, $defaults, $parameters = '') {

$field = '<select multiple name="' . tep_output_string($name) . '"';

 

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

 

$field .= '>' . "\n";

 

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

 

for ($i = 0, $n = sizeof($values); $i < $n; $i++) {

$field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';

if (in_array($values[$i]['id'], $defaults)) {

$field .= ' SELECTED';

}

 

$field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>';

}

$field .= '</select>';

 

return $field;

}

 

add to admin/includes/functions/general.php

 

function tep_get_categories($categories_array = '', $parent_id = '0', $indent = '') {

global $languages_id;

 

if (!is_array($categories_array)) $categories_array = array();

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' 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)) {

$categories_array[] = array('id' => $categories['categories_id'],

'text' => $indent . $categories['categories_name']);

 

if ($categories['categories_id'] != $parent_id) {

$categories_array = tep_get_categories($categories_array, $categories['categories_id'], $indent . '  ');

}

}

 

return $categories_array;

Link to comment
Share on other sites

Delete this line:

 

add to admin/includes/functions/general.php

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Thanks for that I have now done that and I now get this error:

 

Fatal error: Cannot redeclare tep_get_categories() (previously declared in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/includes/functions/general.php:513) in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/includes/functions/html_output.php on line 380

 

Any Ideas

Link to comment
Share on other sites

Delete this:

 

function tep_get_categories($categories_array = '', $parent_id = '0', $indent = '') {
global $languages_id;

if (!is_array($categories_array)) $categories_array = array();

$categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' 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)) {
$categories_array[] = array('id' => $categories['categories_id'],
'text' => $indent . $categories['categories_name']);

if ($categories['categories_id'] != $parent_id) {
$categories_array = tep_get_categories($categories_array, $categories['categories_id'], $indent . '  ');
}
}

return $categories_array;

}

 

The last "}" isn't in the code portion you posted, but it most likely follows "return $categories_array;" in your file.

Link to comment
Share on other sites

Hi there thanks for your input. I have now deleted it but now I get this, any ideas

 

Warning: require(includes/languages/english/FILENAME_DEFAULT) [function.require]: failed to open stream: No such file or directory in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/index.php on line 33

 

Warning: require(includes/languages/english/FILENAME_DEFAULT) [function.require]: failed to open stream: No such file or directory in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/index.php on line 33

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/english/FILENAME_DEFAULT' (include_path='.:/usr/share/pear') in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/index.php on line 33

Link to comment
Share on other sites

For some reason the error message has now changed and I now have this one. Any one got any ideas.

 

Fatal error: Call to a member function add_current_page() on a non-object in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/includes/application_top.php on line 312

Link to comment
Share on other sites

See the links in my posts here:

 

Click Me

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Thanks for that I have look at the links and done as they said but I now have these errors. Do you think I should just reinstanll it.

 

Warning: require(includes/languages/english/FILENAME_DEFAULT) [function.require]: failed to open stream: No such file or directory in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/index.php on line 33

 

Warning: require(includes/languages/english/FILENAME_DEFAULT) [function.require]: failed to open stream: No such file or directory in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/index.php on line 33

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/english/FILENAME_DEFAULT' (include_path='.:/usr/share/pear') in /misc/24/000/205/035/9/user/web/raredisneydvds.com/catalog/index.php on line 33

Link to comment
Share on other sites

in /include/filenames.php there should be a define for FILENAME_DEFAULT

 

define('FILENAME_DEFAULT', 'index.php');

 

Either the line is missing, the file is missing, the configuration file is wrong, the .........

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...