本文整理汇总了PHP中getImageUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP getImageUrl函数的具体用法?PHP getImageUrl怎么用?PHP getImageUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getImageUrl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getChannels
/**
* 获取频道分类数据
* @return array 所有频道分类数据
*/
public function getChannels($uid, $count = 6, $page = 1, $order = 'sort asc', $sql = '')
{
$start = ($page - 1) * $count;
$end = $count;
$data = D('channel_category')->where($sql)->order($order)->limit("{$start}, {$end}")->findAll();
foreach ($data as $k => $v) {
if (!empty($v['ext'])) {
$ext = unserialize($v['ext']);
$v = array_merge($v, $ext);
}
$data[$k] = $v;
}
// 组装附件信息
$attachIds = getSubByKey($data, 'attach');
$attachIds = array_filter($attachIds);
$attachIds = array_unique($attachIds);
$attachInfos = model('Attach')->getAttachByIds($attachIds);
$attachData = array();
foreach ($attachInfos as $attach) {
$attachData[$attach['attach_id']] = $attach;
}
foreach ($data as &$value) {
if (!empty($value['attach']) && !empty($attachData[$value['attach']])) {
$value['icon_url'] = getImageUrl($attachData[$value['attach']]['save_path'] . $attachData[$value['attach']]['save_name']);
} else {
$value['icon_url'] = null;
}
unset($value['ext'], $value['attach'], $value['user_bind'], $value['topic_bind']);
if ($uid) {
$value['followStatus'] = intval(D('ChannelFollow', 'channel')->getFollowStatus($uid, $value['channel_category_id']));
}
}
return $data;
}
示例2: logo_path_to_url
/**
* 根据群组Logo的保存路径获取Logo的URL
*
* @param string $save_path 群组Logo的保存路径
* @return string 群组Logo的URL. 给定路径不存在时, 返回默认的群组Logo的URL地址.
*/
function logo_path_to_url($save_path, $width = 100, $height = 100)
{
$path = getImageUrl($save_path, $width, $height, true);
if ($save_path != 'default.gif') {
return $path;
} else {
return SITE_URL . '/apps/group/Tpl/default/Public/images/group_pic.gif';
}
}
示例3: getCover
function getCover($coverId, $width = 100, $height = 100)
{
if ($coverId > 0) {
$cover = model('Attach')->where("attach_id={$coverId}")->find();
}
if ($cover) {
$cover = getImageUrl($cover['save_path'] . $cover['save_name'], $width, $height, true);
} else {
$cover = SITE_URL . '/apps/event/_static/images/hdpic1.gif';
}
return $cover;
}
示例4: index
/**
* 微吧管理首页-修改微吧信息
* @return void
*/
public function index()
{
$weiba_id = intval($_GET['weiba_id']);
$this->assign('weiba_id', $weiba_id);
$weiba_detail = D('weiba')->where('weiba_id=' . $weiba_id)->find();
if ($weiba_detail['logo']) {
$logo = D('attach')->where('attach_id=' . $weiba_detail['logo'])->find();
$weiba_detail['logo_url'] = getImageUrl($logo['save_path'] . $logo['save_name']);
}
$this->assign('weiba_detail', $weiba_detail);
$this->display();
}
示例5: createMapping
function createMapping($field)
{
$arr['title'] = $field['vendor'] . ' ' . $field['name'];
$arr['body_html'] = $field['description'];
$arr['vendor'] = $field['vendor'];
$arr['product_type'] = $field['type'];
$arr['tags'] = getTags($field['tags']);
$arr['images'] = array(getImageUrl(IMAGE_BASE_URL, $field['image']));
$arr['metafields_global_title_tag'] = 'Paramount BP ' . $arr['title'];
$arr['metafields_global_description_tag'] = $field['meta_description'];
$arr['variants'] = array(getbasicVariants($field));
return $arr;
}
示例6: getMedalByUid
/**
* 返回用户勋章
* @param unknown_type $uid
*/
public function getMedalByUid($uid)
{
$list = D()->query('select b.* from ' . C('DB_PREFIX') . 'medal_user a inner join ' . C('DB_PREFIX') . 'medal b on a.medal_id=b.id where a.uid=' . $uid . ' order by a.ctime desc');
if (is_array($list)) {
foreach ($list as &$v) {
$src = explode('|', $v['src']);
$v['src'] = getImageUrl($src[1]);
$smallsrc = explode('|', $v['small_src']);
$v['small_src'] = getImageUrl($smallsrc[1]);
}
}
return $list;
}
示例7: index
public function index()
{
//echo $_GET['domain'];exit;
if ($_GET['domain']) {
$map['domain'] = t($_GET['domain']);
//echo $domain;exit;
$data['search_key'] = model('FeedTopic')->where($map)->getField('topic_name');
} else {
$data['search_key'] = $this->__getSearchKey();
}
// 专题信息
if (false == ($data['topics'] = model('FeedTopic')->getTopic($data['search_key'], false))) {
if (!$data['topics']) {
$this->error('此话题不存在');
}
$data['topics']['name'] = t($data['search_key']);
}
if ($data['topics']['lock'] == 1) {
$this->error('该话题已被屏蔽');
}
if ($data['topics']['pic']) {
$pic = D('attach')->where('attach_id=' . $data['topics']['pic'])->find();
//$data['topics']['pic'] = UPLOAD_URL.'/'.$pic['save_path'].$pic['save_name'];
$pic_url = $pic['save_path'] . $pic['save_name'];
$data['topics']['pic'] = getImageUrl($pic_url);
}
$data['topic'] = $data['search_key'] ? $data['search_key'] : html_entity_decode($data['topics']['name'], ENT_QUOTES, 'UTF-8');
$data['topic_id'] = $data['topics']['topic_id'] ? $data['topics']['topic_id'] : model('FeedTopic')->getTopicId($data['search_key']);
$initHtml = '#' . $data['search_key'] . '#';
$this->assign('initHtml', $initHtml);
$this->assign($data);
//seo
$seo = model('Xdata')->get("admin_Config:seo_feed_topic");
$replace['topicName'] = $data['topic'];
$replace['topicNote'] = $data['topics']['note'];
$replace['topicDes'] = $data['topics']['des'];
if ($lastTopic = D('feed_data')->where('feed_id=' . D('feed_topic_link')->where('topic_id=' . $data['topic_id'])->order('feed_topic_id desc')->limit(1)->getField('feed_id'))->getField('feed_content')) {
$replace['lastTopic'] = $lastTopic;
}
$replaces = array_keys($replace);
foreach ($replaces as &$v) {
$v = "{" . $v . "}";
}
$seo['title'] = str_replace($replaces, $replace, $seo['title']);
$seo['keywords'] = str_replace($replaces, $replace, $seo['keywords']);
$seo['des'] = str_replace($replaces, $replace, $seo['des']);
!empty($seo['title']) && $this->setTitle($seo['title']);
!empty($seo['keywords']) && $this->setKeywords($seo['keywords']);
!empty($seo['des']) && $this->setDescription($seo['des']);
$this->display();
}
示例8: formatMedal
/**
* 格式化出需要的数据
*
* @param array $medals 数据库原始勋章数据
* @param array [$data] 额外携带的数据
* @return array
* @author Seven Du <lovevipdsw@vip.qq.com>
**/
private function formatMedal(array $medals, array $data = array())
{
foreach ($medals as $value) {
$medal = array();
$medal['id'] = $value['id'];
$medal['name'] = $value['name'];
$medal['desc'] = $value['desc'];
$medal['icon'] = getImageUrl(explode('|', $value['src'])[1]);
$medal['show'] = getImageUrl(explode('|', $value['share_card'])[1]);
array_push($data, $medal);
}
unset($medals, $value, $medal);
return $data;
}
示例9: newslist
/**
* 页面列表
*/
public function newslist()
{
$_REQUEST['tabHash'] = 'newslist';
//按钮
//$this->pageButton[] = array('uid','title'=>'搜索', 'onclick'=>"admin.fold('search_form')");
$this->pageButton[] = array('uid', 'title' => '删除', 'onclick' => "admin.deleteInfo();");
$this->pageButton[] = array('uid', 'title' => '添加资讯', 'onclick' => "location.href='" . U('news/admin/setinfo', array('tabHash' => 'newslist')) . "';");
//处理分类HASH
$cs = model('CategoryTree')->setTable('news_category')->getCategoryList();
$categorys = array();
foreach ($cs as $ct) {
$categorys[$ct['news_category_id']] = $ct;
}
//构造搜索条件
//列表key值 DOACTION表示操作
$this->pageKeyList = array('image', 'news_title', 'news_content', 'state', 'is_top', 'hits', 'date', 'DOACTION');
$listData = M('News')->order('news_id desc')->findPage(15);
foreach ($listData['data'] as $key => $val) {
$listData['data'][$key]['id'] = $val['news_id'];
$thumb = APPS_URL . '/' . APP_NAME . '/_static/nopic.jpg';
if ($val['image']) {
$attach = model('Attach')->getAttachById($val['image']);
if ($attach) {
$thumb = getImageUrl($attach['save_path'] . $attach['save_name'], 100, 100, true);
}
}
//获取分类
$type_str = '';
if ($val['type_id']) {
if (isset($categorys[$val['type_id']])) {
$type_str .= $categorys[$val['type_id']]['title'];
if (isset($categorys[$categorys[$val['type_id']]['pid']])) {
$type_str = $categorys[$categorys[$val['type_id']]['pid']]['title'] . '--' . $type_str;
}
}
}
$listData['data'][$key]['image'] = '<img src="' . $thumb . '">';
$listData['data'][$key]['news_title'] = msubstr($val['news_title'], 0, 20) . "<BR><BR><font style='color:#7d7d7d;'>分类: " . $type_str . "</font>";
$listData['data'][$key]['news_content'] = msubstr(strip_tags($val['news_content']), 0, 20);
$listData['data'][$key]['state'] = D('News')->getState($val['state']);
$listData['data'][$key]['date'] = '创建:' . date('m/d G:i', $val['created']);
if ($val['updated']) {
$listData['data'][$key]['date'] .= '<br>更新:' . date('m/d G:i', $val['updated']);
}
$listData['data'][$key]['is_top'] = $val['is_top'] ? '<font color="red">置顶</font>' : '否';
$listData['data'][$key]['DOACTION'] = '<a href="' . U('news/admin/setinfo', array('news_id' => $val['news_id'], 'tabHash' => 'setinfo')) . '">编辑</a>';
}
$this->displayList($listData);
}
示例10: convertImgUrl
private function convertImgUrl($list)
{
foreach ($list as &$vo) {
$vo['img_url'] = getImageUrl($vo['img']);
unset($vo['img']);
unset($vo['id']);
unset($vo['notes']);
unset($vo['uid']);
unset($vo['storeid']);
unset($vo['createtime']);
unset($vo['starttime']);
unset($vo['endtime']);
unset($vo['noticetime']);
}
return $list;
}
示例11: getReplyList
/**
* 获取回复列表
* @param array $map 查询条件
* @param string $order 排序条件,默认为comment_id ASC
* @param int $limit 结果集数目,默认为10
* @return array 评论列表信息
*/
public function getReplyList($map = null, $order = 'reply_id desc', $limit = 10)
{
!isset($map['is_del']) && ($map['is_del'] = 0);
$data = $this->where($map)->order($order)->findPage($limit);
// // TODO:后续优化
foreach ($data['data'] as &$v) {
$v['user_info'] = model('User')->getUserInfo($v['uid']);
$v['user_info']['groupData'] = model('UserGroupLink')->getUserGroupData($v['uid']);
//获取用户组信息
$v['content'] = parse_html(h(htmlspecialchars($v['content'])));
//$v['sourceInfo'] = model('Source')->getSourceInfo($v['table'], $v['row_id'], false, $v['app']);
$v['attach_info'] = model('Attach')->getAttachById($v['attach_id']);
if ($v['attach_info']['attach_type'] == 'weiba_comment_image' || $v['attach_info']['attach_type'] == 'feed_image') {
$v['attach_info']['attach_url'] = getImageUrl($v['attach_info']['save_path'] . $v['attach_info']['save_name'], 590);
}
}
return $data;
}
示例12: index
public function index()
{
$u['savepath'] = '';
$u['savename'] = '';
list($width, $height) = getimagesize(getImageUrl($u['savepath'] . $u['savename']));
exit;
$demo = json_decode(file_get_contents('http://tsimg.tsurl.cn/2013/0819/16/5211de3274738.jpg!exif'));
settype($demo, 'array');
dump($demo);
exit;
// $str = 'http://tsimg.tsurl.cn/2013/0819/16/5211de3274738.jpg!exif';
$str = 'http://tsimg.tsurl.cn/2013/0819/16/5211de327473832123.jpg!exif';
$demo = file_get_contents($str);
$demo = json_decode($demo);
dump($demo->width);
dump($demo->height);
dump($demo);
}
示例13: login
public function login()
{
// 登录验证
$passport = model('Passport');
if ($passport->isLogged()) {
$this->redirect(U('w3g/Index/index'));
}
//载入站点配置全局变量
if ($GLOBALS['ts']['site']['site_logo_w3g'] == '') {
$w3gLogoUrl = 'img/logo.png';
} else {
$attach = model('Attach')->getAttachById($GLOBALS['ts']['site']['site_logo_w3g']);
$w3gLogoUrl = getImageUrl($attach['save_path'] . $attach['save_name']);
}
$this->assign('w3gLogoUrl', $w3gLogoUrl);
// dump($w3gLogoUrl);exit();
$this->assign('is_register_open', $this->isRegisterOpen() ? '1' : '0');
$this->display();
}
示例14: render
/**
* 渲染关注按钮模板
* @example
* $data['follower_uid'] integer 用户ID
* @param array $data 渲染的相关配置参数
* @return string 渲染后的模板数据
*/
public function render($data)
{
$var = array();
$var['type'] = 'FollowWeibaList';
$follow = D('weiba_follow')->where('follower_uid=' . $data['follower_uid'])->findAll();
$map['weiba_id'] = array('in', getSubByKey($follow, 'weiba_id'));
$map['is_del'] = 0;
$var['weibaList'] = D('weiba')->where($map)->findAll();
$var['weibaListCount'] = D('weiba')->where($map)->count();
foreach ($var['weibaList'] as $k => $v) {
$logo = D('attach')->where('attach_id=' . $v['logo'])->find();
$var['weibaList'][$k]['logo'] = getImageUrl($logo['save_path'] . $logo['save_name']);
}
is_array($data) && ($var = array_merge($var, $data));
// 渲染模版
$content = $this->renderFile(dirname(__FILE__) . "/followWeibaList.html", $var);
unset($var, $data);
// 输出数据
return $content;
}
示例15: getTopic
/**
* 获取全部话题
* @param int limit 每页显示条数
* @return array 话题列表
*/
public function getTopic($limit = 20, $isrecommend)
{
if ($isrecommend) {
$map['recommend'] = 1;
}
if ($_POST) {
$_POST['topic_id'] && ($map['topic_id'] = intval($_POST['topic_id']));
$_POST['topic_name'] && ($map['topic_name'] = array('like', '%' . t($_POST['topic_name']) . '%'));
$_POST['recommend'] && ($map['recommend'] = $_POST['recommend'] == 1 ? 1 : 0);
$_POST['essence'] && ($map['essence'] = $_POST['essence'] == 1 ? 1 : 0);
$_POST['lock'] && ($map['lock'] = $_POST['lock'] == 1 ? 1 : 0);
}
$topic_list = D('feed_topic')->where($map)->order('recommend desc,recommend_time desc,ctime desc')->findpage($limit);
//数据格式化
foreach ($topic_list['data'] as $k => $v) {
if ($v['recommend'] == 1) {
$topic_list['data'][$k]['topic_name'] = '<a target="_blank" href="' . U('public/Topic/index', array('k' => urlencode($topic_list['data'][$k]['topic_name']))) . '">' . $topic_list['data'][$k]['topic_name'] . '</a>';
} else {
$topic_list['data'][$k]['topic_name'] = '<a target="_blank" href="' . U('public/Topic/index', array('k' => urlencode($topic_list['data'][$k]['topic_name']))) . '">' . $topic_list['data'][$k]['topic_name'] . '</a>';
}
$pic = D('attach')->where('attach_id=' . $v['pic'])->find();
$topic_list['data'][$k]['pic'] && ($topic_list['data'][$k]['pic'] = '<img src="' . getImageUrl($pic['save_path'] . $pic['save_name']) . '" width="50">');
$topic_user = explode(',', $v['topic_user']);
$topic_user_info = model('User')->getUserInfoByUids($topic_user);
$topic_list['data'][$k]['topic_user'] = '';
foreach ($topic_user as $key => $val) {
$topic_list['data'][$k]['topic_user'] .= $topic_user_info[$val]['space_link'] . '<br />';
}
//dump($topic_list['data'][$k]['topic_user']);exit;
// $isrecommend = $v['recommend']?'是':'否';
// $topic_list['data'][$k]['recommend'] = '<a href="javascript:void(0);" onclick="admin.setTopic(1,'.$v['topic_id'].','.intval($v['recommend']).')">'.$isrecommend.'</a>';
// $isessence = $v['essence']?'是':'否';
// $topic_list['data'][$k]['essence'] = '<a href="javascript:void(0);" onclick="admin.setTopic(2,'.$v['topic_id'].','.intval($v['essence']).')">'.$isessence.'</a>';
$islock = $v['lock'] ? '取消屏蔽' : '屏蔽';
// 操作数据
$topic_list['data'][$k]['DOACTION'] = '<a href="javascript:void(0);" onclick="admin.setTopic(3,' . $v['topic_id'] . ',' . intval($v['lock']) . ')">' . $islock . '</a> - ';
$topic_list['data'][$k]['DOACTION'] .= '<a href="' . U('admin/Content/editTopic', array('topic_id' => $v['topic_id'], 'tabHash' => 'editTopic')) . '">编辑</a>';
//$listData['data'][$k]['DOACTION'] .= '<a href="javascript:void(0)" onclick="admin.deleteUser(\''.$v['uid'].'\')">'.L('PUBLIC_STREAM_DELETE').'</a>';
}
return $topic_list;
}