Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Silverfish

Pioneers
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Real Name
    Tijm Lanjouw
  • Gender
    Male
  • Location
    Groningen, the Netherlands

Silverfish's Achievements

  1. So I tried your suggestion as well. Then I got this message: Fatal error: require() [function.require]: Failed opening required 'includes/languages/Array.php' (include_path='.:/usr/local/lib/php') in ../includes/application_top.php on line 279 I removed your line and tested the website again before moving the class_exists() back into the language.php file. But I didnt have to do the last step for everything worked fine now without class_exists()! I did change the order of the boxes in the meantime, so it might be related to that after all. All very puzzling...
  2. Ok... ignore the above. The problem wasnt solved by the solution I just posted. I was working in two files at the same time and got a bit confused with what change caused what... What did work in the end was simply editing the language.php file from: class language { var $languages, $catalog_languages, $browser_languages, $language; to if (!class_exists('language')) { class language { var $languages, $catalog_languages, $browser_languages, $language; dont forget to close the if at the end of the file. Shows how much of a noob i actually am.. ;) (is that why they dont let you edit your posts after a certain amount of time? ;))
  3. I'm also running a dual-language site, and I was having the same problem as refered to several times in this topic: "Fatal error: Cannot redeclare class language in .../includes/classes/language.php on line 16" Tried the change in the language.php file as proposed above as well, but didn't work. As with francois21 the problem disappears when I disable the language box. Also tried his removal of several lines of code from bm_generic.php. The problem was actually already solved when I just removed the first two lines of the piece of code francois posted: include_once( DIR_WS_CLASSES . 'language.php' ); $language_class = new language; But of course, that's not really working on the admin side when you want to edit the content of your box. So, php-noob as I am, I went looking for the cause and solutions of this type of fatal error and found out that it's usually solved by first checking whether a class is declared or not. So, that's what I did: if (!class_exists('language')) { include_once( DIR_WS_CLASSES . 'language.php' ); $language_class = new language; $languages = $language_class->catalog_languages; foreach( $languages as $language ) { $this->languages_array[$language['id']] = $language['name']; } unset($language_class); unset($languages); unset($language); } } (added the first and last line to existing code in bm_generic.php) And presto! Everything seems to work fine. Maybe later versions of php don't complain about declaring classes twice, which might explain why some people are getting this error while others don't. As I know just enough of php to tweek things a bit now and than, but nothing near the level of writing my own script, I'm not sure whether the above solution is actually a good one, or whether ther're implications I'm not able to foresee. For the moment I'm happy, for I've got my generic box. Thanks for your work! Great job. Very useful module.
×
×
  • Create New...