miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Bugs miniBB Support Forums / Bugs /  
 

Undefined variable: row in bb_cookie.php on line [...]

 
Author Cynthia
Partaker
#1 | Posted: 18 Mar 2016 13:13 
Hi,

I have upgraded to the last version - from version 2.1.4 to 3.2.1.
After installing 3.2.1 on localhost(WAMPSERVER 2.5), I have imported my database to mySQL, upgraded database with SQL command and converted database with convdb.php.
All succesful.
After that I have customized templates and updated my forum language, all was good.
When i log in to the forum, I get this error:

Notice: Undefined variable: row in \bb_cookie.php on line 36
Call Stack
# Time Memory Function Location
1 0.0040 283376 {main}( ) ..\index.php:0
2 0.0260 586512 user_logged_in( ) ..\index.php:167

In bb_cookie.php, line 36:
$GLOBALS['user_online']=$row[3];

Index,php, line 167-169:
user_logged_in();
if($user_id!=0 and isset($langu) and $langu=str_replace(array('.','/','\\'),'',$langu) and file_exists($pathToFiles."lang/{$langu}.php")) $lang=$langu;
elseif($user_id==0 and isset($_GET['setlang']) and $setlang=str_replace(array('.','/','\\'),'',$_GET['setlang']) and file_exists($pathToFiles."lang/{$setlang}.php")) {$lang=$setlang; $indexphp.='setlang='.$setlang.'&';}

Thanks in advance!

Author Paul
Lead Developer 
#2 | Posted: 19 Mar 2016 23:17 
Cynthia
Did you used the miniBB Compiler, or installed add-ons manually?

$GLOBALS['user_online']=$row[3];
This is what is not supposed from our default codes...

Author Cynthia
Partaker
#3 | Posted: 20 Mar 2016 18:02 
I used miniBB Compiler.

In older version (2.1.4),
bb_cookie.php line 31-46
//if ($username==$GLOBALS['admin_usr'] and $userpassword==$GLOBALS['admin_pwd']) {
$returned=TRUE;
$GLOBALS['logged_user']=0; $GLOBALS['logged_admin']=1; $GLOBALS['user_id']=1;

if($row=db_simpleSelect(0,$GLOBALS['Tu'],$GLOBALS['dbUserSheme']['user_sorttopics']
[1].','.$GLOBALS['dbUserSheme']['lang uage'][1].', '.$GLOBALS['dbUserSheme']['num_posts'][1],$GLOBALS['dbUserId'],'=',1))
$GLOBALS['user_sort']=$row[0]; $GLOBALS['langu']=$row[1]; $GLOBALS['user_num_posts']=$row[2];
$username=$GLOBALS['admin_usr'];

if ($pasttime<=$GLOBALS['cookie_renew']) {
// if expiration time of cookie is less than defined in setup, we redefine it below
$resetCookie=TRUE;
}

}

elseif.......



In the current version miniBb Compiler
line 32-56
if ( ($username==$GLOBALS['admin_usr'] OR (isset($GLOBALS['loginsCase']) and $GLOBALS['loginsCase'] and strtolower($username)==strtolower($GLOBALS['admin_usr']
))) and $userpassword==$user_pwd_cmp) {
//if ($username==$GLOBALS['admin_usr'] and $userpassword==$GLOBALS['admin_pwd']) {
$returned=TRUE;
$GLOBALS['logged_user']=0; $GLOBALS['logged_admin']=1; $GLOBALS['user_id']=1;
$username=$GLOBALS['admin_usr'];
$GLOBALS['user_online']=$row[3];

if($row=db_simpleSelect(0,$GLOBALS['Tu'],$GLOBALS['dbUserSheme']['user_sorttopics']
[1].','.$GLOBALS['dbUserSheme']['lang uage'][1].', '.$GLOBALS['dbUserSheme']['num_posts'][1].', '.$GLOBALS['dbUserSheme']['user_customonline'][1],$GLOBALS['dbUserId'],'=',1)) {
$GLOBALS['user_sort']=$row[0];
$GLOBALS['langu']=$row[1];
$GLOBALS['user_num_posts']=$row[2];
}
else{
$GLOBALS['user_sort']=0;
$GLOBALS['langu']=$GLOBALS['lang'];
$GLOBALS['user_num_posts']=0;
}

if ($pasttime<=$GLOBALS['cookie_renew']) {
// if expiration time of cookie is less than defined in setup, we redefine it below
$resetCookie=TRUE;
}

}

elseif.........

Awaiting your reply,
Thank you

Author Paul
Lead Developer 
#4 | Posted: 21 Mar 2016 12:45 
Ok... I suppose there is kind of bug in Compiler, which I will check later; so far you need just to move this line of code:

$GLOBALS['user_online']=$row[3];

below the line which says

$GLOBALS['user_num_posts']=$row[2];

So it would be:

$GLOBALS['user_num_posts']=$row[2];
$GLOBALS['user_online']=$row[3];
Important: you need to remove the line I've mentioned, in your original code.
And copy it then below the line I've mentioned.
It should work.

Author Cynthia
Partaker
#5 | Posted: 22 Mar 2016 16:03 
Thank you so much. It works!

Author Paul
Lead Developer 
#6 | Posted: 6 Apr 2016 15:12 
Cynthia
Ok... regarding your reports, I found and fixed the bug in Compiler, so now the package should not give errors like this.
Thanks.

Bugs miniBB Support Forums / Bugs /
 Undefined variable: row in bb_cookie.php on line [...]
 Share Topic's Link

This topic is closed. New replies are not allowed.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑