<div class="codetitle"><a style="CURSOR: pointer" data="17385" class="copybut" id="copybut17385" onclick="doCopy('code17385')"> 代码如下:@H_404_1@<div class="codebody" id="code17385">
//– 删除一篇文章生成的多个静态页面
//– 生成的文章名为 5.html 5_2.html 5_3.html
/—————————————————— /
function delStaticHtml ($article_id)
{
global $db;
$sql = “SELECT post_time
FROM @__article
WHERE article_id
= ‘{$article_id}'”;
$art = $db->getOne ($sql);
if ($art)
{
$n = 1;
$html_dir = ‘../html/'.date(‘Ym',$art['post_time']).'/';
$filename = $html_dir.$article_id.'.html';
while (file_exists($filename))
{
@unlink($filename);
$n++;
$filename = $html_dir.$articleid.''.$n.'.html';
}
}
return false;
}
@H_404_1@