Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: Davilac on June 05, 2005, 10:17:49 AM

Title: Google Sitemaps
Post by: Davilac on June 05, 2005, 10:17:49 AM
Just asking if anyone has already a Google Sitemaps working for SMF.

If you don't know what is Sitempas read:

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

https://www.google.com/webmasters/sitemaps/docs/en/protocol.html
https://www.google.com/webmasters/sitemaps/docs/en/faq.html
http://blog.searchenginewatch.com/blog/050602-195224
https://www.google.com/webmasters/sitemaps/docs/en/sitemap-generator.html

If is thought that Sitemaps are going to be important and Google is changing some files thinking in Sitemaps:

QuoteYou may also use the Google Sitemaps (Beta) program to create and submit a detailed sitemap of your pages. We're testing this as a complement to our current crawl and encourage webmasters to participate. Google Sitemaps makes it easier for webmasters to provide information about their sites, and to update us when pages are added or changed.
In http://www.google.com/intl/en/webmasters/1.html

Title: Re: Google Sitemaps
Post by: Trekkie101 on June 05, 2005, 10:28:13 AM
[Unknown] presented this, this morning

http://www.simplemachines.org/community/sitemap.php

Title: Re: Google Sitemaps
Post by: Davilac on June 05, 2005, 11:14:38 AM
That's ok thank you
Title: Re: Google Sitemaps
Post by: Davilac on June 05, 2005, 11:20:03 AM
there's another post talking about it? I don't see nothing
Title: Re: Google Sitemaps
Post by: xenovanis on June 05, 2005, 11:23:28 AM
http://www.simplemachines.org/community/index.php?topic=14004.msg276463#msg276463
Title: Re: Google Sitemaps
Post by: Neol on June 06, 2005, 08:26:15 AM
How can I add such a sitemap to my forum?
Title: Re: Google Sitemaps
Post by: sensovision on June 07, 2005, 07:26:11 AM
Unkown, would you share this mod with us? I'd like to try it on my board.
Title: Re: Google Sitemaps
Post by: basesoft on June 09, 2005, 04:21:44 AM
Quote from: Trekkie101 on June 05, 2005, 10:28:13 AM
[Unknown] presented this, this morning

http://www.simplemachines.org/community/sitemap.php



could you please advise what kind of proces i should follow step by step to
create sitemap for SMF forum? when i tried generate this by myself ,there was
no url for the forum, only list of directories for webserver was found.
Title: Re: Google Sitemaps
Post by: [Unknown] on June 09, 2005, 04:31:59 AM
Untested with SMF 1.0.x.  Upload, test, and give to Google.

Shows the top 20 members, top 20 topics, all boards, and forum only.

-[Unknown]
Title: Re: Google Sitemaps
Post by: Harro on June 09, 2005, 07:20:04 AM
I tested it with 1.0.3
Doesn't work
Parse error: parse error, unexpected T_IF in /home/users/members/hwbk/harro/public_html/forums/SSI.php on line 662
Title: Re: Google Sitemaps
Post by: Neol on June 09, 2005, 08:26:33 AM
The same here!  :-\
Title: Re: Google Sitemaps
Post by: [Unknown] on June 09, 2005, 05:34:38 PM
Quote from: Harro on June 09, 2005, 07:20:04 AM
I tested it with 1.0.3
Doesn't work
Parse error: parse error, unexpected T_IF in /home/users/members/hwbk/harro/public_html/forums/SSI.php on line 662

That means a problem in SSI.php.  What mods do you have installed?

-[Unknown]
Title: Re: Google Sitemaps
Post by: Harro on June 09, 2005, 05:36:51 PM
Yeah, I also can't open ssi_examples.
Got a few
arcade, shoutbox, spider mod.
Title: Re: Google Sitemaps
Post by: Owdy on June 09, 2005, 05:44:21 PM
Quote from: [Unknown] on June 09, 2005, 04:31:59 AM
Untested with SMF 1.0.x.  Upload, test, and give to Google.

Shows the top 20 members, top 20 topics, all boards, and forum only.

-[Unknown]
Works like dream with 1.1. Thank you!
Title: Re: Google Sitemaps
Post by: Trekkie101 on June 09, 2005, 05:53:22 PM
Works a dream on a vanilla 1.0.4 too :D

Thanks [Unknown]!
Title: Re: Google Sitemaps
Post by: Neol on June 09, 2005, 06:13:52 PM
I got this error!

<b>Notice</b>:  Undefined index:  hide in <b>/home/httpd/vhosts/zeriyt.com/subdomains/forumi/httpdocs/Sour...
Title: Re: Google Sitemaps
Post by: [Unknown] on June 09, 2005, 06:25:11 PM
That's also from a modification to SMF, and not from this file itself.

-[Unknown]
Title: Re: Google Sitemaps
Post by: 3fifty on June 10, 2005, 03:45:44 AM
I placed this on both of my sites in /forum/ and it worked fine.  Thanks Unknown!
Title: Re: Google Sitemaps
Post by: Neol on June 10, 2005, 05:48:01 AM
Quote from: [Unknown] on June 09, 2005, 06:25:11 PM
That's also from a modification to SMF, and not from this file itself.

-[Unknown]

And what can we do now? Remove all the mods?
Title: Re: Google Sitemaps
Post by: Harro on June 10, 2005, 05:01:56 PM
olti, any chance that you've installed the googlebot and spiders mod?
It adds a lot to ssi.php, and I think that the error is caused by that one.
Still have to look into it though, but I'm not a great php coder (I'm not one at all :p, but will learn it soon), so I doubt that I'll be able to fix it.
Title: Re: Google Sitemaps
Post by: Harro on June 13, 2005, 06:34:57 AM
I found the line of code where the error is.
But I can't see what's wrong with it:
// + ($modSettings['ob_googlebot_count_most_online'] ? $return['num_spiders'] : 0)
How can I fix it?
Title: Re: Google Sitemaps
Post by: jerm on June 14, 2005, 01:02:48 AM
this just creats the xml file correct?
it doesn't automaticly generate a file for us so that we can link it to google?
Title: Re: Google Sitemaps
Post by: [Unknown] on June 14, 2005, 01:04:34 AM
Quote from: electrohome88 on June 14, 2005, 01:02:48 AM
this just creats the xml file correct?
it doesn't automaticly generate a file for us so that we can link it to google?

Give Google the link to the script.

-[Unknown]
Title: Re: Google Sitemaps
Post by: jerm on June 14, 2005, 01:06:54 AM
ahh okay, the first time i asked it to link sitemap.php it gave me an error.. i just tried again and it worked fine. thanks
Title: Re: Google Sitemaps
Post by: bluevoodu on June 15, 2005, 11:14:19 PM
looks good to me.

So only the categories are included with the site map? 
I know if all the posts were there... that would be massive.

thanks unknown!  I appreciate it.  And it works good to boot.

†B†V†
Title: Re: Google Sitemaps
Post by: bluevoodu on June 17, 2005, 10:43:53 PM
I don't know why... but when I submit the file to Google sitemap..... It says it cannot be found.  I triple checked the URL..

Anyone know why?

Also, what all is supposed to be shown by this php file?  It starts to show users, but it doesn't do the whole list of users, just a few.
Are all messages supposed to be there as well?

THanks for your help.
BV
Title: Re: Google Sitemaps
Post by: [Unknown] on June 17, 2005, 11:21:04 PM
Works fine for me.  I'm using:

http://www.simplemachines.org/community/sitemap.php

-[Unknown]
Title: Re: Google Sitemaps
Post by: Davilac on June 18, 2005, 02:40:32 AM
Works fine, only that only catch dinamic URLs. That could be an improvement if could work with the short urls  ;)
Title: Re: Google Sitemaps
Post by: Davilac on June 18, 2005, 03:05:56 AM
I made my modification to fit this what was saying before:

this is the script modified to fit short urls. Just search and replace this piece of code

Quote// Now the boards!
foreach ($boards as $board)
{
   echo '
   <url>
      <loc>', $scripturl, '/board,', $board['id'], '.0.html</loc>
      <lastmod>', posts_max_time($board['times']), '</lastmod>
      <changefreq>', posts_to_freq($board['times']), '</changefreq>
      <priority>', posts_to_priority(0.8, $board['times']), '</priority>
   </url>';
}

// Popular topics too...
foreach ($topics as $topic)
{
   echo '
   <url>
      <loc>', $scripturl, '/topic,', $topic['id'], '.0.html</loc>
      <lastmod>', posts_max_time($topic['times']), '</lastmod>
      <changefreq>', posts_to_freq($topic['times']), '</changefreq>
      <priority>', posts_to_priority(0.7, $board['times']), '</priority>
   </url>';
}

very easy  ;)
Title: Re: Google Sitemaps
Post by: Davilac on June 18, 2005, 05:18:11 AM
I also was thinking if could do something like this:

Quote//mi modificación

$identidicador=1;
while ($identificador != 60)
{
   echo '
   <url>
      <loc>', $scripturl, '/topic,', $identificador, '.0.html</loc>
      <lastmod>', posts_max_time($topic['times']), '</lastmod>
      <changefreq>', posts_to_freq($topic['times']), '</changefreq>
      <priority>', posts_to_priority(0.7, $board['times']), '</priority>
   </url>';
   $identificador++;
}

About the topics, the most important for Google. (Don't use directly my code because has a little bug, I only know Java, not PHP  ;))

I see important make a sitemap which had as many topics as we can
Title: Re: Google Sitemaps
Post by: bluevoodu on June 18, 2005, 05:45:52 PM
Quote from: [Unknown] on June 17, 2005, 11:21:04 PM
Works fine for me.  I'm using:

http://www.simplemachines.org/community/sitemap.php

-[Unknown]
does the name have to state: sitemap.php ?

mine is:
http://www.egameaddiction.com/forums/smfsmap.php
Its there and works.... but for some odd reason, Google stats that it can't find it

That URL... I copied directly from the google sitemap page.

†B†V†
Title: Re: Google Sitemaps
Post by: Owdy on June 18, 2005, 05:46:45 PM
File name cant be issue.
Title: Re: Google Sitemaps
Post by: bluevoodu on June 18, 2005, 05:49:02 PM
Quote from: Owdy on June 18, 2005, 05:46:45 PM
File name cant be issue.
I figured as all the other sitemap files I worked with had no problem with changing the filename.

I can't figure out why this one is giving me a problem.... or why Google is stating it cannot find it when the link is right.

Edit: I just resubmitted it with a different filename just for curiosity sake.

†B†V†
Title: Re: Google Sitemaps
Post by: bluevoodu on June 18, 2005, 05:50:42 PM
Quote from: Davilac on June 18, 2005, 03:05:56 AM
I made my modification to fit this what was saying before:

this is the script modified to fit short urls. Just search and replace this piece of code

Quote// Now the boards!
foreach ($boards as $board)
{
   echo '
   <url>
      <loc>', $scripturl, '/board,', $board['id'], '.0.html</loc>
      <lastmod>', posts_max_time($board['times']), '</lastmod>
      <changefreq>', posts_to_freq($board['times']), '</changefreq>
      <priority>', posts_to_priority(0.8, $board['times']), '</priority>
   </url>';
}

// Popular topics too...
foreach ($topics as $topic)
{
   echo '
   <url>
      <loc>', $scripturl, '/topic,', $topic['id'], '.0.html</loc>
      <lastmod>', posts_max_time($topic['times']), '</lastmod>
      <changefreq>', posts_to_freq($topic['times']), '</changefreq>
      <priority>', posts_to_priority(0.7, $board['times']), '</priority>
   </url>';
}

very easy  ;)

sorry... not sure I understand, what does this do?

†B†V†
Title: Re: Google Sitemaps
Post by: Davilac on June 19, 2005, 01:54:10 AM
Just a little modifiction to make a sitemap for short url SMF forums
Title: Re: Google Sitemaps
Post by: bluevoodu on June 20, 2005, 11:38:03 AM
Quote from: Owdy on June 18, 2005, 05:46:45 PM
File name cant be issue.

I don't know why... but after I changed my filename, they found the submission.

No clue why...

@ Davilac -  thanks for letting me know

BV
Title: Re: Google Sitemaps
Post by: Harro on June 20, 2005, 08:23:52 PM
Here is a sitemap thingy that I'm making right now:
http://harro.sin.khk.be/forums/test.php
Worked yesterday. had over 300 yahoo bots on my forum :D
Title: Re: Google Sitemaps
Post by: Skoen on June 23, 2005, 02:43:16 PM
Strange error.

Warning: Cannot modify header information - headers already sent by (output started at /home/nordicra/public_html/forum/Sources/Load.php(1040) : eval()'d code:407) in /home/nordicra/public_html/forum/sitemap.php on line 8

Line 8 is: header('Content-Type: text/plain');

This is with version 1.0.4, language Norwegian, if that means anything.

Someone please help.
Title: Re: Google Sitemaps
Post by: [Unknown] on June 23, 2005, 02:46:33 PM
Why is a template or language file even being loaded, and why is it trying to modify the headers?

-[Unknown]
Title: Re: Google Sitemaps
Post by: Trekkie101 on June 24, 2005, 07:12:58 AM
Google Sitemap Report of todays crawl:
Quote
Denied URLs
We have successfully received your sitemap! However, we found some URLs listed in your sitemap that we cannot accept. The list below is a sampling of the URLs we could not accept, with links that explain the type of error and how to correct it.
URL  Error 
http://www.t101.astahost.com/place/index.php?action=profile;u=19  URL not under sitemap domain 
http://www.t101.astahost.com/place/index.php?action=profile;u=23  URL not under sitemap domain 
http://www.t101.astahost.com/place/index.php?action=profile;u=80  URL not under sitemap domain

It happened before and I just hit re-submit, but it came back.


Title: Re: Google Sitemaps
Post by: [Unknown] on June 24, 2005, 01:07:35 PM
Does the URL to the sitemap include www?

-[Unknown]
Title: Re: Google Sitemaps
Post by: Trekkie101 on June 25, 2005, 08:46:17 AM
No.

Should I add it?
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 01:03:31 PM
Quote from: [Unknown] on June 09, 2005, 04:31:59 AM
Untested with SMF 1.0.x.  Upload, test, and give to Google.

Shows the top 20 members, top 20 topics, all boards, and forum only.

-[Unknown]
I have used that file from day you posted it. Now my site hits in google are 75% lower than before.  :( Could this be related?
Title: Re: Google Sitemaps
Post by: [Unknown] on June 25, 2005, 01:26:00 PM
I didn't ever say anything about it being a GOOD thing.  In fact, I have no idea if it is.  That's why I was reluctant to post it.

Quote from: Trekkie101 on June 25, 2005, 08:46:17 AM
No.

Should I add it?

As the error message says, they have to be the same.

-[Unknown]
Title: Re: Google Sitemaps
Post by: Trekkie101 on June 25, 2005, 02:08:28 PM
I added it this morning along with my other one, ill give it a chance, although it usually takes about two days before it has an error, ill keep you posted.
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 04:12:11 PM
This creates maps easy way http://www.auditmypc.com/free-sitemap-generator.asp
Title: Re: Google Sitemaps
Post by: dtm.exe on June 25, 2005, 04:17:35 PM
Quote from: Owdy on June 25, 2005, 04:12:11 PM
This creates maps easy way http://www.auditmypc.com/free-sitemap-generator.asp

Thanks, that was easy :).

-Dan The Man
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 04:19:12 PM
You did it allready?  :o
Title: Re: Google Sitemaps
Post by: [Unknown] on June 25, 2005, 04:20:57 PM
What's the point of a sitemap that just emulates what Google does?

-[Unknown]
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 04:25:06 PM
Whats the whole point of google maps. Inform urls to crawl.
Title: Re: Google Sitemaps
Post by: [Unknown] on June 25, 2005, 04:28:41 PM
Quote from: Owdy on June 25, 2005, 04:25:06 PM
Whats the whole point of google maps. Inform urls to crawl.

I thought it was to:
  - give it URLs it might not otherwise find.
  - tell it the priority of one URL over another.
  - describe how often a specific page is likely to change.

-[Unknown]
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 04:31:32 PM
Seems you didnt test that java app. You can do those things with that. And this is how Google says it:
QuoteThe Sitemap Protocol allows you to inform search engine crawlers about URLs on your Web sites that are available for crawling.



Btw, not everyone is drinking Google's Koolaid. Michael, (aka "Projectphp") quips: (http://www.seroundtable.com/archives/002071.html)

    "For a static site with little changes, SiteMaps is a useful as tits on a Bull"

Well sayd ;D
Title: Re: Google Sitemaps
Post by: [Unknown] on June 25, 2005, 04:36:09 PM
No, I didn't, but if you just have it crawl your site you get all the slowdowns and problems of Google doing it, even if you can tell it extra URLs and relative importances... it's also takes longer than generating and estimating those things.

I don't have Java installed and I have no plans to change that.... so I can't test the program you linked to.

-[Unknown]
Title: Re: Google Sitemaps
Post by: dtm.exe on June 25, 2005, 04:39:33 PM
Quote from: Owdy on June 25, 2005, 04:19:12 PM
You did it allready?  :o

It's still running.

-Dan The Man
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 04:41:20 PM
This is good point also:

QuoteAnother benefit brought by sitemaps is that webmasters can quicken the indexing of some pages by publishing them in the sitemap, without waiting for the usual ,,visit" of the crawlers. This technique is called ,,content pushing".
Title: Re: Google Sitemaps
Post by: dtm.exe on June 25, 2005, 04:48:43 PM
Quote from: Owdy on June 25, 2005, 04:12:11 PM
This creates maps easy way http://www.auditmypc.com/free-sitemap-generator.asp

Just to let everyone else know, while doing this, you'll probably notice a large number of errors.  This is because SMF protects directories such as Sources, Themes, Attachments, etc.

-Dan The Man
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 05:09:39 PM
use robots.txt. Then you get no errors. And you can ad filters.
Title: Re: Google Sitemaps
Post by: Owdy on June 25, 2005, 06:20:54 PM
Quote from: Owdy on June 25, 2005, 01:03:31 PM
I have used that file from day you posted it. Now my site hits in google are 75% lower than before.  :( Could this be related?
Eh, that was temporary, now it shows normal ~4000 pages. Weird behavior from google.
Title: Re: Google Sitemaps
Post by: innerfire on July 04, 2005, 12:54:40 PM
Would love sitemap.php with the SEO url's.  I'm a big believer in never giving two URL's to the same file for google.  Has anyone modified sitemap.php for this?  Also, if I wanted more than twenty posts, would I change:

$request = db_query("
SELECT ID_TOPIC
FROM {$db_prefix}topics
ORDER BY numViews + numReplies DESC
LIMIT 20", __FILE__, __LINE__);


to


$request = db_query("
SELECT ID_TOPIC
FROM {$db_prefix}topics
ORDER BY numViews + numReplies DESC
LIMIT 9999", __FILE__, __LINE__);


Thanks!
Title: Re: Google Sitemaps
Post by: Trekkie101 on July 04, 2005, 12:59:30 PM
After adding the www. and letting it work like that, its been perfect for about a week now, well done [unknown] your still brilliant, not that we ever doubted ya.
Title: Re: Google Sitemaps
Post by: [Unknown] on July 04, 2005, 03:37:01 PM
You can add ob_start('ob_sessrewrite'); to the top of the file (after the include) if you want queryless URLs.

For more topics, yes... you cna do that.

-[Unknown]
Title: Re: Google Sitemaps
Post by: Goosemoose on August 09, 2005, 03:43:28 AM
I can't get this to work since I'm using mambo and http://www.goosemoose.com/rfc/index.php redirects to the mambo component. Any tricks to get this to work anyways?
Title: Re: Google Sitemaps
Post by: DemonicInfluence on August 09, 2005, 09:41:46 AM
What about the boards that guests can't see? Can you make it so that it only is the boards guests see?
Title: Re: Google Sitemaps
Post by: coolparth on November 22, 2005, 05:53:23 AM
Hey..Unknown...
Where can i find sitemap.php...The link in the forums isnt working.
Can u post it here ?
Title: Re: Google Sitemaps
Post by: desistyle on November 26, 2005, 09:03:25 PM
Quote from: [Unknown] on June 09, 2005, 04:31:59 AM
Untested with SMF 1.0.x.  Upload, test, and give to Google.

Shows the top 20 members, top 20 topics, all boards, and forum only.

-[Unknown]

Hi i uploaded the file on my server it shows like this

http://hamarabollywood.com/forums/sitemap.php

can u tell me why its not working fully please
Title: Re: Google Sitemaps
Post by: JayBachatero on November 26, 2005, 09:18:44 PM
It looks good.  That's how its supposed to look.  Just feed the link to google sitemaps website.
Title: Re: Google Sitemaps
Post by: desistyle on November 26, 2005, 09:28:55 PM
Quote from: JayBachatero on November 26, 2005, 09:18:44 PM
It looks good.  That's how its supposed to look.  Just feed the link to google sitemaps website.

isnt it suppose to show all my topics ? like the topic headings and stuff i have 2000 posts isnt that suppose to come just askin ?
Title: Re: Google Sitemaps
Post by: JayBachatero on November 26, 2005, 10:43:03 PM
It is possible but, I believe that is against googles TOS.
Title: Re: Google Sitemaps
Post by: desistyle on November 26, 2005, 10:51:39 PM
Quote from: JayBachatero on November 26, 2005, 10:43:03 PM
It is possible but, I believe that is against googles TOS.

oh ok thanks a lot for your help
Title: Re: Google Sitemaps
Post by: JayBachatero on November 27, 2005, 12:11:02 AM
You're welcome.
Title: Re: Google Sitemaps
Post by: Davilac on November 27, 2005, 03:10:20 AM
Quote from: JayBachatero on November 26, 2005, 10:43:03 PM
It is possible but, I believe that is against googles TOS.

It's not  ;D

QuoteA Sitemap file can contain no more than 50,000 URLs and be no larger than 10MB when uncompressed. If your Sitemap is larger than this, break it into several smaller Sitemaps. These limits help ensure that your web server is not overloaded by serving large files to Google.
https://www.google.com/webmasters/sitemaps/docs/en/overview.html
Title: Re: Google Sitemaps
Post by: Davilac on November 27, 2005, 03:19:12 AM
Quote from: desistyle on November 26, 2005, 09:28:55 PM
Quote from: JayBachatero on November 26, 2005, 09:18:44 PM
It looks good.  That's how its supposed to look.  Just feed the link to google sitemaps website.

isnt it suppose to show all my topics ? like the topic headings and stuff i have 2000 posts isnt that suppose to come just askin ?

I've got what you want. This is working fine for my site. Actually I have this and the other one in this topic, cause you can use as many sitemaps as you want for as many pages you want. You must only modify the variable totaldetopics to fit your forum:

<?php

require_once('SSI.php');

$totaldetopics=5000;

if (
$modSettings['smfVersion'] < '1.1')
ob_start('ob_sessrewrite');

header('Content-Type: text/plain');

echo 
'<?xml version="1.0" encoding="UTF-8"?' '>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'
;

$request db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MSG >= " 
. ($modSettings['maxMsgID'] - 30) . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$latest_post_times = array(time());
while (
$row mysql_fetch_assoc($request))
$latest_post_times[] = $row['posterTime'];
mysql_free_result($request);

$request db_query("
SELECT ID_BOARD
FROM 
{$db_prefix}boards"__FILE____LINE__);
$boards = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_BOARD = 
$row[ID_BOARD]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$board_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$board_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$boards[] = array(
'id' => $row['ID_BOARD'],
'times' => $board_post_times,
);
}
mysql_free_result($request);



$request db_query("
SELECT ID_MEMBER
FROM 
{$db_prefix}members
ORDER BY totalTimeLoggedIn DESC
LIMIT 20"
__FILE____LINE__);
$members = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MEMBER = 
$row[ID_MEMBER]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$member_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$member_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$members[] = array(
'id' => $row['ID_MEMBER'],
'times' => $member_post_times,
);
}
mysql_free_result($request);

// First, the forum URL.  Highest priority!
echo '
<url>
<loc>'
$scripturl'</loc>
<lastmod>'
posts_max_time($latest_post_times), '</lastmod>
<changefreq>'
posts_to_freq($latest_post_times), '</changefreq>
<priority>1.0</priority>
</url>'
;

// Now the boards!
foreach ($boards as $board)
{
echo '
<url>
<loc>'
$scripturl'/board,'$board['id'], '.0.html</loc>
<lastmod>'
posts_max_time($board['times']), '</lastmod>
<changefreq>'
posts_to_freq($board['times']), '</changefreq>
<priority>'
posts_to_priority(0.8$board['times']), '</priority>
</url>'
;
}

// Popular topics too...

$indice;
for (
$indice=1$indice!=$totaldetopics$indice++)
{
echo '
<url>
<loc>'
$scripturl'/topic,'$indice'.0.html</loc>
<lastmod>'
posts_max_time($topic['times']), '</lastmod>
<changefreq>'
posts_to_freq($board['times']), '</changefreq>
<priority>'
posts_to_priority(0.7$board['times']), '</priority>
</url>'
;
}

// Most active members?
foreach ($members as $member)
{
echo '
<url>
<loc>'
$scripturl'?action=profile;u='$member['id'], '</loc>
<lastmod>'
posts_max_time($member['times']), '</lastmod>
<changefreq>'
posts_to_freq($member['times']), '</changefreq>
<priority>'
posts_to_priority(0.5$board['times']), '</priority>
</url>'
;
}

echo 
'
</urlset>'
;

function 
posts_max_time($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'time() - 3600 24 10);

return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'max($post_times));
}

function 
posts_to_priority($base$post_times)
{
if (empty($post_times) || count($post_times) == 1)
return sprintf('%1.1f'$base);

$s = (max($post_times) - min($post_times)) / count($post_times);

if ($s 3600 24)
$mod 0.1;
else
$mod 0;

return sprintf('%1.1f'$base $mod);
}

function 
posts_to_freq($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return 'yearly';

$s = (max($post_times) - min($post_times)) / count($post_times);

// Changes more often than every hour.
if ($s 3600)
return 'always';
elseif ($s 3600 12)
return 'hourly';
elseif ($s 3600 24 4)
return 'daily';
else
return 'monthly';
}

?>


Title: Re: Google Sitemaps
Post by: desistyle on November 27, 2005, 12:27:46 PM
Quote from: Davilac on November 27, 2005, 03:19:12 AM
Quote from: desistyle on November 26, 2005, 09:28:55 PM
Quote from: JayBachatero on November 26, 2005, 09:18:44 PM
It looks good.  That's how its supposed to look.  Just feed the link to google sitemaps website.

isnt it suppose to show all my topics ? like the topic headings and stuff i have 2000 posts isnt that suppose to come just askin ?

I've got what you want. This is working fine for my site. Actually I have this and the other one in this topic, cause you can use as many sitemaps as you want for as many pages you want. You must only modify the variable totaldetopics to fit your forum:

<?php

require_once('SSI.php');

$totaldetopics=5000;

if (
$modSettings['smfVersion'] < '1.1')
ob_start('ob_sessrewrite');

header('Content-Type: text/plain');

echo 
'<?xml version="1.0" encoding="UTF-8"?' '>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'
;

$request db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MSG >= " 
. ($modSettings['maxMsgID'] - 30) . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$latest_post_times = array(time());
while (
$row mysql_fetch_assoc($request))
$latest_post_times[] = $row['posterTime'];
mysql_free_result($request);

$request db_query("
SELECT ID_BOARD
FROM 
{$db_prefix}boards"__FILE____LINE__);
$boards = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_BOARD = 
$row[ID_BOARD]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$board_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$board_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$boards[] = array(
'id' => $row['ID_BOARD'],
'times' => $board_post_times,
);
}
mysql_free_result($request);



$request db_query("
SELECT ID_MEMBER
FROM 
{$db_prefix}members
ORDER BY totalTimeLoggedIn DESC
LIMIT 20"
__FILE____LINE__);
$members = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MEMBER = 
$row[ID_MEMBER]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$member_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$member_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$members[] = array(
'id' => $row['ID_MEMBER'],
'times' => $member_post_times,
);
}
mysql_free_result($request);

// First, the forum URL.  Highest priority!
echo '
<url>
<loc>'
$scripturl'</loc>
<lastmod>'
posts_max_time($latest_post_times), '</lastmod>
<changefreq>'
posts_to_freq($latest_post_times), '</changefreq>
<priority>1.0</priority>
</url>'
;

// Now the boards!
foreach ($boards as $board)
{
echo '
<url>
<loc>'
$scripturl'/board,'$board['id'], '.0.html</loc>
<lastmod>'
posts_max_time($board['times']), '</lastmod>
<changefreq>'
posts_to_freq($board['times']), '</changefreq>
<priority>'
posts_to_priority(0.8$board['times']), '</priority>
</url>'
;
}

// Popular topics too...

$indice;
for (
$indice=1$indice!=$totaldetopics$indice++)
{
echo '
<url>
<loc>'
$scripturl'/topic,'$indice'.0.html</loc>
<lastmod>'
posts_max_time($topic['times']), '</lastmod>
<changefreq>'
posts_to_freq($board['times']), '</changefreq>
<priority>'
posts_to_priority(0.7$board['times']), '</priority>
</url>'
;
}

// Most active members?
foreach ($members as $member)
{
echo '
<url>
<loc>'
$scripturl'?action=profile;u='$member['id'], '</loc>
<lastmod>'
posts_max_time($member['times']), '</lastmod>
<changefreq>'
posts_to_freq($member['times']), '</changefreq>
<priority>'
posts_to_priority(0.5$board['times']), '</priority>
</url>'
;
}

echo 
'
</urlset>'
;

function 
posts_max_time($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'time() - 3600 24 10);

return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'max($post_times));
}

function 
posts_to_priority($base$post_times)
{
if (empty($post_times) || count($post_times) == 1)
return sprintf('%1.1f'$base);

$s = (max($post_times) - min($post_times)) / count($post_times);

if ($s 3600 24)
$mod 0.1;
else
$mod 0;

return sprintf('%1.1f'$base $mod);
}

function 
posts_to_freq($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return 'yearly';

$s = (max($post_times) - min($post_times)) / count($post_times);

// Changes more often than every hour.
if ($s 3600)
return 'always';
elseif ($s 3600 12)
return 'hourly';
elseif ($s 3600 24 4)
return 'daily';
else
return 'monthly';
}

?>




I am lost can u show me where exactly i should modify the code please
Title: Re: Google Sitemaps
Post by: Davilac on November 27, 2005, 12:33:34 PM
$totaldetopics=here_the_number_of_topics_of_your_forum;

This, here_the_number_of_topics_of_your_forum, is the number of topics of yor forum. You can see the number of topics of your forum going to your forum's home
Title: Re: Google Sitemaps
Post by: desistyle on November 27, 2005, 12:38:05 PM
Quote from: Davilac on November 27, 2005, 12:33:34 PM
$totaldetopics=here_the_number_of_topics_of_your_forum;

This, here_the_number_of_topics_of_your_forum, is the number of topics of yor forum. You can see the number of topics of your forum going to your forum's home


I dont see number of topics here u can see my sitemap.php file sir

<?php

require_once('SSI.php');

if (
$modSettings['smfVersion'] < '1.1')
ob_start('ob_sessrewrite');

header('Content-Type: text/plain');

echo 
'<?xml version="1.0" encoding="UTF-8"?' '>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'
;

$request db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MSG >= " 
. ($modSettings['maxMsgID'] - 30) . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$latest_post_times = array(time());
while (
$row mysql_fetch_assoc($request))
$latest_post_times[] = $row['posterTime'];
mysql_free_result($request);

$request db_query("
SELECT ID_BOARD
FROM 
{$db_prefix}boards"__FILE____LINE__);
$boards = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_BOARD = 
$row[ID_BOARD]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$board_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$board_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$boards[] = array(
'id' => $row['ID_BOARD'],
'times' => $board_post_times,
);
}
mysql_free_result($request);

$request db_query("
SELECT ID_TOPIC
FROM 
{$db_prefix}topics
ORDER BY numViews + numReplies DESC
LIMIT 20"
__FILE____LINE__);
$topics = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_TOPIC = 
$row[ID_TOPIC]
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$topic_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$topic_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$topics[] = array(
'id' => $row['ID_TOPIC'],
'times' => $topic_post_times,
);
}
mysql_free_result($request);

$request db_query("
SELECT ID_MEMBER
FROM 
{$db_prefix}members
ORDER BY totalTimeLoggedIn DESC
LIMIT 20"
__FILE____LINE__);
$members = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MEMBER = 
$row[ID_MEMBER]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$member_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$member_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$members[] = array(
'id' => $row['ID_MEMBER'],
'times' => $member_post_times,
);
}
mysql_free_result($request);

// First, the forum URL.  Highest priority!
echo '
<url>
<loc>'
$scripturl'</loc>
<lastmod>'
posts_max_time($latest_post_times), '</lastmod>
<changefreq>'
posts_to_freq($latest_post_times), '</changefreq>
<priority>1.0</priority>
</url>'
;

// Now the boards!
foreach ($boards as $board)
{
echo '
<url>
<loc>'
$scripturl'?board='$board['id'], '.0</loc>
<lastmod>'
posts_max_time($board['times']), '</lastmod>
<changefreq>'
posts_to_freq($board['times']), '</changefreq>
<priority>'
posts_to_priority(0.8$board['times']), '</priority>
</url>'
;
}

// Popular topics too...
foreach ($topics as $topic)
{
echo '
<url>
<loc>'
$scripturl'?topic='$topic['id'], '.0</loc>
<lastmod>'
posts_max_time($topic['times']), '</lastmod>
<changefreq>'
posts_to_freq($topic['times']), '</changefreq>
<priority>'
posts_to_priority(0.7$board['times']), '</priority>
</url>'
;
}

// Most active members?
foreach ($members as $member)
{
echo '
<url>
<loc>'
$scripturl'?action=profile;u='$member['id'], '</loc>
<lastmod>'
posts_max_time($member['times']), '</lastmod>
<changefreq>'
posts_to_freq($member['times']), '</changefreq>
<priority>'
posts_to_priority(0.5$board['times']), '</priority>
</url>'
;
}

echo 
'
</urlset>'
;

function 
posts_max_time($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'time() - 3600 24 10);

return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'max($post_times));
}

function 
posts_to_priority($base$post_times)
{
if (empty($post_times) || count($post_times) == 1)
return sprintf('%1.1f'$base);

$s = (max($post_times) - min($post_times)) / count($post_times);

if ($s 3600 24)
$mod 0.1;
else
$mod 0;

return sprintf('%1.1f'$base $mod);
}

function 
posts_to_freq($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return 'yearly';

$s = (max($post_times) - min($post_times)) / count($post_times);

// Changes more often than every hour.
if ($s 3600)
return 'always';
elseif ($s 3600 12)
return 'hourly';
elseif ($s 3600 24 4)
return 'daily';
else
return 'monthly';
}

?>
Title: Re: Google Sitemaps
Post by: Davilac on November 27, 2005, 12:43:19 PM
You are talking about the official Sitemap, and I'm giving you my own sitemap.
Title: Re: Google Sitemaps
Post by: desistyle on November 27, 2005, 12:47:33 PM
Quote from: Davilac on November 27, 2005, 12:43:19 PM
You are talking about the official Sitemap, and I'm giving you my own sitemap.

Wow sir this one works superbbbbbbbbbbbbbbbbb wow too good just one more question sir can it be modified in a way so even the topic title shows ? just wondering and thanks a lot for this one it shows all my posts now :x thanks a lot
Title: Re: Google Sitemaps
Post by: Davilac on November 27, 2005, 12:56:09 PM
Of course, but then it won't be a Google Sitemap, but a sitemap, which can help you with the others search engines. But I fear I can't do it for you, PHP is not my language. I'm sure someone here can give us the code to do a query this way
Title: Re: Google Sitemaps
Post by: desistyle on November 27, 2005, 01:12:15 PM
Quote from: Davilac on November 27, 2005, 12:56:09 PM
Of course, but then it won't be a Google Sitemap, but a sitemap, which can help you with the others search engines. But I fear I can't do it for you, PHP is not my language. I'm sure someone here can give us the code to do a query this way

Umm thats ok but hey your code is superb it just rocks i see all my post thanks a lot
Title: Re: Google Sitemaps
Post by: Davilac on November 27, 2005, 01:19:52 PM
It's nothing especial, just a while. Only note that my sitemaps is for search spider friendly URLs (without ?)
Title: Re: Google Sitemaps
Post by: daZiiii_boi on November 28, 2005, 07:42:24 AM
Hey I've just created my first SMF forum while maintaining my main website, I'm very interested in this Sitemap business, I created my account a month back and visited back this morning then saw this topic.

so I went to the website for creating this file we all need if thats right?
http://www.auditmypc.com/free-sitemap-generator.asp

Then in the options on the top I simply input
http://www.studentsintheuk.com/

and clicked crawl at the moment it's still crawling, now this seems to be going on for a while do I just direct the Java app to the main directory of my website?

I have my main site:
http://www.studentsintheuk.com
Photos page:
http://www.studentsintheuk.com/cpg135/index.php
Forum:
http://studentsintheuk.com/forum/index.php

So do I put all three off these seperate in the Google sitemaps then simply input each individual and upload the file the java app makes into each directory.

Sorry for the all so many questions just want to make sure this is right at the moment it's saying 5000+ on the queued location < is this way to big?

All I would like is for mainly those 3 places on my site to be seen, please indicate in a numerical order rather than paragragh I'm bad at link back and forth so maybe a
1. Do this
2. Do that

hehe I'm so picky sorry just means I don't have to ask and ask again.
Hopefully someone can help me out! Cheers in advance.
And feel free to sing up if your a student!
daZiiii_boi
Title: Re: Google Sitemaps
Post by: maxmax on December 01, 2005, 06:36:42 AM
ouch ! i got this error using your sitemap.php

Parse error: parse error, unexpected T_VARIABLE in xxxx/forum/SSI.php on line 739

of course i'm using googlebot mod

i'm on 1.1b3p cause of non finished french translation

i've read the 6pages but i didn't find the solution ? am I blind or there's no solution except removing the googlebot mod?
Title: Re: Google Sitemaps
Post by: Davilac on December 01, 2005, 08:25:26 AM
are you sure your SSI.php es well? this seems SSI is corrupted
Title: Re: Google Sitemaps
Post by: maxmax on December 01, 2005, 01:26:24 PM
I used to install googlebot manually, so i restore backups, of course the sitemap rules :)

i will try tonight install the bot by the admin panel, but i need some chown by the admin......

thanks  ;D
Title: Re: Google Sitemaps
Post by: Davilac on December 01, 2005, 01:53:45 PM
No mod is needed.
Title: Re: Google Sitemaps
Post by: desistyle on December 02, 2005, 03:33:56 AM
Quote from: Davilac on November 27, 2005, 03:19:12 AM
Quote from: desistyle on November 26, 2005, 09:28:55 PM
Quote from: JayBachatero on November 26, 2005, 09:18:44 PM
It looks good.  That's how its supposed to look.  Just feed the link to google sitemaps website.

isnt it suppose to show all my topics ? like the topic headings and stuff i have 2000 posts isnt that suppose to come just askin ?

I've got what you want. This is working fine for my site. Actually I have this and the other one in this topic, cause you can use as many sitemaps as you want for as many pages you want. You must only modify the variable totaldetopics to fit your forum:

<?php

require_once('SSI.php');

$totaldetopics=5000;

if (
$modSettings['smfVersion'] < '1.1')
ob_start('ob_sessrewrite');

header('Content-Type: text/plain');

echo 
'<?xml version="1.0" encoding="UTF-8"?' '>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'
;

$request db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MSG >= " 
. ($modSettings['maxMsgID'] - 30) . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$latest_post_times = array(time());
while (
$row mysql_fetch_assoc($request))
$latest_post_times[] = $row['posterTime'];
mysql_free_result($request);

$request db_query("
SELECT ID_BOARD
FROM 
{$db_prefix}boards"__FILE____LINE__);
$boards = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_BOARD = 
$row[ID_BOARD]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$board_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$board_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$boards[] = array(
'id' => $row['ID_BOARD'],
'times' => $board_post_times,
);
}
mysql_free_result($request);



$request db_query("
SELECT ID_MEMBER
FROM 
{$db_prefix}members
ORDER BY totalTimeLoggedIn DESC
LIMIT 20"
__FILE____LINE__);
$members = array();
while (
$row mysql_fetch_assoc($request))
{
$request2 db_query("
SELECT posterTime
FROM 
{$db_prefix}messages
WHERE ID_MEMBER = 
$row[ID_MEMBER]. ($modSettings['totalMessages'] > 100000 "
AND ID_MSG >= " 
. ($modSettings['maxMsgID'] * 0.5) : '') . "
ORDER BY ID_MSG DESC
LIMIT 10"
__FILE____LINE__);
$member_post_times = array(time());
while ($row2 mysql_fetch_assoc($request2))
$member_post_times[] = $row2['posterTime'];
mysql_free_result($request2);

$members[] = array(
'id' => $row['ID_MEMBER'],
'times' => $member_post_times,
);
}
mysql_free_result($request);

// First, the forum URL.  Highest priority!
echo '
<url>
<loc>'
$scripturl'</loc>
<lastmod>'
posts_max_time($latest_post_times), '</lastmod>
<changefreq>'
posts_to_freq($latest_post_times), '</changefreq>
<priority>1.0</priority>
</url>'
;

// Now the boards!
foreach ($boards as $board)
{
echo '
<url>
<loc>'
$scripturl'/board,'$board['id'], '.0.html</loc>
<lastmod>'
posts_max_time($board['times']), '</lastmod>
<changefreq>'
posts_to_freq($board['times']), '</changefreq>
<priority>'
posts_to_priority(0.8$board['times']), '</priority>
</url>'
;
}

// Popular topics too...

$indice;
for (
$indice=1$indice!=$totaldetopics$indice++)
{
echo '
<url>
<loc>'
$scripturl'/topic,'$indice'.0.html</loc>
<lastmod>'
posts_max_time($topic['times']), '</lastmod>
<changefreq>'
posts_to_freq($board['times']), '</changefreq>
<priority>'
posts_to_priority(0.7$board['times']), '</priority>
</url>'
;
}

// Most active members?
foreach ($members as $member)
{
echo '
<url>
<loc>'
$scripturl'?action=profile;u='$member['id'], '</loc>
<lastmod>'
posts_max_time($member['times']), '</lastmod>
<changefreq>'
posts_to_freq($member['times']), '</changefreq>
<priority>'
posts_to_priority(0.5$board['times']), '</priority>
</url>'
;
}

echo 
'
</urlset>'
;

function 
posts_max_time($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'time() - 3600 24 10);

return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00'max($post_times));
}

function 
posts_to_priority($base$post_times)
{
if (empty($post_times) || count($post_times) == 1)
return sprintf('%1.1f'$base);

$s = (max($post_times) - min($post_times)) / count($post_times);

if ($s 3600 24)
$mod 0.1;
else
$mod 0;

return sprintf('%1.1f'$base $mod);
}

function 
posts_to_freq($post_times)
{
if (empty($post_times) || count($post_times) == 1)
return 'yearly';

$s = (max($post_times) - min($post_times)) / count($post_times);

// Changes more often than every hour.
if ($s 3600)
return 'always';
elseif ($s 3600 12)
return 'hourly';
elseif ($s 3600 24 4)
return 'daily';
else
return 'monthly';
}

?>




HI davilac i was wondering if u can modify this code so it can pick up the topic tittle as well is that possible
Title: Re: Google Sitemaps
Post by: Davilac on December 02, 2005, 04:13:13 AM
You mean to do a html sitemap?

I will look at this, I need a html sitemap for both Yahoo! and Msn
Title: Re: Google Sitemaps
Post by: desistyle on December 02, 2005, 05:26:50 AM
Quote from: Davilac on December 02, 2005, 04:13:13 AM
You mean to do a html sitemap?

I will look at this, I need a html sitemap for both Yahoo! and Msn

thanks a lot you are awesome and yes i am using ur sitemap u gave me that works preety good thaugh thanks a lot
Title: Re: Google Sitemaps
Post by: daZiiii_boi on December 02, 2005, 01:16:01 PM
Can i not have any help  :(
Title: Re: Google Sitemaps
Post by: Davilac on December 03, 2005, 09:48:32 AM
Quote from: daZiiii_boi on November 28, 2005, 07:42:24 AM
Hey I've just created my first SMF forum while maintaining my main website, I'm very interested in this Sitemap business, I created my account a month back and visited back this morning then saw this topic.

so I went to the website for creating this file we all need if thats right?
http://www.auditmypc.com/free-sitemap-generator.asp

Then in the options on the top I simply input
http://www.studentsintheuk.com/

and clicked crawl at the moment it's still crawling, now this seems to be going on for a while do I just direct the Java app to the main directory of my website?

I have my main site:
http://www.studentsintheuk.com
Photos page:
http://www.studentsintheuk.com/cpg135/index.php
Forum:
http://studentsintheuk.com/forum/index.php

So do I put all three off these seperate in the Google sitemaps then simply input each individual and upload the file the java app makes into each directory.

Sorry for the all so many questions just want to make sure this is right at the moment it's saying 5000+ on the queued location < is this way to big?

All I would like is for mainly those 3 places on my site to be seen, please indicate in a numerical order rather than paragragh I'm bad at link back and forth so maybe a
1. Do this
2. Do that

hehe I'm so picky sorry just means I don't have to ask and ask again.
Hopefully someone can help me out! Cheers in advance.
And feel free to sing up if your a student!
daZiiii_boi

First: You use my code or the official one or both (you then use 2 sitemaps), paste it into a file on your forum's root directory.
Second: You go to http://www.google.com/webmasters/sitemaps and you add a sitemap
Three: Now you have a sitemap for your forum, then you must think about the rest of your site. Search a sitemap generator.
Title: Re: Google Sitemaps
Post by: daZiiii_boi on December 03, 2005, 01:02:22 PM
Quote<?php

require_once('SSI.php');

$totaldetopics=5000;

if ($modSettings['smfVersion'] < '1.1')
   ob_start('ob_sessrewrite');

header('Content-Type: text/plain');

echo '<?xml version="1.0" encoding="UTF-8"?' . '>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">';

$request = db_query("
   SELECT posterTime
   FROM {$db_prefix}messages
   WHERE ID_MSG >= " . ($modSettings['maxMsgID'] - 30) . "
   ORDER BY ID_MSG DESC
   LIMIT 10", __FILE__, __LINE__);
$latest_post_times = array(time());
while ($row = mysql_fetch_assoc($request))
   $latest_post_times[] = $row['posterTime'];
mysql_free_result($request);

$request = db_query("
   SELECT ID_BOARD
   FROM {$db_prefix}boards", __FILE__, __LINE__);
$boards = array();
while ($row = mysql_fetch_assoc($request))
{
   $request2 = db_query("
      SELECT posterTime
      FROM {$db_prefix}messages
      WHERE ID_BOARD = $row[ID_BOARD]" . ($modSettings['totalMessages'] > 100000 ? "
         AND ID_MSG >= " . ($modSettings['maxMsgID'] * 0.5) : '') . "
      ORDER BY ID_MSG DESC
      LIMIT 10", __FILE__, __LINE__);
   $board_post_times = array(time());
   while ($row2 = mysql_fetch_assoc($request2))
      $board_post_times[] = $row2['posterTime'];
   mysql_free_result($request2);

   $boards[] = array(
      'id' => $row['ID_BOARD'],
      'times' => $board_post_times,
   );
}
mysql_free_result($request);



$request = db_query("
   SELECT ID_MEMBER
   FROM {$db_prefix}members
   ORDER BY totalTimeLoggedIn DESC
   LIMIT 20", __FILE__, __LINE__);
$members = array();
while ($row = mysql_fetch_assoc($request))
{
   $request2 = db_query("
      SELECT posterTime
      FROM {$db_prefix}messages
      WHERE ID_MEMBER = $row[ID_MEMBER]" . ($modSettings['totalMessages'] > 100000 ? "
         AND ID_MSG >= " . ($modSettings['maxMsgID'] * 0.5) : '') . "
      ORDER BY ID_MSG DESC
      LIMIT 10", __FILE__, __LINE__);
   $member_post_times = array(time());
   while ($row2 = mysql_fetch_assoc($request2))
      $member_post_times[] = $row2['posterTime'];
   mysql_free_result($request2);

   $members[] = array(
      'id' => $row['ID_MEMBER'],
      'times' => $member_post_times,
   );
}
mysql_free_result($request);

// First, the forum URL.  Highest priority!
echo '
   <url>
      <loc>', $scripturl, '</loc>
      <lastmod>', posts_max_time($latest_post_times), '</lastmod>
      <changefreq>', posts_to_freq($latest_post_times), '</changefreq>
      <priority>1.0</priority>
   </url>';

// Now the boards!
foreach ($boards as $board)
{
   echo '
   <url>
      <loc>', $scripturl, '/board,', $board['id'], '.0.html</loc>
      <lastmod>', posts_max_time($board['times']), '</lastmod>
      <changefreq>', posts_to_freq($board['times']), '</changefreq>
      <priority>', posts_to_priority(0.8, $board['times']), '</priority>
   </url>';
}

// Popular topics too...

$indice;
for ($indice=1; $indice!=$totaldetopics; $indice++)
{
   echo '
   <url>
      <loc>', $scripturl, '/topic,', $indice, '.0.html</loc>
      <lastmod>', posts_max_time($topic['times']), '</lastmod>
      <changefreq>', posts_to_freq($board['times']), '</changefreq>
      <priority>', posts_to_priority(0.7, $board['times']), '</priority>
   </url>';
}

// Most active members?
foreach ($members as $member)
{
   echo '
   <url>
      <loc>', $scripturl, '?action=profile;u=', $member['id'], '</loc>
      <lastmod>', posts_max_time($member['times']), '</lastmod>
      <changefreq>', posts_to_freq($member['times']), '</changefreq>
      <priority>', posts_to_priority(0.5, $board['times']), '</priority>
   </url>';
}

echo '
</urlset>';

function posts_max_time($post_times)
{
   if (empty($post_times) || count($post_times) == 1)
      return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00', time() - 3600 * 24 * 10);

   return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00', max($post_times));
}

function posts_to_priority($base, $post_times)
{
   if (empty($post_times) || count($post_times) == 1)
      return sprintf('%1.1f', $base);

   $s = (max($post_times) - min($post_times)) / count($post_times);

   if ($s < 3600 * 24)
      $mod = 0.1;
   else
      $mod = 0;

   return sprintf('%1.1f', $base + $mod);
}

function posts_to_freq($post_times)
{
   if (empty($post_times) || count($post_times) == 1)
      return 'yearly';

   $s = (max($post_times) - min($post_times)) / count($post_times);

   // Changes more often than every hour.
   if ($s < 3600)
      return 'always';
   elseif ($s < 3600 * 12)
      return 'hourly';
   elseif ($s < 3600 * 24 * 4)
      return 'daily';
   else
      return 'monthly';
}

?>


The above coding is that your coding?
Then what do I name the file?

Quote(you then use 2 sitemaps)

Is that creating a Sitemap for:
http://studentsintheuk.com/forum/
Then do I click  Add a Sitemap beside the  http://studentsintheuk.com/forum/ ?
What do I put as the sitemap url is this were I would put the Code you specified?

Sorry about the questions it's just I'm getting mixed up with all the quotes from others.

Thanks for replying  :D
Title: Re: Google Sitemaps
Post by: Davilac on December 04, 2005, 02:18:12 AM
Yes, that's my code. Use it with a file named as you want .php Then you must change the number and put instead your forum's topic count, and put it in your forum's root (that code is only for pretty URLs) and then you can go to Google, add Sitemap and tell him the url where is the sitemap
Title: Re: Google Sitemaps
Post by: daZiiii_boi on December 04, 2005, 09:24:40 AM
Quotefunction posts_max_time($post_times)
{
   if (empty($post_times) || count($post_times) == 1)
      return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00', time() - 3600 * 24 * 10);

   return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00', max($post_times));
}

function posts_to_priority($base, $post_times)
{
   if (empty($post_times) || count($post_times) == 1)
      return sprintf('%1.1f', $base);

   $s = (max($post_times) - min($post_times)) / count($post_times);

   if ($s < 3600 * 24)
      $mod = 0.1;
   else
      $mod = 0;

   return sprintf('%1.1f', $base + $mod);
}

function posts_to_freq($post_times)
{
   if (empty($post_times) || count($post_times) == 1)
      return 'yearly';

   $s = (max($post_times) - min($post_times)) / count($post_times);

I can find 5 counts within the coding at the button which one do I change? Sorry I just don't want to get this wrong  8) thanks for the help so far  :P
Title: Re: Google Sitemaps
Post by: Davilac on December 04, 2005, 09:28:14 AM
You must change $totaldetopics (at the beginning) to fit your forum's
Title: Re: Google Sitemaps
Post by: Elijah Bliss on December 04, 2005, 11:19:20 PM
Works fine for me, all I need to do is submit it, but has anyone using this notice any improvement in their google ranking/indexing so far?
Title: Re: Google Sitemaps
Post by: Elijah Bliss on December 05, 2005, 01:23:24 AM
Quote from: [Unknown] on July 04, 2005, 03:37:01 PM
You can add ob_start('ob_sessrewrite'); to the top of the file (after the include) if you want queryless URLs.

For more topics, yes... you cna do that.

-[Unknown]

queryless urls for the site map no longer work in RC1 1.1

EDIT: No big deal, I just manually edited them.
Title: Re: Google Sitemaps
Post by: Davilac on December 05, 2005, 01:39:07 AM
Sitemaps increases your visits, not for improving your rankings, but for improving your indexing very good. Also you can try an urllist for Yahoo!, which works fine for me.
Title: Re: Google Sitemaps
Post by: desistyle on December 05, 2005, 02:01:56 AM
Quote from: Davilac on December 05, 2005, 01:39:07 AM
Sitemaps increases your visits, not for improving your rankings, but for improving your indexing very good. Also you can try an urllist for Yahoo!, which works fine for me.

davilac just wondering if u can make something like this http://forums.hamarabollywood.com/sitemap.html <<
Title: Re: Google Sitemaps
Post by: Davilac on December 05, 2005, 02:10:22 AM
That's exactly what I want to improve my indexing. I think I can do it, but give mesome time. Also a coder help would be great.
Title: Re: Google Sitemaps
Post by: Davilac on December 05, 2005, 02:32:31 AM
OK, I will release something which will make you happy  :D
Title: Re: Google Sitemaps
Post by: desistyle on December 05, 2005, 02:33:02 AM
Quote from: Davilac on December 05, 2005, 02:10:22 AM
That's exactly what I want to improve my indexing. I think I can do it, but give mesome time. Also a coder help would be great.

thanks a lot davilac and good luck and i know u can do it u r da best :x
Title: Re: Google Sitemaps
Post by: daZiiii_boi on December 06, 2005, 01:08:21 PM
Wow thanks for the help tehee get this for info and frame it Davilac,

My website mainly went up mid last month with all the stuff which = 1132 unique visitors.

Then yesterday for Dec I had 128 today I have an amazing.........
waittt
wait....
771 unique visitors  :D Cpanel never lies!
76578 Hits so far this month

last months total was
246972 hits so I should defo beat that!

Really thanks a lot loads of shaking hands hehe  8)
Title: Re: Google Sitemaps
Post by: Davilac on December 06, 2005, 01:56:16 PM
Then wait, because this week I'll release some scripts better.
Title: Re: Google Sitemaps
Post by: Elijah Bliss on December 06, 2005, 05:20:06 PM
How long does it take to see the effects of these sitemaps?
Title: Re: Google Sitemaps
Post by: desistyle on December 06, 2005, 06:38:21 PM
Quote from: Davilac on December 06, 2005, 01:56:16 PM
Then wait, because this week I'll release some scripts better.

i am eagerly waitng for ur next sitemap release
Title: Re: Google Sitemaps
Post by: Davilac on December 07, 2005, 12:48:19 AM
Quote from: Elijah Bliss on December 06, 2005, 05:20:06 PM
How long does it take to see the effects of these sitemaps?

It's not easy to know. To me, one week, but you must know Google is doing some updates right now, and you will see diferent results on every datacenter.
Title: Re: Google Sitemaps
Post by: Davilac on December 07, 2005, 02:29:57 PM
I have released the sitemaps already: http://www.simplemachines.org/community/index.php?topic=59676.0  ;)
Title: Re: Google Sitemaps
Post by: desistyle on December 07, 2005, 07:20:40 PM
Quote from: Davilac on December 07, 2005, 02:29:57 PM
I have released the sitemaps already: http://www.simplemachines.org/community/index.php?topic=59676.0  ;)

wow dude great awesome u rock now i just uploaded the sitemap folder u can see http://forums.hamarabollywood.com/sitemaps  << can u tell me now what link i should add in google sitemap what link i should submit like http://forums.hamarabollywood.com/sitemaps <<this or like http://forums.hamarabollywood.com/sitemaps/index.php ??
Title: Re: Google Sitemaps
Post by: desistyle on December 08, 2005, 01:45:26 AM
hey Davilac want to tell u there is a lil bug in new sitemap in reply area it shows the number of views and in views table it shows number of replys when u fix this thing lemme know :d other than that this sitemap rockssssssss
Title: Re: Google Sitemaps
Post by: Davilac on December 08, 2005, 03:04:15 AM
Please download new version, 0.2

Quote from: desistyle on December 07, 2005, 07:20:40 PM
wow dude great awesome u rock now i just uploaded the sitemap folder u can see http://forums.hamarabollywood.com/sitemaps  << can u tell me now what link i should add in google sitemap what link i should submit like http://forums.hamarabollywood.com/sitemaps <<this or like http://forums.hamarabollywood.com/sitemaps/index.php ??

Please, support for my mods in http://www.simplemachines.org/community/index.php?topic=59676.0

You must say to Google Sitemaps (http://www.google.com/webmasters/sitemaps) this url: http://forums.hamarabollywood.com/sitemaps/sitemaps.php

And you must use html as is follows:
http://forums.hamarabollywood.com/sitemaps/home.html To get links for your boards
http://forums.hamarabollywood.com/sitemaps/0.html -> This is the really important. You should get links to it in order to have search engines indexing your latest topics.

Quote from: desistyle on December 08, 2005, 01:45:26 AM
hey Davilac want to tell u there is a lil bug in new sitemap in reply area it shows the number of views and in views table it shows number of replys when u fix this thing lemme know :d other than that this sitemap rockssssssss

Fixed in version 0.2

Thank you  ;D
Title: Re: Google Sitemaps
Post by: desistyle on December 08, 2005, 04:02:40 AM
wow thanks so much dude and yes i added on google site map like this is this ok

      0.html        Web      1 minutes ago      –      Pending
   1.html    Web    1 minutes ago    –    Pending
   2.html    Web    1 minutes ago    –    Pending
   3.html    Web    0 minutes ago    –    Pending
   4.html    Web    0 minutes ago    –    Pending
   5.html    Web    0 minutes ago    –    Pending
   6.html    Web    0 minutes ago    –    Pending
   home.html    Web    2 minutes ago    –    Pending
   sitemaps.php Sitemap    Web    3 hours ago    3 hours ago    OK
Title: Re: Google Sitemaps
Post by: Davilac on December 08, 2005, 05:18:02 AM
NO, you misundertood. There is a Google Sitemap and a HTML Sitemap. The only sitemap you must submit to Google is sitemaps.php. 0.html and the others can't be submitted to Google Sitemaps. Please read carefully http://www.simplemachines.org/community/index.php?topic=59676.0 and ask question there.
Title: Re: Google Sitemaps
Post by: desistyle on December 08, 2005, 06:29:07 AM
Quote from: Davilac on December 08, 2005, 05:18:02 AM
NO, you misundertood. There is a Google Sitemap and a HTML Sitemap. The only sitemap you must submit to Google is sitemaps.php. 0.html and the others can't be submitted to Google Sitemaps. Please read carefully http://www.simplemachines.org/community/index.php?topic=59676.0 and ask question there.

do u know where i can submit my html site map like to yahoo or something u thing ???
Title: Re: Google Sitemaps
Post by: Davilac on December 08, 2005, 06:54:29 AM
You must get links to your html sitemap. For example, linking it from your forum. All search enines then will find your html sitemap and will spider it. If you want to improve your rankings, then get links to your forum.
Title: Re: Google Sitemaps
Post by: daZiiii_boi on December 10, 2005, 03:44:09 PM
Hey Davilac my unique visitors has gone from 211 to 2000+ a day, but in the last day it's only 70 and my RSS feed for my forum comes up with

"Live bookmark feed failed to load"

Any ideas please  :D
Title: Re: Google Sitemaps
Post by: Davilac on December 11, 2005, 01:55:46 AM
Google is updating datacenters, so be patient.

About your feed, I have no idea.
Title: Re: Google Sitemaps
Post by: desistyle on December 11, 2005, 01:57:36 AM
my user is still the same and traffic to i guess i have to wait few weeks till i see the actual results
Title: Re: Google Sitemaps
Post by: daZiiii_boi on December 11, 2005, 08:07:16 AM
Quote from: Davilac on December 11, 2005, 01:55:46 AM
Google is updating datacenters, so be patient.

About your feed, I have no idea.

Ok I'll wait and see oh and my RSS feed seems to be working now  ;D
Title: Re: Google Sitemaps
Post by: Elijah Bliss on January 01, 2006, 09:47:28 PM
[Unkown]'s sitemap works like a champ. After a few weeks traffic increased 2 fold.

I will now try Davilac's sitemap.
Title: Re: Google Sitemaps
Post by: daZiiii_boi on March 09, 2006, 05:25:52 AM
I submited the below link in Google Sitmaps:

http://www.studentsintheuk.com/cpg135/sitemap.xml (http://www.studentsintheuk.com/cpg135/sitemap.xml)

then I get an error on the Sitmaps linking to the below link:
https://www.google.com/webmasters/sitemaps/docs/en/protocol.html#sitemapLocation (https://www.google.com/webmasters/sitemaps/docs/en/protocol.html#sitemapLocation)

http://www.studentsintheuk.com       URL not under Sitemap path
http://www.studentsintheuk.com/forum/    URL not under Sitemap path
http://www.studentsintheuk.com/studentsintheuk.html    URL not under Sitemap path

Anyone help me please? :D
Title: Re: Google Sitemaps
Post by: Tearabite on March 15, 2006, 08:14:19 PM
Guys, this is frustrating as HECK.. the bots and spiders wont even look at my forum (i assume) because I cant get rid of PHPSESSID's on my URLS.. so i was hoping this sitemap would at least get me into Google..

BUT IT WONT WORK..
anytime i (or google) tries to go to http://mydomain/sitemaps/sitemaps.php, all i get is my forum index page?!
however, IF i go to http://mydomain/mydomain/sitemaps/sitemaps.php it will open, but Google wont accept that!?

Why does my index open every time i try to go to http://mydomain/sitemaps/sitemaps.php  ??  is this a forum setting, a index.php setting?  a .HTACCESS setting??

arrhhhgggg!!   >:(
Title: Re: Google Sitemaps
Post by: geoffs on March 16, 2006, 11:12:27 AM
Quote from: Tearabite on March 15, 2006, 08:14:19 PM
BUT IT WONT WORK..
anytime i (or google) tries to go to http://mydomain/sitemaps/sitemaps.php, all i get is my forum index page?!

Tearabyte, why are you submitting sitemaps.php to google? Their sitemaps faq (https://www.google.com/webmasters/sitemaps/docs/en/faq.html) explains that they try and download a file named sitemaps.xml or the gzipped version, sitemaps.xml.gz. I have it setup on my site in the way they specify and their bot downloads the sitemap regularly.
Title: Re: Google Sitemaps
Post by: carlatf on April 10, 2006, 02:52:30 AM
Hi everybody!.

Just put this to work here: http://acidobase.com.ar/foros/sitemaps/sitemaps.php

The problem is that Google returns:
    Detail
URL not allowed (Line 3) with URL http://acidobase.com.ar/index.php    This url is not allowed for a Sitemap at this location. More
URL not allowed (Line 9) with URL http://acidobase.com.ar/index.php/board,15.0.html    This url is not allowed for a Sitemap at this location. More
URL not allowed (Line 15) with URL http://acidobase.com.ar/index.php/board,27.0.html    This url is not allowed for a Sitemap at this location. More


URL not allowed
Your Sitemap contains a URL that is not allowed based on the Sitemap's location..

Why is not allowed? All the links were constructed via the sitemaps thingie. I have a Joomla/SMF site but I use SMF almost 100% I just got Joomla just in case. I have to put the sitemap in the main directory?

Best,
Carla
Title: Re: Google Sitemaps
Post by: DemonicInfluence on April 10, 2006, 03:29:53 PM
That is just a big with google sitemaps...
Title: Re: Google Sitemaps
Post by: willi1 on April 14, 2006, 12:17:04 AM
Hej Hej,

i have the same problem how Tearabite, google don´t accept my

sitemap.php i think they wants a xml file has anybody a idea or a how to?

i become the error message the url is not allowed. / 1errors

best regards

André
Title: Re: Google Sitemaps
Post by: willi1 on April 14, 2006, 12:57:33 AM
Hej Hej,,

please give me a completly how to and i will translate it to german.

best regards

Abdré
Title: Re: Google Sitemaps
Post by: J. S. on April 15, 2006, 06:52:28 AM
Quote from: carlatf on April 10, 2006, 02:52:30 AM
The problem is that Google returns:
    Detail
URL not allowed (Line 3) with URL http://acidobase.com.ar/index.php    This url is not allowed for a Sitemap at this location. More
URL not allowed (Line 9) with URL http://acidobase.com.ar/index.php/board,15.0.html    This url is not allowed for a Sitemap at this location. More
URL not allowed (Line 15) with URL http://acidobase.com.ar/index.php/board,27.0.html    This url is not allowed for a Sitemap at this location. More


URL not allowed
Your Sitemap contains a URL that is not allowed based on the Sitemap's location..

Add a .htaccess file with the following code in it:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$  /sitemaps/$1 [L]


Now you may access yourboard.com/sitemaps.php.htm

Your sitemap for /test/blah has to be in /test or /test/blah NOT in /test/blah/stuff! That is why you get that error from google.
Title: Re: Google Sitemaps
Post by: carlatf on May 18, 2006, 03:28:40 PM
Hi JS,

I did something radical. I deleted Joomla and I put SMF in the main directory and Joomla as a sub dir! :) after all I never used it.

Now the problem is that index.php apears everywhere. Before the move I didn't see it.

I tried to put sitemaps.php in de main dir, but it doesn't return anything.

In the /sitemaps/ directory works fine but google as usual says:

URL not allowed (Line 3) with URL http://tresjolie.com.ar/index.php      This url is not allowed for a Sitemap at this location.  More
URL not allowed (Line 9) with URL http://tresjolie.com.ar/index.php/board,1.0.html    This url is not allowed for a Sitemap at this location. More

I will try to make it work from the main SMF directory and I'll post here if I made it.

Best.
Carla
Title: Re: Google Sitemaps
Post by: carlatf on May 18, 2006, 04:03:33 PM
Ok, it was dead easy.
I just edited sitemaps.php and change the SSI path. Now it works fine in the same directory that SMF.
Title: Re: Google Sitemaps
Post by: ChrisPlough on May 21, 2006, 11:22:40 PM
This post has helped me get sitemaps working on my site, thanks!   

BTW, if you want your server to respond to http://domainname.com/sitemap.xml instead of sitemap.php and you are using Apache with mod_rewrite enabled - just create (or update) .htaccess in your webroot directory and add the following lines:

RewriteEngine on
RewriteRule     ^sitemap.xml$           sitemap.php


It worked like a charm for me.

--
Thank you,

Chris Plough
MavenWire Consultants
www.mavenwire.com
Title: Re: Google Sitemaps
Post by: J. S. on May 23, 2006, 04:36:10 AM
There is no reason why it would`nt work :) And.. there is no reason why I would use that mod rewrite, google cand download your sitemap even from an url like index.php?sitemap=yes&path=/here/is/my/sitemap :)
Title: Re: Google Sitemaps
Post by: SacmaliK on August 13, 2006, 01:53:46 PM
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Title: Re: Google Sitemaps
Post by: axlarry on November 16, 2006, 01:26:53 PM
is this working on RC3? I'd like to try it
Title: Re: Google Sitemaps
Post by: ladynada on March 27, 2007, 03:51:35 PM
Quote from: [Unknown] on June 09, 2005, 04:31:59 AM
Untested with SMF 1.0.x.  Upload, test, and give to Google.

Shows the top 20 members, top 20 topics, all boards, and forum only.

-[Unknown]

the attachment link still worked and I just tried it today.

http://www.simplemachines.org/community/index.php?action=dlattach;topic=37858.0;attach=7587

and I submitted to google.

I am running SMF 1.12 .  and I wanted to reply to this thread, because then I can report if this php file works for 1.12 today.

hope that is okay
nada
Title: Re: Google Sitemaps
Post by: ladynada on April 04, 2007, 07:03:51 PM
the sitemap.php works fine on my SMF 1.1.2

nada
Title: Re: Google Sitemaps
Post by: NoFeaR / NFSMW on April 22, 2007, 05:57:08 AM
http://www.symbiansector.com/sitemap.php

Is it supposed to look like that?
Title: Re: Google Sitemaps
Post by: MegaTinkerCoder on April 22, 2007, 05:37:11 PM
Not Found
The requested URL /sitemap.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request
-----------------------
No... your php file needs to be world accessible for google to access it.
Title: Re: Google Sitemaps
Post by: NoFeaR / NFSMW on May 02, 2007, 02:53:20 PM
Sorry had a problem with that. its fixed now.
Title: Re: Google Sitemaps
Post by: Apostaganha on May 02, 2007, 07:30:10 PM
And for those who have freindly urls on?? :(