<?php
/*
* @package LabCMS
* @copyright (c) 2006 Alexander Levin aka Loki (loki_angel@mail.ru)
* @support http://labcms.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

$mod_template="sitemap_all.tpl";
if (LabCMS::i()->is_cached($mod_template, 1296000, $_GET['var1'])) return; //кэшируем на две недели

LabConfig::$mcfg['at_page']=130;

$sitemap=getFlatSitemap();

if(intval($_GET['var1']))
{
	$chunks=array_chunk($sitemap, LabConfig::$mcfg['at_page'], true);
	if (array_key_exists(($_GET['var1']+1), $chunks)) $sitemap=$chunks[($_GET['var1']+1)];
}

Tpl::i()->assign('map', $sitemap);
