Tag Archives: Xml Sitemaps

xml sitemap for pligg v0.7

This is a quick fix for a bug introduced in a previous version because I tried to make it compatible with php4 date().

This bug may have made your sitemap invalid because the lastmod date contained the timezone between the date and time.

This version also brings a new feature that could be useful for larger sites.

The cache

I noticed that on a site with over 20000 links it may take a lot of time to generate the sitemap index and sitemap files and will put some significant load on the server if google, yahoo or ask will try to access the sitemap every few minutes or hours ( depending on your site's posting/pinging frequency ), so I thought it would be nice to have some kind of cache.

The module will save generated sitemap index and sitemaps in pligg's cache directory ( this means it needs to be writable by the user running the webserver ) and if the cache has not expired yet the module will serve the sitemaps from the cache instead of trying to regenerate every time.

You can set the expire time ( TTL ) and the module will regenerate the sitemap if TTL seconds have passed since the last time it was modified.

You don't need to set any cron job to generate the sitemap files. It will only generate the sitemap if someone/something(google,yahoo,ask) tries to access it.

Another modification related to the caching system is that the site will only ping services if the cache has expired so make sure you set your cache's TTL accordingly.

Upgrade:

To upgrade to this version just download and unzip in your module's directory and then to pligg admin -> module management , disable and uninstall the module and then reinstall it so that you can see the new options ( "Use Cache" and "Cache TTL")

Download from module's own page

xml sitemap for pligg update v0.6

Update: There is be a new version of this module. Click here to get it.

Last year I have released a pligg module that creates XML sitemaps for better SEO. The module was tested and working on pligg 0.9.7. Since that time pligg was updated two times and is now at 0.9.9.

In pligg 0.9.8 they removed the clear_cache function that the my module's install code was using to clear the configuration cache. Because of this it was impossible to install the module.

The quick fix was just to edit xml_sitemaps_install.php and remove a line (#5) that called clear_cache() and then you could install it without any problems. This workaround was already known and discussed in the comments
Someone in the pligg community released a new version of this module that is basically just my module with that clear_cache function call removed and another 1 bug that was also discussed in the comments and was easy to fix. They bumped the version number to 0.5 which in my opinion was really not necessary since it was such a small fix.
They have also added a .htaccess file to the archive, again not necessary since my initial post already had the details ( .htaccess code ) about how to set it up and the module was also showing that in the configuration section.
One other thing I didn't like about their release was that they didn't make the module available for download without having to register on their forum.

So here I release a new version ( 0.6 ) of this module with more bugs fixed and now the module will have a page of it's own so that it will be easier to track new versions .

What changed:

  • use safe category names
  • generate links according to URLMethod configuration
  • modified use of date() function to work on php4

This module was tested on pligg 0.9.9.

Go to xml sitemap pligg module page for download