if ($save) {
$db->query("insert into news (rss_id, groups_id, news_date, news_title, news_trans_title, news_description, news_text, news_guid, news_pubDate, news_link, news_image, news_imagealt, news_active, news_error, news_errormessage, hash) values ('{rss_id}', '{groups_id}', {news_date}, '{news_title}', '{news_trans_title}', '{news_description}', '{news_text}', '{news_guid}', '{news_pubDate}', '{news_link}', '{news_image}', '{news_imagealt}', '{news_active}', '{news_error}', '{news_errormessage}', IF('".$news_active."' = 'checked', '".(empty($images[0]['image_source']) ? "0" : "1").$rss["groups_id"]."', NULL))", $item);
$id = mysql_insert_id();
$images = array();
if (mysql_error()) {
$save = false;
//echo "\ninsert into news (rss_id, groups_id, news_date, news_title, news_description, news_text, news_guid, news_pubDate, news_link, news_image, news_imagealt, news_active, news_error, news_errormessage) values ('".$rss["rss_id"]."', '".$rss["groups_id"]."', NOW(), '".addslashes($item["title"])."', '', '', '".$item["guid"]."', '".$item["pubDate"]."', '".$item["link"]."', '".$images[0]['image_source']."', '".$images[0]['alt']."', '$news_active', '$news_error', '$news_errormessage')\n".mysql_error();
} else {
if ($options["shingle_check"] == "checked") {
if ($options["grab_shingles_days"] > 0) $db->query("delete from news_shingles where `date` < NOW() - INTERVAL ".$options["grab_shingles_days"]." DAY and type <> 'title'");
$db->query("insert into news_shingles values(".$id.", ".abs(crc32($item["news_guid"])).", 'title', NOW())");
foreach($shingles as $ss) {
$db->query("insert into news_shingles values(".$id.", ".$ss.", '', NOW())");
}
}