<?php
class sitemap{
	var $set_dir = '';
	function sitemap(){
		$this->set_dir = R_P . "/attachment/sitemap/";
		qbase::createdir($this->set_dir );
	}
	function get_table($channelid){
		global $channel,$_MODULE;
		$channelselect = $channel[$channelid]['channelselect'];
		return isset($_MODULE[$channelselect]) ? "".TABLEPRE."" . $_MODULE[$channelselect]['table_name'] . "_" . $channelid : false;
	}
	function clear($name){
		$dir = glob($this->set_dir . $name ."-open-*.xml");
		if($dir === false) return;
		foreach($dir as $name){
			@unlink($name);
		}
		@unlink($this->set_dir . $name ."-open.xml");
		clearstatcache();
	}
	function specialchars($url){
		return str_replace("&", "&amp;", $url);
	}
}
?>