*****************************************************************************
 * vBGSitemap
 * vBulletin Google site map
 *
 * @version "Version 2.41 8 November 2005";
 * @copyright 2005 Michael Brandon Time2Dine, MarketItOnline
 * michael@time2dine.co.nz
 *
 * updates from:
 * http://forum.time2dine.co.nz/seo-vbulletin/vbulletin-google-site-map-3976.html
 * http://www.vbulletin.org/forum/showthread.php?t=91389
 *
 *****************************************************************************

General Description of Program

- creates an index file and multiple gzipped site maps of less than the max size
  permitted by Google (50k url's per sitemap file, max 10meg long uncompressed)
- creates a file that can be added to Yahoo http://submit.search.yahoo.com/free/request

adds 
- for vbseo, it adds rewritten url's and original url's - meaning that Google will
  replace old url's with the new url's when it follows the 301 redirect
- forums - with paginations of forums (excluding redirects, password protected and restricted forums)
- threads - with pagination of threads (excluding invisible threads=soft deleted, and  
  threads inside password protected forums)
- archive forum pages with paginations
- members
- polls

extra
- extra urls from other program types (ie non vBulletin)
- add a new url per line onto file.txt, and a gzipped file will be created for it, and 
  added to the site index file.

------------------------------------------------------------------------------
Installation instructions

- copy the vbgsitemap directory and files to the root directory domain.com/vbgsitemap
- chmod the vbgsitemap/files directory 777 
- copy the vbgsitemap.php file to the root directory
- copy the vbgsitemap/includes/cron/vbgsitemap-cron.php file to the 
  forums/includes/cron/ directory.
- The files are accessed by Google from the root directory via /vbgsitemap.php 
  - you submit the /vbgsitemap.php file to Google, and this file returns the details of
    /vbsitemap/files/vbgsitemap_index.xml.
  - Google then accesses each of the files via /vbgsitemap.php?map=1, map=2 etc
- Submit the /vbgsitemap/files/urllist.gz (or as you have renamed it) file to Yahoo
  http://submit.search.yahoo.com/free/request  
- I have kept the filesize to $max = 3,000 rather than 50,000 url's to make it easier
  to check the files, so after you have checked that the files are being created correctly
  change the vbgsitemap/vbgsitemap-config.php to 50,000 or say 49,500 url's
- check the /vbgsitemap/vbgsitemap-config.php settings. The main one you will need to change is
  the forum directory - to where-ever your forum is 
- some configuration options:
    * For vBSEO - Once Google has spidered the old url's and deleted them from its index, you 
      can stop listing the old url's and just have the new rewritten url's
      - $vbseo_oldurls = true;
    * add last modified (last post/last thread) or use current time
      - $lastmod=true;
    * $xtrafile=""; - add a list of plain url's to the file.txt file (non vBulletin url's),
      and the program will add them to the first site map with the noted change and priority details.
        - I recommend that you use  http://www.auditmypc.com/free-sitemap-generator.asp
- general
    * The lastmod is set as being the most recent of the last time that the templates were changed,
      the date of the last post or thread to a particular forum, or the max of one month. this can be changed
      to take out the max one month, if you want to keep the true last moded dates. However, Google
      often revisits every month, and so having a date as max one month keeps the Googlebot coming around, 
      or asks it to keep coming around.
  
    * In order to conserve memory, the thread url's are stepped through 3000 at a time.

------------------------------------------------------------------------------
Starting the program

- access the program via domain.com/vbgsitemap/
- username and password are the ones used for your database access. You can see these in the 
  /forums/includes/config.php file.
- check the box to ping Google with the domain.com/vbgsitemap.php index file, or
  add that filename to the official Googlesitemap website (link on /vbgsitemap/index.php)
  
-------------------------------------------------------------------------------
How to setup for a cron job

- Once you are happy with the url's via the manual process, please add the vbgsitemap-cron.php
  to your vbulletin scheduled tasks, and the file to that directory - ./includes/cron/vbgsitemap-cron.php 
  The job is set to ping Google and will let you know about a successful ping of Google. 
	
*******************************************************************************
inspired by
http://forums.digitalpoint.com/showthread.php?t=17798

http://code.google.com/sm_thirdparty.html

**************************************************************

Changelog
2.3 6 Nov 05
- clearing out cache variables that vbseo uses
2.42 adding yahoo sitemap, and fixing mysql