Example #1
0
    }
} elseif ($_POST['step'] == 2) {
    InitGP(array('atc_title', 'atc_content'), 'P', 0);
    InitGP(array('replayorder', 'atc_anonymous', 'atc_newrp', 'atc_tags', 'atc_hideatt', 'magicid', 'magicname', 'atc_enhidetype', 'atc_credittype', 'flashatt'), 'P');
    InitGP(array('atc_iconid', 'atc_hide', 'atc_requireenhide', 'atc_rvrc', 'atc_requiresell', 'atc_money', 'atc_usesign', 'atc_html', 'p_type', 'p_sub_type', 'atc_convert', 'atc_autourl'), 'P', 2);
    require_once R_P . 'require/bbscode.php';
    if ($postmodify->type == 'topic') {
        $postdata = new topicPostData($pwpost);
        $postdata->initData($postmodify);
        $postdata->setWtype($p_type, $p_sub_type, $t_per, $t_db, $db_forcetype);
        $postdata->setTags($atc_tags);
        $postdata->setMagic($magicid, $magicname);
        $postdata->setIfmail(0, $atc_newrp);
        $postdata->setStatus('3', decbin($replayorder));
    } else {
        $postdata = new replyPostData($pwpost);
        $postdata->initData($postmodify);
    }
    $postdata->setTitle($atc_title);
    $postdata->setContent($atc_content);
    $postdata->setConvert($atc_convert, $atc_autourl);
    $postdata->setAnonymous($atc_anonymous);
    $postdata->setHideatt($atc_hideatt);
    $postdata->setIconid($atc_iconid);
    $postdata->setIfsign($atc_usesign, $atc_html);
    $postdata->setHide($atc_hide);
    $postdata->setEnhide($atc_requireenhide, $atc_rvrc, $atc_enhidetype);
    $postdata->setSell($atc_requiresell, $atc_money, $atc_credittype);
    if ($special && file_exists(R_P . "lib/special/post_{$special}.class.php")) {
        require_once R_P . "lib/special/post_{$special}.class.php";
        $postSpecial = new postSpecial($pwpost);
Example #2
0
 function sendPost($tid, $uid, $title, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $fid, $timestamp, $pwforum, $pwpost, $_G, $db_uploadfiletype, $uploadcredit, $uploadmoney, $manager, $isBM, $_time;
     $timestamp = time();
     $_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
     list($uid, $tid, $title, $content) = array(intval($uid), intval($tid), trim($title), trim($content));
     if ($uid < 1 || $tid < 1 || !$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);
     }
     $tpcarray = $GLOBALS['db']->get_one("SELECT t.tid,t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.postdate,t.lastpost,t.ifmail,t.special,t.subject,t.type,t.ifshield,t.anonymous,t.ptable,t.replies,t.tpcstatus FROM pw_threads t WHERE t.tid=" . pwEscape($tid));
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($tpcarray['fid']);
     if (!$pwforum->isForum()) {
         return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
     }
     $fid = $tpcarray['fid'];
     $isBM = $pwforum->isBM($windid);
     $isGM = S::inArray($windid, $manager);
     if (!$isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($isBM, 'replylock')) {
         return $this->buildResponse(THREAD_LOCKED);
     }
     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('replypost', 'forum', false);
     $replypost = new replyPost($pwpost);
     $replypost->setTpc($tpcarray);
     $replypost->check();
     $pw_posts = GetPtable($replypost->tpcArr['ptable']);
     $postdata = new replyPostData($pwpost);
     $postdata->setTitle($title);
     $postdata->setContent($content);
     $postdata->conentCheck();
     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->errMessage(THREAD_USER_NOT_RIGHT, $msginfo);
         }
         list($windVersion) = explode(',', WIND_VERSION);
         if ($windVersion && $windVersion < '8.5') {
             $postdata->att->transfer();
             PwUpload::upload($postdata->att);
         }
     }
     $replypost->execute($postdata);
     $pid = $replypost->getNewId();
     return $this->buildResponse(0, array('pid' => $pid));
 }
Example #3
0
     $atc_content = str_replace(array('<', '>', '&nbsp;'), array('&lt;', '&gt;', ' '), $atcdb['content']);
     if (strpos($atc_content, $db_bbsurl) !== false) {
         $atc_content = str_replace('p_w_picpath', $db_picpath, $atc_content);
         $atc_content = str_replace('p_w_upload', $db_attachname, $atc_content);
     }
     $atc_title = $atcdb['subject'];
     require_once PrintEot('ajax');
     ajax_footer();
 } else {
     PostCheck(1, $db_gdcheck & 4 && $winddb['postnum'] < $db_postgd, $winddb['postnum'] < $postq);
     InitGP(array('atc_title', 'atc_content'), 'P', 0);
     require_once R_P . 'require/bbscode.php';
     if ($postmodify->type == 'topic') {
         $postdata = new topicPostData($pwpost);
     } else {
         $postdata = new replyPostData($pwpost);
     }
     $postdata->initData($postmodify);
     $postdata->setTitle($atc_title);
     $postdata->setContent($atc_content);
     $postdata->setConvert(1);
     $postmodify->execute($postdata);
     extract(L::style());
     $aids = array();
     if ($atcdb['attachs']) {
         $aids = attachment($atc_content);
     }
     $leaveword = $atcdb['leaveword'] ? leaveword($atcdb['leaveword']) : '';
     $content = convert($postdata->data['content'] . $leaveword, $db_windpost);
     if (strpos($content, '[p:') !== false || strpos($content, '[s:') !== false) {
         $content = showface($content);
Example #4
0
     wap_msg('reply_ifcheck', $rurl);
 }
 if (!$pwpost->isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($pwpost->isBM, 'replylock')) {
     wap_msg('reply_lockatc', $rurl);
 }
 InitGP(array('subject', 'content'), 'P', 0);
 checkWapPost(0);
 require_once R_P . 'lib/forum/replypost.class.php';
 $replypost = new replyPost($pwpost);
 $replypost->setTpc($tpcarray);
 $replypost->check();
 !empty($pwpost->errMsg) && wap_msg($pwpost->errMsg);
 require_once R_P . 'require/bbscode.php';
 $replypost->setTpc($tpcarray);
 $content = $content . "\r\n\r\n[size=2][color=#a5a5a5]内容来自[/color][color=#4f81bd][url=" . $db_bbsurl . "/m/index.php][手机版][/url][/color] [/size]";
 $postdata = new replyPostData($pwpost);
 $postdata->setTitle(wap_cv($subject, false));
 $postdata->setContent(wap_cv($content, false));
 $postdata->conentCheck();
 $postdata->checkdata();
 !empty($pwpost->errMsg) && wap_msg($pwpost->errMsg);
 $replypost->execute($postdata);
 $pid = $replypost->getNewId();
 pwHook::runHook('after_reply');
 $rurl = "index.php?a=read&tid={$tid}&amp;fid={$fid}&amp;page=e";
 if ($postdata->getIfcheck() == '0') {
     wap_msg("发帖成功,请等待管理员审核", $rurl);
 }
 if ($_POST['upload']) {
     $rurl = "index.php?a=upload&tid={$tid}&fid={$fid}&page=e";
     header("Location:{$rurl}");
Example #5
0
 /**
  * 新增一个回复
  * @param int $tid
  * @param string $content
  */
 function addPost($tid, $content)
 {
     global $timestamp;
     $tpcarray = $this->db->get_one("SELECT tid,fid,locked,subject,ifcheck,postdate,lastpost,ptable,author,replies,type,ifshield,anonymous,tpcstatus FROM pw_threads WHERE tid=" . S::sqlEscape($tid));
     L::loadClass('forum', 'forum', false);
     L::loadClass('post', 'forum', false);
     if ($tpcarray['tid'] != $tid) {
         return false;
     }
     $tpcarray['openIndex'] = getstatus($tpcarray['tpcstatus'], 2);
     $pwforum = new PwForum($tpcarray['fid']);
     $pwpost = new PwPost($pwforum);
     if (!$pwforum->foruminfo['allowrp'] && !$pwpost->admincheck && $GLOBALS['_G']['allowrp'] == 0) {
         return 'reply_group_right';
     } elseif ($pwforum->forumset['lock'] && !$pwpost->isGM && $timestamp - $tpcarray['postdate'] > $pwforum->forumset['lock'] * 86400 && !pwRights($pwpost->isBM, 'replylock')) {
         //$forumset['lock'] = $pwforum->forumset['lock'];
         return 'forum_locked';
     } elseif (!$pwpost->isGM && !$tpcarray['ifcheck'] && !pwRights($pwpost->isBM, 'viewcheck')) {
         return 'reply_ifcheck';
     } elseif (!$pwpost->isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($pwpost->isBM, 'replylock')) {
         return 'reply_lockatc';
     } else {
         L::loadClass('replypost', 'forum', false);
         $replypost = new replyPost($pwpost);
         $replypost->setTpc($tpcarray);
         $pwpost->errMode = true;
         $replypost->check();
         if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
             return $msg;
         }
         require_once R_P . 'require/bbscode.php';
         $postdata = new replyPostData($pwpost);
         //set title
         //$title = '回 楼主(' . $tpcarray['author'].')的帖子';
         //strlen($title) <= intval($postdata->titlemax) && $postdata->setTitle($title);
         $replypost->setTpc($tpcarray);
         $postdata->setContent($content);
         $postdata->conentCheck();
         $replypost->execute($postdata);
         return true;
     }
 }
Example #6
0
         $atc_content = str_replace('p_w_picpath', $db_picpath, $atc_content);
         $atc_content = str_replace('p_w_upload', $db_attachname, $atc_content);
     }
     $atc_title = $atcdb['subject'];
     require_once PrintEot('ajax');
     ajax_footer();
 } else {
     PostCheck(1, $db_gdcheck & 4 && (!$db_postgd || $winddb['postnum'] < $db_postgd), $db_ckquestion & 4 && (!$postq || $winddb['postnum'] < $postq));
     S::gp(array('atc_title', 'atc_content'), 'P', 0);
     require_once R_P . 'require/bbscode.php';
     if ($postmodify->type == 'topic') {
         $postdata = new topicPostData($pwpost);
         $atcdb['special'] && $postdata->setData('special', $atcdb['special']);
     } else {
         $pid = 'tpc';
         $postdata = new replyPostData($pwpost);
     }
     $postdata->initData($postmodify);
     $postdata->setTitle($atc_title);
     $postdata->setContent($atc_content);
     $isKmd && $postdata->setKmdInfo($kmdInfo);
     $postdata->setConvert(1);
     $postdata->setIfcheck();
     $postmodify->execute($postdata);
     extract(L::style());
     $leaveword = $atcdb['leaveword'] ? leaveword($atcdb['leaveword']) : '';
     $content = convert($postdata->data['content'] . $leaveword, $db_windpost);
     if (strpos($content, '[p:') !== false || strpos($content, '[s:') !== false) {
         $content = showface($content);
     }
     if ($atcdb['ifsign'] < 2) {
Example #7
0
     */
    require_once PrintEot('post');
    CloudWind::yunSetCookie(SCR);
    footer();
} elseif ($_POST['step'] == 2) {
    S::gp(array('atc_title', 'atc_content', 'quote_content'), 'P', 0);
    S::gp(array('atc_anonymous', 'atc_hideatt', 'atc_enhidetype', 'atc_credittype', 'flashatt', 'replytouser', '_usernames'), 'P');
    S::gp(array('atc_iconid', 'atc_convert', 'atc_autourl', 'atc_usesign', 'atc_html', 'atc_hide', 'atc_requireenhide', 'atc_rvrc', 'atc_requiresell', 'atc_money', 'go_lastpage'), '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';
    if ($action == 'quote' && $quote_content) {
        $atc_content = $quote_content . $atc_content;
    }
    $postdata = new replyPostData($pwpost);
    $postdata->setTitle($atc_title);
    !$postdata->setContent($atc_content) && Showmsg('post_price_limit');
    $postdata->setConvert($atc_convert, $atc_autourl);
    $postdata->setAnonymous($atc_anonymous);
    $postdata->setHideatt($atc_hideatt);
    $postdata->setIconid($atc_iconid);
    $postdata->setIfsign($atc_usesign, $atc_html);
    $postdata->setHide($atc_hide);
    $postdata->setEnhide($atc_requireenhide, $atc_rvrc, $atc_enhidetype);
    $postdata->setSell($atc_requiresell, $atc_money, $atc_credittype);
    $postdata->setAtUsers($_usernames);
    //$replypost->checkdata();
    $postdata->conentCheck();
    L::loadClass('attupload', 'upload', false);
    /*上传错误检查
Example #8
0
$pwpost = new PwPost($pwforum);
$returnedit = "index.php?a=upload&tid={$tid}&fid={$fid}&page=e";
$pwpost->errMode = true;
$pwpost->forumcheck();
!empty($pwpost->errMsg) && wap_msg($pwpost->errMsg, $returnedit);
$pwpost->postcheck();
!empty($pwpost->errMsg) && wap_msg($pwpost->errMsg, $returnedit);
require_once R_P . 'lib/forum/postmodify.class.php';
require_once R_P . 'require/bbscode.php';
$postmodify = new topicModify($tid, 0, $pwpost);
$postmodify->init();
if ($postmodify->type == 'topic') {
    $postdata = new topicPostData($pwpost);
    $postdata->initData($postmodify);
} else {
    $postdata = new replyPostData($pwpost);
    $postdata->initData($postmodify);
}
//获得附件信息
if ($postmodify->hasAtt()) {
    $atthtml = '';
    $attachs = $postmodify->atcdb['attachs'];
    foreach ($attachs as $key => $var) {
        $atthtml .= '<label><input type="checkbox" name="keep' . $key . '" value="' . $key . '" checked />' . $var['name'] . '<label><br/>';
    }
}
if ($step == 2) {
    list($uploadcredit, $uploadmoney, , ) = explode("\t", $pwforum->forumset['uploadset']);
    //处理旧附件删除
    if ($postmodify->hasAtt() && is_array($attachs)) {
        $keep = array();
Example #9
0
 function reply($tid, $author, $title, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $timestamp, $pwforum, $pwpost;
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
     $winddb = $userService->getByUserName($author, true, true);
     if (empty($winddb)) {
         return new ApiResponse('API_THREAD_AUTHOR_NOT_EXISTS');
         //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 ($groupid == 6 || getstatus($winddb['userstatus'], PW_USERSTATUS_BANUSER)) {
         //会员禁言
         return new ApiResponse('API_THREAD_THE_USER_BAN');
     }
     $tpcarray = $this->db->get_one("SELECT t.tid,t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.postdate,t.lastpost,t.ifmail,t.special,t.subject,t.type,t.ifshield,t.anonymous,t.ptable,t.replies,t.tpcstatus FROM pw_threads t WHERE t.tid=" . pwEscape($tid));
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($tpcarray['fid']);
     if (!$pwforum->isForum()) {
         return new ApiResponse('THREAD_FORUM_NOT_EXIST');
     }
     L::loadClass('post', 'forum', false);
     require_once R_P . 'require/bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     $pwpost->forumcheck();
     $pwpost->postcheck();
     L::loadClass('replypost', 'forum', false);
     $replypost = new replyPost($pwpost);
     $replypost->setTpc($tpcarray);
     $replypost->check();
     $postdata = new replyPostData($pwpost);
     $postdata->setTitle($title);
     $postdata->setContent($content);
     $postdata->conentCheck();
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         return new ApiResponse('THREAD_SYSTEM_ERROR');
     }
     $replypost->execute($postdata);
     $pid = $replypost->getNewId();
     return new ApiResponse($pid);
 }
Example #10
0
 if ($postmodify->type == 'topic') {
     $postdata = new topicPostData($pwpost);
     $postdata->initData($postmodify);
     $postdata->setWtype($p_type, $p_sub_type, $t_per, $t_db, $db_forcetype);
     $postdata->setTags($atc_tags);
     $postdata->setMagic($magicid, $magicname);
     $postdata->setIfmail($atc_email, $atc_newrp);
     if ($replayorder == 1) {
         $postdata->setStatus('3', '01');
     } elseif ($replayorder == 2) {
         $postdata->setStatus('3', '10');
     } else {
         $postdata->setStatus('3', '00');
     }
 } else {
     $postdata = new replyPostData($pwpost);
     $postdata->initData($postmodify);
 }
 $postdata->setTitle($atc_title);
 !$postdata->setContent($atc_content) && Showmsg('post_price_limit');
 $postdata->setConvert($atc_convert, $atc_autourl);
 $postdata->setAnonymous($atc_anonymous);
 $isAttachOpen && $postdata->setHideatt($atc_hideatt);
 $postdata->setIconid($atc_iconid);
 $postdata->setIfsign($atc_usesign, $atc_html);
 $postdata->setHide($atc_hide);
 $postdata->setEnhide($atc_requireenhide, $atc_rvrc, $atc_enhidetype);
 $postdata->setSell($atc_requiresell, $atc_money, $atc_credittype);
 $postdata->setAtUsers($_usernames);
 if ($atcdb['specialsort'] == PW_THREADSPECIALSORT_KMD && $postmodify->type == 'topic' && $winduid == $atcdb['authorid']) {
     $kmdService = L::loadClass('KmdService', 'forum');