private function _commentReply($res, $data)
 {
     global $_G;
     require DISCUZ_ROOT . './source/function/function_home.php';
     require_once libfile('function/portalcp');
     // 在DISCUZ_ROOT/source/include/portalcp/portalcp_comment.php基础上二次开发
     if (!checkperm('allowcommentarticle')) {
         return $this->makeErrorInfo($res, 'group_nopermission', array('{grouptitle}' => $_G['group']['grouptitle']), array('login' => 1));
     }
     switch ($data['idType']) {
         case 'aid':
             $_POST['aid'] = $data['id'];
             break;
         case 'tid':
             $_POST['topicid'] = $data['id'];
             break;
         default:
             return $this->makeErrorInfo($res, 'mobcent_error_params');
     }
     $id = 0;
     $idtype = '';
     if (!empty($_POST['aid'])) {
         $id = intval($_POST['aid']);
         $idtype = 'aid';
     } elseif (!empty($_POST['topicid'])) {
         $id = intval($_POST['topicid']);
         $idtype = 'topicid';
     }
     // 获取评论内容
     $_POST['message'] = $commentText = '';
     foreach ($data['content'] as $line) {
         $line['type'] = $this->_transCommentType($line['type']);
         // 引用评论
         if (isset($data['quoteCommentId']) && $data['quoteCommentId'] > 0) {
             $quoteComment = DzPortalComment::getCommentById($data['quoteCommentId']);
             if (!empty($quoteComment)) {
                 $commentText .= $this->_getCommentMessage($quoteComment);
             }
         }
         if ($line['type'] == 'text') {
             $line['infor'] = rawurldecode($line['infor']);
             $commentText .= WebUtils::t($line['infor']);
         }
     }
     $_POST['message'] = $commentText;
     $message = $_POST['message'];
     require_once libfile('function/spacecp');
     if (($checkMessage = mobcent_cknewuser()) != '') {
         return $this->makeErrorInfo($res, WebUtils::emptyHtml($checkMessage));
     }
     $waittime = interval_check('post');
     if ($waittime > 0) {
         return $this->makeErrorInfo($res, 'operating_too_fast', array('{waittime}' => $waittime), array('return' => true));
     }
     $retmessage = addportalarticlecomment($id, $message, $idtype);
     return $this->makeErrorInfo($res, $retmessage, array('noError' => $retmessage == 'do_success' ? 1 : 0));
 }
Beispiel #2
0
    $folder = $_G['gp_folder'] == 'inbox' ? 'inbox' : 'outbox';
    if (submitcheck('deletesubmit')) {
        if ($deluid) {
            $retrun = uc_pm_deleteuser($_G['uid'], array($deluid));
            $pmid = $deluid;
        } else {
            $retrun = uc_pm_delete($_G['uid'], $folder, array($pmid));
        }
        if ($retrun > 0) {
            showmessage('do_success', dreferer(), array('pmid' => $pmid), array('showdialog' => 1, 'showmsg' => true, 'closetime' => 1));
        } else {
            showmessage('this_message_could_not_be_deleted');
        }
    }
} elseif ($_GET['op'] == 'send') {
    $waittime = interval_check('post');
    if ($waittime > 0) {
        showmessage('operating_too_fast', '', 1, array($waittime));
    }
    cknewuser();
    if ($touid) {
        if (isblacklist($touid)) {
            showmessage('is_blacklist');
        }
    }
    if (submitcheck('pmsubmit')) {
        checklowerlimit('sendpm');
        $username = empty($_POST['username']) ? '' : $_POST['username'];
        $message = (!empty($_POST['messageappend']) ? $_POST['messageappend'] . "\n" : '') . trim($_POST['message']);
        if (empty($message)) {
            showmessage('unable_to_send_air_news');
Beispiel #3
0
/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: network_thread.php 10953 2009-01-12 02:55:37Z liguode $
*/
if (!defined('IN_UCHOME')) {
    exit('Access Denied');
}
@(include_once S_ROOT . './data/data_profield.php');
//初始化
$gets = $list = array();
$multi = '';
if (!empty($_GET['searchmode'])) {
    //需要登录
    checklogin();
    //判断是否搜索太快
    $waittime = interval_check('search');
    if ($waittime > 0) {
        showmessage('search_short_interval');
    }
    $gets['key'] = empty($_GET['key']) ? '' : (stripsearchkey($_GET['key']) ? $_GET['key'] : '');
    $gets['tagid'] = empty($_GET['tagid']) ? '' : intval($_GET['tagid']);
    $gets['username'] = empty($_GET['username']) ? '' : (stripsearchkey($_GET['username']) ? $_GET['username'] : '');
    $_GET['starttime'] = empty($_GET['starttime']) ? '' : sstrtotime($_GET['starttime']);
    if ($_GET['starttime']) {
        $gets['starttime'] = sgmdate('Y-m-d', $_GET['starttime']);
    }
    $_GET['endtime'] = empty($_GET['endtime']) ? '' : sstrtotime($_GET['endtime']);
    if ($_GET['endtime']) {
        $gets['endtime'] = sgmdate('Y-m-d', $_GET['endtime']);
    }
    if ($gets['endtime'] && $gets['endtime'] <= $gets['starttime']) {
Beispiel #4
0
 private function _pmSend($res, $data)
 {
     global $_G;
     $touid = (int) $data['toUid'];
     $pmid = (int) $data['pmid'];
     $_GET['topmuid'] = $touid;
     $_POST['message'] = $this->_transMessage($data['msg']);
     $_POST['subject'] = '';
     $users = array();
     $type = 0;
     $waittime = interval_check('post');
     if ($waittime > 0) {
         // showmessage('message_can_not_send_2', '', array(), array('return' => true));
         return $this->makeErrorInfo($res, lang('message', 'message_can_not_send_2'));
     }
     if (($checkMessage = mobcent_cknewuser()) != '') {
         return $this->makeErrorInfo($res, WebUtils::emptyHtml($checkMessage));
     }
     if (!checkperm('allowsendpm')) {
         // showmessage('no_privilege_sendpm', '', array(), array('return' => true));
         return $this->makeErrorInfo($res, 'no_privilege_sendpm');
     }
     if ($touid) {
         if (isblacklist($touid)) {
             // showmessage('is_blacklist', '', array(), array('return' => true));
             return $this->makeErrorInfo($res, lang('message', 'is_blacklist'));
         }
     }
     // !($_G['group']['exempt'] & 1) && checklowerlimit('sendpm', 0, $coef);
     $message = (!empty($_POST['messageappend']) ? $_POST['messageappend'] . "\n" : '') . trim($_POST['message']);
     if (empty($message)) {
         // showmessage('unable_to_send_air_news', '', array(), array('return' => true));
         return $this->makeErrorInfo($res, lang('message', 'unable_to_send_air_news'));
     }
     // $message = censor($message);
     loadcache(array('smilies', 'smileytypes'));
     foreach ($_G['cache']['smilies']['replacearray'] as $key => $smiley) {
         $_G['cache']['smilies']['replacearray'][$key] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$key]]['directory'] . '/' . $smiley . '[/img]';
     }
     $message = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], $message);
     $subject = '';
     if ($type == 1) {
         $subject = dhtmlspecialchars(trim($_POST['subject']));
     }
     include_once libfile('function/friend');
     $return = 0;
     if ($touid || $pmid) {
         if ($touid) {
             if ($value = getuserbyuid($touid)) {
                 $value['onlyacceptfriendpm'] = $value['onlyacceptfriendpm'] ? $value['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2);
                 if ($_G['group']['allowsendallpm'] || $value['onlyacceptfriendpm'] == 2 || $value['onlyacceptfriendpm'] == 1 && friend_check($touid)) {
                     $return = sendpm($touid, $subject, $message, '', 0, 0, $type);
                 } else {
                     // showmessage('message_can_not_send_onlyfriend', '', array(), array('return' => true));
                     return $this->makeErrorInfo($res, lang('message', 'message_can_not_send_onlyfriend'));
                 }
             } else {
                 // showmessage('message_bad_touid', '', array(), array('return' => true));
                 return $this->makeErrorInfo($res, lang('message', 'message_bad_touid'));
             }
         } else {
             $topmuid = intval($_GET['topmuid']);
             $return = sendpm($topmuid, $subject, $message, '', $pmid, 0);
         }
     } elseif ($users) {
         $newusers = $uidsarr = $membersarr = array();
         if ($users) {
             $membersarr = C::t('common_member')->fetch_all_by_username($users);
             foreach ($membersarr as $aUsername => $aUser) {
                 $uidsarr[] = $aUser['uid'];
             }
         }
         if (empty($membersarr)) {
             showmessage('message_bad_touser', '', array(), array('return' => true));
         }
         if (isset($membersarr[$_G['uid']])) {
             showmessage('message_can_not_send_to_self', '', array(), array('return' => true));
         }
         friend_check($uidsarr);
         foreach ($membersarr as $key => $value) {
             $value['onlyacceptfriendpm'] = $value['onlyacceptfriendpm'] ? $value['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2);
             if ($_G['group']['allowsendallpm'] || $value['onlyacceptfriendpm'] == 2 || $value['onlyacceptfriendpm'] == 1 && $_G['home_friend_' . $value['uid'] . '_' . $_G['uid']]) {
                 $newusers[$value['uid']] = $value['username'];
                 unset($users[array_search($value['username'], $users)]);
             }
         }
         if (empty($newusers)) {
             showmessage('message_can_not_send_onlyfriend', '', array(), array('return' => true));
         }
         foreach ($newusers as $key => $value) {
             if (isblacklist($key)) {
                 showmessage('is_blacklist', '', array(), array('return' => true));
             }
         }
         $coef = count($newusers);
         $return = sendpm(implode(',', $newusers), $subject, $message, '', 0, 1, $type);
     } else {
         // showmessage('message_can_not_send_9', '', array(), array('return' => true));
         return $this->makeErrorInfo($res, lang('message', 'message_can_not_send_9'));
     }
     if ($return > 0) {
         include_once libfile('function/stat');
         updatestat('sendpm', 0, $coef);
         C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP));
         !($_G['group']['exempt'] & 1) && updatecreditbyaction('sendpm', 0, array(), '', $coef);
         if (!empty($newusers)) {
             if ($type == 1) {
                 $returnurl = 'home.php?mod=space&do=pm&filter=privatepm';
             } else {
                 $returnurl = 'home.php?mod=space&do=pm';
             }
             showmessage(count($users) ? 'message_send_result' : 'do_success', $returnurl, array('users' => implode(',', $users), 'succeed' => count($newusers)));
         } else {
             if (!defined('IN_MOBILE')) {
                 // showmessage('do_success', 'home.php?mod=space&do=pm&subop=view&touid='.$touid, array('pmid' => $return), $_G['inajax'] ? array('msgtype' => 3, 'showmsg' => false) : array());
             } else {
                 // showmessage('do_success', 'home.php?mod=space&do=pm&subop=view'.(intval($_POST['touid']) ? '&touid='.intval($_POST['touid']) : ( intval($_POST['plid']) ? '&plid='.intval($_POST['plid']).'&daterange=1&type=1' : '' )));
             }
             $res = $this->makeErrorInfo($res, 'do_success', array('noError' => 1, 'alert' => 0));
             $msgInfo = uc_pm_viewnode($_G['uid'], $type, $return);
             $res['body']['plid'] = (int) $msgInfo['plid'];
             $res['body']['pmid'] = (int) $msgInfo['pmid'];
             $res['body']['sendTime'] = $msgInfo['dateline'] . '000';
             // ios push
             UserUtils::pushIOSMessage($touid, 'pm', $_G['username'] . WebUtils::t(' 对 您 说: ') . $message);
         }
     } else {
         if (in_array($return, range(-16, -1))) {
             // showmessage('message_can_not_send_'.abs($return));
             return $this->makeErrorInfo($res, lang('message', 'message_can_not_send_' . abs($return)));
         } else {
             // showmessage('message_can_not_send', '', array(), array('return' => true));
             return $this->makeErrorInfo($res, lang('message', 'message_can_not_send'));
         }
     }
     return $res;
 }
 $seccodecheck = $_G['group']['seccode'] ? $_G['setting']['seccodestatus'] & 4 : 0;
 $secqaacheck = $_G['group']['seccode'] ? $_G['setting']['secqaa']['status'] & 2 : 0;
 if (submitcheck("commentsubmit", 0, $seccodecheck, $secqaacheck)) {
     if ($_G['group']['pdnovelcomment'] != 1) {
         showmessage("group_nopermission", NULL, array("grouptitle" => $_G['group']['grouptitle']), array("login" => 1));
     }
     checkperm("allownewcomment");
     $novelid = intval($_POST['novelid']);
     $novel = DB::fetch_first("SELECT * FROM " . DB::table("pdnovel_view") . (" WHERE novelid='" . $novelid . "'"));
     if (empty($novel)) {
         showmessage("comment_comment_noexist");
     }
     require_once libfile("function/spacecp");
     ckrealname("comment");
     cknewuser();
     $waittime = interval_check("post");
     if (0 < $waittime) {
         showmessage("operating_too_fast", "", array("waittime" => $waittime), array("return" => TRUE));
     }
     $message = getstr($_POST['message'], 0, 1, 1, 1, 0);
     if (strlen($message) < 2) {
         showmessage("content_is_too_short");
     }
     pdupdatecredit('pdnovelcomment', $lang['common_no_credit']);
     $message = censor($message);
     if (censormod($message)) {
         $comment_status = 1;
     } else {
         $comment_status = 0;
     }
     $setarr = array("uid" => $_G['uid'], "username" => $_G['username'], "novelid" => $novelid, "postip" => $_G['onlineip'], "dateline" => $_G['timestamp'], "status" => $comment_status, "message" => $message);