You are here

function xmlsitemap_sitemap_load_by_context in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap.module \xmlsitemap_sitemap_load_by_context()

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

Parameters

$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

xmlsitemap_get_current_context()

Related topics

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

File

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

Code

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_result(db_query_range("SELECT smid FROM {xmlsitemap_sitemap} WHERE smid = '%s'", $hash, 0, 1));
  return xmlsitemap_sitemap_load($smid);
}