function getArchiveTitle($aid = 0){
	$aid = intval($aid);
	if($aid){
		$archive = new archive();
		$row = $archive->getrow($aid,'1 DESC','title');
		return $row['title'];
	}
	return '';
}
 function delete_before($id) {
     $arc = new archive();
     $info = $arc->getrow($id);
     $attachment = new attachment();
     $res = $attachment->getrows(array("aid"=>$id));
     if(is_array($res) && !empty($res)){
     	foreach($res as $v){
     		@unlink($v['path']);
     	}
     }
     
     if(category::getarcishtml($info)) {
         $path=ROOT.preg_replace("%".THIS_URL."[\\/]%",'',archive::url($info));
         if(file_exists($path)) unlink($path);
     }
     
 }