class vB_SiteMap_Node extends vB_SiteMap

Specific class for generating node-associated sitemaps. Used to generate channel sitemaps, but extended by vB_SiteMap_Starter

Constants

FLAG_PING_GOOGLE

FLAG_PING_BING

Properties

protected int $lastid The last id of the content, for per_page from vB_SiteMap
protected array $forum_custom_priority An array of custom Forum priorities forumid => priority from vB_SiteMap
protected array $custom_priority An array of custom priorities contenttype => forumid => priority from vB_SiteMap
protected vB_Registry $registry The vBulletin registry object from vB_SiteMap
protected vB_Database $dbobject The vBulletin database object from vB_SiteMap
protected vB_XML_Parser $xmlobject A vB_XML_Parser database object from vB_SiteMap
protected string $content String to save the content of the sitemap while being generated before being written out from vB_SiteMap
protected int $pagecount Counter for the numbers of URLs added to the current sitemap content from vB_SiteMap
protected boolean|null $has_more Determines if there is more of this content type to process. from vB_SiteMap
protected array $errors Array to store any errors encountered while building data from vB_SiteMap
protected array $sitemap_index Array to store currently generated (or listed) site maps. Used to generate sitemap index file (the master one). ['loc'] && ['lastmod'] from vB_SiteMap
array $search_engines Array of search engine urls' for sitemap call back, populated with defaults from options from vB_SiteMap
protected $sitemap_path from vB_SiteMap
protected $tempfile from vB_SiteMap
static protected $channels

Methods

__construct(vB_Registry $registry, vB_XML_Parser $xml_handler = null)

Constructor - checks that the registry object has been passed correctly.

generate_sitemap(int $startat = 0, int $perpage = 30000)

Adds the URLs to $this->content

array
get_sitemap_index()

Gets the current data that will be used to build the sitemap index

set_sitemap_index(array $value)

Sets the current data that will be used to build the sitemap index

boolean|null
has_more()

Returns indicator for whether there's more of this content to be processed.

float
get_effective_priority(string $contenttype, integer $contentid)

Returns the effective priority for a non-forum type

int
get_pagecount()

Accessor

int
get_lastid()

Accessor

boolean
create_sitemap_index()

Write out the sitemap index file using sitemap file refrences in $this->sitemap_index

boolean
create_sitemap($filename)

Build the actual file for the sitemap

string
url_block(string $url, int $lastmod, double $pri = false, boolean $formatting = false)

Create a url XML text block for one URL

boolean
remove_sitemaps()

Delete all sitemaps named : '_sitemap.xml' '_sitemap.xml.gz' 'sitemap_index.xml'

none
ping_search_engines()

Ping the search engines

set_node_priorities()

No description

get_node_priority($nodeid)

No description

get_allowed_channels()

No description

Details

at line 1004
__construct(vB_Registry $registry, vB_XML_Parser $xml_handler = null)

Constructor - checks that the registry object has been passed correctly.

Parameters

vB_Registry $registry Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
vB_XML_Parser $xml_handler Instance of the vBulletin XML parser.

at line 1068
generate_sitemap(int $startat = 0, int $perpage = 30000)

Adds the URLs to $this->content

Parameters

int $startat forumdid to start at
int $perpage perpage limit defaults to 30000

in vB_SiteMap at line 690
array get_sitemap_index()

Gets the current data that will be used to build the sitemap index

Return Value

array

in vB_SiteMap at line 700
set_sitemap_index(array $value)

Sets the current data that will be used to build the sitemap index

Parameters

array $value

in vB_SiteMap at line 711
boolean|null has_more()

Returns indicator for whether there's more of this content to be processed.

Useful for the case where there is exactly the "per page" pieces of content.

Return Value

boolean|null Null is unknown, booling otherwise

in vB_SiteMap at line 724
float get_effective_priority(string $contenttype, integer $contentid)

Returns the effective priority for a non-forum type

Parameters

string $contenttype content type
integer $contentid content ID

Return Value

float Usable priority

in vB_SiteMap at line 739
int get_pagecount()

Accessor

Return Value

int

in vB_SiteMap at line 750
int get_lastid()

Accessor

Return Value

int

in vB_SiteMap at line 761
final boolean create_sitemap_index()

Write out the sitemap index file using sitemap file refrences in $this->sitemap_index

Return Value

boolean indicates success. On failure an error message will be recorded in $this->errors

in vB_SiteMap at line 806
final boolean create_sitemap($filename)

Build the actual file for the sitemap

Parameters

$filename

Return Value

boolean indicates success. On failure an error message will be recorded in $this->errors

in vB_SiteMap at line 861
protected string url_block(string $url, int $lastmod, double $pri = false, boolean $formatting = false)

Create a url XML text block for one URL

Parameters

string $url The URL (not encoded) to add to the sitemap
int $lastmod The unix timestamp of the last modifictaion time of the data in UTC
double $pri The priority of the data from 0.1 to 1.0
boolean $formatting Enable formatting of the output

Return Value

string Formatted escaped wrapped text

in vB_SiteMap at line 925
final boolean remove_sitemaps()

Delete all sitemaps named : '_sitemap.xml' '_sitemap.xml.gz' 'sitemap_index.xml'

Return Value

boolean FALSE on any fails

in vB_SiteMap at line 964
none ping_search_engines()

Ping the search engines

Return Value

none A blind call, no return currently parsed

at line 1012
protected set_node_priorities()

at line 1022
get_node_priority($nodeid)

Parameters

$nodeid

at line 1032
get_allowed_channels()