本文整理汇总了PHP中MbqError类的典型用法代码示例。如果您正苦于以下问题:PHP MbqError类的具体用法?PHP MbqError怎么用?PHP MbqError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MbqError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqEtThank = MbqMain::$oClk->newObj('MbqEtThank');
$oMbqEtThank->key->setOriValue($in->postId);
$oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
if ($oMbqEtForumPost = $oMbqRdEtForumPost->initOMbqEtForumPost($oMbqEtThank->key->oriValue, array('case' => 'byPostId'))) {
$oMbqAclEtForumPost = MbqMain::$oClk->newObj('MbqAclEtForumPost');
$aclResult = $oMbqAclEtForumPost->canAclThankPost($oMbqEtForumPost);
if ($aclResult === true) {
//acl judge
$oMbqWrEtForumPost = MbqMain::$oClk->newObj('MbqWrEtForumPost');
$oMbqEtThank->userId->setOriValue(MbqMain::$oCurMbqEtUser->userId->oriValue);
$oMbqWrEtForumPost->thankPost($oMbqEtForumPost, $oMbqEtThank);
$this->data['result'] = true;
$oTapatalkPush = new TapatalkPush();
$oTapatalkPush->callMethod('doInternalPushThank', array('oMbqEtForumPost' => $oMbqEtForumPost, 'oMbqEtThank' => $oMbqEtThank));
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid post id!", '', MBQ_ERR_APP);
}
}
示例2: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
if ($oMbqEtForumPost = $oMbqRdEtForumPost->initOMbqEtForumPost($in->postId, array('case' => 'byPostId'))) {
$oMbqAclEtForumPost = MbqMain::$oClk->newObj('MbqAclEtForumPost');
$aclResult = $oMbqAclEtForumPost->canAclReportPost($oMbqEtForumPost);
if ($aclResult === true) {
//acl judge
$oMbqWrEtForumPost = MbqMain::$oClk->newObj('MbqWrEtForumPost');
$result = $oMbqWrEtForumPost->reportPost($oMbqEtForumPost, $in->reason);
if ($result === true) {
$this->data['result'] = true;
$this->data['result_text'] = 'Post reported';
} else {
$this->data['result'] = false;
$this->data['result_text'] = $result;
}
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid post id!", '', MBQ_ERR_APP);
}
}
示例3: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
if ($oMbqEtForumTopic = $oMbqRdEtForumTopic->initOMbqEtForumTopic($in->topicId, array('case' => 'byTopicId'))) {
$oMbqAclEtForumTopic = MbqMain::$oClk->newObj('MbqAclEtForumTopic');
$aclResult = $oMbqAclEtForumTopic->canAclMRenameTopic($oMbqEtForumTopic);
if ($aclResult === true) {
//acl judge
$oMbqWrEtForumTopic = MbqMain::$oClk->newObj('MbqWrEtForumTopic');
$result = $oMbqWrEtForumTopic->mRenameTopic($oMbqEtForumTopic, $in->title);
if ($result === true) {
$this->data['result'] = true;
} else {
if ($result === false) {
$this->data['result'] = false;
$this->data['is_login_mod'] = true;
$this->data['result_text'] = 'You need to authenticate again to do the action';
} else {
$this->data['result'] = false;
$this->data['result_text'] = $result;
}
}
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid topic id!", '', MBQ_ERR_APP);
}
}
示例4: actionImplement
/**
* action implement
*/
protected function actionImplement()
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$forumId = MbqMain::$input['get']['fid'];
$content = MbqMain::$input['get']['content'] ? MbqMain::$input['get']['content'] : 'both';
$page = (int) MbqMain::$input['get']['page'];
$perpage = (int) MbqMain::$input['get']['perpage'];
$type = MbqMain::$input['get']['type'] ? MbqMain::$input['get']['type'] : 'normal';
$prefix = MbqMain::$input['get']['prefix'];
$oMbqDataPage = MbqMain::$oClk->newObj('MbqDataPage');
$oMbqDataPage->initByPageAndPerPage($page, $perpage);
$oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum');
$objsMbqEtForum = $oMbqRdEtForum->getObjsMbqEtForum(array($forumId), array('case' => 'byForumIds'));
if ($objsMbqEtForum && ($oMbqEtForum = $objsMbqEtForum[0])) {
if ($content == 'sub' || $content == 'both') {
MbqError::alert('', "Not support content type {$content}!", '', MBQ_ERR_APP);
} elseif ($content == 'topic') {
$oMbqAclEtForumTopic = MbqMain::$oClk->newObj('MbqAclEtForumTopic');
if ($oMbqAclEtForumTopic->canAclGetTopic($oMbqEtForum)) {
//acl judge
switch ($type) {
case 'sticky':
/* returns sticky topics. */
$oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
$oMbqDataPage = $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oMbqEtForum, array('case' => 'byForum', 'oMbqDataPage' => $oMbqDataPage, 'top' => true));
$this->data['total'] = (int) $oMbqDataPage->totalNum;
//!!! must
$this->data['forum'] = $oMbqRdEtForum->returnApiDataForum($oMbqEtForum);
$this->data['forums'] = array();
$this->data['topics'] = $oMbqRdEtForumTopic->returnApiArrDataForumTopic($oMbqDataPage->datas);
break;
case 'normal':
/* returns standard topics */
$oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
$oMbqDataPage = $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oMbqEtForum, array('case' => 'byForum', 'oMbqDataPage' => $oMbqDataPage, 'notIncludeTop' => true));
$this->data['total'] = (int) $oMbqDataPage->totalNum;
//!!! must
$this->data['forum'] = $oMbqRdEtForum->returnApiDataForum($oMbqEtForum);
$this->data['forums'] = array();
$this->data['topics'] = $oMbqRdEtForumTopic->returnApiArrDataForumTopic($oMbqDataPage->datas);
break;
case 'all':
MbqError::alert('', "Not supported topic type filter:{$type}.", '', MBQ_ERR_APP);
break;
default:
MbqError::alert('', "Unknown topic type filter:{$type}.", '', MBQ_ERR_APP);
break;
}
} else {
MbqError::alert('', '', '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid content type!", '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid forum id!", '', MBQ_ERR_APP);
}
}
示例5: actionImplement
/**
* action implement
*/
protected function actionImplement()
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$startNum = (int) MbqMain::$input[0];
$lastNum = (int) MbqMain::$input[1];
$oMbqDataPage = MbqMain::$oClk->newObj('MbqDataPage');
$oMbqDataPage->initByStartAndLast($startNum, $lastNum);
$filter = array('searchid' => MbqMain::$input[2], 'page' => $oMbqDataPage->curPage, 'perpage' => $oMbqDataPage->numPerPage);
if (MbqMain::$input[3] && is_array(MbqMain::$input[3])) {
$filter = array_merge($filter, MbqMain::$input[3]);
}
$filter['showposts'] = 0;
$oMbqAclEtForumTopic = MbqMain::$oClk->newObj('MbqAclEtForumTopic');
if ($oMbqAclEtForumTopic->canAclGetUnreadTopic()) {
//acl judge
$oMbqRdForumSearch = MbqMain::$oClk->newObj('MbqRdForumSearch');
$oMbqDataPage = $oMbqRdForumSearch->forumAdvancedSearch($filter, $oMbqDataPage, array('case' => 'getUnreadTopic', 'unread' => true));
$oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
$this->data['result'] = true;
$this->data['total_topic_num'] = (int) $oMbqDataPage->totalNum;
$this->data['topics'] = $oMbqRdEtForumTopic->returnApiArrDataForumTopic($oMbqDataPage->datas);
} else {
MbqError::alert('', '', '', MBQ_ERR_APP);
}
}
示例6: actionImplement
/**
* action implement
*/
protected function actionImplement()
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$topicId = MbqMain::$input[0];
$forumId = MbqMain::$input[1];
$oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
$oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum');
$oMbqEtForumTopic = $oMbqRdEtForumTopic->initOMbqEtForumTopic($topicId, array('case' => 'byTopicId'));
$objsMbqEtForum = $oMbqRdEtForum->getObjsMbqEtForum(array($forumId), array('case' => 'byForumIds'));
if ($oMbqEtForumTopic && $objsMbqEtForum && ($oMbqEtForum = $objsMbqEtForum[0])) {
$oMbqAclEtForumTopic = MbqMain::$oClk->newObj('MbqAclEtForumTopic');
if ($oMbqAclEtForumTopic->canAclMMoveTopic($oMbqEtForumTopic, $oMbqEtForum)) {
//acl judge
$oMbqWrEtForumTopic = MbqMain::$oClk->newObj('MbqWrEtForumTopic');
$oMbqWrEtForumTopic->mMoveTopic($oMbqEtForumTopic, $oMbqEtForum);
$this->data['result'] = true;
} else {
MbqError::alert('', '', '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid topic id or forum id!", '', MBQ_ERR_APP);
}
}
示例7: actionImplement
/**
* action implement
*/
protected function actionImplement()
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$postId = MbqMain::$input[0];
$mode = (int) MbqMain::$input[1];
if ($mode != 1 && $mode != 2) {
MbqError::alert('', "Need valid mode!", '', MBQ_ERR_APP);
}
if ($mode == 2) {
MbqError::alert('', "Sorry!Not support hard-delete a post!", '', MBQ_ERR_APP);
}
$oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
if ($oMbqEtForumPost = $oMbqRdEtForumPost->initOMbqEtForumPost($postId, array('case' => 'byPostId'))) {
$oMbqAclEtForumPost = MbqMain::$oClk->newObj('MbqAclEtForumPost');
if ($oMbqAclEtForumPost->canAclMDeletePost($oMbqEtForumPost, $mode)) {
//acl judge
$oMbqWrEtForumPost = MbqMain::$oClk->newObj('MbqWrEtForumPost');
$oMbqWrEtForumPost->mDeletePost($oMbqEtForumPost, $mode);
$this->data['result'] = true;
} else {
MbqError::alert('', '', '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid post id!", '', MBQ_ERR_APP);
}
}
示例8: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('subscribe')) {
MbqError::alert('', "Not support module subscribe!", '', MBQ_ERR_NOT_SUPPORT);
}
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum');
if ($oMbqEtForum = $oMbqRdEtForum->initOMbqEtForum($in->forumId, array('case' => 'byForumId'))) {
$oMbqAclEtForum = MbqMain::$oClk->newObj('MbqAclEtForum');
$aclResult = $oMbqAclEtForum->canAclUnsubscribeForum($oMbqEtForum);
if ($aclResult === true) {
//acl judge
$oMbqWrEtForum = MbqMain::$oClk->newObj('MbqWrEtForum');
$result = $oMbqWrEtForum->unsubscribeForum($oMbqEtForum);
if ($result === true) {
$this->data['result'] = true;
} else {
$this->data['result'] = false;
$this->data['result_text'] = $result;
}
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid forum id!", '', MBQ_ERR_APP);
}
}
示例9: uploadAttachment
/**
* upload an attachment
*
* @param Integer $forumId
* @param String $groupId
* @return Object $oMbqEtAtt
*/
public function uploadAttachment($oMbqEtForum, $groupId = null)
{
//ref wcf\action\AJAXUploadAction,wcf\action\AJAXProxyAction,wcf\data\attachment\AttachmentAction
$parameters['objectType'] = 'com.woltlab.wbb.post';
$parameters['objectID'] = 0;
$parameters['tmpHash'] = $groupId ? $groupId : StringUtil::getRandomID();
$parameters['parentObjectID'] = $oMbqEtForum->forumId->oriValue;
$parameters['__files'] = UploadHandler::getUploadHandler('attachment');
//ref AJAXUploadAction::readParameters()
$oAttachmentAction = new AttachmentAction(array(), 'upload', $parameters);
//ref AJAXProxyAction::invoke()
$oAttachmentAction->validateAction();
//todo:catch exception
$ret = $oAttachmentAction->executeAction();
//todo:catch exception
if ($ret['returnValues']['attachments']) {
$r = array_shift($ret['returnValues']['attachments']);
$oMbqEtAtt = MbqMain::$oClk->newObj('MbqEtAtt');
$oMbqEtAtt->attId->setOriValue($r['attachmentID']);
$oMbqEtAtt->groupId->setOriValue($parameters['tmpHash']);
$oMbqEtAtt->filtersSize->setOriValue($r['filesize']);
$oMbqEtAtt->uploadFileName->setOriValue($r['filename']);
return $oMbqEtAtt;
} else {
MbqError::alert('', "Upload attachment failed!", '', MBQ_ERR_APP);
}
}
示例10: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('user')) {
MbqError::alert('', "Not support module user!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser');
if ($oMbqEtUser = $oMbqRdEtUser->initOMbqEtUser($in->userId, array('case' => 'byUserId'))) {
$oMbqAclEtUser = MbqMain::$oClk->newObj('MbqAclEtUser');
$aclResult = $oMbqAclEtUser->canAclIgnoreUser($oMbqEtUser, $in->mode);
if ($aclResult === true) {
//acl judge
$oMbqWrEtUser = MbqMain::$oClk->newObj('MbqWrEtUser');
$result = $oMbqWrEtUser->ignoreUser($oMbqEtUser, $in->mode);
if ($result === true) {
$this->data['result'] = true;
} else {
$this->data['result'] = false;
$this->data['result_text'] = $result;
}
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "User not found!", '', MBQ_ERR_APP);
}
}
示例11: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('user')) {
MbqError::alert('', "Not support module user!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser');
if ($oMbqEtUser = $oMbqRdEtUser->initOMbqEtUser($in->username, array('case' => 'byLoginName'))) {
$oMbqAclEtUser = MbqMain::$oClk->newObj('MbqAclEtUser');
$aclResult = $oMbqAclEtUser->canAclMBanUser($oMbqEtUser, $in->mode);
if ($aclResult === true) {
//acl judge
$oMbqWrEtUser = MbqMain::$oClk->newObj('MbqWrEtUser');
$result = $oMbqWrEtUser->mBanUser($oMbqEtUser, $in->mode, $in->reason, $in->expires);
if ($result === true) {
$this->data['result'] = true;
} else {
if ($result === false) {
$this->data['result'] = false;
$this->data['is_login_mod'] = true;
$this->data['result_text'] = 'You need to authenticate again to do the action';
} else {
$this->data['result'] = false;
$this->data['result_text'] = $result;
}
}
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "User not found!", '', MBQ_ERR_APP);
}
}
示例12: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('subscribe')) {
MbqError::alert('', "Not support module subscribe!", '', MBQ_ERR_NOT_SUPPORT);
}
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
if ($oMbqEtForumTopic = $oMbqRdEtForumTopic->initOMbqEtForumTopic($in->topicId, array('case' => 'byTopicId'))) {
$oMbqAclEtForumTopic = MbqMain::$oClk->newObj('MbqAclEtForumTopic');
if ($oMbqEtForumTopic->isSubscribed->oriValue) {
$this->data['result'] = true;
return;
}
$aclResult = $oMbqAclEtForumTopic->canAclSubscribeTopic($oMbqEtForumTopic);
if ($aclResult === true) {
//acl judge
$oMbqWrEtForumTopic = MbqMain::$oClk->newObj('MbqWrEtForumTopic');
$result = $oMbqWrEtForumTopic->subscribeTopic($oMbqEtForumTopic);
if ($result === true) {
$this->data['result'] = true;
$oTapatalkPush = new TapatalkPush();
$oTapatalkPush->callMethod('doInternalPushNewSubscription', array('oMbqEtForumTopic' => $oMbqEtForumTopic));
} else {
$this->data['result'] = false;
$this->data['result_text'] = $result;
}
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid topic id!", '', MBQ_ERR_APP);
}
}
示例13: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
if ($oMbqEtForumTopic = $oMbqRdEtForumTopic->initOMbqEtForumTopic($in->topicId, array('case' => 'byTopicId'))) {
$oMbqAclEtForumTopic = MbqMain::$oClk->newObj('MbqAclEtForumTopic');
$aclResult = $oMbqAclEtForumTopic->canAclGetThread($oMbqEtForumTopic);
if ($aclResult === true) {
//acl judge
$oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
$in->oMbqDataPage = $oMbqRdEtForumPost->getObjsMbqEtForumPost($oMbqEtForumTopic, array('case' => 'byTopic', 'oMbqDataPage' => $in->oMbqDataPage));
$this->data = $oMbqRdEtForumTopic->returnApiDataForumTopic($oMbqEtForumTopic);
$this->data['forum_name'] = (string) $oMbqEtForumTopic->oMbqEtForum->forumName->oriValue;
$this->data['can_upload'] = (bool) $oMbqEtForumTopic->oMbqEtForum->canUpload->oriValue;
$this->data['posts'] = $oMbqRdEtForumPost->returnApiArrDataForumPost($in->oMbqDataPage->datas, $in->returnHtml);
$oMbqWrEtForumTopic = MbqMain::$oClk->newObj('MbqWrEtForumTopic');
/* add forum topic view num */
$oMbqWrEtForumTopic->addForumTopicViewNum($oMbqEtForumTopic);
/* mark forum topic read */
$oMbqWrEtForumTopic->markForumTopicRead($oMbqEtForumTopic);
/* reset forum topic subscription */
$oMbqWrEtForumTopic->resetForumTopicSubscription($oMbqEtForumTopic);
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Need valid topic id!", '', MBQ_ERR_APP);
}
}
示例14: actionImplement
/**
* action implement
*/
protected function actionImplement($in)
{
if (MbqMain::$oMbqConfig->moduleIsEnable('pm')) {
$oMbqEtPm = MbqMain::$oClk->newObj('MbqEtPm');
$oMbqEtPm->userNames->setOriValue($in->usernames);
$oMbqEtPm->msgTitle->setOriValue($in->subject);
$oMbqEtPm->msgContent->setOriValue($in->body);
if ($in->action == 1) {
$oMbqEtPm->isReply->setOriValue(true);
$oMbqEtPm->toMsgId->setOriValue($in->messageId);
} else {
if ($in->action == 2) {
$oMbqEtPm->isForward->setOriValue(true);
$oMbqEtPm->toMsgId->setOriValue($in->messageId);
}
}
$oMbqAclEtPm = MbqMain::$oClk->newObj('MbqAclEtPm');
$aclResult = $oMbqAclEtPm->canAclCreateMessage();
if ($aclResult === true) {
$oMbqWrEtPm = MbqMain::$oClk->newObj('MbqWrEtPm');
$oMbqWrEtPm->addMbqEtPm($oMbqEtPm);
$this->data['result'] = true;
$this->data['msg_id'] = (string) $oMbqEtPm->msgId->oriValue;
$oTapatalkPush = new TapatalkPush();
$oTapatalkPush->callMethod('doInternalPushNewMessage', array('oMbqEtPm' => $oMbqEtPm));
} else {
MbqError::alert('', $aclResult, '', MBQ_ERR_APP);
}
} else {
MbqError::alert('', "Not support module private message!", '', MBQ_ERR_NOT_SUPPORT);
}
}
示例15: actionImplement
/**
* action implement
*/
protected function actionImplement()
{
if (!MbqMain::$oMbqConfig->moduleIsEnable('forum')) {
MbqError::alert('', "Not support module forum!", '', MBQ_ERR_NOT_SUPPORT);
}
$startNum = (int) MbqMain::$input[1];
$lastNum = (int) MbqMain::$input[2];
$oMbqDataPage = MbqMain::$oClk->newObj('MbqDataPage');
$oMbqDataPage->initByStartAndLast($startNum, $lastNum);
$filter = array('keywords' => MbqMain::$input[0], 'searchid' => MbqMain::$input[3], 'page' => $oMbqDataPage->curPage, 'perpage' => $oMbqDataPage->numPerPage);
$filter['showposts'] = 1;
if (strlen(MbqMain::$input[0]) < MbqBaseFdt::getFdt('MbqFdtConfig.forum.min_search_length.default')) {
MbqError::alert('', "Search words too short!", '', MBQ_ERR_APP);
}
$oMbqAclEtForumPost = MbqMain::$oClk->newObj('MbqAclEtForumPost');
if ($oMbqAclEtForumPost->canAclSearchPost()) {
//acl judge
$oMbqRdForumSearch = MbqMain::$oClk->newObj('MbqRdForumSearch');
$oMbqDataPage = $oMbqRdForumSearch->forumAdvancedSearch($filter, $oMbqDataPage, array('case' => 'searchPost'));
$oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
$this->data['total_post_num'] = (int) $oMbqDataPage->totalNum;
$this->data['posts'] = $oMbqRdEtForumPost->returnApiArrDataForumPost($oMbqDataPage->datas);
} else {
MbqError::alert('', '', '', MBQ_ERR_APP);
}
}