示例#1
0
    require_once PrintEot('post');
    CloudWind::yunSetCookie(SCR);
    footer();
} elseif ($_POST['step'] == 2) {
    S::gp(array('atc_title', 'atc_content'), 'P', 0);
    S::gp(array('replayorder', 'atc_anonymous', 'atc_newrp', 'atc_tags', 'atc_hideatt', 'magicid', 'magicname', 'atc_enhidetype', 'atc_credittype', 'flashatt', 'buildIfcheck', 'robstarttime', 'robendtime', 'robendbuild', 'robawardbuilds', '_usernames', 'replyrewardcredit'), 'P');
    S::gp(array('atc_iconid', 'atc_email', 'digest', 'topped', 'atc_hide', 'atc_requireenhide', 'atc_rvrc', 'atc_requiresell', 'atc_money', 'atc_usesign', 'atc_html', 'p_type', 'p_sub_type', 'atc_convert', 'atc_autourl', 'replyreward'), 'P', 2);
    S::gp(array('iscontinue'), 'P');
    //ajax提交时有敏感词时显示是否继续
    $db_sellset['price'] && (int) $atc_money > $db_sellset['price'] && Showmsg('post_price_limit');
    require_once R_P . 'require/bbscode.php';
    $postdata = new topicPostData($pwpost);
    $replayorder = $replayorder == 1 || $replayorder == 2 ? $replayorder : 0;
    $postdata->setStatus('3', decbin($replayorder));
    $postdata->setWtype($p_type, $p_sub_type, $t_per, $t_db, $db_forcetype);
    $postdata->setTitle($atc_title);
    !$postdata->setContent($atc_content) && Showmsg('post_price_limit');
    $postdata->setConvert($atc_convert, $atc_autourl);
    $postdata->setTags($atc_tags);
    $postdata->setAnonymous($atc_anonymous);
    $postdata->setHideatt($atc_hideatt);
    $postdata->setIfmail($atc_email, $atc_newrp);
    $postdata->setDigest($digest);
    $postdata->setTopped($topped);
    $postdata->setIconid($atc_iconid);
    $postdata->setIfsign($atc_usesign, $atc_html);
    $postdata->setMagic($magicid, $magicname);
    $postdata->setHide($atc_hide);
    $postdata->setEnhide($atc_requireenhide, $atc_rvrc, $atc_enhidetype);
    $postdata->setSell($atc_requiresell, $atc_money, $atc_credittype);
    //$newpost->checkdata();
示例#2
0
 function postModify($tid, $fid, $uid, $title, $content, $tags = '', $convert = 1, $usesign = 1, $usehtml = 0, $topped = 0, $digest = 0, $p_type = '', $p_sub_type = '')
 {
     global $winddb, $winduid, $windid, $groupid, $_G, $SYSTEM, $timestamp;
     require_once R_P . 'lib/forum.class.php';
     $pwforum = new PwForum($fid);
     if (!$pwforum->isForum()) {
         return new ErrorMsg(API_THREAD_FORUM_NOT_EXISTS, 'Forum not exists');
     }
     $winddb = $this->db->get_one("SELECT m.uid,m.username,m.password,m.safecv,m.email,m.oicq,m.groupid,m.memberid,m.groups,m.icon,m.regdate,m.honor,m.timedf,m.style,m.datefm,m.t_num,m.p_num,m.yz,m.newpm,m.userstatus,m.shortcut,md.postnum,md.rvrc,md.money,md.credit,md.currency,md.lastvisit,md.thisvisit,md.onlinetime,md.lastpost,md.todaypost,md.monthpost,md.onlineip,md.uploadtime,md.uploadnum,md.starttime,md.pwdctime,md.monoltime,md.digests,md.f_num,md.creditpop FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid WHERE m.uid=" . pwEscape($uid));
     if (empty($winddb)) {
         return new ErrorMsg(API_THREAD_AUTHOR_NOT_EXISTS, 'User not exists');
     }
     $winduid = $winddb['uid'];
     $groupid = $winddb['groupid'];
     $windid = $winddb['username'];
     $groupid == '-1' && ($groupid = $winddb['memberid']);
     if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) {
         include Pcv(D_P . "data/groupdb/group_{$groupid}.php");
     } else {
         include D_P . 'data/groupdb/group_1.php';
     }
     require_once R_P . 'lib/post.class.php';
     require_once R_P . 'require/bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     require_once R_P . 'lib/postmodify.class.php';
     $postmodify = new topicModify($tid, 0, $pwpost);
     $atcdb = $postmodify->init();
     if (empty($atcdb) || $atcdb['fid'] != $fid) {
         return new ErrorMsg(API_THREAD_ILLEGAL_TID, 'The tid is illegal');
     }
     if ($winduid != $atcdb['authorid'] && $groupid != 3 && $groupid != 4) {
         $authordb = $this->db->get_one("SELECT groupid FROM pw_members WHERE uid=" . pwEscape($atcdb['authorid']));
         if ($authordb['groupid'] == 3 || $authordb['groupid'] == 4) {
             return new ErrorMsg(API_THREAD_MODIFY_ADMIN, 'The tid is not modify');
         }
     }
     if ($_G['edittime'] && $timestamp - $atcdb['postdate'] > $_G['edittime'] * 60) {
         return new ErrorMsg(API_THREAD_MODIFY_TIMELIMIT, 'The modify time limit');
     }
     $postdata = new topicPostData($pwpost);
     include_once D_P . 'data/bbscache/cache_post.php';
     $t_db = $topic_type_cache[$fid];
     $postdata->setWtype($p_type, $p_sub_type, 0, $t_db);
     $postdata->initData($postmodify);
     $postdata->setTitle($title);
     $postdata->setContent($content);
     $postdata->setConvert($convert, 1);
     $postdata->setTags($tags);
     $postdata->setDigest($digest);
     $postdata->setTopped($topped);
     $postdata->setIfsign($usesign, $usehtml);
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         $errmsg = $this->getErrMsg($msg);
         return new ErrorMsg($errmsg[0], $errmsg[1]);
     }
     $postmodify->execute($postdata);
     return new ApiResponse(true);
 }
 function postThread($uid, $fid, $subject, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $_G, $timestamp, $pwforum, $pwpost, $uploadcredit, $uploadmoney, $db_uploadfiletype, $_time;
     $timestamp = time();
     $_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
     list($uid, $fid, $subject, $content) = array(intval($uid), intval($fid), trim($subject), trim($content));
     if ($uid < 1 || $fid < 1 || !$subject || !$content) {
         return $this->buildResponse(THREAD_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
         return $this->buildResponse(THREAD_USER_NOT_RIGHT);
     }
     $user->initRight();
     $winduid = $user->uid;
     $groupid = $user->groupid;
     $windid = $user->username;
     $winddb = $user->info;
     $_G = $user->_G;
     if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
         return $this->buildResponse(POST_GP_LIMIT);
     }
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($fid);
     if (!$pwforum->isForum()) {
         return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
     }
     list($uploadcredit, $uploadmoney, , ) = explode("\t", $pwforum->forumset['uploadset']);
     L::loadClass('post', 'forum', false);
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     $pwpost->forumcheck();
     $pwpost->postcheck();
     L::loadClass('topicpost', 'forum', false);
     $topicpost = new topicPost($pwpost);
     $topicpost->check();
     $postdata = new topicPostData($pwpost);
     $postdata->setWtype('', '', $pwforum->foruminfo['t_type'], $pwforum->foruminfo['topictype']);
     $postdata->setTitle($subject);
     $postdata->setContent($content);
     $postdata->setConvert(1, 1);
     $postdata->setTags('');
     $postdata->setDigest('');
     $postdata->setTopped('');
     $postdata->setIfsign(1, 0);
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
     }
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
     if (PwUpload::getUploadNum()) {
         $_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
         $db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
         $postdata->att = new AttUpload($user->uid);
         $return = $postdata->att->check();
         if ($return) {
             $msginfo = getLangInfo('msg', $return);
             return $this->buildResponse(THREAD_USER_NOT_RIGHT);
         }
         list($windVersion) = explode(',', WIND_VERSION);
         if ($windVersion && $windVersion < '8.5') {
             PwUpload::upload($postdata->att);
             $postdata->att->transfer();
         }
     }
     $topicpost->execute($postdata);
     $tid = $topicpost->getNewId();
     return $this->buildResponse(0, array('tid' => $tid));
 }
示例#4
0
     }
 }
 if (empty($step)) {
     $template = 'threadmodify';
 } elseif ($step == '2') {
     if (!is_numeric($fid)) {
         wap_msg("post_nofid!", $basename);
     }
     InitGP(array('subject', 'content'), 'GP');
     checkWapPost();
     require_once R_P . 'require/bbscode.php';
     if ($postmodify->type == 'topic') {
         $postdata = new topicPostData($pwpost);
         $postdata->initData($postmodify);
     }
     $postdata->setTitle(wap_cv($subject, false));
     $postdata->setContent(wap_cv($content, false));
     $postdata->checkdata();
     !empty($pwpost->errMsg) && wap_msg($pwpost->errMsg, $basename);
     $postmodify->execute($postdata);
     $rurl = "index.php?a=read&tid=" . $tid;
     if ($_POST['upload']) {
         $rurl = "index.php?a=upload&tid={$tid}&fid={$fid}&page=e";
         header("Location:{$rurl}");
     }
     /*删除缓存*/
     $_filename = D_P . "data/wapcache/wap_all_cache.php";
     if (file_exists($_filename)) {
         P_unlink($_filename);
     }
     $_filename = Pcv(D_P . "data/wapcache/wap_" . $fid . "_cache.php");
示例#5
0
 function postModify($tid, $fid, $uid, $title, $content, $tags = '', $convert = 1, $usesign = 1, $usehtml = 0, $topped = 0, $digest = 0, $p_type = '', $p_sub_type = '')
 {
     global $winddb, $winduid, $windid, $groupid, $_G, $SYSTEM, $timestamp;
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($fid);
     if (!$pwforum->isForum()) {
         return new ErrorMsg(API_THREAD_FORUM_NOT_EXISTS, 'Forum not exists');
     }
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
     $winddb = $userService->get($uid, true, true);
     if (empty($winddb)) {
         return new ErrorMsg(API_THREAD_AUTHOR_NOT_EXISTS, 'User not exists');
     }
     $winduid = $winddb['uid'];
     $groupid = $winddb['groupid'];
     $windid = $winddb['username'];
     $groupid == '-1' && ($groupid = $winddb['memberid']);
     if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) {
         //* include pwCache::getPath(S::escapePath(D_P."data/groupdb/group_$groupid.php"));
         extract(pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php", false)));
     } else {
         //* include pwCache::getPath(D_P.'data/groupdb/group_1.php');
         extract(pwCache::getData(D_P . 'data/groupdb/group_1.php', false));
     }
     L::loadClass('post', 'forum', false);
     require_once R_P . 'require/bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     L::loadClass('postmodify', 'forum', false);
     $postmodify = new topicModify($tid, 0, $pwpost);
     $atcdb = $postmodify->init();
     if (empty($atcdb) || $atcdb['fid'] != $fid) {
         return new ErrorMsg(API_THREAD_ILLEGAL_TID, 'The tid is illegal');
     }
     if ($winduid != $atcdb['authorid'] && $groupid != 3 && $groupid != 4) {
         $authordb = $userService->get($atcdb['authorid']);
         /**Begin modify by liaohu*/
         $pce_arr = explode(",", $GLOBALS['SYSTEM']['tcanedit']);
         if (($authordb['groupid'] == 3 || $authordb['groupid'] == 4 || $authordb['groupid'] == 5) && !in_array($authordb['groupid'], $pce_arr)) {
             return new ErrorMsg(API_THREAD_MODIFY_ADMIN, 'The tid is not modify');
         }
         /*if (($authordb['groupid'] == 3 || $authordb['groupid'] == 4)) {
         			return new ErrorMsg(API_THREAD_MODIFY_ADMIN, 'The tid is not modify');
         		}*/
         /**End modify by liaohu*/
     }
     if ($_G['edittime'] && $timestamp - $atcdb['postdate'] > $_G['edittime'] * 60) {
         return new ErrorMsg(API_THREAD_MODIFY_TIMELIMIT, 'The modify time limit');
     }
     $postdata = new topicPostData($pwpost);
     //* include_once pwCache::getPath(D_P.'data/bbscache/cache_post.php');
     extract(pwCache::getData(D_P . 'data/bbscache/cache_post.php', false));
     $t_db = $topic_type_cache[$fid];
     $postdata->setWtype($p_type, $p_sub_type, 0, $t_db);
     $postdata->initData($postmodify);
     $postdata->setTitle($title);
     $postdata->setContent($content);
     $postdata->setConvert($convert, 1);
     $postdata->setTags($tags);
     $postdata->setDigest($digest);
     $postdata->setTopped($topped);
     $postdata->setIfsign($usesign, $usehtml);
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         $errmsg = $this->getErrMsg($msg);
         return new ErrorMsg($errmsg[0], $errmsg[1]);
     }
     $postmodify->execute($postdata);
     return new ApiResponse(true);
 }