本文整理汇总了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;
//.........这里部分代码省略.........
示例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);
}