function xmlsitemap_sitemap_load_by_context

7.x xmlsitemap.module xmlsitemap_sitemap_load_by_context(array $context = NULL)
6.x xmlsitemap.module xmlsitemap_sitemap_load_by_context(array $context = NULL)

Load an XML sitemap array from the database based on its context.


$context: An optional XML sitemap context array to use to find the correct XML sitemap. If not provided, the current site's context will be used.

See also


Related topics

4 calls to xmlsitemap_sitemap_load_by_context()
XMLSitemapTestHelper::drupalGetSitemap in xmlsitemap/xmlsitemap.test
Retrieves an XML sitemap.
xmlsitemap_output_chunk in xmlsitemap/
Output a sitemap page.
xmlsitemap_robotstxt in xmlsitemap/xmlsitemap.module
Implements hook_robotstxt().
xmlsitemap_sitemap_edit_form_validate in xmlsitemap/


xmlsitemap/xmlsitemap.module, line 383
Main file for the xmlsitemap module.


function xmlsitemap_sitemap_load_by_context(array $context = NULL) {
  if (!isset($context)) {
    $context = xmlsitemap_get_current_context();
  $hash = xmlsitemap_sitemap_get_context_hash($context);
  $smid = db_query_range("SELECT smid FROM {xmlsitemap_sitemap} WHERE smid = :hash", 0, 1, array(':hash' => $hash))->fetchField();
  return xmlsitemap_sitemap_load($smid);