if (++$n % 50 === 0) {
$db_tmp->ReConnect(false, $setting['db']['name']);
}
}
$db_tmp->delete($setting['db']['pre_sub'] . "news_tag", array(array("count", "n<", 2), array("click", "n<", 5, "and"), array("add_date", "f<", "UNIX_TIMESTAMP()-60*60*24*10", "and")));
$db->Free();
$n = 1;
$db->select($setting['db']['pre_sub'] . "news_tag", "id, tag");
while ($record = $db->GetRS()) {
$counter = $db_tmp->result($setting['db']['pre_sub'] . "news_show", "count(*)", array("tag", "like", $record['tag']));
$db_tmp->update($setting['db']['pre_sub'] . "news_tag", array("count" => $counter), array("id", "n=", $record['id']));
if (++$n % 50 === 0) {
$db_tmp->ReConnect(false, $setting['db']['name']);
}
}
$db_tmp->Close();
unset($db_tmp);
break;
default:
break;
}
if (!empty($log_info)) {
write_log($log_info, "id={$id}");
$goto_url = $setting['info']['self'] . "?web_id=" . $web_id;
}
$mystep->pageEnd(false);
function build_page($method)
{
global $mystep, $req, $db, $tpl, $tpl_info, $setting, $id, $web_id, $setting_sub;
$tpl_info['idx'] = "art_tag";
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);