Inserita sitemap e file robots
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
User-agent: *
|
||||
Disallow: /admin/
|
||||
Sitemap: sitemap.txt
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/*
|
||||
Author: Riccardo Di Dato
|
||||
Creation Date: 14/apr/2016
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__)."/load.php");
|
||||
|
||||
$config = GlobalVariables::get("config");
|
||||
|
||||
$baseurl = $config->pages->remoteLocationPath;
|
||||
|
||||
header('Content-Type: text/xml');
|
||||
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n".
|
||||
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
|
||||
|
||||
// URL della home page
|
||||
echo "<url>";
|
||||
echo "<loc>$baseurl/index.php"."</loc>";
|
||||
echo "<changefreq>hourly</changefreq>";
|
||||
echo "<priority>1</priority>";
|
||||
echo "</url>";
|
||||
|
||||
// URL delle sezioni principali
|
||||
foreach (NotiziaModel::$NOTIZIE_CATEGORY as $category=>$data){
|
||||
if(($data["mainMenu"]) && !$data["hidden"]){
|
||||
echo "<url>";
|
||||
echo "<loc>$baseurl/categorySummary.php?category=".$category."</loc>";
|
||||
echo "<changefreq>hourly</changefreq>";
|
||||
echo "<priority>1</priority>";
|
||||
echo "</url>";
|
||||
}
|
||||
}
|
||||
|
||||
// URL delle sezioni secondarie
|
||||
foreach(NotiziaModel::$NOTIZIE_CATEGORY as $category=>$data){
|
||||
if(!$data["mainMenu"] && !$data["hidden"]){
|
||||
echo "<url>";
|
||||
echo "<loc>$baseurl/categorySummary.php?category=".$category."</loc>";
|
||||
echo "<changefreq>yearly</changefreq>";
|
||||
echo "<priority>0.7</priority>";
|
||||
echo "</url>";
|
||||
}
|
||||
}
|
||||
|
||||
$latestNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"about.data"=>array('$lte'=>new MongoDate())),
|
||||
array("sort"=>array("about.data"=>-1),"limit"=>100)
|
||||
);
|
||||
|
||||
if (sizeof($latestArticles)>0){
|
||||
foreach ($latestArticles as $article){
|
||||
echo "<url>";
|
||||
echo "<loc>$baseurl/articolo.php?id=".$article->id."</loc>";
|
||||
echo "<changefreq>monthly</changefreq>";
|
||||
echo "<priority>0.3</priority>";
|
||||
echo "</url>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</urlset>";
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user