PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Anil Gupta   Sitemap creator for Google, Yahoo and MSN   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Sitemap creator for Google, Yahoo and MSN
Generate a site map from lists of site files
Author: By
Last change:
Date: 17 years ago
Size: 1,219 bytes
 

Contents

Class file image Download
<?php
/**
 *
 * PHP Class for sitemap
 *
 * Here are some testing examples which will demonstrate how to use this class
 *
 * PHP versions : php5
 *
 * @author Anil Gupta <[email protected]>
 * Web Engineer
 * @version v0.0.1
 *
 * @todo
 *
 * 1.Copy class.sitemap.php and example.php file in server for which you want to genrate sitemap
 * 2.Set properties according to your site and requirements
 * 3.run the file example.php from browser
 *
 */

require_once('class.sitemap.php');


/**
 * Example - 1
 *
 */
$sitemap = new Sitemap();
$sitemap->hostUrl = 'http://www.thinkerminds.com/';
/**
 * Please specify your project directory here don't add '/' before or after of the dir name
 * @example 'shoping'
 */
$projectDir = "" ;

/**
 * Filepath
 * specify the path where you want to store the generated sitemap files
 * keep it '' if you want to store it in your projectDir
 * Please make sure that the filepath has write permission for apache users
 * @example
 * $filePath = '';
 * $filePath = '/var/www/html/sitemaps';
 */

$filePath = "";
$sitemapXmlfile = $sitemap->getXmlSiteMap($projectDir,$filePath);
$sitemapTextfile = $sitemap->getTextSiteMap($projectDir,$filePath);