Greensboro
 | 
Travel
 | 
Advice
 |  News |  Blog

Sitemap for Google - PHPBB 3 Mod

by Liv | Published on Tue Oct 31, 2006 2:19 pm | Advice
Modification Name: PHPBB Site Map for Google Mod
Modification Version:: 15 (10/1/2011) Validated for 3.0.9, and prior.
Author: L. Jones

Modification Description::
    PHPBB SiteMap for Google Mod produces an XML (by redirect) or pseudo XML compliant link tree for use with various sitemap submission softwares such as Google's Webmaster tools sitemap submission service or Yahoo's Site Explorer

Features:
    Simple installation, "upload and go" if your forum is in the root domain. Simply upload the PHP file (sitemap.php) and add the link to your index page. Otherwise, modify the domain variables in the top of the PHP file and off you go. The site-map provides real-time 24 hour data on topics to Search Engines down to the second.

Screenshots:
phpbb_sitemap_mod.jpg

Demo URL: sitemap.xml

Modification Download:

phpbb3_google_sitemap_v15.zip
(3.45 KiB) Downloaded 125 times


Site Map Install Instructions:
    1) Download phpbb3_google_sitemap_v15 and decompress. (above)

    2) If Your PHPBB3 Forum is installed in the root folder, for instance at http://greensboring.com then skip "a"
      a) modify the $folder or $subdomain variable to match your forum. An example is given at the top of the PHP code.
    3) Upload to your forum root folder. (where PHPBB's index.php is)
    4) Access your PHPBB's index.php from your forum root folder and open it for editing, find:
    Code: Select all
    'TOTAL_POSTS'   => sprintf($user->lang[$l_total_post_s], $total_posts),

    After that add:
    Code: Select all
    'SITE_MAP' => '<a href="sitemap.php" title="sitemap" rel="alternate" type="application/rss+xml">SiteMap</a> by <a href="http://www.livjones.com">Liv</a>',

    5) Go into your administrator control panel -> styles -> template -> edit -> "index_body.html" ->
    find in template:
    Code: Select all
    <!-- INCLUDE overall_footer.html -->


    before it add:
    (Running a SubSilver or a custom theme? No problem... just add it where you feel most comfortable in the template)
    Code: Select all
    {SITE_MAP}


    Click submit, and you're almost done...

    6) Submit to Google, at Google Sitemaps.

      This sitemap also works for Yahoo, (and others) etc. If you wish to submit it you may do so at Yahoo Site Explorer

    7) Go get a lovely pint of Guinness and drink because you are officially done!

    EXTRA CREDIT!!!! (optional)
    Advanced users may wish to add to their .htaccess file the following command to make it fully xml compliant. This really has no effect on anything unless a random bot comes along looking for a sitemap.xml. I would honestly just recommend skipping this, unless it's important to you to have it as sitemap.xml

    add (or create) in .htaccess file
    Code: Select all
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule sitemap.xml sitemap.php [NC]


PHPBB3 Sitemap Change Log:
    Version: 15 (and prior) Changes:
    -Added Gzip compression which greatly increases the speed.
    -Refined SQL SELECTs to speed reduce resource overhead.
    -Updated code to handle parent forums and "1969" issue with Google sitemaps.
    -Depreciated file_get_contents() in favor of Curl. (hat-tip to Marcel)
    -Added Limits to the number of URLs, set default to Google's 50,000 Max.
    -Fixed glitch where forums with subforums wouldn't display topics or forums.
    -Added a echo statement for path if script die()'s because of faulty path.
    -XML Compliant Header added.
    -Corrected last mod tags format for W3c standards.
    -Added LastMod tags to sitemap with data pulled from phpbb3 database.
    -Only displays non-private content of both forums and topics.
    -Non-Indexable forums have been removed from the sitemap.
    -Changed Mysql_fetch_array to sql_fetchrow per Dave Turner to solve database compatibility issues.
    -Add subdomain variable for ease. Allows user to change domain if not set by server.
    -Pulls PHPBB prefix from config.php
    -removed the need to state domain and path. Made it more intuitive by only needing to state folder of PHPBB install.
    -Moved Forums to be listed last.
    -Changed viewtopic posts to only those that are approved.
    -List latest topics first rather than last.


 
thanks will give a try good that someone makes sitemapper for phpbb regards
pr10google
 
HI

now i can see below in my google webmaster page -

Status OK
Total URLs in Sitemap 59
Indexed URLs in Sitemap Help Help No data available. Please check back soon.

PLZ TELL WAT THIS MEANS ???????????????????No data available. Please check back soon.
Guest
 
Indexed URLs mean the URLs which actually appear in Google's index. You can see the URLs for your website that appear in Google's index by using the site command in the Google search box.

Code: Select all
Site:mydomain.com


Generally URLs that appear in your sitemap show up in the index based on algorithmic performance indicators, in 24 hours to 30 days in my experience. Though I've found the RSS feature can quicken indexing.
User avatar
Liv
Just sit there and watch me!
 
I was able to install the sitemap.php at my forum then i submited the sitemap.php to google webmastertools site.

Google reads it but there are no words inside the list where google shows what the googlebot does see.
The XML Sitemaps page shows 231 read pages, but when i search the net for any of the words inside the forum there are no hits.


when i run the script asthe bot would do, then i receive a page with lots of lines like this:

<url>
<loc>http://forum.konsolenpunkt.de/viewtopic.php?f=45&t=151</loc>
</url>

can anybody help me?
TecD0c
 
Hi,

Giving Google bot the sitemap is one thing. Now you'll have to wait few days until it will pull the sitemap and process it for their search engine.

Lots of line is great! that means Google can process each link and add it to their engine.

I would also suggest for you to *make sure* that Googlebot can actually access your forum messages. I had an issue that google didn't index my forum for few weeks even when I gave him my sitemap. Apparently, I didn't let their bot to access the content :)

Try installing in your firefox "user agent switcher" and then switch the user-agent to Google-bot, and try accessing different parts of your forum to see if Googlebot will be able to access them as well. See more info here

Good luck,
Hetz
hetz
 
TecD0c wrote:I was able to install the sitemap.php at my forum then i submited the sitemap.php to google webmastertools site.

Google reads it but there are no words inside the list where google shows what the googlebot does see.
The XML Sitemaps page shows 231 read pages, but when i search the net for any of the words inside the forum there are no hits.


when i run the script asthe bot would do, then i receive a page with lots of lines like this:

<url>
<loc>http://forum.konsolenpunkt.de/viewtopic.php?f=45&t=151</loc>
</url>

can anybody help me?


Well your sitemap is working flawless. The "lines" are the psuedo XML which Google will read and try to index. Remember, all a sitemap does is "submit" the content to Google, it does not necessarily mean Google will include it.

Your site is lower in page-rank, so it may take time. Get inbound links, and you should see an increase in the number of indexed pages.

Another helpful step is to look at this page: SEO for PHPBB which can do a lot for making things easier on Googlebot. After all we don't want to stress the little guy (or gal) out. (If you haven't already)
User avatar
Liv
Just sit there and watch me!
 
StoneRanger wrote:Thanks for the code!

On Google Webmaster, the status for the sitemap gives me a caution sign. Is this normal? Downloading the table showed it as a warning. I did change the .htaccess edit at first, but changed it back and the caution sign still shows up after a delete and submit.


I have seen on some installs where the timestamp is showing up without the GMT adjustment, meaning instead of this:

Code: Select all
<lastmod>2009-08-14T06:47:14-05:00</lastmod>


It's echoing:

Code: Select all
<lastmod>2009-08-14T06:47:14P</lastmod>


Which I believe Google can still parse, but isn't necessarily correct. It could be a server configuration error, or perhaps merely that the server isn't running PHP4/5 yet...

If you post your URL, I'll be glad to see what I think...
User avatar
Liv
Just sit there and watch me!
 
Thanks for the amazing mod.
snow
 
Your welcome...

I'd also like to thank, "God", his son "Jesus" whom without this mod it couldn't be possible.... My mother, and father, grandmother, grandfather.... the people of wales, the queen of England, Barack Obama..... the secret society of Greensboring.... and my cat Sunshine... thank you, all of you.
User avatar
Liv
Just sit there and watch me!
 
Hi.

Im using php3 seo mod and my urls are like phpbb3.com/a-new-topic/

in your sitemap mod the urls will go /viewtopic.php?f=6&t=3329

How can I change this?
Sj0din
 
You can use the mod in the form it is if the pages are reachable by both URLs and you use a canacolization tag on your pages....

else you can revert back to the original PHPBB url architecture...

else I'd be glad to write you a custom version for a few hundred dollars.
User avatar
Liv
Just sit there and watch me!
 
Liv is there a way to remove certain forums from being generated in the sitemap?
And since this is constantly updated, do I have to resubmit everyday to Google?
How many times should I resubmit the sitemap?

Regards,
snow
snow
 
snow wrote:Liv is there a way to remove certain forums from being generated in the sitemap?
And since this is constantly updated, do I have to resubmit everyday to Google?
How many times should I resubmit the sitemap?

Regards,
snow


Yes, under forum administration in your ACP change this option to "no" for the forums you don't want included:
Code: Select all
Enable search indexing:
If set to yes posts made to this forum will be indexed for searching.


And... No... you should never have to re-submit the sitemap after the first time, Google is intelligent enough to check the sitemap prior to crawls. If your site is popular enough you'll see it automatically updated with crawl dates every so many days. The only time you would want to resubmit the sitemap is if your site suffered a pro-longed outage resulting in Google not finding the sitemap for prolonged period of time.
User avatar
Liv
Just sit there and watch me!
 
I'm pretty new to all this, so please forgive me if this is an ignorant question.

My site uses the subsilver2 template. When I came to edit index_body.html I could not find the

<!-- INCLUDE overall_footer.html -->

line of code, which does exist in the prosilver template.

Is there a way to use this mod with the subsilver2 template?
newbie111
 
That's okay... basically just add

Code: Select all
{SITE_MAP}


...anywhere at the bottom of the template and you'll be fine. You can even move it where you want.... it just adds a link to your sitemap so crawlers can find it, and a courtesy link to my site for all my hardwork. That's all.

As long as the info appears on your index page you'll be fine.
User avatar
Liv
Just sit there and watch me!
 
Thanks heaps, it works just great :D
newbie111
 
Hello,

Will this work with SEF urls?

Thanks!
jv
 
Indirectly if you have the proper redirects.... Google should be able to find it, but unfortunately this does not alter PHPBB's URL structure on its own.
User avatar
Liv
Just sit there and watch me!
 
Thanks it worked..
Jackz
 
hi,I install the mod and it works great.But there is a problem with the URL generated,"&amp;"always there and it seems that google bot can't parse it.

This is the link to my sitemap: http://bbs.xradish.com/sitemap.php

This is the url with problem:
<loc>http://bbs.xradish.com/viewtopic.php?f=12&amp;t=21</loc>
varding
 
It appears fine for me. Google will show them in your sitemap dashboard differently but unless you`re getting an actual warning you`re fine. Just looking at your sitemap remotely shows they`re parsing correctly.
User avatar
Liv
Just sit there and watch me!
 
Great!

Worked like a charm! Thanks :-)
Guest
 
Hi, i go to site:mydomine.com

and :

www.infagames.com/sitemap.php?forum=28

when I go to the link, see the sitemap, not the forum in question

Is it a problem I have? or do I have to wait for the google crawl the links.

I need help please
lokis
 
No, no problem... sitemap doesn't use any $_GET variables.... so it doesn't matter.
User avatar
Liv
Just sit there and watch me!
 
go please:

http://www.google.com/#q=site:www.infag ... 72b4d3c5a7

There are many links in google indexed my forum

but when I click takes me to the sitemap and not to sections of my forum

is normal??

sorry, i dont speak english

^^
lokis
 
It didn't for me, but I'd assume if it did at one time, it's a incorrect re-dirrect in your .htaccess. Check that.
User avatar
Liv
Just sit there and watch me!
 
please my htaccess is:

Code: Select all
#
# @package phpBB3 Portal  a.k.a canverPortal  ( www.phpbb3portal.com )
# @version $Id: .htaccess,v 1.7 2008/02/09 08:18:13 angelside Exp $
# @copyright (c) Canver Software - www.canversoft.net
# @license http://opensource.org/licenses/gpl-license.php GNU Public License
#

DirectoryIndex portal.php index.php index.html index.htm

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>



I have a portal.
this is my file.

Could you add what is missing please

thanks
Guest
 
If that's your .htaccess then that's not it....

I can't imagine anything that would cause a redirection to the sitemap other than a "redirect". There must be some sort of conflict with the "portal".

I'd suggest attempting to make sure you're only making changes to the PHPBB forum software, and not the portal.
User avatar
Liv
Just sit there and watch me!
 
Hi there, how long does it take, until sitemap is generated and how often those it update?

Thank you
Gilly
 
Gilly wrote:Hi there, how long does it take, until sitemap is generated and how often those it update?

Thank you


The sitemap is generated when the file is loaded, and provides real-time data. The only situation where this would not occur, is if you are cacheing the file, which is not done by default.
User avatar
Liv
Just sit there and watch me!
 
I am getting the red X - unsupported file format error for the url in Google Sitemaps.
jlf
 
jlf wrote:I am getting the red X - unsupported file format error for the url in Google Sitemaps.


What's the URL?
User avatar
Liv
Just sit there and watch me!
 
Hello
I had no problems installing the Modification I thought, but I am getting this error
Code: Select all
Something went wrong, check your path first: http://help.nilandsplace.com/campingforum/
We could not find an author citation link: http://livjones.com - Please refer to this webpage for full installation instructions:http://greensboring.com/viewtopic.php?f=23&t=1563 - Thanks!
The URL is correct. Did I miss something? I really don't know PHP coding so I have no idea what is wrong
James Niland
Laurinburg NC
nilands55
 
I don't see the URL to the author on your website.... It's possible you modified the pro_silver theme rather than the one you're using. Add a link to your theme... and it should work.
User avatar
Liv
Just sit there and watch me!
 
I build in several Times Sitemap and it works but now I tried another Hoster and this Bug Info show up
I tryed bplaced.net
Fatal error: Call to undefined function curl_init() in /users/cgnmadmax/www/F1/sitemap.php on line 61
CGNMadMax
 
It's possible your new provider does not have cUrl libraries installed.
User avatar
Liv
Just sit there and watch me!
 
Is there a way 2 Fix this iam no Programm Designer so your answer is lite bit short but Nevermind THX 4 Support Overall
CGNMadMax
 
Talk to your host, and ask them to install "Curl Libraries" for you.
User avatar
Liv
Just sit there and watch me!
 
I get the following error:

Code: Select all
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/vhosts/default/htdocs/forum/sitemap.php on line 64

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/default/htdocs/forum/sitemap.php:64) in /var/www/vhosts/default/htdocs/forum/sitemap.php on line 74
http://85.25.129.12/forum/ 2011-06-23T17:28:06+02:00 http://85.25.129.12/forum/viewforum.php?f=6 2011-06-21T21:06:06+02:00 http://85.25.129.12/forum/viewforum.php?f=7 2011-06-15T18:28:22+02:00 http://85.25.129.12/forum/viewforum.php?f=3 2011-06-23T17:28:06+02:00 http://85.25.129.12/forum/viewforum.php?f=8 2011-06-21T21:07:10+02:00 http://85.25.129.12/forum/viewforum.php?f=21 2011-06-16T23:19:32+02:00


What do i wrong?
CraftersUnited
 
Curl needs to activated by your host.
User avatar
Liv
Just sit there and watch me!
 
Im my own host,
can u tell me hwo to activate?
(debian5, plesk )
CraftersUnited
 
Nice work!
Thank you very much :)

No it's works fine.

http://85.25.129.12/forum/sitemap.php
CraftersUnited