I have had an annoying problem that manifests itself with a "no permission" page coming up while going between the flash games and my vBPortal.
I have found the solution to my problem and it looks like there is a logic problem with the placement of "show_nopermission()" call. I know that people say they have no problem with this. But I have the problem and many of my members say they see the "no permission form" as well.
Anyway, logic of the original code is shown below:
PHP Code:
require('./global.php');
if ($bbuserinfo[userid]) {
if ($play) {
// do play stuff here
}
else {
// do error stuff here
}
show_nopermission(); // looks like this [b]always displays ???[/b]
}
It looks like the show_nopermission() can only possibly be called in the block of code that is executed by a playing member. And, that's what I see. So, I decided to put the show_nopermission() where it made sense (at least to me).
In my revised version, I moved the show_nopermission() to the block of code that actually is executed, if the player has no permissions.
PHP Code:
//vB Flash Player 1.1 by Erwin Loh
//modified by: Mike Davis
//change: changed location of show_nopermission() and made it only
require('./global.php');
if ($bbuserinfo[usergroupid]==1) {
show_nopermission();
}
else {
if ($play) {
// do play stuff here
}
else {
// do no game selected stuff here
}
}
?>
Even though I have it working now on my site, I'd like to know if this is a bug, in the original code, that has just been masked on some systems or if I'm misunderstanding how this works. Because with the original code, 1) showed the "no permission page" and 2) the show_permission() function seems logically, in the wrong place, anyway.
My correcte page.