本文整理汇总了PHP中WebUtils::getHttpFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP WebUtils::getHttpFileName方法的具体用法?PHP WebUtils::getHttpFileName怎么用?PHP WebUtils::getHttpFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebUtils
的用法示例。
在下文中一共展示了WebUtils::getHttpFileName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArticleSummary
/**
* 获取文章摘要(内容摘要以及图片)
*
* @param int $aid 文章id
* @param bool $transBr 是否要转换换行
* @param array $options 参数选项, 可选值: array('imageList' => 1, 'imageListLen' => 9, 'imageListThumb' => 1)
* @return array array('msg' => '', 'image' => '', 'imageList' => array())
*/
public static function getArticleSummary($aid, $transBr = true, $options = array())
{
$summary = array('msg' => '', 'image' => '', 'imageList' => array());
$summaryLength = WebUtils::getDzPluginAppbymeAppConfig('portal_summary_length');
$allowImage = WebUtils::getDzPluginAppbymeAppConfig('portal_allow_image');
$allowImage = !($allowImage === '0');
if ($summaryLength === '0' && !$allowImage) {
return $summary;
}
require_once DISCUZ_ROOT . './source/function/function_home.php';
$article = DzPortalArticle::getArticleByAid($aid);
if (!empty($article)) {
$getImageList = isset($options['imageList']) ? $options['imageList'] : 0;
$imageListLen = isset($options['imageListLen']) ? $options['imageListLen'] : 9;
$imageListThumb = isset($options['imageListThumb']) ? $options['imageListThumb'] : 1;
$msg = $article['summary'];
if ($article['pic']) {
// $article['pic'] = pic_get($article['pic'], '', $article['thumb'], $article['remote'], 1, 1);
$article['pic'] = pic_get($article['pic'], '', $article['thumb'], $article['remote'], 0, 1);
if ($allowImage) {
$summary['image'] = WebUtils::getHttpFileName($article['pic']);
if ($getImageList) {
$tempImage = $summary['image'];
$imageListThumb && ($tempImage = ImageUtils::getThumbImage($tempImage));
$summary['imageList'][] = $tempImage;
}
}
}
$transBr && ($msg = WebUtils::emptyReturnLine($msg, ' '));
$msg = trim($msg);
$summaryLength === false && ($summaryLength = 40);
$summary['msg'] = (string) WebUtils::subString($msg, 0, $summaryLength);
}
return $summary;
}
示例2: getAttachUrl
public static function getAttachUrl($remote = false)
{
global $_G;
$setting = $_G['setting'];
$attachUrl = WebUtils::getHttpFileName($setting['attachurl']);
$remote && $_G['setting']['ftp']['on'] == 1 && ($attachUrl = WebUtils::getHttpFileName($setting['ftp']['attachurl']));
return $attachUrl;
}
示例3: getActivityInfo
public static function getActivityInfo($tid)
{
$activity = array('image' => '', 'summary' => '', 'content' => array(), 'action' => array(), 'applyList' => array());
$activityInfo = ForumUtils::getTopicActivityInfo($tid);
if (!empty($activityInfo)) {
$activity['image'] = WebUtils::getHttpFileName($activityInfo['thumb']);
$activity['summary'] = self::_getActivitySummary($activityInfo);
$activity['action'] = self::_getActivityAction($activityInfo);
$activity['applyList'] = self::_getActivityApplyList($activityInfo);
$activity['applyListVerified'] = self::_getActivityApplyListVerified($activityInfo);
}
return $activity;
}
示例4: _fetchArticleUrl
private function _fetchArticleUrl($aid)
{
return WebUtils::getHttpFileName('portal.php?mod=view&aid=' . $aid);
}
示例5: getSourceWebUrl
/**
* 获得在pc访问的url
*
* @param mixed $souceId 源的ID
* @param string $sourceType 源的类型(topic|news)
*
* @return string 访问地址
*/
public static function getSourceWebUrl($souceId, $sourceType = 'topic')
{
$sourceWebUrl = '';
switch ($sourceType) {
case 'topic':
$sourceWebUrl = WebUtils::getHttpFileName('forum.php?mod=viewthread&tid=' . $souceId);
break;
case 'news':
$sourceWebUrl = WebUtils::getHttpFileName('portal.php?mod=view&aid=' . $souceId);
break;
default:
break;
}
return $sourceWebUrl;
}
示例6: _getPostInfos
private function _getPostInfos($res, $topic, $page, $pageSize, $order, $authorId, $params = array())
{
extract($params);
$postInfos = array();
$tid = (int) $topic['tid'];
$postCount = ForumUtils::getPostCount($tid, array('authorId' => $authorId));
if (!empty($topic)) {
global $_G;
$isOnlyAuthorTopic = ForumUtils::isOnlyAuthorTopic($topic);
$postList = ForumUtils::getPostList($tid, $page, $pageSize, array('order' => $order ? 'dateline DESC' : 'dateline ASC', 'authorId' => $authorId));
$position = $order ? $postCount + 1 - $pageSize * ($page - 1) : $pageSize * ($page - 1) + 2;
if (MobcentDiscuz::getMobcentDiscuzVersion() > 'x25' && $_G['setting']['repliesrank'] && $postList) {
if ($postList) {
$tempPids = array();
$tempPostRecommends = array();
foreach ($postList as $post) {
$tempPids[] = (int) $post['pid'];
}
foreach (C::t('forum_hotreply_number')->fetch_all_by_pids(array_values($tempPids)) as $pid => $post) {
$tempPostRecommends[$pid]['support'] = dintval($post['support']);
// $tempPostRecommends[$pid]['against'] = dintval($post['against']);
}
$isSupport = DzSupportInfo::getSupportPostsByUidAndTid($_G['uid'], $tid);
}
}
foreach ($postList as $post) {
$pid = (int) $post['pid'];
$content = ForumUtils::getPostContent($tid, $pid, $post);
$isOnlyAuthorPost = $isOnlyAuthorTopic && $_G['uid'] != $post['authorid'] && $_G['uid'] != $_G['forum_thread']['authorid'] && !$post['first'] && !$_G['forum']['ismoderator'];
$postInfo['reply_id'] = ForumUtils::isAnonymousPost($tid, $post) ? 0 : (int) $post['authorid'];
$postInfo['reply_content'] = $isOnlyAuthorPost ? $this->_filterContent(array(array('content' => WebUtils::t('此帖仅作者可见'), 'type' => 'text'))) : $this->_getPostContent($content);
$postInfo['reply_type'] = 'normal';
$this->_isComplexContent($postInfo['reply_content']) && ($postInfo['reply_type'] = 'normal_complex');
$postInfo['reply_name'] = ForumUtils::isAnonymousPost($tid, $post) ? $this->_getAnonymoustext() : $post['author'];
$postInfo['reply_posts_id'] = $pid;
// 抢楼帖时采用原楼层
if (getstatus($topic['status'], 3)) {
$postInfo['position'] = $post['position'];
} else {
$postInfo['position'] = $order ? $position-- : $position++;
}
$postInfo['posts_date'] = $post['dateline'] . '000';
$postInfo['icon'] = UserUtils::getUserAvatar($postInfo['reply_id']);
$postInfo['level'] = $this->_getUserLevel($postInfo['reply_id']);
$postInfo['userTitle'] = UserUtils::getUserTitle($postInfo['reply_id']);
$postInfo['location'] = ForumUtils::getPostLocation($pid);
$postInfo['mobileSign'] = ForumUtils::getMobileSign($post['status']);
// if(empty($post['author']) && isset($post['authorid']) && !empty($post['authorid'])){
// $postInfo['reply_status'] = -1;
// }elseif(empty($post ['author']) && empty($post ['authorid'])){
// $postInfo['reply_status'] = 0;
// }else{
// $postInfo['reply_status'] = 1;
// }
$postInfo['reply_status'] = 1;
$postInfo['status'] = 1;
$postInfo['role_num'] = 1;
$postInfo['title'] = '';
$postInfo = array_merge($postInfo, $this->_getPostQuoteInfo($content, $isOnlyAuthorPost));
// 回帖管理面板编辑 start
$userMember = $this->_getUserInfoByAuthorid($post['authorid']);
$userMember = array_merge($userMember, $post);
$params = array('editPerm' => $editPerm, 'userMember' => $userMember);
// end
$manageItems = ForumUtils::getPostManagePanel($params);
foreach ($manageItems['post'] as $key => $item) {
if ($item['action'] == 'edit') {
$item['action'] = WebUtils::getHttpFileName("forum.php?mod=post&action=edit&fid={$post['fid']}&tid={$post['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' => 'post'));
}
$manageItems['post'][$key] = $item;
}
$count = mb_strlen($postInfo['reply_content'][0]['infor'], $_G['charset']);
if ($count < $_G['setting']['threadfilternum']) {
$isWater = true;
}
$isWater = false;
$count = mb_strlen($postInfo['reply_content'][0]['infor'], $_G['charset']);
if ($_G['setting']['filterednovote'] && $count < $_G['setting']['threadfilternum']) {
$isWater = true;
}
$extraItems = array();
$tempExtraItems = ForumUtils::getPostExtraPanel();
foreach ($tempExtraItems['post'] as $key => $item) {
$item['extParams'] = array('beforeAction' => '');
$item['type'] = $item['action'];
$item['action'] = '';
if ($item['type'] == 'support' && !$isWater) {
$item['action'] = WebUtils::createUrl_oldVersion('forum/support', array('tid' => $tid, 'pid' => $post['pid'], 'type' => 'post'));
$item['extParams']['recommendAdd'] = (int) $tempPostRecommends[$post['pid']]['support'];
$isRecommendAdd = in_array($post['pid'], $isSupport) ? 1 : 0;
$item['extParams']['isHasRecommendAdd'] = (int) $isRecommendAdd;
}
if ($item['type'] != 'support' || !$isWater) {
$extraItems[] = $item;
}
}
$postInfo['managePanel'] = $manageItems['post'];
$postInfo['extraPanel'] = $extraItems;
//.........这里部分代码省略.........
示例7: getPhotosoRiginCover
public static function getPhotosoRiginCover($albumImage)
{
require_once DISCUZ_ROOT . './source/function/function_home.php';
$image = pic_get($albumImage['filepath'], 'album', 0, $albumImage['remote']);
return WebUtils::getHttpFileName($image);
}
示例8: _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;
}
示例9: _getPicByBid
private function _getPicByBid($bid)
{
global $_G;
block_get($bid);
$itemList = $_G['block'][$bid]['itemlist'];
$list = array();
foreach ($itemList as $item) {
$sourceType = $item['idtype'] == 'aid' ? 'news' : 'topic';
$sourceId = $item['id'];
$title = $item['title'];
if ($item['makethumb'] == 1) {
// 生成缩略图成功
if ($item['picflag'] == 1) {
// 本地
$picPath = $_G['setting']['attachurl'] . $item['thumbpath'];
} elseif ($item['picflag'] == 2) {
// 远程
$picPath = $_G['setting']['ftp']['attachurl'] . $item['thumbpath'];
}
} elseif ($item['makethumb'] == 0) {
// 缩略图生成失败
$picPath = $item['pic'];
}
$picPath = ImageUtils::getThumbImage(WebUtils::getHttpFileName($picPath));
$list[] = $this->_fieldPicList(0, $sourceType, $sourceId, $title, $picPath);
}
return $list;
}
示例10: _getForumInfo
private function _getForumInfo($fid)
{
global $_G;
$forum = $_G['forum'];
require_once libfile('function/forumlist');
$forumImage = get_forumimg($forum['icon']);
$forumImage = (string) WebUtils::getHttpFileName($forumImage);
$forumInfo = array();
$forumInfo['id'] = (int) $fid;
$forumInfo['title'] = $fid != 0 ? (string) WebUtils::emptyHtml($forum['name']) : '';
$forumInfo['description'] = (string) WebUtils::emptyHtml($forum['description']);
$forumInfo['icon'] = (string) $forumImage;
return $forumInfo;
}
示例11: _getForumInfo
private function _getForumInfo($forum)
{
$fid = (int) $forum['fid'];
$forum = array_merge($forum, DzForumForum::getForumFieldByFid($fid));
$dateline = $this->_getDateLine($forum);
// 判断该版块是否有权限访问
if (!forum($forum)) {
return array();
}
$matches = array();
preg_match('/<img src="(.+?)"/', $forum['icon'], $matches);
$image = !empty($matches[1]) ? $matches[1] : '';
// $dateline = '0';
// if (is_array($forum['lastpost'])) {
// $matches = array();
// preg_match('/<span title="(.+?)"/', $forum['lastpost']['dateline'], $matches);
// $dateline = !empty($matches[1]) ? $matches[1] : $forum['lastpost']['dateline'];
// $dateline = strtotime($dateline);
// $dateline !== false or $dateline = '0';
// }
$forumSubList = ForumUtils::getForumSubList($fid);
$forumInfo = array();
$forumInfo['board_id'] = (int) $fid;
$forumInfo['board_name'] = WebUtils::emptyHtml($forum['name']);
$forumInfo['description'] = (string) WebUtils::emptyHtml($forum['description']);
$forumInfo['board_child'] = count($forumSubList) > 0 ? 1 : 0;
$forumInfo['board_img'] = WebUtils::getHttpFileName($image);
$forumInfo['last_posts_date'] = !empty($dateline) ? $dateline . '000' : '';
$forumInfo['board_content'] = $forum['threads'] != 0 && !($forum['simple'] & 1) ? 1 : 0;
$forumInfo['forumRedirect'] = $forum['redirect'];
$todayPosts = (int) $forum['todayposts'];
$threads = (int) $forum['threads'];
$posts = (int) $forum['posts'];
foreach ($forumSubList as $value) {
$todayPosts += $value['todayposts'];
$threads += $value['threads'];
$posts += $value['posts'];
}
$forumInfo['td_posts_num'] = $todayPosts;
$forumInfo['topic_total_num'] = $threads;
$forumInfo['posts_total_num'] = $posts;
return $forumInfo;
}
示例12: getPhotoAlbumCover
public static function getPhotoAlbumCover($image)
{
return WebUtils::getHttpFileName($image);
}