Full Error:
in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /var/www/vhosts/example.com/httpdocs/sites/example.com/themes/example/page.tpl.php on line 22.
Relevant Code:
if (($_GET['nid']) && ($_GET['uid'] != '5')) :
$arr = array("7916","7917","7996","7918","7990","7919","7921","7924","7925","7923","7922","8011");
reset($arr);
$nid = $_GET['nid'];
// settype($nid, "integer");
elseif(($_GET['uid'] == '5') && ($is_front)):
include("include_ad_front.php");
endif;
if((in_array($nid, $arr)) && ($is_front) && (!$_GET['uid'])) {
//code continues below...
Lines 3 and 5 were just my attemts to fix the problem. Line 10 is actually line 22 in this error and the one throwing the error.
I think I see your problem.
You have the
in_arraystuff being called after you’ve done your first set ofif..elsechecks. Now the first part of yourif...elsehas the array being created, but not the second.Try moving the array somewhere before your first
if...elseinstead of inside it.