Hi - I am very new to XOOPS, but not to websites. I just don't know php yet. I really want to have a sitemap for my XOOPS installation, (here
GIVEthing)
but can't get it to go right! Please can you help? I tried the code above, edited like this:
<?set_time_limit(500);?>
<? header("Content-type: text/xml");
include "mainfile.php";
$resultb = mysql_query("SELECT storyid FROM XOOPS_stories LIMIT 0,5000");
?>
<?php echo '<?xml version="1.0" encoding="ISO-8859-9"?>'; ?>
<?php echo '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'; ?>
<? $i=1;
while ($resultat = mysql_fetch_array($resultb)) {
$storyid=$resultat["storyid"];
$date=date('Y-m-d');
echo "
<url>
<loc>http://www.givething.info/mything/modules/news/article.php?storyid=$storyid</loc>
<lastmod>$date</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url> ";
$i++;
} ?>
</urlset>
I get this error:
XML Parsing Error: xml processing instruction not at start of external entity
Location:
http://www.givething.info/mything/sitemap.phpLine Number 2, Column 1:<?xml version="1.0" encoding="ISO-8859-9"?>
^
I tried this:
<?set_time_limit(500);?>
<? header("Content-type: text/xml");
include "mainfile.php";
$resultb = mysql_query("SELECT storyid FROM XOOPS_stories LIMIT 0,5000");
?>
<?php echo '<xml version="1.0" encoding="ISO-8859-9">'; ?>
<?php echo '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'; ?>
<? $i=1;
while ($resultat = mysql_fetch_array($resultb)) {
$storyid=$resultat["storyid"];
$date=date('Y-m-d');
echo "
<url>
<loc>http://www.givething.info/mything/modules/news/article.php?storyid=$storyid</l
oc>
<lastmod>$date</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url> ";
$i++;
} ?>
</urlset>
I get this error:
XML Parsing Error: no element found
Location:
http://www.givething.info/mything/sitemap1.phpLine Number 5, Column 11:</urlset>
----------^
What do I do next - Any ideas please?