PDA


View Full Version : [Bug] $bgclass not initialized


Kirby
11-23-2007, 04:09 AM
When CMPS is integrated with other scripts (like showthread.php), the bgclass for the displayed modules is not constant - it depends on the last bgclass used by the host script.

It's confusig to have the navigation module in alt1 on forumhome, while it might be alt1 or alt2 in threads ;)

I therefore suggest to initialize $bgclass to alt1 before processing modules.

For those who need a fix now, I'v attached a plugin.

jw0ollard
11-23-2007, 04:43 AM
Isn't the Process PHP File Modules Within A Function setting for problems like this?

I can't test it out, so I'm probably wrong.. and I guess a "real" fix is always helpful.

Subliminal message: (Brian should beg you to become a dev--you seem to know the code better than Brian at times. =p)

Thanks, Kirby. :)

Kirby
11-24-2007, 12:08 PM
The modules are processed within function print_portal_output() anyway, no matter what the setting is ;)

The problem is that exec_switch_bg() uses a global variable, and CMPS does not re-initialize it before processing the modules - so it is in the state it was after processing the normal script (eg. showthread.php, etc.)