if ($ppost->getVar('posterid') != $_SESSION['jieqiUserId']) { jieqi_printfail($jieqiLang['system']['ppost_edit_noper']); } jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); if (!isset($_REQUEST['action'])) { $_REQUEST['action'] = 'edit'; } //主题处理相关函数 include_once JIEQI_ROOT_PATH . '/include/funpost.php'; switch ($_REQUEST['action']) { case 'update': //校验错误信息数组 $check_errors = array(); //检查和过滤提交变量 $post_set = array('module' => JIEQI_MODULE_NAME, 'ownerid' => intval($ppost->getVar('ownerid')), 'topicid' => intval($ppost->getVar('topicid')), 'postid' => intval($ppost->getVar('postid')), 'posttime' => intval($ppost->getVar('posttime', 'n')), 'topictitle' => &$_POST['ptitle'], 'posttext' => &$_POST['pcontent'], 'attachment' => '', 'emptytitle' => true, 'isnew' => false, 'istopic' => intval($ppost->getVar('istopic')), 'istop' => 0, 'sname' => 'jieqiSystemParlorTime', 'attachfile' => '', 'oldattach' => '', 'checkcode' => $_POST['checkcode']); jieqi_post_checkvar($post_set, $jieqiConfigs['system'], $check_errors); if (empty($check_errors)) { $oldtitle = $ppost->getVar('subject', 'n'); //更新帖子表 jieqi_post_upedit($post_set, jieqi_dbprefix('system_pposts')); //如果是主题则更新主题表 if ($ppost->getVar('istopic') == 1 && $post_set['topictitle'] != $oldtitle) { jieqi_topic_upedit($post_set, jieqi_dbprefix('system_ptopics')); } jieqi_jumppage(JIEQI_URL . '/ptopicshow.php?tid=' . $ppost->getVar('topicid'), LANG_DO_SUCCESS, $jieqiLang['system']['ppost_edit_success']); } else { jieqi_printfail(implode('<br />', $check_errors)); } break; case 'edit': default:
} //检查发表书评需要积分 if (!empty($jieqiConfigs['article']['reviewneedscore']) && $_SESSION['jieqiUserScore'] < intval($jieqiConfigs['article']['reviewneedscore'])) { jieqi_printfail(sprintf($jieqiLang['article']['review_score_limit'], intval($jieqiConfigs['article']['reviewneedscore']))); } } //主题处理相关函数 include_once JIEQI_ROOT_PATH . '/include/funpost.php'; //发表书评 $addnewreply = 0; if (!empty($_POST['pcontent']) && $enablepost) { //校验错误信息数组 $check_errors = array(); //检查和过滤提交变量 $post_set = array('module' => JIEQI_MODULE_NAME, 'ownerid' => intval($ownerid), 'topicid' => intval($_REQUEST['rid']), 'postid' => 0, 'posttime' => JIEQI_NOW_TIME, 'topictitle' => &$_POST['ptitle'], 'posttext' => &$_POST['pcontent'], 'attachment' => '', 'isnew' => true, 'istopic' => 0, 'istop' => 0, 'sname' => 'jieqiArticleReviewTime', 'attachfile' => '', 'oldattach' => '', 'checkcode' => $_POST['checkcode']); jieqi_post_checkvar($post_set, $jieqiConfigs['article'], $check_errors); if (empty($check_errors)) { include_once $jieqiModules['article']['path'] . '/class/replies.php'; $replies_handler =& JieqiRepliesHandler::getInstance('JieqiRepliesHandler'); $newReply = $replies_handler->create(); jieqi_post_newset($post_set, $newReply); $replies_handler->insert($newReply); $addnewreply = 1; $_REQUEST['page'] = 'last'; //增加书评积分 if (!empty($jieqiConfigs['article']['scorereview'])) { include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); $users_handler->changeScore($_SESSION['jieqiUserId'], $jieqiConfigs['article']['scorereview'], true); } } else {