XMLSitemap
[ class tree: XMLSitemap ] [ index: XMLSitemap ] [ all elements ]

Class: SitemapXML

Source Location: /plugins/xmlsitemap/xmlsitemap.class.php

Class Overview


This is the built-in Geeklog class for creating the Google sitemap.


Variables

Methods



Class Details

[line 68]
This is the built-in Geeklog class for creating the Google sitemap.

USAGE:

  1.    $sitemap new SitemapXML();
  2.    $sitemap->setFileNames('path_to_sitemap_file',
  3.        'path_to_mobile_sitemap_file');
  4.    // $sitemap->setTypes(array('article', 'staticpages'));
  5.    // $sitemap->setPriority('article', 0.6);
  6.    // $sitemap->setPriority('staticpages', 0.4);
  7.    // $sitemap->setChangeFreq('article', 'weekly');
  8.    // $sitemap->setChangeFreq('staticpages', 'monthly');
  9.    $sitemap->create();




[ Top ]


Class Variables

$_changeFreqs =

[line 77]


Type:   mixed


[ Top ]

$_encoding =

[line 76]


Type:   mixed


[ Top ]

$_filename =

[line 80]


Type:   mixed


[ Top ]

$_mobile_filename =

[line 81]


Type:   mixed


[ Top ]

$_priorities =

[line 78]


Type:   mixed


[ Top ]

$_types =

[line 79]


Type:   mixed


[ Top ]

$_valid_change_freqs = array('always', 'hourly', 'daily', 'weekly',
            'monthly', 'yearly', 'never')

[line 86]

Valid expressions for 'changefreq' field. Should be constants in PHP5


Type:   mixed


[ Top ]



Class Methods


constructor SitemapXML [line 95]

SitemapXML SitemapXML( [string $encoding = ''])

Constructor



Tags:

access:  public


Parameters:

string   $encoding   the encoding of contents

[ Top ]

method checkChangeFreq [line 222]

string checkChangeFreq( string $str)

Check if a string stands for a proper frequency



Tags:

return:  a valid string or an empty string
access:  public


Parameters:

string   $str   a string for a frequency

[ Top ]

method checkPriority [line 178]

float checkPriority( string $str)

Check if a string stands for a valid value of priority



Tags:

return:  a valid value or 0.5 (default value)
access:  public


Parameters:

string   $str   a string for a priority

[ Top ]

method create [line 447]

boolean create( )

Create the sitemap and save it as a file



Tags:

return:  TRUE = success, FALSE = otherwise
access:  public


[ Top ]

method getChangeFreq [line 252]

string getChangeFreq( string $type)

Return the value of change frequency



Tags:

return:  any of 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never', ''
access:  public


Parameters:

string   $type   'article', 'staticpages', ...

[ Top ]

method getEncoding [line 131]

string getEncoding( )

Return the encoding of the source content



Tags:

return:  the encoding of contents
access:  public


[ Top ]

method getFileNames [line 166]

array getFileNames( )

Return the names of sitemap files



Tags:

return:  names of the sitemap and mobile sitemap
access:  public


[ Top ]

method getPriority [line 206]

float getPriority( string $type)

Return the value of priority



Tags:

return:  0.0..1.0 (default value is 0.5)
access:  public


Parameters:

string   $type   'article', 'staticpages', ...

[ Top ]

method getTypes [line 282]

array getTypes( )

Get the types of content



Tags:

return:  array of strings of types: 'article', 'staticpages', ...
access:  public


[ Top ]

method setChangeFreq [line 236]

void setChangeFreq( string $type, string $value)

Set the change frequency of the item



Tags:

access:  public


Parameters:

string   $type   'article', 'staticpages', ...
string   $value   any of 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never'

[ Top ]

method setEncoding [line 113]

void setEncoding( string $encoding)

Set the encoding of contents



Tags:

access:  public


Parameters:

string   $encoding   the encoding of contents

[ Top ]

method setFileNames [line 147]

void setFileNames( [string $filename = ''], [string $mobile_filename = ''])

Set the name(s) of the sitemap file (and optionally the mobile sitemap file)

NOTE: Sitemap files must be located in the top directory of the site, i.e., the same directory as "lib-common.php".




Tags:

access:  public


Parameters:

string   $filename   name of sitemap file
string   $mobile_filename   name of mobile sitemap file

[ Top ]

method setPriority [line 191]

void setPriority( string $type, float $value)

Set the priority of the item



Tags:

access:  public


Parameters:

string   $type   'article', 'staticpages', ...
float   $value   the value of priority

[ Top ]

method setTypes [line 271]

void setTypes( mixed $types)

Set the types of content

NOTE: $types parameter is not checked to handle a case where a plugins is being enabled/disabled, i.e., when you can't depend on $_PLUGINS.




Tags:

access:  public


Parameters:

mixed   $types   (string or array of string): 'article', ...

[ Top ]

method _write [line 392]

boolean _write( string $filename, string $sitemap)

Write the sitemap into a file



Tags:

return:  TRUE = success, FALSE = otherwise
access:  protected


Parameters:

string   $filename   the name of the sitemap file
string   $sitemap   the content of the sitemap

[ Top ]


Documentation generated on Sat, 11 Feb 2012 02:09:33 -0500 by phpDocumentor 1.4.3