1
indream
google sitemap and my sitemap.php file
  • 2005/7/6 14:13

  • indream

  • Not too shy to talk

  • Posts: 170

  • Since: 2004/9/21


hi

i'am using this code for google sitemap list my news.

filename: sitemap.php

<?  header("Content-type: text/xml"); 
include "mainfile.php"; 
$resultb = mysql_query("SELECT storyid  FROM kuku_stories ORDER BY storyid DESC LIMIT 0,1000"); 

?> 
<?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.mysite.net/modules/news/article.php?storyid=$storyid</loc> 
<lastmod>$date</lastmod> 
<changefreq>weekly</changefreq> 
<priority>0.5</priority> 
</url> "; 
$i++; 
} ?> 
</urlset>

http://www.google.com/webmasters/sitemaps/login

if this codes wrong or bad ?

2
hervet
Re: google sitemap and my sitemap.php file
  • 2005/7/7 10:56

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


why don't you use the sitemap module ?
It has a script to do it.

3
carnuke
Re: google sitemap and my sitemap.php file
  • 2005/7/7 12:06

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


Quote:
why don't you use the sitemap module ?
The current sitemap module seems to have problems with the old wfsections module. I use this for about 50% of my site content, so the module is not very useful.

The google SM could be worth persuing ??
hhttp://houseofstrauss.co.uk Resource for alternative health and holistic lifestyle
search xoops

4
hervet
Re: google sitemap and my sitemap.php file
  • 2005/7/7 12:38

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Richard,

Quote:

carnuke wrote:
The current sitemap module seems to have problems with the old wfsections module. I use this for about 50% of my site content, so the module is not very useful.

Edit the file called /xoops/modules/sitemap/plugins/wfsection.php and replace the line :
$block = sitemap_get_categoires_map($xoopsDB->prefix("wfs_category"), "id", "pid", "title", "viewarticles.php?category=", "title");

with :
$block = sitemap_get_categoires_map($xoopsDB->prefix("wfs_category"), "id", "pid", "title", "index.php?category=", "title");

5
indream
Re: google sitemap and my sitemap.php file
  • 2005/7/7 13:08

  • indream

  • Not too shy to talk

  • Posts: 170

  • Since: 2004/9/21


@herko:
i think this a small file and working perfect :)