1
SLEO577
VLWeather Module Trouble...
  • 2005/7/19 7:41

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


I am having two errors come back with the (vlweather module). This is only happening in Version 2.2RC, not in version 2.13.

Quote:

Notice [PHP]: Undefined variable: xoopsConfig in file modules/vlweather/index.php line 16
$language = $xoopsConfig['language'];

Notice [PHP]: Undefined variable: xoopsConfig in file modules/vlweather/index.php line 18
if(file_exists(XOOPS_ROOT_PATH.'/modules/vlweather/language/'.$xoopsConfig['language'].'/main.php')){


This is the script where the problem is:
Quote:

Line 14 function disp_complete_vlweather() {
Line 15 global $xoopsDB, $xoopsUser;
Line 16 $language = $xoopsConfig['language'];
Line 17 // Include the appropriate language file.
Line 18 if(file_exists(XOOPS_ROOT_PATH.'/modules/vlweather/language/'.$xoopsConfig['language'].'/main.php')){
Line 19 include_once(XOOPS_ROOT_PATH.'/modules/vlweather/language/'.$xoopsConfig['language'].'/main.php');
Line 20 } else {
Line 21 include_once(XOOPS_ROOT_PATH.'/modules/vlweather/language/english/main.php');
Line 22 }

The errors seem to be caused by anything with this script in it:
($xoopsConfig['language'];

2
Pnooka
Re: VLWeather Module Trouble...
  • 2005/7/19 9:40

  • Pnooka

  • Just popping in

  • Posts: 68

  • Since: 2004/7/16


You could comment this lines, like this.
Quote:

//$language = $xoopsConfig['language'];

Since the XOOPS core finds module specific languages within the module structure.

3
SLEO577
Re: VLWeather Module Trouble...
  • 2005/7/19 9:52

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Thanks for the quick reply Pnooka. I tried that, but this is the error i got when trying that:

Quote:
Parse error: parse error, unexpected T_ELSE in /home/fstate/public_html/modules/vlweather/index.php on line 20

4
Pnooka
Re: VLWeather Module Trouble...
  • 2005/7/19 9:58

  • Pnooka

  • Just popping in

  • Posts: 68

  • Since: 2004/7/16


This should do the trick for that.
Quote:

Line 14 function disp_complete_vlweather() {
Line 15 global $xoopsDB, $xoopsUser;
Line 16 //$language = $xoopsConfig['language'];
Line 17 // Include the appropriate language file.
Line 18 //if(file_exists(XOOPS_ROOT_PATH.'/modules/vlweather/language/'.$xoopsConfig['language'].'/main.php')){
Line 19 //include_once(XOOPS_ROOT_PATH.'/modules/vlweather/language/'.$xoopsConfig['language'].'/main.php');
Line 20 //} else {
Line 21 //include_once(XOOPS_ROOT_PATH.'/modules/vlweather/language/english/main.php');
Line 22 //}

5
highlander
Re: VLWeather Module Trouble...
  • 2005/7/19 9:58

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


Quote:

Pnooka wrote:
You could comment this lines, like this.
Quote:

//$language = $xoopsConfig['language'];

Since the XOOPS core finds module specific languages within the module structure.


Pnooka,
The line you want to comment out is the module asking the core which language is default and then looking for a folder with that name.

If you want to fix this by adding // in front of lines you would have to comment out lines 16, 18, 19, 20 and 22.
The module should then work without errors but only in english. (you could offcourse change "english" into your default langauge!!) (line 21)

The part which is giving you trouble is the module asking XOOPS about the default language. And there should be a better fix then just taking this question out of the code. I believe I have seen other modules request the default langauge the same way. Will the all give errors on 2.2 ???

greetings Highlander
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
www.AnimalPedigree.com

6
highlander
Re: VLWeather Module Trouble...
  • 2005/7/19 10:01

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


SLEO577,

Dont comment out line 21 like in Pnooka's code. You will receive alot more errors than you are getting now.
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
www.AnimalPedigree.com

7
Pnooka
Re: VLWeather Module Trouble...
  • 2005/7/19 10:03

  • Pnooka

  • Just popping in

  • Posts: 68

  • Since: 2004/7/16


Well, i found the place in kernel/module.php. This is where XOOPS 2.2 get the module specific language code.
Quote:

function loadLanguage($type = "main") {
global $xoopsConfig, $xoopsModule;
if ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/".$xoopsConfig['language']."/".$type.".php") ) {
include_once XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/".$xoopsConfig['language']."/".$type.".php";
} else {
if ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/english/".$type.".php") ) {
include_once XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/english/".$type.".php";
}
}
}

8
SLEO577
Re: VLWeather Module Trouble...
  • 2005/7/19 11:35

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Commenting out all the lines 16, 17, 18, 19, 20, 21 and 22 did stop any errors from coming up and the module is working as good as it did in version 2.0.13.

Quote:

Pnooka wrote: this should do the trick:

Line 14 function disp_complete_vlweather() {
Line 15 global $xoopsDB, $xoopsUser;
Line 16 //$language = $xoopsConfig['language'];
Line 17 // Include the appropriate language file.
Line 18 //if(file_exists(XOOPS_ROOT_PATH.'/modules/vlweather/language/'.$xoopsConfig['language'].'/main.php')){
Line 19 //include_once(XOOPS_ROOT_PATH.'/modules/vlweather/language/'.$xoopsConfig['language'].'/main.php');
Line 20 //} else {
Line 21 //include_once(XOOPS_ROOT_PATH.'/modules/vlweather/language/english/main.php');
Line 22 //}


Luckily, I only need it in english. But no errors came up after commenting // out 21.

Thanks for all your help!

Login

Who's Online

226 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 226


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits