miniBB Support Forums | 15 years on The Web
miniBB ®

miniBB

®
 
 | Forums | Register | Reply | Search | Statistics | 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


 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
 
miniBB Support Forums Powered by Forum Software miniBB ® 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.
↑ TOP