echo $e->getMessage(); } } $priority -= 0.01; } } $urls = array(); $sql = "delete from `sitemaps` where type='news';"; $shopcoins_class->setQuery($sql); require_once $cfg['path'] . '/models/news.php'; require_once $cfg['path'] . '/configs/config_news.php'; $r_url = "http://www.numizmatik.ru/news"; $news_class = new model_news($db_class); $sql = "select news, date, name, text, source from news where `check`=1 ;"; //echo $sql; $result = $news_class->getDataSql($sql); $newstime = ''; foreach ($result as $rows) { $namehref = contentHelper::strtolower_ru($rows["name"]) . "_n" . $rows["news"] . ".html"; //echo "http://numizmatik.ru/news/".$namehref."<br>"; $sql_ins = "insert into sitemaps (`url`,`page`,`priority`,`type`,`dateinsert`,`lastmod`) \n\tvalues ('http://numizmatik.ru/news/" . $namehref . "', 'daily',0.5,'news'," . time() . ",'" . date('Y-m-d', $rows['date']) . "')"; $shopcoins_class->setQuery($sql_ins); if ($newstime < $rows['date']) { $newstime = $rows['date']; } } $WhereParams = array(); $count = $news_class->countallByParams($WhereParams); $page = ceil($count / $tpl['onpage']); $sql_ins = "insert into sitemaps (`url`,`page`,`priority`,`type`,`dateinsert`,`lastmod`) \n\t\tvalues ('http://numizmatik.ru/news/', 'daily',0.5,'news'," . time() . ",'" . date('Y-m-d', $newstime) . "')"; $shopcoins_class->setQuery($sql_ins);