Esempio n. 1
0
 protected function _bulidBbsSign($sign, $groupRight, $userstatus)
 {
     if (!$groupRight['allow_sign'] || Pw::getstatus($userstatus, PwUser::STATUS_BAN_SIGN)) {
         return '';
     }
     $sign = WindSecurity::escapeHTML($sign);
     if ($groupRight['sign_ubb'] && Pw::getstatus($userstatus, PwUser::STATUS_SIGN_USEUBB)) {
         $ubb = new PwUbbCodeConvertConfig();
         $ubb->isConverImg = $groupRight['sign_ubb_img'] ? true : false;
         $sign = PwUbbCode::convert($sign, $ubb);
     }
     return $sign;
 }
Esempio n. 2
0
 protected function _dateFormat()
 {
     if (isset($this->_data['content'])) {
         $this->_data['content'] = PwUbbCode::autoUrl($this->_data['content'], true);
         $useubb = 0;
         if ($this->hide) {
             $this->_data['content'] = "[post]" . str_replace(array('[post]', '[/post]'), "", $this->_data['content']) . "[/post]";
             $useubb = 1;
         }
         if ($this->user && preg_match('/\\[sell=(\\d+)(\\,(\\d+))?\\].+?\\[\\/sell\\]/is', $this->_data['content'], $matchs)) {
             $this->_data['content'] = $this->_formatSell($this->_data['content'], $matchs);
             $useubb = 1;
         }
         if ($this->_data['reminds']) {
             $useubb = 1;
         }
         if (!$useubb) {
             $useubb = $this->_data['content'] == PwUbbCode::convert($this->_data['content'], new PwUbbCodeConvertThread()) ? 0 : 1;
         }
         $this->_setUseubb($useubb);
     }
 }
Esempio n. 3
0
 /** 
  * 编辑用户信息
  */
 public function dorunAction()
 {
     $userDm = new PwUserInfoDm($this->loginUser->uid);
     $userDm->setRealname($this->getInput('realname', 'post'));
     $userDm->setByear($this->getInput('byear', 'post'));
     $userDm->setBmonth($this->getInput('bmonth', 'post'));
     $userDm->setBday($this->getInput('bday', 'post'));
     $userDm->setGender($this->getInput('gender', 'post'));
     $userDm->setHomepage($this->getInput('homepage', 'post'));
     $userDm->setProfile($this->getInput('profile', 'post'));
     list($hometown, $location) = $this->getInput(array('hometown', 'location'), 'post');
     /* @var $srv PwAreaService */
     $srv = Wekit::load('area.srv.PwAreaService');
     $areas = $srv->fetchAreaInfo(array($hometown, $location));
     $userDm->setHometown($hometown, isset($areas[$hometown]) ? $areas[$hometown] : '');
     $userDm->setLocation($location, isset($areas[$location]) ? $areas[$location] : '');
     //没有禁止签名的时候方可编辑签名
     if ($this->loginUser->getPermission('allow_sign')) {
         $bbsSign = $this->getInput('bbs_sign', 'post');
         if (($len = $this->loginUser->getPermission('sign_max_length')) && Pw::strlen($bbsSign) > $len) {
             //仅在此限制签名字数
             $this->showError(array('USER:user.edit.sign.length.over', array('{max}' => $len)));
         }
         Wind::import('LIB:ubb.PwUbbCode');
         Wind::import('LIB:ubb.config.PwUbbCodeConvertConfig');
         $ubb = new PwUbbCodeConvertConfig();
         $ubb->isConverImg = $this->loginUser->getPermission('sign_ubb_img') ? true : false;
         $userDm->setBbsSign($bbsSign)->setSignUseubb($bbsSign != PwUbbCode::convert($bbsSign, $ubb) ? 1 : 0);
     }
     $result = $this->_editUser($userDm, PwUser::FETCH_MAIN + PwUser::FETCH_INFO);
     if ($result instanceof PwError) {
         $this->showError($result->getError());
     } else {
         $this->loginUser->info = array_merge($this->loginUser->info, $userDm->getData());
         $this->showMessage('USER:user.edit.profile.success');
     }
 }
Esempio n. 4
0
 /**
  * 阅读更多
  * 
  */
 public function readAction()
 {
     Wind::import('SRV:forum.bo.PwThreadBo');
     $id = (int) $this->getInput('id');
     $fresh = Wekit::load('attention.PwFresh')->getFresh($id);
     if ($fresh['type'] == 1) {
         $thread = new PwThreadBo($fresh['src_id']);
         $array = $thread->info;
         $array['pid'] = 0;
     } else {
         $array = Wekit::load('forum.PwThread')->getPost($fresh['src_id']);
         $thread = new PwThreadBo($array['tid']);
     }
     Wind::import('LIB:ubb.PwUbbCode');
     Wind::import('LIB:ubb.config.PwUbbCodeConvertThread');
     $array['content'] = WindSecurity::escapeHTML($array['content']);
     $array['content'] = str_replace("\n", '<br />', $array['content']);
     $array['useubb'] && ($array['content'] = PwUbbCode::convert($array['content'], new PwUbbCodeConvertThread($thread, $array, $this->loginUser)));
     echo $array['content'];
     $this->setTemplate('');
 }
Esempio n. 5
0
 public function readAction()
 {
     Wind::import('SRV:forum.bo.PwThreadBo');
     $id = $this->getInput('id');
     $fresh = $this->_getService()->getFresh($id);
     if ($fresh['type'] == 1) {
         $thread = new PwThreadBo($fresh['src_id']);
         $array = $thread->info;
         $array['pid'] = 0;
     } else {
         $array = $this->_getThread()->getPost($fresh['src_id']);
         $thread = new PwThreadBo($array['tid']);
     }
     Wind::import('LIB:ubb.PwUbbCode');
     Wind::import('LIB:ubb.config.PwUbbCodeConvertThread');
     $array['content'] = WindSecurity::escapeHTML($array['content']);
     $array['content'] = str_replace("\n", '<br />', $array['content']);
     $array['useubb'] && ($array['content'] = PwUbbCode::convert($array['content'], new PwUbbCodeConvertThread($thread, $array, $this->loginUser)));
     echo $array['content'];
     $this->setTemplate('');
     //$this->setOutPut($array['content'], 'data');
     //$this->showMessage('success');
 }