} 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);
} 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 {
function changyan_seo_comment($client_id, $sid, $url = null) { $html = ''; $contents = ''; $head = <<<EOT <div id="changyan-comments" style="display:none"> <ol id="comments-list"> EOT; $footer = <<<EOT </ol> </div> EOT; $topic_info = changyan_get_topic_comments($client_id, $sid, $url); if (empty($topic_info['error_code']) && !empty($topic_info['topic_id'])) { $comments_info = changyan_get_comments($client_id, $topic_info['topic_id']); if (empty($comments_info['error_code']) && !empty($comments_info['comments'])) { $comments = $comments_info['comments']; foreach ($comments as $comment) { $contents .= ' <div class="comment">' . iconv("UTF-8", "GB2312", $comment['passport']['nickname']) . ' ˵: '; $contents .= iconv("UTF-8", "GB2312", $comment['content']) . ' </div>'; } } } else { $contents = "»ñÈ¡ÆÀÂÛʧ°Ü"; } $html = $head . $contents . $footer; return $html; }