Exemplo n.º 1
0
function CountPostArray($array)
{
    global $zbp;
    $array = array_unique($array);
    foreach ($array as $value) {
        if ($value == 0) {
            continue;
        }
        $article = new Post();
        $article->LoadInfoByID($value);
        CountPost($article);
        $article->Save();
    }
}
Exemplo n.º 2
0
/**
 * 批量统计指定文章下评论数并保存
 * @param array $array 记录文章ID的数组
 * @param int $plus 控制是否要进行全表扫描
 */
function CountPostArray($array, $plus = null)
{
    global $zbp;
    $array = array_unique($array);
    foreach ($array as $value) {
        if ($value == 0) {
            continue;
        }
        $article = $zbp->GetPostByID($value);
        if ($article->ID > 0) {
            CountPost($article, $plus);
            $article->Save();
        }
    }
}