/** * calculate the final config of $this->cfg through $this->cfg default value and MbqMain::$customConfig and MbqMain::$oMbqAppEnv and the plugin support degree */ public function calCfg() { $url = WCF::getPath(); MbqMain::$oMbqAppEnv->siteRootUrl = substr($url, 0, strlen($url) - 4); //init user $oUser = DefaultUserAuthentication::getInstance()->loginAutomatically(true); if ($oUser && $oUser->userID) { MbqMain::$oMbqAppEnv->oCurrentUser = $oUser; $oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser'); $oMbqRdEtUser->initOCurMbqEtUser(); } if (MbqMain::hasLogin()) { //!!! header('Mobiquo_is_login: true'); } else { header('Mobiquo_is_login: false'); } $oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum'); MbqMain::$oMbqAppEnv->exttForumTree = $oMbqRdEtForum->getForumTree(); //!!! parent::calCfg(); /* calculate the final config */ $this->cfg['base']['sys_version']->setOriValue(PACKAGE_VERSION); if (OFFLINE) { $this->cfg['base']['is_open']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.is_open.range.no')); } else { $this->cfg['base']['is_open']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.is_open.range.yes')); } if (!MODULE_CONVERSATION || !WCF::getSession()->getPermission('user.conversation.canUseConversation')) { $this->cfg['pc']['module_enable']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.pc.module_enable.range.disable')); $this->cfg['pc']['conversation']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.notSupport')); } }
/** * action implement */ protected function actionImplement($in) { if (!MbqMain::$oMbqConfig->moduleIsEnable('user')) { MbqError::alert('', "Not support module user!", '', MBQ_ERR_NOT_SUPPORT); } if (MbqMain::$oMbqConfig->getCfg('user.inappreg')->oriValue != MbqBaseFdt::getFdt('MbqFdtConfig.user.inappreg.range.support')) { MbqError::alert('', '', '', MBQ_ERR_APP); } $oMbqWrEtUser = MbqMain::$oClk->newObj('MbqWrEtUser'); $oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser'); $oMbqEtUser = $oMbqRdEtUser->initOMbqEtUser($in->email, array('case' => 'byEmail')); if (isset($oMbqEtUser)) { $this->data['result'] = false; $this->data['result_text'] = 'The email is already in use'; return; } $oMbqEtUser = $oMbqRdEtUser->initOMbqEtUser($in->username, array('case' => 'byLoginName')); if (isset($oMbqEtUser)) { $this->data['result'] = false; $this->data['result_text'] = 'The username is already in use'; return; } $this->oMbqEtUser = $oMbqWrEtUser->registerUser($in->username, $in->password, $in->email, false, array(), array(), $this->errors); $this->data['result'] = $this->oMbqEtUser != null; if (isset($this->errors) && empty($this->errors) == false) { foreach ($this->errors as $key => $value) { $this->data['result_text'] = (isset($this->data['result_text']) ? $this->data['result_text'] : '') . $value . PHP_EOL; } } if ($this->data['result']) { $oTapatalkPush = new TapatalkPush(); $oTapatalkPush->callMethod('doAfterAppLogin', $this->oMbqEtUser->userId->oriValue); } }
/** * action implement */ protected function actionImplement($in) { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $oMbqEtPcInviteParticipant = MbqMain::$oClk->newObj('MbqEtPcInviteParticipant'); $oMbqEtPcInviteParticipant->userNames->setOriValue($in->usernames); $oMbqEtPcInviteParticipant->convId->setOriValue($in->conversationId); $oMbqEtPcInviteParticipant->inviteReasonText->setOriValue($in->reason); $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($oMbqEtPcInviteParticipant->oMbqEtPc = $oMbqRdEtPc->initOMbqEtPc($oMbqEtPcInviteParticipant->convId->oriValue, array('case' => 'byConvId'))) { $oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser'); foreach ($oMbqEtPcInviteParticipant->userNames->oriValue as $userName) { if ($oMbqEtUser = $oMbqRdEtUser->initOMbqEtUser($userName, array('case' => 'byLoginName'))) { $oMbqEtPcInviteParticipant->objsMbqEtUser[] = $oMbqEtUser; } } $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); $aclResult = $oMbqAclEtPc->canAclInviteParticipant($oMbqEtPcInviteParticipant); if ($aclResult === true) { //acl judge $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); $oMbqWrEtPc->inviteParticipant($oMbqEtPcInviteParticipant); $this->data['result'] = true; } else { MbqError::alert('', $aclResult, '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } }
/** * 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); } }
/** * action implement */ protected function actionImplement() { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $convId = MbqMain::$input[0]; $startNum = (int) MbqMain::$input[1]; $lastNum = (int) MbqMain::$input[2]; $returnHtml = (bool) MbqMain::$input[3]; $oMbqDataPage = MbqMain::$oClk->newObj('MbqDataPage'); $oMbqDataPage->initByStartAndLast($startNum, $lastNum); $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($objsMbqEtPc = $oMbqRdEtPc->getObjsMbqEtPc(array($convId), array('case' => 'byConvIds'))) { $oMbqEtPc = $objsMbqEtPc[0]; $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); if ($oMbqAclEtPc->canAclGetConversation($oMbqEtPc)) { //acl judge $oMbqRdEtPcMsg = MbqMain::$oClk->newObj('MbqRdEtPcMsg'); $oMbqDataPage = $oMbqRdEtPcMsg->getObjsMbqEtPcMsg($oMbqEtPc, array('case' => 'byPc', 'oMbqDataPage' => $oMbqDataPage)); $this->data = $oMbqRdEtPc->returnApiDataPc($oMbqEtPc); $this->data['list'] = $oMbqRdEtPcMsg->returnApiArrDataPcMsg($oMbqDataPage->datas, $returnHtml); $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); /* mark pc read */ $oMbqWrEtPc->markPcRead($oMbqEtPc); } else { MbqError::alert('', '', '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } }
/** * action implement */ public function actionImplement() { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $convId = MbqMain::$input[0]; $msgId = MbqMain::$input[1]; $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($objsMbqEtPc = $oMbqRdEtPc->getObjsMbqEtPc(array($convId), array('case' => 'byConvIds'))) { $oMbqEtPc = array_shift($objsMbqEtPc); $oMbqRdEtPcMsg = MbqMain::$oClk->newObj('MbqRdEtPcMsg'); if ($objsMbqEtPcMsg = $oMbqRdEtPcMsg->getObjsMbqEtPcMsg(array($msgId), array('case' => 'byMsgIds'))) { $oMbqEtPcMsg = array_shift($objsMbqEtPcMsg); $oMbqAclEtPcMsg = MbqMain::$oClk->newObj('MbqAclEtPcMsg'); if ($oMbqAclEtPcMsg->canAclGetQuoteConversation($oMbqEtPcMsg, $oMbqEtPc)) { $this->data['text_body'] = (string) $oMbqRdEtPcMsg->getQuoteConversation($oMbqEtPcMsg); } else { MbqError::alert('', '', '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation message id!", '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } }
/** * judge is a sent box * * @return Boolean */ public function isSentBox() { if ($this->boxType->hasSetOriValue() && $this->boxType->oriValue == MbqBaseFdt::getFdt('MbqFdtPm.MbqEtPmBox.boxType.range.sent')) { return true; } return false; }
/** * judge can get_conversations * * @return Boolean */ public function canAclGetConversations() { if (MbqMain::hasLogin() && MbqMain::$oCurMbqEtUser->canPm->oriValue == MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canPm.range.yes')) { return true; } return false; }
/** * action implement */ protected function actionImplement() { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $oMbqEtPcMsg = MbqMain::$oClk->newObj('MbqEtPcMsg'); $oMbqEtPcMsg->convId->setOriValue(MbqMain::$input[0]); $oMbqEtPcMsg->msgContent->setOriValue(MbqMain::$input[1]); $oMbqEtPcMsg->msgTitle->setOriValue(MbqMain::$input[2]); $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($objsMbqEtPc = $oMbqRdEtPc->getObjsMbqEtPc(array($oMbqEtPcMsg->convId->oriValue), array('case' => 'byConvIds'))) { $oMbqEtPc = $objsMbqEtPc[0]; $oMbqAclEtPcMsg = MbqMain::$oClk->newObj('MbqAclEtPcMsg'); if ($oMbqAclEtPcMsg->canAclReplyConversation($oMbqEtPcMsg, $oMbqEtPc)) { $oMbqWrEtPcMsg = MbqMain::$oClk->newObj('MbqWrEtPcMsg'); $oMbqWrEtPcMsg->addMbqEtPcMsg($oMbqEtPcMsg, $oMbqEtPc); $this->data['result'] = true; $this->data['msg_id'] = (string) $oMbqEtPcMsg->msgId->oriValue; } else { MbqError::alert('', '', '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } }
/** * action implement */ protected function actionImplement($in) { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($oMbqEtPc = $oMbqRdEtPc->initOMbqEtPc($in->convId, array('case' => 'byConvId'))) { $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); $aclRestult = $oMbqAclEtPc->canAclGetConversation($oMbqEtPc); if ($aclRestult === true) { //acl judge $oMbqRdEtPcMsg = MbqMain::$oClk->newObj('MbqRdEtPcMsg'); $in->oMbqDataPage = $oMbqRdEtPcMsg->getObjsMbqEtPcMsg($oMbqEtPc, array('case' => 'byPc', 'oMbqDataPage' => $in->oMbqDataPage)); $this->data = $oMbqRdEtPc->returnApiDataPc($oMbqEtPc); $this->data['list'] = $oMbqRdEtPcMsg->returnApiArrDataPcMsg($in->oMbqDataPage->datas, $in->returnHtml); $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); /* mark pc read */ $oMbqWrEtPc->markPcRead($oMbqEtPc); } else { MbqError::alert('', $aclRestult, '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } }
/** * action implement */ protected function actionImplement($in) { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $oMbqEtPc = MbqMain::$oClk->newObj('MbqEtPc'); $oMbqEtPc->userNames->setOriValue($in->usernames); $oMbqEtPc->convTitle->setOriValue($in->subject); $oMbqEtPc->convContent->setOriValue($in->body); if (isset($in->attachmentIds)) { $oMbqEtPc->attachmentIdArray->setOriValue($in->attachmentIds); } if (isset($in->groupId)) { $oMbqEtPc->groupId->setOriValue($in->groupId); } $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); $aclResult = $oMbqAclEtPc->canAclNewConversation($oMbqEtPc); if ($aclResult === true) { //acl judge $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); $oMbqEtPc = $oMbqWrEtPc->addMbqEtPc($oMbqEtPc); $this->data['result'] = true; $this->data['conv_id'] = (string) $oMbqEtPc->convId->oriValue; $oMbqRdEtPcMsg = MbqMain::$oClk->newObj('MbqRdEtPcMsg'); $oMbqEtPcMsg = $oMbqRdEtPcMsg->initOMbqEtPcMsg($oMbqEtPc, array('case' => 'byPcMsgId', 'pcMsgId' => $oMbqEtPc->firstMsgId->oriValue)); $oTapatalkPush = new TapatalkPush(); $oTapatalkPush->callMethod('doInternalPushNewConversation', array('oMbqEtPc' => $oMbqEtPc, 'oMbqEtPcMsg' => $oMbqEtPcMsg)); } else { MbqError::alert('', $aclResult, '', MBQ_ERR_APP); } }
/** * judge can search_post * * @return Boolean */ public function canAclSearchPost() { if (MbqMain::$oMbqConfig->getCfg('forum.guest_search')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.forum.guest_search.range.support')) { return true; } else { return MbqMain::hasLogin(); } }
/** * return private message api data * * @param Object $oMbqEtPm * @param Boolean $returnHtml * @return Array */ public function returnApiDataPm($oMbqEtPm, $returnHtml = true) { $data = array(); if ($oMbqEtPm->msgId->hasSetOriValue()) { $data['msg_id'] = (string) $oMbqEtPm->msgId->oriValue; } if ($oMbqEtPm->msgTitle->hasSetOriValue()) { $data['msg_subject'] = (string) $oMbqEtPm->msgTitle->oriValue; } if ($returnHtml) { if ($oMbqEtPm->msgContent->hasSetTmlDisplayValue()) { $data['text_body'] = (string) $oMbqEtPm->msgContent->tmlDisplayValue; } } else { if ($oMbqEtPm->msgContent->hasSetTmlDisplayValueNoHtml()) { $data['text_body'] = (string) $oMbqEtPm->msgContent->tmlDisplayValueNoHtml; } } $data['short_content'] = (string) $oMbqEtPm->shortContent->oriValue; if ($oMbqEtPm->isOnline->hasSetOriValue()) { $data['is_online'] = (bool) $oMbqEtPm->isOnline->oriValue; } if ($oMbqEtPm->isRead->hasSetOriValue() && $oMbqEtPm->isRead->oriValue == MbqBaseFdt::getFdt('MbqFdtPm.MbqEtPm.isRead.range.yes')) { $data['msg_state'] = 2; } elseif ($oMbqEtPm->isReply->hasSetOriValue() && $oMbqEtPm->isReply->oriValue == MbqBaseFdt::getFdt('MbqFdtPm.MbqEtPm.isReply.range.yes')) { $data['msg_state'] = 3; } elseif ($oMbqEtPm->isForward->hasSetOriValue() && $oMbqEtPm->isForward->oriValue == MbqBaseFdt::getFdt('MbqFdtPm.MbqEtPm.isForward.range.yes')) { $data['msg_state'] = 4; } else { $data['msg_state'] = 1; } if ($oMbqEtPm->sentDate->hasSetOriValue()) { $data['sent_date'] = (string) MbqMain::$oMbqCm->datetimeIso8601Encode($oMbqEtPm->sentDate->oriValue); } if ($oMbqEtPm->msgFromId->hasSetOriValue()) { $data['msg_from_id'] = (string) $oMbqEtPm->msgFromId->oriValue; } if ($oMbqEtPm->msgFrom->hasSetOriValue()) { $data['msg_from'] = (string) $oMbqEtPm->msgFrom->oriValue; } if ($oMbqEtPm->allowSmilies->hasSetOriValue()) { $data['allow_smilies'] = (bool) $oMbqEtPm->allowSmilies->oriValue; } if ($oMbqEtPm->oMbqEtPmBox && $oMbqEtPm->oMbqEtPmBox->isSentBox() && $oMbqEtPm->oFirstRecipientMbqEtUser && $oMbqEtPm->oFirstRecipientMbqEtUser->iconUrl->hasSetOriValue()) { $data['icon_url'] = (string) $oMbqEtPm->oFirstRecipientMbqEtUser->iconUrl->oriValue; } elseif ($oMbqEtPm->oAuthorMbqEtUser && $oMbqEtPm->oAuthorMbqEtUser->iconUrl->hasSetOriValue()) { $data['icon_url'] = (string) $oMbqEtPm->oAuthorMbqEtUser->iconUrl->oriValue; } if ($oMbqEtPm->objsRecipientMbqEtUser) { $oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser'); $data['msg_to'] = $oMbqRdEtUser->returnApiArrDataUser($oMbqEtPm->objsRecipientMbqEtUser, true); } else { $data['msg_to'] = array(); } return $data; }
/** * judge can get_conversations * * @return Boolean */ public function canAclGetConversations() { if (!WCF::getSession()->getPermission('user.conversation.canUseConversation')) { return false; } if (MbqMain::hasLogin() && MbqMain::$oCurMbqEtUser->canPm->oriValue == MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canPm.range.yes')) { return true; } return false; }
/** * judge can get online users * * @return Boolean */ public function canAclGetOnlineUsers() { if (MbqMain::hasLogin()) { return true; } else { if (MbqMain::$oMbqConfig->getCfg('user.guest_whosonline')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.user.guest_whosonline.range.support')) { return true; } } return false; }
function getInput() { $in = new stdClass(); $oMbqDataPage = MbqMain::$oClk->newObj('MbqDataPage'); if (MbqMain::isJsonProtocol()) { $filters = $this->getInputParam('filters'); $search_filter = $filters[0]; $in->searchId = $this->getValue($search_filter, 'searchId'); $in->keywords = $this->getValue($search_filter, 'keywords'); $in->userId = $this->getValue($search_filter, 'userId'); $in->searchId = $this->getValue($search_filter, 'searchId'); $in->searchUser = $this->getValue($search_filter, 'searchUser'); $in->forumId = $this->getValue($search_filter, 'forumId'); $in->topicId = $this->getValue($search_filter, 'topicId'); $in->titleOnly = $this->getValue($search_filter, 'titleOnly'); $in->showPosts = $this->getValue($search_filter, 'showPosts'); $in->searchTime = $this->getValue($search_filter, 'searchTime'); $in->onlyIn = $this->getValue($search_filter, 'onlyIn'); $in->notIn = $this->getValue($search_filter, 'notIn'); $in->startedBy = $this->getValue($search_filter, 'started_by'); $page = $this->getValue($search_filter, 'page', 1); $perpage = $this->getValue($search_filter, 'perpage', 20); $oMbqDataPage->initByPageAndPerPage($page, $perpage); if ($in->startedBy) { $in->showPosts = 0; } } else { $search_filter = $this->getInputParam(0); $in->searchId = $this->getValue($search_filter, 'searchid'); $in->keywords = $this->getValue($search_filter, 'keywords'); $in->userId = $this->getValue($search_filter, 'userid'); $in->searchId = $this->getValue($search_filter, 'searchid'); $in->searchUser = $this->getValue($search_filter, 'searchuser'); $in->forumId = $this->getValue($search_filter, 'forumid'); $in->topicId = $this->getValue($search_filter, 'threadid'); $in->titleOnly = $this->getValue($search_filter, 'titleonly'); $in->showPosts = $this->getValue($search_filter, 'showposts'); $in->searchTime = $this->getValue($search_filter, 'searchtime'); $in->onlyIn = $this->getValue($search_filter, 'only_in'); $in->notIn = $this->getValue($search_filter, 'not_in'); $in->startedBy = $this->getValue($search_filter, 'started_by'); if ($in->startedBy) { $in->showPosts = 0; } $page = $this->getValue($search_filter, 'page', 1); $perpage = $this->getValue($search_filter, 'perpage', 20); $oMbqDataPage->initByPageAndPerPage($page, $perpage); } if (isset($in->keywords) && strlen($in->keywords) < MbqBaseFdt::getFdt('MbqFdtConfig.forum.min_search_length.default')) { MbqError::alert('', "Search words too short!", '', MBQ_ERR_APP); } $in->oMbqDataPage = $oMbqDataPage; return $in; }
/** * action implement */ protected function actionImplement($in) { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); $aclResult = $oMbqAclEtPc->canAclGetConversations(); if ($aclResult === true) { //acl judge $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); $in->oMbqDataPage = $oMbqRdEtPc->getObjsMbqEtPc(NULL, array('case' => 'all', 'oMbqDataPage' => $in->oMbqDataPage)); $this->data['conversation_count'] = (int) $in->oMbqDataPage->totalNum; $this->data['unread_count'] = $in->oMbqDataPage->totalUnreadNum != null ? $in->oMbqDataPage->totalUnreadNum : (int) $oMbqRdEtPc->getUnreadPcNum(); $this->data['list'] = $oMbqRdEtPc->returnApiArrDataPc($in->oMbqDataPage->datas); } else { MbqError::alert('', $aclResult, '', MBQ_ERR_APP); } }
/** * action implement */ protected function actionImplement($in) { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($in->convId != null) { $in->convId = explode(',', $in->convId); foreach ($in->convId as $convId) { if ($oMbqEtPc = $oMbqRdEtPc->initOMbqEtPc($convId, array('case' => 'byConvId'))) { $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); $oMbqWrEtPc->markPcUnread($oMbqEtPc); } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } } } $this->data['result'] = true; }
/** * action implement */ protected function actionImplement() { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $oMbqEtPc = MbqMain::$oClk->newObj('MbqEtPc'); $oMbqEtPc->userNames->setOriValue((array) MbqMain::$input[0]); $oMbqEtPc->convTitle->setOriValue(MbqMain::$input[1]); $oMbqEtPc->convContent->setOriValue(MbqMain::$input[2]); $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); if ($oMbqAclEtPc->canAclNewConversation($oMbqEtPc)) { //acl judge $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); $oMbqWrEtPc->addMbqEtPc($oMbqEtPc); $this->data['result'] = true; $this->data['conv_id'] = (string) $oMbqEtPc->convId->oriValue; } else { MbqError::alert('', '', '', MBQ_ERR_APP); } }
function getInput() { $in = new stdClass(); $oMbqDataPage = MbqMain::$oClk->newObj('MbqDataPage'); if (MbqMain::isJsonProtocol()) { $in->keywords = $this->getInputParam('keywords'); $in->searchId = $this->getInputParam('searchId'); $oMbqDataPage->initByPageAndPerPage($this->getInputParam('page'), $this->getInputParam('perPage')); } else { $in->keywords = $this->getInputParam(0); $in->searchId = $this->getInputParam(3); $startNum = (int) $this->getInputParam(1); $lastNum = (int) $this->getInputParam(2); $oMbqDataPage->initByStartAndLast($startNum, $lastNum); } if (strlen($in->keywords) < MbqBaseFdt::getFdt('MbqFdtConfig.forum.min_search_length.default')) { MbqError::alert('', "Search words too short!", '', MBQ_ERR_APP); } $in->oMbqDataPage = $oMbqDataPage; return $in; }
/** * action implement */ protected function actionImplement($in) { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($oMbqEtPc = $oMbqRdEtPc->initOMbqEtPc($in->conversationId, array('case' => 'byConvId'))) { $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); $aclResult = $oMbqAclEtPc->canAclDeleteConversation($oMbqEtPc, $in->mode); if ($aclResult === true) { //acl judge $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); $oMbqWrEtPc->deleteConversation($oMbqEtPc, $in->mode); $this->data['result'] = true; } else { MbqError::alert('', '', '', MBQ_ERR_APP); } } else { MbqError::alert('', $aclResult, '', MBQ_ERR_APP); } } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } }
/** * action implement */ protected function actionImplement() { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $startNum = (int) MbqMain::$input[0]; $lastNum = (int) MbqMain::$input[1]; $oMbqDataPage = MbqMain::$oClk->newObj('MbqDataPage'); $oMbqDataPage->initByStartAndLast($startNum, $lastNum); $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); if ($oMbqAclEtPc->canAclGetConversations()) { //acl judge $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); $oMbqDataPage = $oMbqRdEtPc->getObjsMbqEtPc(NULL, array('case' => 'all', 'oMbqDataPage' => $oMbqDataPage)); $this->data['conversation_count'] = (int) $oMbqDataPage->totalNum; $this->data['unread_count'] = (int) $oMbqRdEtPc->getUnreadPcNum(); $this->data['list'] = $oMbqRdEtPc->returnApiArrDataPc($oMbqDataPage->datas); } else { MbqError::alert('', '', '', MBQ_ERR_APP); } }
/** * action implement */ protected function actionImplement() { /* TODO */ if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); if ($oMbqAclEtPc->canAclGetInboxStat()) { //acl judge $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); $this->data['inbox_unread_count'] = (int) $oMbqRdEtPc->getUnreadPcNum(); } else { MbqError::alert('', '', '', MBQ_ERR_APP); } } elseif (MbqMain::$oMbqConfig->moduleIsEnable('pm')) { $this->data['inbox_unread_count'] = (int) 0; } else { $this->data['inbox_unread_count'] = (int) 0; } if (MbqMain::$oMbqConfig->moduleIsEnable('subscribe')) { $this->data['subscribed_topic_unread_count'] = (int) 0; } else { $this->data['subscribed_topic_unread_count'] = (int) 0; } }
/** * action implement */ protected function actionImplement() { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } $convId = MbqMain::$input[0]; $mode = (int) MbqMain::$input[1]; $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($objsMbqEtPc = $oMbqRdEtPc->getObjsMbqEtPc(array($convId), array('case' => 'byConvIds'))) { $oMbqEtPc = $objsMbqEtPc[0]; $oMbqAclEtPc = MbqMain::$oClk->newObj('MbqAclEtPc'); if ($oMbqAclEtPc->canAclDeleteConversation($oMbqEtPc, $mode)) { //acl judge $oMbqWrEtPc = MbqMain::$oClk->newObj('MbqWrEtPc'); $oMbqWrEtPc->deleteConversation($oMbqEtPc, $mode); $this->data['result'] = true; } else { MbqError::alert('', '', '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } }
/** * init one attachment by condition * * @param Mixed $var * @param Array $mbqOpt * $mbqOpt['case'] = 'oAttachment' means init attachment by oAttachment * $mbqOpt['case'] = 'byAttId' means init attachment by attachment id * @return Mixed */ public function initOMbqEtAtt($var, $mbqOpt) { if ($mbqOpt['case'] == 'byAttId') { $oAttachment = new Attachment($var); if ($oAttachment->attachmentID) { $mbqOpt['case'] = 'oAttachment'; return $this->initOMbqEtAtt($oAttachment, $mbqOpt); } return false; } elseif ($mbqOpt['case'] == 'oAttachment') { $oMbqEtAtt = MbqMain::$oClk->newObj('MbqEtAtt'); $oMbqEtAtt->attId->setOriValue($var->attachmentID); $oMbqEtAtt->postId->setOriValue($var->objectID); $oMbqEtAtt->filtersSize->setOriValue($var->filesize); $oMbqEtAtt->uploadFileName->setOriValue($var->filename); $ext = strtolower(MbqMain::$oMbqCm->getFileExtension($var->filename)); if ($ext == 'jpeg' || $ext == 'gif' || $ext == 'bmp' || $ext == 'png' || $ext == 'jpg') { $contentType = MbqBaseFdt::getFdt('MbqFdtAtt.MbqEtAtt.contentType.range.image'); } elseif ($ext == 'pdf') { $contentType = MbqBaseFdt::getFdt('MbqFdtAtt.MbqEtAtt.contentType.range.pdf'); } else { $contentType = MbqBaseFdt::getFdt('MbqFdtAtt.MbqEtAtt.contentType.range.other'); } $oMbqEtAtt->contentType->setOriValue($contentType); if ($var->showAsImage()) { if ($var->hasThumbnail()) { $oMbqEtAtt->thumbnailUrl->setOriValue(MbqMain::$oMbqAppEnv->siteRootUrl . 'index.php/Attachment/' . $var->attachmentID . '/?thumbnail=1'); } } $oMbqEtAtt->url->setOriValue(MbqMain::$oMbqAppEnv->siteRootUrl . 'index.php/Attachment/' . $var->attachmentID); $oMbqEtAtt->userId->setOriValue($var->userID); $oMbqEtAtt->mbqBind['oAttachment'] = $var; return $oMbqEtAtt; } MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . MBQ_ERR_INFO_UNKNOWN_CASE); }
/** * action implement */ protected function actionImplement($in) { if (MbqMain::$oMbqConfig->moduleIsEnable('pc') && MbqMain::$oMbqConfig->getCfg('pc.conversation')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.support')) { $oMbqRdEtPc = MbqMain::$oClk->newObj('MbqRdEtPc'); if ($oMbqEtPc = $oMbqRdEtPc->initOMbqEtPc($in->convId, array('case' => 'byConvId'))) { $oMbqRdEtPcMsg = MbqMain::$oClk->newObj('MbqRdEtPcMsg'); if ($oMbqEtPcMsg = $oMbqRdEtPcMsg->initOMbqEtPcMsg($oMbqEtPc, array('case' => 'byPcMsgId', 'pcMsgId' => $in->msgId))) { $oMbqAclEtPcMsg = MbqMain::$oClk->newObj('MbqAclEtPcMsg'); $aclResult = $oMbqAclEtPcMsg->canAclGetQuoteConversation($oMbqEtPcMsg, $oMbqEtPc); if ($aclResult) { $this->data['text_body'] = (string) $oMbqRdEtPcMsg->getQuoteConversation($oMbqEtPcMsg); } else { MbqError::alert('', $aclResult, '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation message id!", '', MBQ_ERR_APP); } } else { MbqError::alert('', "Need valid conversation id!", '', MBQ_ERR_APP); } } else { MbqError::alert('', "Not support module private conversation!", '', MBQ_ERR_NOT_SUPPORT); } }
/** * judge can mark all my unread topics as read * * @return Boolean */ public function canAclMarkAllAsRead() { return MbqMain::hasLogin() && MbqMain::$oMbqConfig->getCfg('forum.mark_read')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.forum.mark_read.range.support'); }
/** * return forum topic json api data * * @param Object $oMbqEtForumTopic * @return Array */ protected function returnAdvJsonApiDataForumTopic($oMbqEtForumTopic) { $data = array(); if ($oMbqEtForumTopic->topicId->hasSetOriValue()) { $data['id'] = (string) $oMbqEtForumTopic->topicId->oriValue; } if ($oMbqEtForumTopic->topicTitle->hasSetOriValue()) { $data['title'] = (string) $oMbqEtForumTopic->topicTitle->oriValue; } if ($oMbqEtForumTopic->postTime->hasSetOriValue()) { $data['time'] = (int) $oMbqEtForumTopic->postTime->oriValue; } if ($oMbqEtForumTopic->replyNumber->hasSetOriValue()) { $data['replies'] = (int) $oMbqEtForumTopic->replyNumber->oriValue; } if ($oMbqEtForumTopic->viewNumber->hasSetOriValue()) { $data['views'] = (int) $oMbqEtForumTopic->viewNumber->oriValue; } if ($oMbqEtForumTopic->oMbqEtForum) { $oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum'); $data['forum'] = $oMbqRdEtForum->returnApiDataForum($oMbqEtForumTopic->oMbqEtForum); } if ($oMbqEtForumTopic->oAuthorMbqEtUser) { $oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser'); $data['author'] = $oMbqRdEtUser->returnApiDataUser($oMbqEtForumTopic->oAuthorMbqEtUser); } if ($oMbqEtForumTopic->prefixId->hasSetOriValue() && $oMbqEtForumTopic->prefixName->hasSetOriValue()) { $data['prefix'] = array('id' => $oMbqEtForumTopic->prefixId->oriValue, 'name' => $oMbqEtForumTopic->prefixName->oriValue); } $data['status'] = array(); if ($oMbqEtForumTopic->newPost->hasSetOriValue()) { $data['status']['is_unread'] = (bool) $oMbqEtForumTopic->newPost->oriValue; } if ($oMbqEtForumTopic->isSubscribed->hasSetOriValue()) { $data['status']['is_follow'] = (bool) $oMbqEtForumTopic->isSubscribed->oriValue; } if ($oMbqEtForumTopic->isHot->hasSetOriValue()) { $data['status']['is_hot'] = (bool) $oMbqEtForumTopic->isHot->oriValue; } if ($oMbqEtForumTopic->isDigest->hasSetOriValue()) { $data['status']['is_digest'] = (bool) $oMbqEtForumTopic->isDigest->oriValue; } if ($oMbqEtForumTopic->isClosed->hasSetOriValue()) { $data['status']['is_closed'] = (bool) $oMbqEtForumTopic->isClosed->oriValue; } if ($oMbqEtForumTopic->isSticky->hasSetOriValue()) { $data['status']['is_sticky'] = (bool) $oMbqEtForumTopic->isSticky->oriValue; } if ($oMbqEtForumTopic->state->hasSetOriValue()) { $data['status']['is_pending'] = (bool) $oMbqEtForumTopic->state->oriValue; //!!! } if ($oMbqEtForumTopic->isDeleted->hasSetOriValue()) { $data['status']['is_deleted'] = (bool) $oMbqEtForumTopic->isDeleted->oriValue; } $data['permission'] = array(); if ($oMbqEtForumTopic->canReply->hasSetOriValue()) { $data['permission']['can_reply'] = (bool) $oMbqEtForumTopic->canReply->oriValue; } else { $data['permission']['can_reply'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canReply.default'); } if ($oMbqEtForumTopic->canRename->hasSetOriValue()) { $data['permission']['can_edit'] = (bool) $oMbqEtForumTopic->canRename->oriValue; } else { $data['permission']['can_edit'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canRename.default'); } if ($oMbqEtForumTopic->canSubscribe->hasSetOriValue()) { $data['permission']['can_follow'] = (bool) $oMbqEtForumTopic->canSubscribe->oriValue; } else { $data['permission']['can_follow'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canSubscribe.default'); } if ($oMbqEtForumTopic->canClose->hasSetOriValue()) { $data['permission']['can_close'] = (bool) $oMbqEtForumTopic->canClose->oriValue; } else { $data['permission']['can_close'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canClose.default'); } if ($oMbqEtForumTopic->canStick->hasSetOriValue()) { $data['permission']['can_stick'] = (bool) $oMbqEtForumTopic->canStick->oriValue; } else { $data['permission']['can_stick'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canStick.default'); } if ($oMbqEtForumTopic->canApprove->hasSetOriValue()) { $data['permission']['can_approve'] = (bool) $oMbqEtForumTopic->canApprove->oriValue; } else { $data['permission']['can_approve'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canApprove.default'); } if ($oMbqEtForumTopic->canDelete->hasSetOriValue()) { $data['permission']['can_delete'] = (bool) $oMbqEtForumTopic->canDelete->oriValue; } else { $data['permission']['can_delete'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canDelete.default'); } if ($oMbqEtForumTopic->canMove->hasSetOriValue()) { $data['permission']['can_move'] = (bool) $oMbqEtForumTopic->canMove->oriValue; } else { $data['permission']['can_move'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canMove.default'); } if ($oMbqEtForumTopic->canMerge->hasSetOriValue()) { $data['permission']['can_merge'] = (bool) $oMbqEtForumTopic->canMerge->oriValue; } else { $data['permission']['can_merge'] = (bool) MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canMerge.default'); } $oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost'); if ($oMbqEtForumTopic->oFirstMbqEtForumPost) { $data['first_post'] = $oMbqRdEtForumPost->returnApiDataForumPost($oMbqEtForumTopic->oFirstMbqEtForumPost); } if ($oMbqEtForumTopic->oLastMbqEtForumPost) { $data['last_post'] = $oMbqRdEtForumPost->returnApiDataForumPost($oMbqEtForumTopic->oLastMbqEtForumPost); } return $data; }
/** * judge is all cfgValueType */ public function isAllCfgValueType() { return $this->hasSetCfgValueType() && $this->cfgValueType == MbqBaseFdt::getFdt('MbqFdtConfig.otherDefine.cfgValueType.range.all') ? TRUE : FALSE; }
/** * return user api data * * @param Object $oMbqEtUser * @return Array */ public function returnApiDataUser($oMbqEtUser) { if (MbqMain::isJsonProtocol()) { return $this->returnJsonApiDataUser($oMbqEtUser); } $data = array(); if ($oMbqEtUser->userId->hasSetOriValue()) { $data['user_id'] = (string) $oMbqEtUser->userId->oriValue; } $data['username'] = (string) $oMbqEtUser->getDisplayName(); $data['user_name'] = (string) $oMbqEtUser->getDisplayName(); if ($oMbqEtUser->userGroupIds->hasSetOriValue()) { $data['usergroup_id'] = (array) MbqMain::$oMbqCm->changeArrValueToString($oMbqEtUser->userGroupIds->oriValue); } if ($oMbqEtUser->iconUrl->hasSetOriValue()) { $data['icon_url'] = (string) $oMbqEtUser->iconUrl->oriValue; } if ($oMbqEtUser->postCount->hasSetOriValue()) { $data['post_count'] = (int) $oMbqEtUser->postCount->oriValue; } if ($oMbqEtUser->canPm->hasSetOriValue()) { $data['can_pm'] = (bool) $oMbqEtUser->canPm->oriValue; } else { $data['can_pm'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canPm.default'); } if ($oMbqEtUser->canSendPm->hasSetOriValue()) { $data['can_send_pm'] = (bool) $oMbqEtUser->canSendPm->oriValue; } else { $data['can_send_pm'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canSendPm.default'); } if ($oMbqEtUser->canModerate->hasSetOriValue()) { $data['can_moderate'] = (bool) $oMbqEtUser->canModerate->oriValue; } else { $data['can_moderate'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canModerate.default'); } if ($oMbqEtUser->canSearch->hasSetOriValue()) { $data['can_search'] = (bool) $oMbqEtUser->canSearch->oriValue; } else { $data['can_search'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canSearch.default'); } if ($oMbqEtUser->canWhosonline->hasSetOriValue()) { $data['can_whosonline'] = (bool) $oMbqEtUser->canWhosonline->oriValue; } else { $data['can_whosonline'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canWhosonline.default'); } if ($oMbqEtUser->canUploadAvatar->hasSetOriValue()) { $data['can_upload_avatar'] = (bool) $oMbqEtUser->canUploadAvatar->oriValue; } else { $data['can_upload_avatar'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canUploadAvatar.default'); } if ($oMbqEtUser->maxAttachment->hasSetOriValue()) { $data['max_attachment'] = (int) $oMbqEtUser->maxAttachment->oriValue; } if ($oMbqEtUser->maxPngSize->hasSetOriValue()) { $data['max_png_size'] = (int) $oMbqEtUser->maxPngSize->oriValue; } if ($oMbqEtUser->maxJpgSize->hasSetOriValue()) { $data['max_jpg_size'] = (int) $oMbqEtUser->maxJpgSize->oriValue; } if ($oMbqEtUser->displayText->hasSetOriValue()) { $data['display_text'] = (string) $oMbqEtUser->displayText->oriValue; } if ($oMbqEtUser->regTime->hasSetOriValue()) { $data['reg_time'] = (string) MbqMain::$oMbqCm->datetimeIso8601Encode($oMbqEtUser->regTime->oriValue); } if ($oMbqEtUser->lastActivityTime->hasSetOriValue()) { $data['last_activity_time'] = (string) MbqMain::$oMbqCm->datetimeIso8601Encode($oMbqEtUser->lastActivityTime->oriValue); } if ($oMbqEtUser->isOnline->hasSetOriValue()) { $data['is_online'] = (bool) $oMbqEtUser->isOnline->oriValue; } if ($oMbqEtUser->acceptPm->hasSetOriValue()) { $data['accept_pm'] = (bool) $oMbqEtUser->acceptPm->oriValue; } else { $data['accept_pm'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.acceptPm.default'); } if ($oMbqEtUser->iFollowU->hasSetOriValue()) { $data['i_follow_u'] = (bool) $oMbqEtUser->iFollowU->oriValue; } else { $data['i_follow_u'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.iFollowU.default'); } if ($oMbqEtUser->uFollowMe->hasSetOriValue()) { $data['u_follow_me'] = (bool) $oMbqEtUser->uFollowMe->oriValue; } else { $data['u_follow_me'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.uFollowMe.default'); } if ($oMbqEtUser->acceptFollow->hasSetOriValue()) { $data['accept_follow'] = (bool) $oMbqEtUser->acceptFollow->oriValue; } else { $data['accept_follow'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.acceptFollow.default'); } if ($oMbqEtUser->followingCount->hasSetOriValue()) { $data['following_count'] = (int) $oMbqEtUser->followingCount->oriValue; } if ($oMbqEtUser->follower->hasSetOriValue()) { $data['follower'] = (int) $oMbqEtUser->follower->oriValue; } if ($oMbqEtUser->currentAction->hasSetOriValue()) { $data['current_action'] = (string) $oMbqEtUser->currentAction->oriValue; } if ($oMbqEtUser->topicId->hasSetOriValue()) { $data['topic_id'] = (string) $oMbqEtUser->topicId->oriValue; } if ($oMbqEtUser->canBan->hasSetOriValue()) { $data['can_ban'] = (bool) $oMbqEtUser->canBan->oriValue; } else { $data['can_ban'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canBan.default'); } if ($oMbqEtUser->isBan->hasSetOriValue()) { $data['is_ban'] = (bool) $oMbqEtUser->isBan->oriValue; } if ($oMbqEtUser->canMarkSpam->hasSetOriValue()) { $data['can_mark_spam'] = (bool) $oMbqEtUser->canMarkSpam->oriValue; } else { $data['can_mark_spam'] = (bool) MbqBaseFdt::getFdt('MbqFdtUser.MbqEtUser.canMarkSpam.default'); } if ($oMbqEtUser->isSpam->hasSetOriValue()) { $data['is_spam'] = (bool) $oMbqEtUser->isSpam->oriValue; } if ($oMbqEtUser->reputation->hasSetOriValue()) { $data['reputation'] = (int) $oMbqEtUser->reputation->oriValue; } if ($oMbqEtUser->customFieldsList->hasSetOriValue()) { $data['custom_fields_list'] = (array) MbqMain::$oMbqCm->changeArrValueToString($oMbqEtUser->customFieldsList->oriValue); } return $data; }