-
Notifications
You must be signed in to change notification settings - Fork 3
/
google.php
27 lines (26 loc) · 904 Bytes
/
google.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
error_reporting(0);
//error_reporting(2047);
define('M_COM',TRUE);
define('M_ROOT','');
$timestamp = time();
include_once M_ROOT.'./base.inc.php';
include_once M_ROOT.'./include/general.fun.php';
load_cache('sitemaps');
empty($sitemaps['google']) && exit();
$sitemap = $sitemaps['google'];
$cachefile = M_ROOT.'./google.xml';
if(empty($sitemap['setting']['life']) || ($timestamp - @filemtime($cachefile) > $sitemap['setting']['life'] * 3600) || (!$datastr = file2str($cachefile))){
require M_ROOT.'./dynamic/cache/mconfigs.cac.php';
@extract($mconfigs_0);
include_once M_ROOT.'./include/mysql.cls.php';
$db = new cls_mysql;
$db->connect($dbhost,$dbuser,$dbpw,$dbname,$pconnect,true,$dbcharset);
include_once M_ROOT.'./include/common.fun.php';
include_once M_ROOT.'./include/sitemap.inc.php';
str2file($datastr,$cachefile);
}
echo $datastr;
header("Content-type: application/xml");
exit;
?>