Exemple #1
0
            $s_step = $postIndexDB->deletePostIndex($tids[$index], $s_step);
            $next = $s_step ? $step : $step + 1;
        }
        if ($next) {
            $tids = implode(',', $tids);
            $j_url = "{$basename}&action=delete&step={$next}&s_step={$s_step}&tids={$tids}";
            adminmsg('updatecache_total_step', EncodeUrl($j_url));
        } else {
            adminmsg("operate_success");
        }
    }
} else {
    InitGP(array('replies', 'page', 'tid'), 'GP');
    if ($action == "search") {
        if ($tid) {
            $threads = $postIndexDB->getThreadsById($tid);
        } else {
            $threads = $postIndexDB->getThreadsByReplies($replies, $page);
        }
    } elseif ($action == "update") {
        InitGP(array('threads'), 'GP');
        if (!is_array($threads)) {
            $threads = explode(',', $threads);
        }
        InitGP(array('step', 't_step'), 'GP');
        !$step && ($step = 1);
        !$t_step && ($t_step = 1);
        $index = $step - 1;
        $total = count($threads);
        if ($total > $index) {
            $t_step = $postIndexDB->addPostIndex($threads[$index], $t_step);