miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

in_array() expects parameter 2 to be array

Author Patriboom
Registered
#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 Top

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

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


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