当前位置: 首页>>代码示例>>PHP>>正文


PHP WebUtils::emptyHtml方法代码示例

本文整理汇总了PHP中WebUtils::emptyHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP WebUtils::emptyHtml方法的具体用法?PHP WebUtils::emptyHtml怎么用?PHP WebUtils::emptyHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebUtils的用法示例。


在下文中一共展示了WebUtils::emptyHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getImageInfoByTids

 private function _getImageInfoByTids($page, $pageSize)
 {
     $imageList = $this->_getImageTidsByFids($page, $pageSize);
     $list = array();
     global $_G;
     $forum = $_G['forum'];
     foreach ($imageList as $image) {
         $tmpImageInfo = ForumUtils::getTopicInfo($image);
         $imageSummary = ForumUtils::getTopicCover((int) $image);
         $imageInfo['board_id'] = (int) $tmpImageInfo['fid'];
         $imageInfo['board_name'] = $fid != 0 ? $forum['name'] : ForumUtils::getForumName($tmpImageInfo['fid']);
         $imageInfo['board_name'] = WebUtils::emptyHtml($imageInfo['board_name']);
         $imageInfo['topic_id'] = (int) $image;
         $imageInfo['title'] = WebUtils::emptyHtml($tmpImageInfo['subject']);
         $imageInfo['user_id'] = (int) $tmpImageInfo['authorid'];
         $imageInfo['last_reply_date'] = $tmpImageInfo['lastpost'] . "000";
         $imageInfo['user_nick_name'] = $tmpImageInfo['author'];
         $imageInfo['hits'] = (int) $tmpImageInfo['views'];
         $imageInfo['replies'] = (int) $tmpImageInfo['replies'];
         $imageInfo['top'] = (int) ForumUtils::isTopTopic($image) ? 1 : 0;
         $imageInfo['status'] = (int) $tmpImageInfo['status'];
         $imageInfo['essence'] = (int) $tmpImageInfo['digest'] ? 1 : 0;
         $imageInfo['hot'] = (int) $tmpImageInfo['highlight'] ? 1 : 0;
         $tempImageInfo = ImageUtils::getThumbImageEx($imageSummary, 15, true, false);
         $imageInfo['pic_path'] = $tempImageInfo['image'];
         $imageInfo['ratio'] = $tempImageInfo['ratio'];
         $imageInfo['userAvatar'] = UserUtils::getUserAvatar($tmpImageInfo['authorid']);
         $imageInfo['recommendAdd'] = (int) ForumUtils::getRecommendAdd($image);
         $imageInfo['isHasRecommendAdd'] = (int) ForumUtils::isHasRecommendAdd($image);
         $imageInfo['imageList'] = array();
         $imageInfo['sourceWebUrl'] = (string) ForumUtils::getSourceWebUrl($image, 'topic');
         $list[] = $imageInfo;
     }
     return $list;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:35,代码来源:PhotoGalleryAction.php

示例2: getTopicSort

 public function getTopicSort($threadsortshow)
 {
     $sort = array('title' => '', 'summary' => '');
     if ($threadsortshow['optionlist']) {
         if ($threadsortshow['optionlist'] == 'expire') {
             $sort['summary'] = WebUtils::t("该信息已经过期\n");
         } else {
             global $_G;
             $sort['title'] = $_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']];
             if (is_array($threadsortshow['optionlist'])) {
                 foreach ($threadsortshow['optionlist'] as $option) {
                     if ($option['type'] != 'info') {
                         $sort['summary'] .= sprintf("%s :\t", $option['title']);
                         if ($option['value'] || $option['type'] == 'number' && $option['value'] !== '') {
                             $option['value'] = WebUtils::emptyHtml($option['value']);
                             $sort['summary'] .= $option['value'] . $option['unit'];
                         }
                         $sort['summary'] .= "\n";
                     }
                 }
             }
         }
     }
     return $sort;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:25,代码来源:SortTemplate.php

示例3: _getImageInfoList

 private function _getImageInfoList($res, $landUid, $uid, $page, $pageSize, $albumId)
 {
     $list = array();
     $imageList = UserPhotoInfo::getImageListByAlbumId($albumId, $uid, $page, $pageSize);
     foreach ($imageList as $image) {
         $tempimageInfo = PhotoUtils::getPhotoInfo($image);
         // $imageInfo['board_id'] = (Int)$albumId;
         $imageInfo['pic_id'] = (int) $image;
         $imageInfo['title'] = $tempimageInfo['title'] == "" ? $tempimageInfo['filename'] : $tempimageInfo['title'];
         $imageInfo['title'] = WebUtils::emptyHtml($imageInfo['title']);
         $imageInfo['user_id'] = (int) $uid;
         $imageInfo['release_date'] = $tempimageInfo['dateline'] . "000";
         $lastReplyDate = PhotoUtils::getReplyDate($image);
         $imageInfo['last_update_date'] = $lastReplyDate['last_reply_date'] . "000";
         $imageInfo['user_nick_name'] = $tempimageInfo['username'];
         $imageInfo['hot'] = (int) $tempimageInfo['hot'];
         $imageInfo['replies'] = (int) PhotoUtils::getReplyCount($image);
         $imageInfo['thumb_pic'] = PhotoUtils::getImageCover($image);
         $imageInfo['origin_pic'] = PhotoUtils::getPhotosoRiginCover($tempimageInfo);
         $list[] = $imageInfo;
     }
     global $_G;
     if ($_G['adminid'] != 1) {
         $albumInfo = UserPhotoInfo::getAlbumInfo($uid, $albumId);
         switch ($albumInfo['friend']) {
             case 0:
                 $list;
                 break;
             case 1:
                 UserUtils::isFriend($uid, $landUid) || $landUid == $uid ? $list : ($list = 1);
                 break;
             case 2:
                 $list = PhotoUtils::judgeDesignatedFriends($albumInfo, $landUid, $uid, $list);
                 break;
             case 3:
                 $uid == $landUid ? $list : ($list = 3);
                 break;
             case 4:
                 $landUid == $uid ? $list : ($list = 4);
                 break;
         }
     }
     $res['list'] = $list;
     if ($albumId == 0) {
         $count = UserPhotoInfo::getImageListCountByAlbumId($uid);
     } else {
         $count = UserPhotoInfo::getImageListCount($albumId, $uid);
     }
     $res = WebUtils::getWebApiArrayWithPage_oldVersion($page, $pageSize, $count, $res);
     if (empty($res['list'])) {
         if ($albumId == 0) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_defaultAlbum_does_not_exist');
         }
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_does_not_exist');
     } elseif ($res['list'] == 1 || $res['list'] == 2 || $res['list'] == 3 || $res['list'] == 4) {
         $res['list'] = array();
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_set_privacy', array('{username}' => $albumInfo['username']));
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:60,代码来源:PhotoListAction.php

示例4: _getAnnouncementInfo

 private function _getAnnouncementInfo($res, $id)
 {
     global $_G;
     require_once libfile('function/discuzcode');
     $announce = DzForumAnnouncement::getAnnouncementByUid($id);
     if (!count($announce)) {
         $res = $this->makeErrorInfo($res, 'announcement_nonexistence');
     } else {
         $tempAnnounce = array();
         $tempAnnounce['author'] = $announce['author'];
         $tmp = explode('.', dgmdate($announce['starttime'], 'Y.m'));
         $months[$tmp[0] . $tmp[1]] = $tmp;
         if (!empty($_GET['m']) && $_GET['m'] != dgmdate($announce['starttime'], 'Ym')) {
             continue;
         }
         $tempAnnounce['starttime'] = dgmdate($announce['starttime'], 'd');
         $tempAnnounce['endtime'] = $announce['endtime'] ? dgmdate($announce['endtime'], 'd') : '';
         $tempAnnounce['title'] = WebUtils::emptyHtml($announce['subject']);
         $uid = DzCommonMember::getUidByUsername($announce['author']);
         $tempAnnounce['icon'] = UserUtils::getUserAvatar($uid);
         $announceMessage = $announce['type'] == 1 ? "{$announce[message]}" : $announceMessage;
         $announceMessage = nl2br(discuzcode($announce['message'], 0, 0, 1, 1, 1, 1, 1));
         $announceType = array();
         $announceType['infor'] = WebUtils::emptyHtml($announceMessage);
         $announce['type'] == 1 ? $announceType['type'] = 'url' : ($announceType['type'] = 'text');
         $tempAnnounce['content'] = $announceType;
         $res['body']['list'] = $tempAnnounce;
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:30,代码来源:AnnouncementAction.php

示例5: _getNotifyInfo

 private function _getNotifyInfo($uid, $type, $page, $pageSize)
 {
     $info = array('count' => 0, 'list' => array(), 'data' => array());
     $count = DzHomeNotification::getCountByUid($uid, $type);
     $notifyData = DzHomeNotification::getAllNotifyByUid($uid, $type, $page, $pageSize);
     foreach ($notifyData as $data) {
         $isAllowData = true;
         $actions = array();
         $matches = array();
         preg_match('/<a onclick="showWindow.+?>(\\S+)<\\/a>/mi', $data['note'], $matches);
         if (!empty($matches)) {
             $actions = array();
             $action = array('redirect' => '', 'title' => $matches[1], 'type' => '');
             // 添加好友按钮
             $tempMatches = array();
             preg_match('/ac=friend&op=(\\w+)&uid=(\\d+)/mi', $matches[0], $tempMatches);
             if (!empty($tempMatches)) {
                 $action['redirect'] = WebUtils::createUrl_oldVersion('user/useradminview', array('act' => $tempMatches[1], 'uid' => $tempMatches[2]));
                 $action['type'] = self::NOTIFY_TYPE_FRIEND;
             }
             $data['note'] = str_replace($matches[1], '', $data['note']);
             // 暂时屏蔽已经是好友的动作
             if (friend_check($tempMatches[2])) {
                 $isAllowData = false;
                 $count--;
             }
             $actions[] = $action;
         }
         if ($isAllowData) {
             $tmpData['dateline'] = $data['dateline'] . '000';
             $tmpData['type'] = $data['type'];
             $tmpData['note'] = WebUtils::emptyHtml($data['note']);
             $tmpData['fromId'] = (int) $data['from_id'];
             $tmpData['fromIdType'] = $data['from_idtype'];
             $tmpData['author'] = $data['author'];
             $tmpData['authorId'] = (int) $data['authorid'];
             $tmpData['authorAvatar'] = UserUtils::getUserAvatar($data['authorid']);
             $tmpData['actions'] = $actions;
             $info['data'][] = $tmpData;
         }
     }
     if ($type == self::NOTIFY_TYPE_POST || $type == self::NOTIFY_TYPE_AT) {
         foreach ($notifyData as $data) {
             $matches = array();
             preg_match_all('/&ptid=(\\d+?)&pid=(\\d+?)"/i', $data['note'], $matches);
             $ptid = $matches[1][0];
             $pid = $matches[2][0];
             $postInfo = $this->_getPostInfo($ptid, $pid);
             if (!empty($postInfo)) {
                 $info['list'][] = $postInfo;
             } else {
                 --$count;
             }
         }
     }
     $info['count'] = $count;
     return $info;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:58,代码来源:NotifyListAction.php

示例6: getUserTitle

 public static function getUserTitle($uid, $userInfo = array())
 {
     $userTitle = '';
     empty($userInfo) && ($userInfo = self::getUserInfo($uid));
     if (!empty($userInfo)) {
         $groupId = $userInfo['groupid'];
         $userGroup = UserUtils::getUserGroupsByGids($groupId);
         $userTitle = (string) WebUtils::emptyHtml($userGroup[$groupId]['grouptitle']);
     }
     return $userTitle;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:11,代码来源:UserUtils.php

示例7: makeErrorInfo

 public static function makeErrorInfo($res, $message, $params = array())
 {
     $errInfo = explode(':', Yii::t('mobcent', $message, $params), 2);
     if (count($errInfo) == 1) {
         $errInfo[1] = $errInfo[0];
         $errInfo[0] = isset($params['noError']) && $params['noError'] > 0 ? MOBCENT_ERROR_NONE : MOBCENT_ERROR_DEFAULT;
     }
     $res['head']['errCode'] = !empty($errInfo[0]) ? $errInfo[0] : '';
     $res['head']['errInfo'] = !empty($errInfo[1]) ? WebUtils::emptyHtml($errInfo[1]) : '';
     $res['head']['alert'] = isset($params['alert']) ? (int) $params['alert'] : 1;
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:12,代码来源:WebUtils.php

示例8: _getAlbumInfoList

 private function _getAlbumInfoList($res, $landUid, $uid, $page, $pageSize)
 {
     $list = array();
     $albumList = UserAlbumInfo::getAlbumList($uid, $page, $pageSize);
     foreach ($albumList as $album) {
         $albumInfo['album_id'] = (int) $album['albumid'];
         $albumInfo['user_id'] = (int) $uid;
         $albumInfo['release_date'] = $album['dateline'] . "000";
         $albumInfo['last_update_date'] = $album['updatetime'] . "000";
         $albumInfo['user_nick_name'] = $album['username'];
         $albumInfo['title'] = WebUtils::emptyHtml($album['albumname']);
         $albumInfo['info'] = $album['depict'];
         $albumPic = $this->getAlbumImagePic($album);
         $albumInfo['thumb_pic'] = PhotoUtils::getPhotoAlbumCover($albumPic);
         $list[] = $albumInfo;
     }
     $count = UserAlbumInfo::getAlbumListCount($uid) + 1;
     if ($page == ceil($count / $pageSize) && $landUid == $uid) {
         $list[] = $this->getDefaultAlbum($uid);
     }
     return $list;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:22,代码来源:AlbumListAction.php

示例9: _sendPostResult

 private function _sendPostResult($jsonInfo, $act)
 {
     $res = $this->initWebApiArray();
     switch ($act) {
         case 'new':
             $res['head']['errInfo'] = WebUtils::t('发贴成功');
             break;
         case 'reply':
             $res['head']['errInfo'] = WebUtils::t('回贴成功');
             break;
         default:
             $res['head']['errInfo'] = WebUtils::t('编辑成功');
             break;
     }
     $app = Yii::app()->getController()->mobcentDiscuzApp;
     $app->loadForum($jsonInfo['fid'], $jsonInfo['tid']);
     if (($checkMessage = mobcent_cknewuser()) != '') {
         return $this->makeErrorInfo($res, WebUtils::emptyHtml($checkMessage));
     }
     require_once libfile('class/credit');
     require_once libfile('function/post');
     global $_G;
     if ($_G['forum']['simple'] & 1 || $_G['forum']['redirect']) {
         return $this->makeErrorInfo($res, lang('message', 'forum_disablepost'));
     }
     /*初始化变量*/
     $pid = 0;
     $sortid = 0;
     $typeid = 0;
     $special = 0;
     $readperm = 0;
     $_GET['tid'] = $jsonInfo['tid'];
     $_GET['fid'] = $jsonInfo['fid'];
     $_G['tid'] = $jsonInfo['tid'];
     $_GET['typeoption'] = WebUtils::jsonDecode(rawurldecode($jsonInfo['typeOption']));
     $typeInfo = array();
     foreach ($_GET['typeoption'] as $k => $v) {
         $typeInfo[$k] = WebUtils::t($v);
     }
     $_GET['typeoption'] = $typeInfo;
     $_GET['isanonymous'] = $jsonInfo['isAnonymous'];
     $_GET['hiddenreplies'] = $jsonInfo['isOnlyAuthor'];
     $_GET['usesig'] = 1;
     $_GET['allownoticeauthor'] = 1;
     if ($jsonInfo['typeId']) {
         $typeid = $jsonInfo['typeId'];
     }
     //copy dz from source/module/forum/forum_post.php
     $postinfo = array('subject' => '');
     $thread = array('readperm' => '', 'pricedisplay' => '', 'hiddenreplies' => '');
     $_G['forum_dtype'] = $_G['forum_checkoption'] = $_G['forum_optionlist'] = $tagarray = $_G['forum_typetemplate'] = array();
     if ($jsonInfo['sortId'] && $jsonInfo['sortId'] > 0) {
         $sortid = $jsonInfo['sortId'];
         require_once libfile('post/threadsorts', 'include');
     }
     /*找出哪项是图片上传项和多项选择项,拼接成所想要的数组类型*/
     $optionId = DB::fetch_all("SELECT optionid FROM " . DB::table('forum_typevar') . " WHERE sortid=%d", array($sortid));
     foreach ($optionId as $key => $value) {
         $type = DB::fetch_first("SELECT identifier,type FROM " . DB::table('forum_typeoption') . " WHERE optionid=%d", array($value['optionid']));
         if ($type['type'] == 'image') {
             $attachImg = DB::fetch_first("SELECT attachment FROM " . DB::table('forum_attachment_unused') . " WHERE aid = %d ", array($_GET['typeoption'][$type['identifier']]));
             $attachImg = $_G['setting']['attachurl'] . 'forum/' . $attachImg['attachment'];
             $_GET['typeoption'][$type['identifier']] = array('aid' => $_GET['typeoption'][$type['identifier']], 'url' => $attachImg);
         }
         if ($type['type'] == 'checkbox') {
             $_GET['typeoption'][$type['identifier']] = explode(',', $_GET['typeoption'][$type['identifier']]);
         }
     }
     require_once libfile('function/discuzcode');
     if ($act == 'edit' || $act == 'reply') {
         $thread = C::t('forum_thread')->fetch($_G['tid']);
         if (!$_G['forum_auditstatuson'] && !($thread['displayorder'] >= 0 || in_array($thread['displayorder'], array(-4, -2)) && $thread['authorid'] == $_G['uid'])) {
             $thread = array();
         }
         if (!empty($thread)) {
             if ($thread['readperm'] && $thread['readperm'] > $_G['group']['readaccess'] && !$_G['forum']['ismoderator'] && $thread['authorid'] != $_G['uid']) {
                 return WebUtils::makeErrorInfo_oldVersion($res, 'thread_nopermission', array('{readperm}' => $thread['readperm']));
             }
             $_G['fid'] = $thread['fid'];
             $special = $thread['special'];
         } else {
             return WebUtils::makeErrorInfo_oldVersion($res, 'thread_nonexistence');
         }
         if ($thread['closed'] == 1 && !$_G['forum']['ismoderator']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'post_thread_closed');
         }
     }
     if ($jsonInfo['isQuote'] && $jsonInfo['replyId'] > 0) {
         $_GET['repquote'] = $jsonInfo['replyId'];
         $language = lang('forum/misc');
         $noticeauthor = $noticetrimstr = '';
         $thaquote = C::t('forum_post')->fetch('tid:' . $_G['tid'], $_GET['repquote']);
         if (!($thaquote && ($thaquote['invisible'] == 0 || $thaquote['authorid'] == $_G['uid'] && $thaquote['invisible'] == -2))) {
             $thaquote = array();
         }
         if ($thaquote['tid'] != $_G['tid']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'reply_quotepost_error');
         }
         if (getstatus($thread['status'], 2) && $thaquote['authorid'] != $_G['uid'] && $_G['uid'] != $thread['authorid'] && $thaquote['first'] != 1 && !$_G['forum']['ismoderator']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'reply_quotepost_error');
//.........这里部分代码省略.........
开发者ID:caidongyun,项目名称:CS,代码行数:101,代码来源:TopicAdminAction.php

示例10: _getTopicTypeSortInfos

 private function _getTopicTypeSortInfos()
 {
     $infos = array();
     $fields = DbUtils::getDzDbUtils(true)->queryAll('
         SELECT fid, threadtypes, threadsorts
         FROM %t
         WHERE fid IN (%n)
         ', array('forum_forumfield', DzForumForum::getFids()));
     foreach ($fields as $field) {
         if (!empty($field)) {
             $info = array('fid' => (int) $field['fid'], 'types' => array(), 'sorts' => array());
             $types = unserialize($field['threadtypes']);
             if (!empty($types['types'])) {
                 foreach ($types['types'] as $key => $value) {
                     // 控制管理组专用
                     // if ($types['moderators'][$key] == 1) {
                     // continue;
                     // }
                     $info['types'][] = array('id' => $key, 'title' => WebUtils::emptyHtml($value));
                 }
             }
             $sorts = unserialize($field['threadsorts']);
             if (!empty($sorts['types'])) {
                 foreach ($sorts['types'] as $key => $value) {
                     $info['sorts'][] = array('id' => $key, 'title' => WebUtils::emptyHtml($value));
                 }
             }
             $infos[$info['fid']] = $info;
         }
     }
     return $infos;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:32,代码来源:UIDiyController.php

示例11: _transMessage

 private function _transMessage($msgString)
 {
     $msg = array('type' => 'text', 'content' => '');
     $matches = array();
     preg_match_all('/<img.*?src="(.*?)".*?\\/>/s', $msgString, $matches, PREG_SET_ORDER);
     if (!empty($matches)) {
         foreach ($matches as $match) {
             $match[1] = WebUtils::getHttpFileName($match[1]);
             if (strpos($match[0], 'static/image/smiley') !== false || strpos($match[0], 'mobcent/app/data/phiz') !== false) {
                 $msgString = str_replace($match[0], sprintf('[mobcent_phiz=%s]', $match[1]), $msgString);
             } else {
                 $msg['type'] = 'image';
                 $msgString = ImageUtils::getThumbImage($match[1]);
                 break;
             }
         }
     }
     $matches = array();
     preg_match_all('/<a href="(.*?)".*?>(.*?)<\\/a>/s', $msgString, $matches, PREG_SET_ORDER);
     if (!empty($matches)) {
         foreach ($matches as $match) {
             $match[1] = WebUtils::getHttpFileName($match[1]);
             if (strpos($match[0], UploadUtils::getUploadAudioBaseUrlPath()) !== false) {
                 $msg['type'] = 'audio';
                 $msgString = $match[1];
                 break;
             } else {
                 // $msgString = str_replace($match[0], sprintf('[mobcent_url=%s]%s[/mobcent_url]', $match[1], $match[2]), $msgString);
                 $msgString = str_replace($match[0], sprintf(' %s %s ', $match[2], $match[1]), $msgString);
             }
         }
     }
     $msg['content'] = WebUtils::emptyHtml($msgString);
     return $msg;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:35,代码来源:PMListAction.php

示例12: _init_misc

 protected function _init_misc()
 {
     if ($this->config['security']['urlxssdefend'] && !defined('DISABLEXSSCHECK')) {
         $this->_xss_check();
     }
     // if(!$this->init_misc) {
     //     return false;
     // }
     lang('core');
     if ($this->init_setting && $this->init_user) {
         if (!isset($this->var['member']['timeoffset']) || $this->var['member']['timeoffset'] == 9999 || $this->var['member']['timeoffset'] === '') {
             $this->var['member']['timeoffset'] = $this->var['setting']['timeoffset'];
         }
     }
     $timeoffset = $this->init_setting ? $this->var['member']['timeoffset'] : $this->var['setting']['timeoffset'];
     $this->var['timenow'] = array('time' => dgmdate(TIMESTAMP), 'offset' => $timeoffset >= 0 ? $timeoffset == 0 ? '' : '+' . $timeoffset : $timeoffset);
     $this->timezone_set($timeoffset);
     $this->var['formhash'] = formhash();
     define('FORMHASH', $this->var['formhash']);
     if ($this->init_user) {
         $allowvisitflag = in_array(CURSCRIPT, array('member')) || defined('ALLOWGUEST') && ALLOWGUEST;
         if ($this->var['group'] && isset($this->var['group']['allowvisit']) && !$this->var['group']['allowvisit']) {
             if ($this->var['uid'] && !$allowvisitflag) {
                 if (!defined('IN_MOBILE_API')) {
                     showmessage('user_banned');
                 } else {
                     mobile_core::result(array('error' => 'user_banned'));
                 }
             } elseif ((!defined('ALLOWGUEST') || !ALLOWGUEST) && !in_array(CURSCRIPT, array('member', 'api')) && !$this->var['inajax']) {
                 if (!defined('IN_MOBILE_API')) {
                     dheader('location: member.php?mod=logging&action=login&referer=' . rawurlencode($this->var['siteurl'] . $this->var['basefilename'] . ($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '')));
                 } else {
                     mobile_core::result(array('error' => 'to_login'));
                 }
             }
         }
         if (isset($this->var['member']['status']) && $this->var['member']['status'] == -1 && !$allowvisitflag) {
             if (!defined('IN_MOBILE_API')) {
                 showmessage('user_banned');
             } else {
                 mobile_core::result(array('error' => 'user_banned'));
             }
         }
     }
     if ($this->var['setting']['ipaccess'] && !ipaccess($this->var['clientip'], $this->var['setting']['ipaccess'])) {
         if (!defined('IN_MOBILE_API')) {
             showmessage('user_banned');
         } else {
             mobile_core::result(array('error' => 'user_banned'));
         }
     }
     if ($this->var['setting']['bbclosed']) {
         if ($this->var['uid'] && ($this->var['group']['allowvisit'] == 2 || $this->var['groupid'] == 1)) {
         } elseif (in_array(CURSCRIPT, array('admin', 'member', 'api')) || defined('ALLOWGUEST') && ALLOWGUEST) {
         } else {
             $closedreason = C::t('common_setting')->fetch('closedreason');
             $closedreason = str_replace(':', '&#58;', $closedreason);
             if (!defined('IN_MOBILE_API')) {
                 // showmessage($closedreason ? $closedreason : 'board_closed', NULL, array('adminemail' => $this->var['setting']['adminemail']), array('login' => 1));
                 $closedreason = $closedreason ? $closedreason : lang('message', 'board_closed');
                 WebUtils::endAppWithErrorInfo(array(), WebUtils::emptyHtml($closedreason));
             } else {
                 mobile_core::result(array('error' => $closedreason ? $closedreason : 'board_closed'));
             }
         }
     }
     if (CURSCRIPT != 'admin' && !in_array($this->var['mod'], array('logging', 'seccode'))) {
         periodscheck('visitbanperiods');
     }
     if (defined('IN_MOBILE')) {
         $this->var['tpp'] = $this->var['setting']['mobile']['mobiletopicperpage'] ? intval($this->var['setting']['mobile']['mobiletopicperpage']) : 20;
         $this->var['ppp'] = $this->var['setting']['mobile']['mobilepostperpage'] ? intval($this->var['setting']['mobile']['mobilepostperpage']) : 5;
     } else {
         $this->var['tpp'] = $this->var['setting']['topicperpage'] ? intval($this->var['setting']['topicperpage']) : 20;
         $this->var['ppp'] = $this->var['setting']['postperpage'] ? intval($this->var['setting']['postperpage']) : 10;
     }
     if ($this->var['setting']['nocacheheaders']) {
         @header("Expires: -1");
         @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
         @header("Pragma: no-cache");
     }
     if ($this->session->isnew && $this->var['uid']) {
         updatecreditbyaction('daylogin', $this->var['uid']);
         include_once libfile('function/stat');
         updatestat('login', 1);
         if (defined('IN_MOBILE')) {
             updatestat('mobilelogin', 1);
         }
         if ($this->var['setting']['connect']['allow'] && $this->var['member']['conisbind']) {
             updatestat('connectlogin', 1);
         }
     }
     if (isset($this->var['member']['conisbind']) && $this->var['member']['conisbind'] && $this->var['setting'] && $this->var['setting']['connect']['newbiespan'] !== '') {
         $this->var['setting']['newbiespan'] = $this->var['setting']['connect']['newbiespan'];
     }
     $lastact = TIMESTAMP . "\t" . dhtmlspecialchars(basename($this->var['PHP_SELF'])) . "\t" . dhtmlspecialchars($this->var['mod']);
     dsetcookie('lastact', $lastact, 86400);
     setglobal('currenturl_encode', base64_encode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
     if ((!empty($_GET['fromuid']) || !empty($_GET['fromuser'])) && ($this->var['setting']['creditspolicy']['promotion_visit'] || $this->var['setting']['creditspolicy']['promotion_register'])) {
         require_once libfile('misc/promotion', 'include');
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:discuz_core_x30.php

示例13: _pmSend

 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'));
     }
//.........这里部分代码省略.........
开发者ID:caidongyun,项目名称:CS,代码行数:101,代码来源:PMAdminAction.php

示例14: transArticleContent

 public static function transArticleContent($content)
 {
     $content = PortalUtils::parseArticleContent($content);
     $newContent = array();
     $matches = array();
     preg_match_all('/(.+?)\\[mobcent_br\\]/s', $content, $matches);
     foreach ($matches[1] as $match) {
         $tempMatches = array();
         $tempContent = array('type' => 'text', 'content' => '');
         preg_match('/\\[mobcent_(audio|video|image)=(.*?)\\]/', $match, $tempMatches);
         if (!empty($tempMatches)) {
             $tempContent['type'] = $tempMatches[1];
             $tempContent['content'] = $tempMatches[2];
             if ($tempContent['type'] == 'image') {
                 $tempContent['extraInfo']['source'] = $tempMatches[2];
                 $tempContent['content'] = ImageUtils::getThumbImage($tempMatches[2]);
             }
         } else {
             $match = preg_replace('/(<p>|<\\/p>|<div>|<\\/div>|<br>|<br\\/>)/i', PortalUtils::CONTENT_DELIMITER, $match);
             $match .= PortalUtils::CONTENT_DELIMITER;
             $tempText = '';
             $tempMatches = array();
             preg_match_all('/(.+?)\\[mobcent_br\\]/s', $match, $tempMatches);
             foreach ($tempMatches[1] as $value) {
                 $value = str_replace(PortalUtils::CONTENT_DELIMITER, '', $value);
                 $tempText .= $value . "\r\n";
             }
             $tempText = WebUtils::emptyHtml($tempText);
             $tempText = (string) trim($tempText);
             $tempContent['content'] = $tempText;
         }
         $tempContent['content'] != '' && ($newContent[] = $tempContent);
     }
     return $newContent;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:35,代码来源:PortalUtils.php

示例15: _transUserList

 private function _transUserList($users, $viewUid, $longitude, $latitude, $radius, $page, $pageSize, $sortType)
 {
     loadcache('usergroups');
     $list = array();
     foreach ($users as $user) {
         if ($sortType == 'range') {
             $tmpUserInfo['distance'] = (string) $user['distance'];
             $tmpUserInfo['location'] = (string) WebUtils::t($user['location']);
             $uid = $user['uid'];
         } else {
             $tmpUserInfo['distance'] = '';
             $tmpUserInfo['location'] = '';
             $uid = $user;
         }
         $tmpUserInfo['is_friend'] = UserUtils::isFollow($viewUid, $uid) ? 1 : 0;
         $tmpUserInfo['isFriend'] = UserUtils::isFriend($viewUid, $uid) ? 1 : 0;
         $tmpUserInfo['isFollow'] = UserUtils::isFollow($viewUid, $uid) ? 1 : 0;
         $tmpUserInfo['uid'] = (int) $uid;
         $tmpUserInfo['name'] = UserUtils::getUserName($uid);
         $tmpUserInfo['name'] = WebUtils::emptyHtml($tmpUserInfo['name']);
         $tmpUserInfo['status'] = (int) UserUtils::getUserLoginStatus($uid);
         $tmpUserInfo['is_black'] = UserUtils::isBlacklist($viewUid, $uid) ? 1 : 0;
         $tmpUserInfo['gender'] = (int) UserUtils::getUserGender($uid);
         $tmpUserInfo['icon'] = UserUtils::getUserAvatar($uid);
         $tmpUserInfo['level'] = (int) DzCommonUserList::getUserLevel($uid);
         $lastLogin = WebUtils::t(DzCommonUserList::getUserLastVisit($uid));
         $tmpUserInfo['lastLogin'] = $lastLogin . '000';
         if ($sortType == 'regdate') {
             $lastRegdate = DzCommonUserList::getUserLastRegdate($uid);
             $tmpUserInfo['dateline'] = $lastRegdate . '000';
         } else {
             $tmpUserInfo['dateline'] = $lastLogin . '000';
         }
         $signature = WebUtils::emptyHtml(DzCommonUserList::getUserSightml($uid));
         $tmpUserInfo['signature'] = WebUtils::t($signature);
         $userInfo = UserUtils::getUserInfo($uid);
         $tmpUserInfo['credits'] = (int) $userInfo['credits'];
         $list[] = $tmpUserInfo;
     }
     return $list;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:41,代码来源:UserListAction.php


注:本文中的WebUtils::emptyHtml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。