i'm using stm202 v4 ,install it on vps hosting,now get this error Warning: Invalid argument supplied for foreach() in /www/stm202/202-account/ajax/alerts.php on line 13 ,how to fix this?? thanks
OK, this is a weird one! I've not seen this error before, I must admit.
Did you follow the STM install guide at http://stmforum.com/forum/showthread...e-Tracker-V3-4 ? If so, at what stage did this error show up?
It's normal. It just means you have no alerts and the code is erroring out because it's trying to show you alerts that aren't in the array.
UPDATE---
It's the 202 alerts RSS feed. It will error out if the install is new and 202 hasn't fetched the RSS "alerts" yet. Below is a fix if anyone is interested, but it's no big deal if left unfixed.
Replace lines 13 thru 26 on 202-account/ajax/alerts.php with the code below.
if(!empty($rss->items)&&is_array($rss->items)) {
foreach ($rss->items as $item ) {
//check if this alert is already marked as seen
$mysql['prosper_alert_id'] = mysql_real_escape_string($item['prosper_alert_id']);
$sql = "SELECT COUNT(*) AS count FROM 202_alerts WHERE prosper_alert_id='{$mysql['prosper_alert_id']}' AND prosper_alert_seen='1'";
$result = _mysql_query($sql);
$row = mysql_fetch_assoc($result);
if ($row['count']) {
#echo 'dont show';
$dontShow[$item['prosper_alert_id']] = true;
} else {
#echo 'show alerts';
$showAlerts = true;
}
}
}else {
$showAlerts = false;
}
thank you kyleirwin i know
Thanks, kyleirwin!
Much appreciated, I actually didn't know that.
Thanks for the patch!
Even though if you disable warnings in PHP all should be good too.