Revision [20454]

Last edited on 2009-02-10 11:21:42 by DarTar [sample output and validation]
Additions:
===Sample output===
http://nitens.org/taraborelli/home/sitemap.xml
===Validation===
[[http://www.validome.org/google/validate?url=http://nitens.org/taraborelli/home/sitemap.xml&lang=en&googleTyp=SITEMAP Validome]]
===Code===
Save the following as ##handlers/page/sitemap.xml.php##
$xml .= '<?xml version="1.0" encoding="utf-8"?>'."\n";
header('Content-Type: text/xml; charset=utf-8');
Deletions:
===handlers/page/sitemap.xml.php===
$xml .= '<?xml version="1.0" encoding="iso-8859-1"?>'."\n";
header('Content-Type: text/xml; charset=iso-8859-1');


Revision [20450]

Edited on 2009-02-10 08:00:56 by DarTar [discussion]
Additions:
===Discussion===
It would be nice to calculate the optimal value for changefreq as a function of the actual history of revisions of a page. As a first approximation, the following query gives all the data one may need:
%%(sql)
SELECT SQL_NO_CACHE tag,
MAX(time) as latest,
MIN(time) as first,
DATEDIFF(MAX(time), MIN(time)) as history,
COUNT(id) as revisions
FROM wikka_pages
GROUP BY tag
ORDER BY revisions DESC;%%
Dividing the number of existing revisions by the number of days between the first and the last edit should give an approximate index of the frequency with which the page has been modified. Unfortunately this approach is not able to make any useful distinction between a page that has been modified several times per hour on a single date and has been unchanged for months vs. a page that has been modified on a regular basis every week or month.


Revision [20449]

Edited on 2009-02-10 06:31:43 by DarTar [[m] fixed path]
Additions:
===handlers/page/sitemap.xml.php===
Deletions:
===handlers/sitemap.xml.php===


Revision [20447]

The oldest known version of this page was created on 2009-02-10 06:30:04 by DarTar [[m] fixed path]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki