i'm getting this error when editing user, edit works when i go back and refresh but when i click okay i get this. It gets me annoyed :)
Code:
Warning: Invalid argument supplied for foreach() in /home/f1scsup/public_html/tracker-f1/include/vfunc.php on line 535
Warning: Cannot modify header information - headers already sent by (output started at /home/f1scsup/public_html/tracker-f1/include/vfunc.php:535) in /home/f1scsup/public_html/tracker-f1/modtask.php on line 1200
modtask.php arround line 1200
Code:
if (($CURUSER['class'] == UC_CODER && ($user['modcomment'] != $_POST['modcomment'] ||
$modcomment != $_POST['modcomment'])) || ($CURUSER['class'] < UC_CODER && $modcomment !=
$user['modcomment']))
$updateset[] = "modcomment = " . sqlesc($modcomment);
if (sizeof($updateset) > 0)
mysql_query("UPDATE users SET " . implode(", ", $updateset) . " WHERE id=" .
sqlesc($userid) . "") or sqlerr(__file__, __line__);
status_change($userid);
forummods(true);
$returnto = $_POST["returnto"];
header("Location: $DEFAULTBASEURL/$returnto");
die();
vfunc.php arround line 535
Code:
if (!file_exists($file) || $forced == true)
{
$q = sql_query("SELECT id,username,forums_mod FROM users WHERE forum_mod = 'yes' ") or print(mysql_error());
while($a = mysql_fetch_assoc($q))
$users[] = $a;
$forums = array();
foreach($users as $user)
{
$reg = "([0-9]+)";
preg_match_all($reg,$user["forums_mod"],$fids);
foreach($fids[0] as $fid)
{
if(!array_key_exists($fid,$forums))
$forums[$fid] = array();
$forums[$fid][] = array($user["id"],$user["username"]);
}
}
$h = fopen($file,"w+");
if($h)
{
fwrite($h,serialize($forums));
fclose($h);
}
}