You are here

function xmlsitemap_get_current_chunk in XML sitemap 7.2

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_get_current_chunk()
  2. 6.2 xmlsitemap.pages.inc \xmlsitemap_get_current_chunk()
  3. 2.x xmlsitemap.module \xmlsitemap_get_current_chunk()

Get the sitemap chunk/page of the current request.

1 call to xmlsitemap_get_current_chunk()
xmlsitemap_output_chunk in ./xmlsitemap.pages.inc
Output a sitemap page.

File

./xmlsitemap.pages.inc, line 13
Page callbacks for the xmlsitemap module.

Code

function xmlsitemap_get_current_chunk(stdClass $sitemap) {

  // Check if we should be displaing the index.
  if (!isset($_GET['page']) || !is_numeric($_GET['page'])) {
    if ($sitemap->chunks > 1) {
      return 'index';
    }
    else {
      return 1;
    }
  }
  else {
    return (int) $_GET['page'];
  }
}