topical media & game development

talk show tell print

professional-search-09-seophp-sitemap.php / php



  <?php
  // redirect requests to dynamic to their keyword rich versions
  require_once 'include/sitemap.inc.php';
  // load configuration
  require_once 'include/config.inc.php';
  // load URL factory
  require_once 'include/url_factory.inc.php';
  
  // create the Sitemap object
  s = new Sitemap();
  
  // add sitemap items
  s->addItem(SITE_DOMAIN . '/catalog.html', '2006/10/27', 'weekly');
  s->addItem(make_category_product_url(
          "Carpenter's Tools", 12, "Belt Sander", 45), '2006/10/27', 'weekly');
  s->addItem(make_category_product_url(
          "SEO & Toolbox", 6, "Link Juice", 31), '2006/10/27', 'weekly');
  s->addItem(make_category_product_url(
          "Friends' Shed", 2, "AJAX PHP Book", 42), '2006/10/27', 'weekly');
  
  // output sitemap
  if (isset(_GET['target']))
  {   
    // generate Google sitemap
    if ((target = _GET['target']) == 'google')
    {
      echo s->getGoogle();
    }
    // generate Yahoo sitemap
    else if (target == 'yahoo')
    {
      echo s->getYahoo();
    }
  }
  ?> 
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.