ADD articles to the sitemap
This commit is contained in:
parent
dc03affbb2
commit
1716200d9d
|
|
@ -155,8 +155,17 @@ class IndexController extends Controller
|
||||||
{
|
{
|
||||||
$xml = new SimpleXMLElement('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"/>');
|
$xml = new SimpleXMLElement('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"/>');
|
||||||
|
|
||||||
$points = Point::model()->getAll(array('order' => 'ID DESC', 'asArray' => true));
|
$articles = Article::model()->getAll(array('order' => 'ID DESC', 'asArray' => true));
|
||||||
|
foreach ($articles as $article)
|
||||||
|
{
|
||||||
|
$url = $xml->addChild('url');
|
||||||
|
$url->addChild('loc', 'http://wikipoints.ru/page/article/id/' . $article['id']);
|
||||||
|
$url->addChild('lastmod', date("Y-m-d", strtotime('- 5 days')));
|
||||||
|
$url->addChild('changefreq', "weekly");
|
||||||
|
$url->addChild('priority', "0.8");
|
||||||
|
}
|
||||||
|
|
||||||
|
$points = Point::model()->getAll(array('order' => 'ID DESC', 'asArray' => true));
|
||||||
foreach ($points as $point)
|
foreach ($points as $point)
|
||||||
{
|
{
|
||||||
$url = $xml->addChild('url');
|
$url = $xml->addChild('url');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue