For Visual PHP™
Soubor sitemap.xml obsahuje souhrn URL na jednotlivé stránky Vaší prezentace. Jedná se o poměrně jednoduchý XML soubor, který specifikuje protokol sitemaps XML format.
Ukázkový soubor se dvěma stránkami může vypadat takto:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.domain.com/site-1/</loc>
<lastmod>2011-05-14T14:20:29+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>http://www.domain.com/site-2/</loc>
<lastmod>2011-05-14T14:20:29+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
</urlset>Specifikace určuje tyto elementy:Název: tables Typ komponenty: TABLES Parametry komponenty: Multiselect = trueNyní už stačí pouze zadat jednotlivé události:
$this->tables = array();
$this->tableRecordIndex = 0;
$this->allTablesRecordIndex = 0;
$this->tableRecordStep = 20;
$this->fileName = PROJECTPATH."sitemap.xml";
$this->tmpFileName = PROJECTPATH."repository/temp/sitemap.xml";
_file_put_contents($this->tmpFileName, "");
$total = 0;
foreach($this->params["tables"] as $tableName)
{
$Table = getTable($tableName);
if ($Table)
{
foreach(getObject("Translators")->languages as $language)
{
$total += getTable($tableName)->getContentRecordCount();
$this->tables[] = array("name" => $tableName, "recordCount" => $total, "language" => $language);
}
}
}
return($total);Událost onContinue:$f = fopen($this->tmpFileName, "a+");
if ($this->allTablesRecordIndex == 0)
{
fwrite($f, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
fwrite($f, "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">");
}
while(count($this->tables))
{
$Table = getTable($this->tables[0]["name"]);
setLanguage($this->tables[0]["language"]);
processProgressText("Processing table '".$Table->name."' record ".($this->tableRecordIndex+1)." of ".$this->tables[0]["recordCount"]." for language ".$this->tables[0]["language"]);
processProgressByIndex($this->allTablesRecordIndex);
$records = $Table->getContentRecords("begin=".$this->tableRecordIndex.",limit=".$this->tableRecordStep);
foreach($records as $record)
{
fwrite($f, "<url>");
fwrite($f, "<loc>".parseFileLinks($Table->fileName."?id=".$record["id"])."</loc>");
if ($record["date"])
fwrite($f, "<lastmod>".date("c",_strtotime($record["date"]))."</lastmod>");
fwrite($f, "<changefreq>monthly</changefreq>");
fwrite($f, "<priority>0.5</priority>");
fwrite($f, "</url>");
}
$this->tableRecordIndex += $this->tableRecordStep;
$this->allTablesRecordIndex += count($records);
processMessage($this->tableRecordIndex." >= ".$this->tables[0]["recordCount"]);
if ($this->tableRecordIndex >= $this->tables[0]["recordCount"])
{
array_shift($this->tables);
$this->tableRecordIndex = 0;
}
if ($this->resumeNeeded())
{
fclose($f);
$this->resumeInBackground();
}
}
fwrite($f, "</urlset>");
fclose($f);
$this->finish();Událost onFinish:_file_put_contents($this->fileName, "");
rename($this->tmpFileName, $this->fileName);
// ping Google to say that sitemap has changed
download("http://www.google.com/webmasters/sitemaps/ping?sitemap=".urlencode(PROJECTURL."sitemap.xml"), array(), array(), array("timeout" => 2));
processProgressText("Finished");
Skript generuje odkazy pro všechny nastavené jazyky, lze jej tedy využít i pro vícejazyčné prezentace.$tables = array(
"news",
"documents",
"articles",
"photogalleries",
);
runProcessScript("sitemap_xml", array("tables" => $tables));
Které tabulky budete generovat záleží už jen na rozsáhlosti Vašeho projektu.http://www.domain.com/cron.php?tid=sitemap_xmlPrůběh provádění skriptu na pozadí můžete sledovat v Nástroje -> Správce procesů -> Všechny procesy.
http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_SOUBORU_SITEMAP_XMLVolání samo je provedeno ve skriptu v události onFinish. Pro ostatní vyhledávače musíme přidat do souboru robots.txt (nacházející se v rootu webu) cestu, kde je sitemap.xml uložen. Výsledný soubor robots.txt :
User-agent: * Allow: Sitemap: http://www.domain.com/sitemap.xml
Some properties published in this article can only be functional with the latest core version. If you have any older core version, we recommend you to update to the latest version.
| Fotogalerie | 5/10/2012 |
| Section: Tvorba prezentací | |
| Chyba v hromadné korespondenci, nelze odeslat příloha (nová verze | 4/6/2012 |
| Section: Bug reporty | |
| AntiSpam obrázek | 4/6/2012 |
| Section: Programování | |
| Chyba při opravách textů | 4/4/2012 |
| Section: Bug reporty | |
| Admin může smazat Developera, je to ok? | 3/27/2012 |
| Section: Bug reporty | |
| Mapa webu | 3/19/2012 |
| Section: Tvorba prezentací | |
| Weather Component Update
november 18, 2011 |
|
Server weather.com decided to stop providing weather information for free and passed to the paid version (about $ 60 per month). For this reason, we were forced to modify the Weather component to pulling weather information from another data source, namely from the server www.worldweatheronline.com . This site also provides information about weather all around the world, but the amount of information is smaller than the original source. For proper functionality of the Weather component please update core to version 1.7.9.638. |
| Added new tutorials
october 4, 2011 |
|
He added new instructions Using another HTML editor |
English

