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


PHP WebUtils::getWebApiResPadding方法代码示例

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


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

示例1: _getTopicInfo

 private function _getTopicInfo($topic, $params = array())
 {
     extract($params);
     $topicInfo = array();
     $tid = (int) $topic['tid'];
     if (!empty($topic)) {
         $post = ForumUtils::getTopicPostInfo($tid);
         if (!empty($post)) {
             $content = ForumUtils::getTopicContent($tid, $post);
             $sort = $this->_getSortInfo($topic);
             global $_G;
             $typeTitle = $sortTitle = '';
             if ($_G['forum_thread']['typeid'] && $_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]) {
                 if (!IS_ROBOT && ($_G['forum']['threadtypes']['listable'] || $_G['forum']['status'] == 3)) {
                     $typeTitle = "[{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}]";
                 } else {
                     $typeTitle = "[{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}]";
                 }
             }
             if (!empty($sort['title'])) {
                 $sortTitle = "[{$sort['title']}]";
             }
             $topicInfo['topic_id'] = $tid;
             $topicInfo['title'] = $typeTitle . $sortTitle . $topic['subject'];
             $topicInfo['title'] = WebUtils::emptyHtml($topicInfo['title']);
             // 修正帖子查看数
             if (isset($_G['forum_thread']['views']) && $_G['forum_thread']['tid'] == $topic['tid'] && $_G['forum_thread']['views'] > $topic['views']) {
                 $topic['views'] = $_G['forum_thread']['views'];
             }
             $topicInfo['type'] = ForumUtils::getTopicType($topic);
             $topicInfo['sortId'] = (int) $topic['sortid'];
             $topicInfo['user_id'] = ForumUtils::isAnonymousPost($tid, $post) ? 0 : (int) $topic['authorid'];
             $topicInfo['user_nick_name'] = ForumUtils::isAnonymousPost($tid, $post) ? $this->_getAnonymoustext() : $topic['author'];
             $topicInfo['replies'] = (int) $topic['replies'];
             $topicInfo['hits'] = (int) ($topic['replies'] > $topic['views'] ? $topic['replies'] : $topic['views']);
             $topicInfo['essence'] = ForumUtils::isMarrowTopic($topic) ? 1 : 0;
             $topicInfo['vote'] = ForumUtils::isVoteTopic($topic) ? 1 : 0;
             $topicInfo['hot'] = ForumUtils::isHotTopic($topic) ? 1 : 0;
             $topicInfo['top'] = ForumUtils::isTopTopic($topic) ? 1 : 0;
             $topicInfo['is_favor'] = ForumUtils::isFavoriteTopic($_G['uid'], $tid) ? 1 : 0;
             $topicInfo['create_date'] = $topic['dateline'] . '000';
             $topicInfo['icon'] = UserUtils::getUserAvatar($topicInfo['user_id']);
             $topicInfo['level'] = $this->_getUserLevel($topicInfo['user_id']);
             $topicInfo['userTitle'] = UserUtils::getUserTitle($topicInfo['user_id']);
             $postContent = $this->_getPostContent($content);
             if (!empty($sort['summary'])) {
                 array_unshift($postContent, $this->_transSortInfo($sort));
             }
             $topicInfo['content'] = $postContent;
             if ($topicInfo['type'] == 'normal') {
                 $this->_isComplexContent($topicInfo['content']) && ($topicInfo['type'] = 'normal_complex');
             }
             $topicInfo['poll_info'] = ForumUtils::isVoteTopic($topic) ? $this->_getVoteInfo($topic) : WebUtils::getWebApiResPadding();
             $topicInfo['activityInfo'] = ForumUtils::isActivityTopic($topic) ? TopicUtils::getActivityInfo($topic) : WebUtils::getWebApiResPadding();
             $topicInfo['location'] = ForumUtils::getTopicLocation($tid);
             // 主题管理面板编辑 start
             $userMember = $this->_getUserInfoByAuthorid($post['authorid']);
             $userMember = array_merge($userMember, $post);
             $params = array('editPerm' => $editPerm, 'userMember' => $userMember);
             // end
             $manageItems = ForumUtils::getPostManagePanel($params);
             foreach ($manageItems['topic'] as $key => $item) {
                 $item['type'] = $item['action'];
                 if ($item['action'] == 'edit') {
                     $item['action'] = WebUtils::getHttpFileName("forum.php?mod=post&action=edit&fid={$post['fid']}&tid={$tid}&pid={$post['pid']}");
                 } else {
                     $item['action'] = WebUtils::createUrl_oldVersion('forum/topicadminview', array('fid' => $post['fid'], 'tid' => $tid, 'pid' => $post['pid'], 'act' => $item['action'], 'type' => 'topic'));
                 }
                 $manageItems['topic'][$key] = $item;
             }
             $extraItems = ForumUtils::getPostExtraPanel();
             foreach ($extraItems['topic'] as $key => $item) {
                 $item['extParams'] = array('beforeAction' => '');
                 $item['type'] = $item['action'];
                 $item['action'] = '';
                 if ($item['type'] == 'rate') {
                     $item['action'] = WebUtils::createUrl_oldVersion('forum/topicrate', array('tid' => $tid, 'pid' => $post['pid'], 'type' => 'view'));
                     $item['extParams']['beforeAction'] = WebUtils::createUrl_oldVersion('forum/topicrate', array('tid' => $tid, 'pid' => $post['pid'], 'type' => 'check'));
                 } elseif ($item['type'] == 'support') {
                     $item['action'] = WebUtils::createUrl_oldVersion('forum/support', array('tid' => $tid, 'pid' => $post['pid'], 'type' => 'thread'));
                     $item['extParams']['recommendAdd'] = (int) $_G['thread']['recommend_add'];
                     $recommendAdd = DzSupportInfo::getSupportTopicByUidAndTid($_G['uid'], $tid);
                     $item['extParams']['isHasRecommendAdd'] = !empty($recommendAdd) ? 1 : 0;
                 }
                 $extraItems['topic'][$key] = $item;
             }
             $topicInfo['managePanel'] = $manageItems['topic'];
             $topicInfo['extraPanel'] = $extraItems['topic'];
             $topicInfo['mobileSign'] = ForumUtils::getMobileSign($post['status']);
             // if (empty($topic['author']) && !empty($topic['authorid'])){
             //     $topicInfo['reply_status'] = -1;
             // } else if(empty($topic['author']) && empty($topic['authorid'])){
             //     $topicInfo['reply_status'] = 0;
             // } else {
             //     $topicInfo['reply_status'] = 1;
             // }
             $topicInfo['status'] = 1;
             $topicInfo['reply_status'] = 1;
             $topicInfo['flag'] = 0;
             $topicInfo['gender'] = 1;
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:PostListAction.php

示例2: _makeInputElement

 private static function _makeInputElement($type, $name, $value = '', $label = '', $attributes = null, $elements = array())
 {
     empty($attributes) && ($attributes = WebUtils::getWebApiResPadding());
     return array('type' => $type, 'name' => $name, 'value' => $value, 'label' => $label, 'attributes' => $attributes, 'elements' => $elements);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:5,代码来源:TopicUtils.php


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