class html
{
var $dir; //dir for the htmls(without/)
var $rootdir; //root of html files(without/):html
var $name; //html file storage path
var $dirname; //Specified folder name
var $url; //Get the source web address of html file information
var $time; //Time to fill in html file information
var $dirtype; //Directory storage method: year, month,,,,
var $nametype; //html file naming method: name
function html($nametype='name',$dirtype='year',$rootdir='html')
function setvar($nametype='name',$dirtype='year',$rootdir='html')
function createdir($dir='')
{
$this->dir=$dir?$dir:$this->dir;
if (!is_dir($this->dir))
{
$temp = explode('/',$this->dir);
$cur_dir = '';
for($i=0;$i {
$cur_dir .= $temp[$i].'/';
if (!is_dir($cur_dir))
}
}
}
function getdir($dirname='',$time=0)
{
$this->time=$time?$time:$this->time;
$this->dirname=$dirname?$dirname:$this->dirname;
switch($this->dirtype)
{
case 'name':
if(empty($this->dirname))
$this->dir=$this->rootdir;
else
$this->dir=$this->rootdir.'/'.$this->dirname;
break;
case 'year':
$this->dir=$this->rootdir.'/'.date("Y",$this->time);
break;
case 'month':
$this->dir=$this->rootdir.'/'.date("Y-m",$this->time);
break;
case 'day':
$this->dir=$this->rootdir.'/'.date("Y-m-d",$this->time);
break;
}
$this->createdir();