miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Simple sitemap creation

 
Author Bluesplayer
Partaker
#1 | Posted: 29 Jul 2012 18:29 
Minibb get indexed pretty quickly anyways so not sure there is much need for a sitemap but I have got in the habit of using them in Google's webmaster tools.

Dunno if there is an addon for a sitemap? Couldn't find one anyways so I knocked one up myself. Dead simple coding really. Creates an ordered txt file of topics. Text files can be submitted to Google, Bing etc.

3 files in all. One to create the sitemap, another to hold the data and lastly a file to ping the search engines.

1st file - sitemap.txt save as sitemap.php

2nd file - create a file called sitemap.txt and make sure it is writeable - chmod of 666 works fine on my server.

3rd file - sitemapping.php - save as sitemapping.php

Save all 3 in the root of your domain.

Easy admin links to update the sitemap file - ping etc
I doctored the templates admin_panel.html file like provided.

You can now create a sitemap whenever you want, view it for any errors and then ping the search engines.

It doesn't cover forum titles or comments and so on but they could easily be added. I only use one forum so topic titles are enough for me. Anyways Google will still find your forums and comments from viewing the topic pages.

There is a limit of 50,000 urls with Google webmaster tools but again that isn't a problem as I have more elaborate sitemap.php files that create as many sitemaps as needed - sitemap1 - 2 and so on whilst keeping the urls below 50,000. Some of my sites have over 100,000 urls and I have to create 3 sitemaps. All 3 can be created at the same time quite easily. If you have this problem then ask for more info.

Sitemap and rich urls?
Google won't use the created urls but your minibb rich urls if your site is using such, otherwise google will use the created urls.

Regards

Author kuopassa
Partaker
#2 | Posted: 30 Jul 2012 20:05 
Rich URL's = clean URL's? If so, I recommend modifying the sitemap.php file to show only clean URL's if someone is using them in his/hers forum. Offering messy URL addresses in sitemap and clean URL's in forum doesn't sound good for SEO.

Author Bluesplayer
Partaker
#3 | Posted: 30 Jul 2012 22:54 
kuopassa:
Rich URL's = clean URL's? If so, I recommend modifying the sitemap.php file to show only clean URL's if someone is using them in his/hers forum. Offering messy URL addresses in sitemap and clean URL's in forum doesn't sound good for SEO.
Indeed. I have in fact altered the code now so that topic title urls are used instead with my own sitemap creation. It is a lot easier to work out with regard to my own forum though as I only use one forum. It is a simple matter to include the forum name and number in the url for my own setup. Requires a bit more coding to include the same data if you are using lots of forums - as is usual. When I have the time I will rewrite it for clean topic title urls.

Author Paul
Lead Developer 
#4 | Posted: 31 Jul 2012 09:31 
Sorry to say, but the code is really weak implementation. It seems not usable for other users except you.

- why to duplicate settings code (mySQL info)? You can just include setup_options.php and take them from there. Now imagine each script will have standalone settings. You will be killed to change them all if moving to the other database.

- listing just all topics from top to bottom doesn't mean a sitemap. How about forums structure? Forums should be linked to topics. That's something about a "map".

- your sitemap script doesn't seem to provide any headers, encodings. That all will force regular XML readers throw an error.

- I suppose "pinging" search engines will not work. Search engines must some way find your sitemap on their own. That means, the sitemap files just should be named as sitemap.xml or sitemap.xml.gz.

- your script will load ALL topics each time when the sitemap is loaded. But search engines may do it quite often. That means extra powers to server - the sitemap should be cached in a static file to avoid this.

On miniBB, we have this add-on installed. I was not releasing it by now, hoping it will be a bonus to the final miniBB 3.

Also, if you provide a custom solution, please ZIP it first and upload to miniBB Forum File Bank. We do not support storing custom solutions on 3rd party websites. They may expire much more earlier than the solution itself :) Also, it would be a pleasure to see the instruction step-by-step without viewing tons of files or webpages.

I think you don't need to care about that all, because we will have the official add-on for sitemaps soon; but anyway, thanks for your interest and time.

Author kuopassa
Partaker
#5 | Posted: 1 Aug 2012 00:06 
Google should accept also simple .txt files as "sitemaps". I've read that such plain URL sitemap should be constructed so that it has one URL per line. XML version can certainly have more information, like date and time of last modification.

Author Paul
Lead Developer 
#6 | Posted: 2 Aug 2012 15:21 
May be it doesnt matter the extension, but it should be cached file. So far your version generates the list of topics each time dynamically.

Author Bluesplayer
Partaker
#7 | Posted: 4 Aug 2012 14:10 
I realize the coding is very weak but it does work fine on my own forum. I have used this sitemap creation method on lots of my sites so the files were already there and just needed adjusting a little. It definitely needs more work though to be suitable for all minibb users.

Google does accept txt files and the sitemap that is created using my files does list them one url per line. The bing also works. Whenever I update the site I ping and the sitemaps are updated on both google and bing.

I quite like this method as the sitemap.txt files are a lot smaller than xml ones and a lot easier to manage - split and so on.

The files definitely need more work though for rich urls and my own solution to this is messy.

As you say your own solution is the answer and I look forward to using it eventually.

Author Paul
Lead Developer 
#8 | Posted: 4 Aug 2012 18:56 
Bluesplayer:
Google does accept txt files
Let's remember that Google is not the only one search engine on Earth, as well as Bing. Many other smaller search engines (Yahoo, Baidu, AOL, Yandex, etc.) may refer to sitemaps as well. In that case, I suppose, not always they would accept the dynamically generated .txt file.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Simple sitemap creation
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑