<?php

	if (@$_GET['job'] != $websitejob){
		die ('Parameter error!');
	}

	require '../siteinfo.php';
	$date = date('Y-m-d');
	$code = '
<?xml version="1.0" encoding="UTF-8"?>
<urlset
    xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
       http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">	

  <url>
    <loc>'.$WebSite_Url.'index.php</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=password_get</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=reg</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=login</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=search</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=support</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=about</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=wall</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=top</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=Anumet</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>
  <url>
    <loc>'.$WebSite_Url.'index.php?act=yl</loc>
	<priority>1.0</priority>
	<lastmod>'.$date.'</lastmod>
	<changefreq>hourly</changefreq>
  </url>';


	//连接数据库
	$localhost = mysql_connect($sqlhost,$sqluser,$sqlpass)or die('无法连接数据库，请联系网站管理员！');
	mysql_select_db ($sqldata,$localhost);
	//循环生成代码
	$sql = mysql_query('select * from `qqlist` where `qq` order by `id` ASC limit 0,1000000');
	while($row = mysql_fetch_array ($sql)){
	$code .= <<<HTML
  <url>
    <loc>{$WebSite_Url}QQ-{$row['qq']}.html</loc>
	<priority>1.0</priority>
	<lastmod>{$date}</lastmod>
	<changefreq>hourly</changefreq>
  </url>
HTML;
}
	$code .= '
</urlset>';

	file_put_contents ('../sitemap.xml',$code);

	echo 'Treatment success!';

