示例#1
0
    } else {
        $start_date = date('Y-m-d H:i:s', $last_export);
    }
    //$start_date='2014-01-01 00:00:00';
    $recent = changyan_get_recent($client_id, $start_date);
    //var_dump($recent);exit;
    if (count($recent['topics']) <= 0) {
        ShowMsg("没有发现新的评论内容需要导出!", -1);
        exit;
    }
    $exports = array();
    foreach ($recent['topics'] as $topic) {
        $exports[] = array('topic_id' => $topic['topic_id'], 'aid' => $topic['topic_source_id'], 'title' => $topic['topic_title']);
    }
    foreach ($exports as $export) {
        changyan_insert_comments(changyan_get_comments(changyan_get_setting('appid'), $export['topic_id']), $export['aid'], $export['title']);
    }
    changyan_set_setting('last_export', time());
    ShowMsg("成功备份畅言评论到DedeCMS系统!", "?dopost=import");
    exit;
} elseif ($dopost == 'checkupdate') {
    ShowMsg("<p>当前为最新版本,无须下载更新!</p> <p><a href='?' >返回上一页</a></p>", "javascript:;");
    exit;
} elseif ($dopost == 'clearcache') {
    changyan_clearcache();
    ShowMsg("成功清空标签缓存!", "?");
    exit;
} elseif ($dopost == 'forget-pwd') {
    ShowMsg("<p> 如果您忘记了畅言密码 </p> <p><a href='http://www.kuaizhan.com/passport/forget-pwd?refer=http://changyan.kuaizhan.com/audit/comments/TOAUDIT/1' >点击这里找回</a></p>", "javascript:;");
    exit;
} else {
    } else {
        $start_date = date('Y-m-d H:i:s', $last_export);
    }
    //$start_date='2014-01-01 00:00:00';
    $recent = changyan_get_recent($client_id, $start_date);
    //var_dump($recent);exit;
    if (count($recent['topics']) <= 0) {
        ShowMsg("没有发现新的评论内容需要导出!", -1);
        exit;
    }
    $exports = array();
    foreach ($recent['topics'] as $topic) {
        $exports[] = array('topic_id' => $topic['topic_id'], 'aid' => $topic['topic_source_id'], 'title' => $topic['topic_title']);
    }
    foreach ($exports as $export) {
        changyan_insert_comments(changyan_get_comments($export['topic_id']), $export['aid'], $export['title']);
    }
    changyan_set_setting('last_export', time());
    ShowMsg("成功备份畅言评论到DedeCMS系统!", "?dopost=import");
    exit;
} elseif ($dopost == 'change_appinfo') {
    if ($action == 'do') {
        if (empty($appInfo)) {
            ShowMsg("请选择正确的AppID信息!", -1);
            exit;
        }
        list($appid, $isv_app_key) = explode('|', $appInfo);
        changyan_set_setting('appid', $appid);
        changyan_set_setting('isv_app_key', $isv_app_key);
        $user = changyan_get_setting('user');
        $sign = changyan_gen_sign($user);