Jump to content


[Snippet] GoogleSiteMap_XML


1 reply to this topic

#1 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 24 March 2007 - 04:54 AM

File Name: GoogleSiteMap_XML
File Submitter: lloyd_borrett
File Submitted: 24 Mar 2007
File Updated: 24 Mar 2007
File Category: Search Engines

/**
* ---------------------------
* Snippet: GoogleSiteMap_XML
* ---------------------------
* Version: 0.9 - 2007-03-24
*
* Description:
* Create a Google Sitemap XML page.
*
* Useage: [!GoogleSiteMap_XML
*
* ?validate=[true|1]
* if true|1 then the validation header is output.
* tells the snippet to output the additional headers required to validate
* your Sitemap file against a schema.
*
* !]
*
* Create a snippet "GoogleSiteMap_XML" with the content of this file.
* Update the configuration options below in the MakeMap function to suit your needs.
* Create a template "GoogleSiteMap_Template"
* with the content "[!GoogleSiteMap_XML!]".
* Create a page in your repository "Google Site Map"
* with no content, the alias "google-sitemap",
* using the GoogleSiteMap_Template, not searchable,
* not cacheable, with content type "text/xml".
*
* Goto the Google Webaster Tools site at https://www.google.com/webmasters/tools/
* Create an account, or login using your existing account.
* Enter http://www.<your domain name>/ in the add site box and click OK.
* Click on "Verify your site".
* Choose "Add a META tag" as your verification option.
* Add the generated meta tag to the head section of your home page template.
* Back in Google Webmaster Tools, click on "Verify".
* Click on the "Sitemaps" button.
* Click on "Add a Sitemap".
* Select "Add General Web Sitemap".
* Enter "http://www.<your domain name>/google-sitemap.htm" as your sitemap URL.
* Click on "Add Web Sitemap".
*
* Submit to Google: Replace <your-domain-name> with you domain name
* URL: http://www.google.com/webmasters/sitemaps/...gle-sitemap.htm
*
* Submit to Yahoo: Replace <your-domain-name> with you domain name
* URL: https://login.yahoo.com/config/login_verify...gle-sitemap.htm
*
* History:
* 2006-03-24 0.9 Lloyd Borrett
* Updated the documentation.
* Fixed a typo.
*
* 2006-11-17 0.8 Lloyd Borrett
* Updated to identify itself as using the Sitemap 0.9 protocol.
* Added ability to force the change frequency to a set value for all documents.
* Added ability to output the additional headers required to validate the sitemap format.
* Additional comments added.
* Code layout made consistent.
*
* 2006-04-30 0.7 Lloyd Borrett
* Get the base URL from Etomite using the new available
* method built in to Etomite 0.6.1 Final. If using an earlier
* version of Etomite, you'll still need to provide the URL
* as a configuration option.
*
* 2006-04-07 0.6 Lloyd Borrett
* Get the base URL from Etomite instead of it being a configuration option.
*
* 2006-02-15 0.5 Lloyd Borrett
* Fixed incorrect local GMT offset value
*
* 2006-02-05 0.4 Lloyd Borrett
* Changed the snippet to output the local time for all date values
* based on the Etomite server offset time
*
* 2005-09-22 0.3 Lloyd Borrett
* Only list searchable pages (Mod suggested by mplx)
* Added configuration settings.
* Made the site URL a configuration option.
* Made displaying lastmoddate, priority and/or changefreq optional.
* Added ability to display long date & time for lastmoddate
* Made the long or short timeformat optional.
*
* 2005-06-05 0.2 Ryan Nutt - http://blog.nutt.net
* Fixed a stupid mistake :-)
*
* 2005-06-04 0.1 Ryan Nutt - http://blog.nutt.net
*
* Based on the ListSiteMap snippet by
* JaredDC
*
* datediff function from
* www.ilovejackdaniels.com
*/


Click here to download this file

#2 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 10 March 2009 - 07:15 PM

google doesn't like when you have redirects in your sitemap...what we create as 'weblinks' in Etomite.

I modified GoogleSiteMap_XML as follows.

line 296 - to include the 'type' field (document type - either 'reference' or 'document') :

$children = $funcEtomite->getActiveChildren($listParent, "menuindex", "ASC", "id, editedon, searchable, type");

and then line 306 from if ($searchable){ to :

if (($searchable) && ($child['type'] != "reference" )){

...thereby removing any weblinks from my sitemap.


Would there be other unintended results from this change?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users