core/api/modules/qsitemap/index.php

28 lines
981 B
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
//echo $_GET['id'];
//604800 - неделя
ini_set('memory_limit', '512M');
header( 'Content-Type: text/xml' );
header("Cache-Control: public");
header("Expires: " . date("r", time() + 604800));
ini_set( 'display_errors', 0 );
$smarty -> caching = true;
$smarty -> cache_lifetime = 604800;
$data=date( "Y-m-d" );
$smarty -> assign( 'data', $data );
#читаем карту сайта
$page = ( $_GET['id'] ) ? $_GET['id'] : 1; // текущая страница
$kol = 50000; //количество записей для вывода
$art=($page>0)? ($page * $kol) - $kol : 0;// определяем, с какой записи нам выводить
$total = \DB::getValue ( "SELECT COUNT(*) FROM `sitemap` WHERE `status`=1" );
$link=\DB::getAll("SELECT * FROM `sitemap` WHERE `status`=1 LIMIT $art, $kol");
//print_r($all);
//$link= \DB::getAll( 'SELECT `link` FROM `sitemap` WHERE `status`=1' );
$smarty -> assign( 'link', $link );
?>