miniBB ® 

miniBB

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

in_array() expects parameter 2 to be array

 
Author Patriboom
Partaker
#1 | Posted: 17 Jan 2015 23:38 
I have this message when i click on one of my topics


=============== result =================

mod = 2
user_id = 2
mod = 2
isMod = 0

Warning: in_array() expects parameter 2 to be array, integer given in /Documents/modem/web/rcmission/plongee/outils/Babillard/index.php on line 252

=============== end of result ============

modified (as below) index.php gives that



------------------ index.php linee 245 to 252 --------------------
echo 'mod = '.$mods[$forum].'<br />';
echo 'user_id = '.$user_id.'<br />';
echo 'mod = '.$mods[$forum].'<br />';
echo 'isMod = '.$isMod.'<br />';
echo '';


if(isset($mods[$forum]) and in_array($user_id,$mods[$forum])) $isMod=1;
------------------- end of quotation -------------------------------------


I'm using a different user_id field name as setup.options fixed (line 123)

$dbUserId='mbre_id';

Author Paul
Lead Developer 
#2 | Posted: 18 Jan 2015 15:03 
Sorry, if it's your custom code, I couldn't say anything exact. We do not provide free support for custom modifications.

Whatever could be wrong, is that you don't follow the generic format of $mods as it should be an array of arrays, as suggested in the Manual.

Specific miniBB Support Forums / Specific /
 in_array() expects parameter 2 to be array
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
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
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑