示例#1
0
function PruneNews()
{
    $story = new NewsStory();
    $timestamp = intval($_POST['prune_date']);
    $expired = intval($_POST['expired']);
    $topiclist = "";
    if (isset($_POST['pruned_topics'])) {
        $topiclist = $_POST['pruned_topics'];
    }
    if (intval($_POST['ok']) == 1) {
        $story = new NewsStory();
        xoops_cp_header();
        $count = $story->GetCountStoriesPublishedBefore($timestamp, $expired, $topiclist);
        $msg = sprintf(_AM_NEWS_PRUNE_DELETED, $count);
        $story->DeleteBeforeDate($timestamp, $expired, $topiclist);
        unset($story);
        updateCache();
        redirect_header('index.php', 3, $msg);
    }
}