• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getRootUrl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getRootUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP getRootUrl函数的具体用法?PHP getRootUrl怎么用?PHP getRootUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getAtlasQiniuImageById

/**
 * 使用七牛模块
 * 
 * @param $type 0=imageView2, 1=imageMogr2
 */
function getAtlasQiniuImageById($cover_id, $type = 0, $parameters)
{
    $picture = S('picture_' . $cover_id);
    if (empty($picture)) {
        $picture = M('Picture')->where(array('status' => 1))->getById($cover_id);
        S('picture_' . $cover_id, $picture);
    }
    if (empty($picture)) {
        return getRootUrl() . 'Public/images/nopic.png';
    }
    switch ($picture['type']) {
        case 'qiniu':
            $qiniuConfig = C('UPLOAD_QINIU_CONFIG');
            if ($type == 0) {
                //imageView2
                $parameters ? $picture['path'] = $picture['path'] . '?imageView/' . $parameters : '';
            } else {
                //imageMogr2
                $parameters ? $picture['path'] = $picture['path'] . '?imageMogr2/' . $parameters : '';
            }
            //return $picture['path'];
            break;
    }
    return 'http://' . $qiniuConfig['domain'] . '/' . $picture['path'];
}
开发者ID:chenyongze,项目名称:bighaha,代码行数:30,代码来源:function.php


示例2: getImageUrlByRoleId

 /**
  * 根据角色获取默认头像
  * @param $role_id
  * @param $size
  * @return mixed|string
  * @author 郑钟良<[email protected]>
  */
 private function getImageUrlByRoleId($role_id, $size)
 {
     $avatar_id = S('Role_Avatar_Id_' . $role_id);
     if (!$avatar_id) {
         $map = getRoleConfigMap('avatar', $role_id);
         $avatar_id = D('RoleConfig')->where($map)->field('value')->find();
         S('Role_Avatar_Id_' . $role_id, $avatar_id, 600);
     }
     if ($avatar_id) {
         if ($size != 0) {
             $path = getThumbImageById($avatar_id['value'], $size, $size);
         } else {
             $path = getThumbImageById($avatar_id['value']);
         }
     } else {
         //角色没有默认
         if ($size != 0) {
             $default_avatar = "Public/images/default_avatar.jpg";
             $path = $this->getImageUrlByPath($default_avatar, $size);
         } else {
             $path = getRootUrl() . "Public/images/default_avatar.jpg";
         }
     }
     return $path;
 }
开发者ID:smartymoon,项目名称:e-anjia,代码行数:32,代码来源:UploadAvatarWidget.class.php


示例3: getImageUrlByPath

function getImageUrlByPath($path, $size)
{
    $thumb = getThumbImage($path, $size);
    $thumb = $thumb['src'];
    $thumb = substr($thumb, 1);
    return getRootUrl() . $thumb;
}
开发者ID:nullog,项目名称:zhanglubao,代码行数:7,代码来源:thumb.php


示例4: issueDetail

 /**
  * @param $id
  * 专辑详情页
  */
 public function issueDetail($id)
 {
     // dump($id);exit;
     $aPage = I('post.page', 0, 'op_t');
     $aCount = I('post.count', 5, 'op_t');
     $map['id'] = array('eq', $id);
     $mapl['row_id'] = array('eq', $id);
     $issuedetail = D('Issue_content')->where($map)->select();
     $issuecomment = D('Local_comment')->where(array('status' => 1, $mapl))->page($aPage, $aCount)->order('create_time desc')->select();
     D('IssueContent')->where(array('id' => $id))->setInc('view_count');
     //查看数加1
     $support['appname'] = 'Issue';
     //查找需要判断是否点赞的数据
     $support['table'] = 'issue_content';
     $support['uid'] = is_login();
     $is_zan = D('Support')->where($support)->select();
     $is_zan = array_column($is_zan, 'row');
     $issue_uid = D('IssueContent')->where(array('status' => 1, 'id' => $id))->find();
     //根据微博ID查找专辑发送人的UID
     foreach ($issuedetail as &$k) {
         $k['user'] = query_user(array('nickname', 'avatar32'), $k['uid']);
         $k['cover_url'] = getThumbImageByCoverId($k['cover_id']);
         //获得原图
         $bi = M('Picture')->where(array('status' => 1))->getById($k['cover_id']);
         if (!is_bool(strpos($bi['path'], 'http://'))) {
             $k['cover_url'] = $bi['path'];
         } else {
             $k['cover_url'] = getRootUrl() . substr($bi['path'], 1);
         }
         if (in_array($k['id'], $is_zan)) {
             //判断是否已经点赞
             $k['is_support'] = '1';
         } else {
             $k['is_support'] = '0';
         }
         if (is_administrator(get_uid()) || $issue_uid['uid'] == get_uid()) {
             //如果是管理员,则可以删除评论
             $k['is_admin_or_mine'] = '1';
         } else {
             $k['is_admin_or_mine'] = '0';
         }
     }
     foreach ($issuecomment as &$v) {
         $v['user'] = query_user(array('nickname', 'avatar32'), $v['uid']);
         $v['cover_url'] = getThumbImageByCoverId($v['cover_id']);
         $v['content'] = parse_weibo_mobile_content($v['content']);
     }
     //dump($issuedetail);exit;
     $this->assign('issuedetail', $issuedetail);
     $this->assign('issuecomment', $issuecomment);
     $this->display();
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:56,代码来源:IssueController.class.php


示例5: pageHeader

 /**
  * 站点头部钩子,加载换肤插件所需样式
  * @param array $param 相关参数
  * @return bool
  * @author 郑钟良<[email protected]>
  */
 public function pageHeader($param)
 {
     $SkinsUrl = getRootUrl() . "Addons/Skin/Skins/";
     $config = getAddonConfig();
     if ($config['canSet'] == 0 || $config['mandatory'] == 1) {
         //强制执行管理员设置的默认皮肤
         // 载入换肤插件默认样式
         echo '<link href="' . $SkinsUrl . $config['defaultSkin'] . '/style.css" data-role="skin_link" rel="stylesheet" type="text/css"/>';
     } else {
         //执行用户设置样式
         // 载入换肤插件用户样式
         $userSkin = getUserConfig();
         echo '<link href="' . $SkinsUrl . $userSkin['skin'] . '/style.css" data-role="skin_link" rel="stylesheet" type="text/css"/>';
     }
 }
开发者ID:admpub,项目名称:OpenCenter,代码行数:21,代码来源:SkinAddon.class.php


示例6: getSkinInfoList

/**
 * 根据皮肤列表,获取皮肤详细信息
 * @param $skinList 皮肤列表
 * @return array
 * @author 郑钟良<[email protected]>
 */
function getSkinInfoList($skinList)
{
    $skinInfoList = array();
    $skinUrl = getRootUrl() . preg_replace('|^' . ONETHINK_ADDON_PATH . '|', 'Addons/', SKIN_PATH);
    foreach ($skinList as $path) {
        $skinConf = (include SKIN_PATH . 'Skins/' . $path . '/config.php');
        $skin['value'] = $path;
        $skin['name'] = $skinConf['name'];
        $skin['sort'] = $skinConf['sort'];
        $skin['thumb_url'] = $skinUrl . 'Skins/' . $path . '/thumb.png';
        $skinInfoList[] = $skin;
    }
    unset($path, $skin);
    $skinInfoList = list_sort_by($skinInfoList, 'sort', 'asc');
    return $skinInfoList;
}
开发者ID:admpub,项目名称:OpenCenter,代码行数:22,代码来源:function.php


示例7: fetchImage

 /**
  * fetchImage  渲染图片微博
  * @param $weibo
  * @return string
  * @author:xjw129xjt(肖骏涛) [email protected]
  */
 public function fetchImage($weibo)
 {
     $weibo_data = unserialize($weibo['data']);
     $weibo_data['attach_ids'] = explode(',', $weibo_data['attach_ids']);
     foreach ($weibo_data['attach_ids'] as $k_i => $v_i) {
         $weibo_data['image'][$k_i]['small'] = getThumbImageById($v_i, 100, 100);
         $bi = M('Picture')->where(array('status' => 1))->getById($v_i);
         if (!is_bool(strpos($bi['path'], 'http://'))) {
             $weibo_data['image'][$k_i]['big'] = $bi['path'];
         } else {
             $weibo_data['image'][$k_i]['big'] = getRootUrl() . substr($bi['path'], 1);
         }
         $param['weibo'] = $weibo;
         $param['weibo']['weibo_data'] = $weibo_data;
     }
     $this->assign($param);
     return $this->fetch(T('Application://Weibo@Type/fetchimage'));
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:24,代码来源:TypeController.class.php


示例8: fetchImage

 public function fetchImage($weibo)
 {
     $weibo_data = unserialize($weibo['data']);
     $weibo_data['attach_ids'] = explode(',', $weibo_data['attach_ids']);
     foreach ($weibo_data['attach_ids'] as $k_i => $v_i) {
         if (strtolower(C('PICTURE_UPLOAD_DRIVER')) == 'sae') {
             $weibo_data['image'][$k_i]['small'] = getThumbImageById($v_i, 100, 100);
             // dump( $weibo_data['image'][$k_i]['small']);exit;
             $bi = M('Picture')->where(array('status' => 1))->getById($v_i);
             $weibo_data['image'][$k_i]['big'] = $bi['path'];
         } else {
             $weibo_data['image'][$k_i]['small'] = getThumbImageById($v_i, 100, 100);
             $bi = M('Picture')->where(array('status' => 1))->getById($v_i);
             $weibo_data['image'][$k_i]['big'] = getRootUrl() . substr($bi['path'], 1);
         }
         $param['weibo'] = $weibo;
         $param['weibo']['weibo_data'] = $weibo_data;
     }
     $this->assign($param);
     return $this->fetch('display');
 }
开发者ID:yaomoo,项目名称:bbs,代码行数:21,代码来源:InsertImageAddon.class.php


示例9: _doEditQusetion

 private function _doEditQusetion()
 {
     $aId = I('post.id', 0, 'intval');
     $need_audit = modC('QUESTION_NEED_AUDIT', 1, 'Question');
     if ($aId) {
         $data['id'] = $aId;
         $now_data = M('Mob/Question')->getData($aId);
         $this->checkAuth('Question/Index/edit', $now_data['uid'], '没有编辑该问题权限!');
         if ($need_audit) {
             $data['status'] = 2;
         }
         $this->checkActionLimit('edit_question', 'question', $now_data['id'], get_uid());
     } else {
         $this->checkAuth('Question/Index/add', -1, '没有发布问题的权限!');
         $this->checkActionLimit('add_question', 'question', 0, get_uid());
         $data['uid'] = get_uid();
         $data['answer_num'] = $data['good_question'] = 0;
         if ($need_audit) {
             $data['status'] = 2;
         } else {
             $data['status'] = 1;
         }
     }
     $data['title'] = I('post.title', '', 'text');
     $data['category'] = I('post.category', 0, 'intval');
     $attach_ids = I('post.attach_ids', '0', 'op_t');
     if ($attach_ids) {
         $data['description'] = I('post.description', '', 'filter_content');
         $img_ids = explode(',', $attach_ids);
         //把图片和内容结合
         //    dump($img_ids);
         foreach ($img_ids as &$v) {
             $v = D('Picture')->where(array('status' => 1))->getById($v);
             if (!is_bool(strpos($v['path'], 'http://'))) {
                 $v = $v['path'];
             } else {
                 $v = getRootUrl() . substr($v['path'], 1);
             }
             $v = '<p><img src="' . $v . '" style=""/></p><br>';
         }
         $img_ids = implode('', $img_ids);
         //  dump($img_ids);
         $data['description'] = $img_ids . $data['description'];
         $contentHandler = new ContentHandlerModel();
         $data['description'] = $contentHandler->filterHtmlContent($data['description']);
         //把图片和内容结合END
     } else {
         $data['description'] = I('post.description', '', 'filter_content');
     }
     if (!mb_strlen($data['title'], 'utf-8')) {
         $this->error('标题不能为空!');
     }
     $res = M('Mob/Question')->editData($data);
     $title = $aId ? "编辑" : "提";
     if ($res) {
         if (!$aId) {
             $aId = $res;
             if ($need_audit) {
                 $data['status'] = 1;
                 $data['info'] = $title . '问题成功!' . ' 请等待审核~';
                 $this->ajaxReturn($data);
             }
         }
         if (M('Common/Module')->isInstalled('Weibo')) {
             //安装了轻博客模块
             //同步到轻博客
             $postUrl = "http://{$_SERVER['HTTP_HOST']}" . U('Mob/Question/questionDetail', array('id' => $aId));
             $weiboModel = M('Mob/Weibo');
             $weiboModel->addWeibo("我问了一个问题【" . $data['title'] . "】:" . $postUrl);
         }
         $data['status'] = 1;
         $data['info'] = $title . '问题成功!' . ' 请等待审核~';
     } else {
         $data['status'] = 0;
         $data['info'] = $title . '问题失败!';
     }
     $this->ajaxReturn($data);
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:78,代码来源:QuestionController.class.php


示例10: doSendBlog

 public function doSendBlog()
 {
     $aId = I('post.id', 0, 'intval');
     $data['category'] = I('post.category', 0, 'intval');
     if ($aId) {
         $data['id'] = $aId;
         $now_data = M('News/News')->getData($aId);
         if ($now_data['status'] == 1) {
             $this->error('该资讯已被审核,不能被编辑!');
         }
         $category = M('News/newsCategory')->where(array('status' => 1, 'id' => $data['category']))->find();
         if ($category) {
             if ($category['can_post']) {
                 if ($category['need_audit']) {
                     $data['status'] = 2;
                 } else {
                     $data['status'] = 1;
                 }
             } else {
                 $this->error('该分类不能投稿!');
             }
         } else {
             $this->error('该分类不存在或被禁用!');
         }
         $data['status'] = 2;
         $data['template'] = $now_data['detail']['template'] ?: '';
     } else {
         $this->checkActionLimit('add_news', 'news', 0, is_login(), true);
         $data['uid'] = get_uid();
         $data['sort'] = $data['position'] = $data['view'] = $data['comment'] = $data['collection'] = 0;
         $category = M('News/NewsCategory')->where(array('status' => 1, 'id' => $data['category']))->find();
         if ($category) {
             if ($category['can_post']) {
                 if ($category['need_audit']) {
                     $data['status'] = 2;
                 } else {
                     $data['status'] = 1;
                 }
             } else {
                 $this->error('该分类不能投稿!');
             }
         } else {
             $this->error('该分类不存在或被禁用!');
         }
         $data['template'] = '';
     }
     $data['title'] = I('post.title', '', 'text');
     $data['cover'] = I('post.one_attach_id', 0, 'intval');
     $data['description'] = I('post.description', '', 'text');
     $data['dead_line'] = I('post.dead_line', '', 'text');
     $data['content_img'] = I('post.attach_ids', '', 'text');
     if ($data['dead_line'] == '') {
         $data['dead_line'] = 99999999999;
     } else {
         $data['dead_line'] = strtotime($data['dead_line']);
     }
     $data['source'] = I('post.source', '', 'text');
     $data['content'] = I('post.content', '', 'html');
     if (!mb_strlen($data['title'], 'utf-8')) {
         $this->error('标题不能为空!');
     }
     if (mb_strlen($data['content'], 'utf-8') < 20) {
         $this->error('内容不能少于20个字!');
     }
     if ($data['content_img']) {
         $img_ids = explode(',', $data['content_img']);
         //把图片和内容结合
         foreach ($img_ids as &$v) {
             $v = D('Picture')->where(array('status' => 1))->getById($v);
             if (!is_bool(strpos($v['path'], 'http://'))) {
                 $v = $v['path'];
             } else {
                 $v = getRootUrl() . substr($v['path'], 1);
             }
             $v = '<p><img src="' . $v . '" style=""/></p><br>';
         }
         $img_ids = implode('', $img_ids);
         $data['content'] = $img_ids . $data['content'];
         $contentHandler = new ContentHandlerModel();
         $data['content'] = $contentHandler->filterHtmlContent($data['content']);
         //把图片和内容结合END
     }
     //  dump($data['content']);exit;
     $res = M('News/news')->editData($data);
     // dump(M('News/newsModel')->getLastSql());exit;
     $title = $aId ? "编辑" : "新增";
     if ($res) {
         if (!$aId) {
             $aId = $res;
             if ($category['need_audit']) {
                 $return['status'] = 1;
                 $return['info'] = $title . '资讯成功!请等待审核~';
             }
         }
         $return['status'] = 1;
         $return['info'] = $title . '资讯成功!';
     } else {
         $return['status'] = 0;
         $return['info'] = $title . '资讯失败!';
     }
//.........这里部分代码省略.........
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:101,代码来源:BlogController.class.php


示例11: tfu_info

function tfu_info($file)
{
    global $use_image_magic;
    unset($_SESSION['TFU_LAST_UPLOADS']);
    $_SESSION['TFU_LAST_PREVIEW'] = fixUrl(getRootUrl() . $file);
    echo '&size=' . filesize($file);
    // we check if the image can be resized
    if (is_supported_tfu_image($file)) {
        set_error_handler('on_error_no_output');
        // is needed because error are most likly but we don't care about fields we don't even know
        $oldsize = @getimagesize($file);
        set_error_handler('on_error');
        if ($oldsize) {
            if (isMemoryOk($oldsize, "")) {
                echo '&hasPreview=true&tfu_x=' . $oldsize[0] . '&tfu_y=' . $oldsize[1];
                // has preview!
            } else {
                echo '&hasPreview=error';
                // too big! - same error massage as hasPreview=false
            }
            return;
        }
        echo '&hasPreview=false';
        // no image!
    }
    if (preg_match("/.*\\.(p|P)(d|D)(f|F)\$/", $file) && $use_image_magic && file_exists(dirname(__FILE__) . '/thumbs') && is_writable(dirname(__FILE__) . '/thumbs')) {
        // check if pdf
        echo '&hasPreview=true&tfu_x=1000&tfu_y=1000';
        // has preview! - pdfs are max 1000x1000';
        return;
    }
    echo '&hasPreview=false';
}
开发者ID:jnvilo,项目名称:tomasinasanctuary.org,代码行数:33,代码来源:tfu_helper.php


示例12: getProfile

 public function getProfile($uid = null)
 {
     //默认查看自己的详细资料
     if (!$uid) {
         $this->requireLogin();
         $uid = $this->getUid();
     }
     //读取数据库中的用户详细资料
     $map = array('uid' => $uid);
     $user1 = D('Home/Member')->where($map)->find();
     $user2 = D('User/UcenterMember')->where(array('id' => $uid))->find();
     //获取头像信息
     $avatar = new AvatarAddon();
     $avatar_path = $avatar->getAvatarPath($uid);
     $avatar_url = getRootUrl() . $avatar->getAvatarPath($uid);
     //缩略头像
     $avatar128_path = getThumbImage($avatar_path, 128);
     $avatar128_path = '/' . $avatar128_path['src'];
     $avatar128_url = getRootUrl() . $avatar128_path;
     //获取等级
     $title = D('Usercenter/Title')->getTitle($user1['score']);
     //只返回必要的详细资料
     $this->apiSuccess("获取成功", null, array('uid' => $uid, 'avatar_url' => $avatar_url, 'avatar128_url' => $avatar128_url, 'signature' => $user1['signature'], 'email' => $user2['email'], 'mobile' => $user2['mobile'], 'score' => $user1['score'], 'name' => $user1['name'], 'sex' => $this->encodeSex($user1['sex']), 'birthday' => $user1['birthday'], 'title' => $title, 'username' => $user2['username']));
 }
开发者ID:Willshon,项目名称:OLCS,代码行数:24,代码来源:UserController.class.php


示例13: addmoreWeibo

 public function addmoreWeibo()
 {
     $aPage = I('post.page', 1, 'op_t');
     $aCount = I('post.count', 10, 'op_t');
     $uid = I('post.uid', '', 'op_t');
     $weibo = D('Weibo')->where(array('status' => 1, 'uid' => $uid))->order('create_time desc')->page($aPage, $aCount)->select();
     //我关注的人的微博
     $support['appname'] = 'Weibo';
     //查找是否点赞
     $support['table'] = 'weibo';
     $support['uid'] = is_login();
     $is_zan = D('Support')->where($support)->select();
     $is_zan = array_column($is_zan, 'row');
     foreach ($weibo as &$v) {
         $v['user'] = query_user(array('nickname', 'avatar64', 'space_mob_url'), $v['uid']);
         $v['rand_title'] = mob_get_head_title($v['uid']);
         $v['support'] = D('Support')->where(array('appname' => 'Weibo', 'table' => 'weibo', 'row' => $v['id']))->count();
         $v['content'] = parse_weibo_mobile_content($v['content']);
         if (empty($v['from'])) {
             $v['from'] = "网站端";
         }
         $v['data'] = unserialize($v['data']);
         //字符串转换成数组,获取微博源ID
         if ($v['data']['sourceId']) {
             //判断是否是源微博
             $v['sourceId'] = $v['data']['sourceId'];
             $v['is_sourceId'] = '1';
         } else {
             $v['sourceId'] = $v['id'];
             $v['is_sourceId'] = '0';
         }
         $v['sourceId_user'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->find();
         //源微博用户名
         $v['sourceId_user'] = $v['sourceId_user']['uid'];
         $v['sourceId_user'] = query_user(array('nickname', 'space_mob_url'), $v['sourceId_user']);
         $v['sourceId_content'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('content')->find();
         //源微博内容
         $v['sourceId_content'] = parse_weibo_mobile_content($v['sourceId_content']['content']);
         //把表情显示出来。
         $v['sourceId_repost_count'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('repost_count')->find();
         //源微博转发数
         $v['sourceId_from'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('from')->find();
         //源微博来源
         if (empty($v['sourceId_from']['from'])) {
             $v['sourceId_from'] = "网站端";
         } else {
             $v['sourceId_from'] = "手机网页版";
         }
         $v['sourceId_img'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('data')->find();
         //为了获取源微图片
         $v['sourceId_img'] = unserialize($v['sourceId_img']['data']);
         $v['sourceId_img'] = explode(',', $v['sourceId_img']['attach_ids']);
         //把attach_ids里的图片ID转出来
         foreach ($v['sourceId_img'] as &$b) {
             $v['sourceId_img_path'][] = getThumbImageById($b, 100, 100);
             //获得缩略图
             //获得原图
             $bi = M('Picture')->where(array('status' => 1))->getById($b);
             if (!is_bool(strpos($bi['path'], 'http://'))) {
                 $v['sourceId_img_big'][] = $bi['path'];
             } else {
                 $v['sourceId_img_big'][] = getRootUrl() . substr($bi['path'], 1);
             }
         }
         $v['cover_url'] = explode(',', $v['data']['attach_ids']);
         //把attach_ids里的图片ID转出来
         foreach ($v['cover_url'] as &$a) {
             $v['img_path'][] = getThumbImageById($a, 100, 100);
             //获得原图
             $bi = M('Picture')->where(array('status' => 1))->getById($b);
             if (!is_bool(strpos($bi['path'], 'http://'))) {
                 $v['sourceId_img_big'][] = $bi['path'];
             } else {
                 $v['sourceId_img_big'][] = getRootUrl() . substr($bi['path'], 1);
             }
         }
         if (in_array($v['id'], $is_zan)) {
             //判断是否已经点赞
             $v['is_support'] = '1';
         } else {
             $v['is_support'] = '0';
         }
         if (empty($v['data']['attach_ids'])) {
             //判断是否是图片
             $v['is_img'] = '0';
         } else {
             $v['is_img'] = '1';
         }
         if (empty($v['sourceId_img']['0'])) {
             $v['sourceId_is_img'] = '0';
         } else {
             $v['sourceId_is_img'] = '1';
         }
     }
     if ($weibo) {
         $data['html'] = "";
         foreach ($weibo as $val) {
             $this->assign("vo", $val);
             $data['html'] .= $this->fetch("_myweibo");
             $data['status'] = 1;
//.........这里部分代码省略.........
开发者ID:ccccy,项目名称:wuanlife,代码行数:101,代码来源:UserController.class.php


示例14: fixAttachUrl

function fixAttachUrl($url)
{
    if (is_local()) {
        return str_replace('//', '/', getRootUrl() . $url);
        //防止双斜杠的出现
    } else {
        return $url;
    }
}
开发者ID:fishling,项目名称:chatPro,代码行数:9,代码来源:thumb.php


示例15: get_pic_src

/**
 * get_pic_src   渲染图片链接
 * @param $path
 * @return mixed
 * @author:xjw129xjt(肖骏涛) [email protected]
 */
function get_pic_src($path)
{
    //不存在http://
    $not_http_remote = strpos($path, 'http://') === false;
    //不存在https://
    $not_https_remote = strpos($path, 'https://') === false;
    if ($not_http_remote && $not_https_remote) {
        //本地url
        return str_replace('//', '/', getRootUrl() . $path);
        //防止双斜杠的出现
    } else {
        //远端url
        return $path;
    }
}
开发者ID:ccccy,项目名称:wuanlife,代码行数:21,代码来源:thumb.php


示例16: issueDetail

 /**
  * @param $id
  * 专辑详情页
  */
 public function issueDetail($id)
 {
     // dump($id);exit;
     $aPage = I('post.page', 1, 'op_t');
     $aCount = I('post.count', 10, 'op_t');
     $this->setTopTitle('专辑详情');
     $map['id'] = array('eq', $id);
     $mapl['row_id'] = array('eq', $id);
     $issuedetail = D('Issue_content')->where($map)->find();
     $issuedetail['meta']['description'] = mb_substr($issuedetail['content'], 0, 50, 'UTF-8');
     //取得前50个字符
     $issuedetail['meta']['keywords'] = D('Issue')->where(array('id' => $issuedetail['issue_id']))->field('title')->find();
     $totalCount = D('Local_comment')->where(array('status' => 1, $mapl))->count();
     if ($totalCount <= $aPage * $aCount) {
         $pid['count'] = 0;
     } else {
         $pid['count'] = 1;
     }
     $issuecomment = D('Local_comment')->where(array('status' => 1, $mapl))->page($aPage, $aCount)->order('create_time desc')->select();
     D('IssueContent')->where(array('id' => $id))->setInc('view_count');
     //查看数加1
     $support['appname'] = 'Issue';
     //查找需要判断是否点赞的数据
     $support['table'] = 'issue_content';
     $support['uid'] = is_login();
     $is_zan = D('Support')->where($support)->select();
     $is_zan = array_column($is_zan, 'row');
     $issue_uid = D('IssueContent')->where(array('status' => 1, 'id' => $id))->find();
     //根据微博ID查找专辑发送人的UID
     $issuedetail['user'] = query_user(array('nickname', 'avatar32', 'uid'), $issuedetail['uid']);
     //获得原图
     $bi = M('Picture')->where(array('status' => 1))->getById($issuedetail['cover_id']);
     if (!is_bool(strpos($bi['path'], 'http://'))) {
         $issuedetail['cover_url'] = $bi['path'];
     } else {
         $issuedetail['cover_url'] = getRootUrl() . substr($bi['path'], 1);
     }
     if (in_array($issuedetail['id'], $is_zan)) {
         //判断是否已经点赞
         $issuedetail['is_support'] = '1';
     } else {
         $issuedetail['is_support'] = '0';
     }
     if (is_administrator(get_uid()) || $issue_uid['uid'] == get_uid()) {
         //如果是管理员,则可以删除评论
         $issuedetail['is_admin_or_mine'] = '1';
     } else {
         $issuedetail['is_admin_or_mine'] = '0';
     }
     foreach ($issuecomment as &$v) {
         $v['user'] = query_user(array('nickname', 'avatar32', 'uid'), $v['uid']);
         $v['cover_url'] = getThumbImageById($v['cover_id']);
         $v['content'] = parse_weibo_mobile_content($v['content']);
     }
     $this->setMobTitle($issuedetail['user']['nickname'], $issuedetail['title']);
     $this->setMobDescription($issuedetail['meta']['description']);
     $this->setMobKeywords($issuedetail['title'], $issuedetail['user']['nickname'], $issuedetail['meta']['keywords']['title']);
     //dump($issuedetail);exit;
     $this->assign('issuedetail', $issuedetail);
     $this->assign('issuecomment', $issuecomment);
     $this->assign("pid", $pid);
     $this->display();
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:67,代码来源:IssueController.class.php


示例17: doAddInfo

 public function doAddInfo()
 {
     unset($_POST['__hash__']);
     $entity_id = I('post.entity_id', 0, 'intval');
     $info_id = I('post.info_id', 0, 'intval');
     $aOverTime = I('post.over_time', '', 'op_t');
     $entity = D('cat_entity')->find($entity_id);
     /**权限认证**/
     $can_post = CheckCanPostEntity(is_login(), $entity_id);
     if (!$can_post) {
         $this->error('对不起,您无权发布。');
     }
     /**权限认证end*/
     $info['title'] = I('post.title', '', 'op_t');
     if ($info['title'] == '') {
         $this->error('必须输入标题');
     }
     if (mb_strlen($info['title'], 'utf-8') > 40) {
         $this->error('标题过长。');
     }
     $info['create_time'] = time();
     if ($info_id != 0) {
         //保存逻辑
         $info = D('cat_info')->find($info_id);
         $this->checkAuth('Cat/Index/editInfo', $info['uid'], '你没有编辑该条信息的权限!');
         $this->checkActionLimit('cat_edit_info', 'cat_info', $info['id']);
         if ($aOverTime != '') {
             $info['over_time'] = strtotime($aOverTime);
         }
         $info['id'] = $info_id;
         $res = D('cat_info')->save($info);
         $rs_info = $info['id'];
         if ($res) {
             action_log('cat_edit_info', 'cat_info', $info['id']);
         }
     } else {
         $this->checkAuth('Cat/Index/addInfo', -1, '你没有发布信息的权限!');
         $this->checkActionLimit('cat_add_info', 'cat_info');
         //新增逻辑
         $info['entity_id'] = $entity_id;
         $info['uid'] = is_login();
         if ($entity['need_active'] && !is_administrator()) {
             $info['status'] = 2;
         } else {
             $info['status'] = 1;
         }
         if (isset($_POST['over_time'])) {
             $info['over_time'] = strtotime($_POST['over_time']);
         }
         $rs_info = D('cat_info')->add($info);
         if ($rs_info) {
             action_log('cat_add_info', 'cat_info');
         }
     }
     $rs_data = 1;
     if ($rs_info != 0) {
         if ($info_id != 0) {
             $map_data['info_id'] = $info_id;
             D('Data')->where($map_data)->delete();
         }
         $dataModel = D('Data');
         //处理房屋的图片
         if ($entity_id == 2) {
             $listl = array('zhaopian1' => "", 'zhaopian2' => "", 'zhaopian3' => "", 'zhaopian4' => "", 'zhaopian5' => "");
             $list = $_POST;
             foreach ($list as $key => &$v) {
                 $array = explode(",", $list['zhaopian']);
                 foreach ($array as $k => $val) {
                     $list['zhaopian' . ($k + 1)] = $val;
                 }
                 unset($k, $val);
             }
             unset($list['zhaopian']);
             $list = array_merge($listl, $list);
         } else {
             if ($entity_id == 3) {
                 $list = $_POST;
                 if ($list['zhaopian']) {
                     $img_ids = explode(',', $list['zhaopian']);
                     //把图片和内容结合
                     foreach ($img_ids as &$v) {
                         $v = M('Picture')->where(array('status' => 1))->getById($v);
                         if (!is_bool(strpos($v['path'], 'http://'))) {
                             $v = $v['path'];
                         } else {
                             $v = getRootUrl() . substr($v['path'], 1);
                         }
                         $v = '<p><img src="' . $v . '" style=""/></p><br>';
                     }
                     $img_ids = implode('', $img_ids);
                     $list['jieshao'] = $img_ids . $list['jieshao'];
                     $contentHandler = new ContentHandlerModel();
                     $list['jieshao'] = $data['content'] = $contentHandler->filterHtmlContent($list['jieshao']);
                     //把图片和内容结合END
                 }
                 unset($list['zhaopian']);
             } else {
                 $list = $_POST;
                 if ($list['zhaopian']) {
                     $img_ids = explode(',', $list['zhaopian']);
//.........这里部分代码省略.........
开发者ID:ccccy,项目名称:wuanlife,代码行数:101,代码来源:CatController.class.php


示例18: addMoreHotWeibo

 /**
  * 加载更多热门微博
  */
 public function addMoreHotWeibo()
 {
     $aPage = I('post.page', 1, 'op_t');
     $aCount = I('post.count', 10, 'op_t');
     $hot_left = modC('HOT_LEFT', 3);
     $time_left = get_some_day($hot_left);
     $time_left = get_some_day($hot_left);
     $param['create_time'] = array('gt', $time_left);
     $param['status'] = 1;
     $param['is_top'] = 0;
     $weibo = D('Weibo')->where(array('status' => 1, $param))->page($aPage, $aCount)->order('comment_count desc')->select();
     $support['appname'] = 'Weibo';
     //查找是否点赞
     $support['table'] = 'weibo';
     $support['uid'] = is_login();
     $is_zan = D('Support')->where($support)->select();
     $is_zan = array_column($is_zan, 'row');
     foreach ($weibo as &$v) {
         $v['user'] = query_user(array('nickname', 'avatar64', 'uid'), $v['uid']);
         $v['rand_title'] = mob_get_head_title($v['uid']);
         $v['support'] = D('Support')->where(array('appname' => 'Weibo', 'table' => 'weibo', 'row' => $v['id']))->count();
         if ($v['type'] === "repost") {
             $v['content'] = A('Mob/WeiboType')->fetchRepost($v);
         } else {
             if ($v['type'] === "xiami" || $v['type'] == "video") {
                 $v['content'] = Hook::exec('Addons\\Insert' . ucfirst($v['type']) . '\\Insert' . ucfirst($v['type']) . 'Addon', 'fetch' . ucfirst($v['type']), $v);
             } else {
                 $v['content'] = parse_weibo_mobile_content($v['content']);
             }
         }
         if (empty($v['from'])) {
             $v['from'] = "网站端";
         }
         $v['data'] = unserialize($v['data']);
         //字符串转换成数组,获取微博源ID
         if ($v['data']['sourceId']) {
             //判断是否是源微博
             $v['sourceId'] = $v['data']['sourceId'];
             $v['is_sourceId'] = '1';
         } else {
             $v['sourceId'] = $v['id'];
             $v['is_sourceId'] = '0';
         }
         $v['sourceId_user'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->find();
         //源微博用户名
         $v['sourceId_user'] = $v['sourceId_user']['uid'];
         $v['sourceId_user'] = query_user(array('nickname', 'uid'), $v['sourceId_user']);
         $v['sourceId_content'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('content')->find();
         //源微博内容
         if (!is_null($v['sourceId_content'])) {
             $v['sourceId_content'] = parse_weibo_mobile_content($v['sourceId_content']['content']);
             //把表情显示出来。
         }
         $v['sourceId_repost_count'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('repost_count')->find();
         //源微博转发数
         $v['sourceId_from'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('from')->find();
         //源微博来源
         if (empty($v['sourceId_from']['from'])) {
             $v['sourceId_from'] = "网站端";
         } else {
             $v['sourceId_from'] = "手机网页版";
         }
         $v['sourceId_img'] = D('Weibo')->where(array('status' => 1, 'id' => $v['sourceId']))->field('data')->find();
         //为了获取源微图片
         $v['sourceId_img'] = unserialize($v['sourceId_img']['data']);
         $v['sourceId_img'] = explode(',', $v['sourceId_img']['attach_ids']);
         //把attach_ids里的图片ID转出来
         foreach ($v['sourceId_img'] as &$b) {
             $v['sourceId_img_path'][] = getThumbImageById($b, 100, 100);
             //获得缩略图
             //获得原图
             $bi = M('Picture')->where(array('status' => 1))->getById($b);
             if (!is_bool(strpos($bi['path'], 'http://'))) {
                 $v['sourceId_img_big'][] = $bi['path'];
             } else {
                 $v['sourceId_img_big'][] = getRootUrl() . substr($bi['path'], 1);
             }
         }
         $v['cover_url'] = explode(',', $v['data']['attach_ids']);
         //把attach_ids里的图片ID转出来
         foreach ($v['cover_url'] as &$a) {
             $v['img_path'][] = getThumbImageById($a, 100, 100);
             //获得原图
             $bi = M('Picture')->where(array('status' => 1))->getById($b);
             if (!is_bool(strpos($bi['path'], 'http://'))) {
                 $v['sourceId_img_big'][] = $bi['path'];
             } else {
                 $v['sourceId_img_big'][] = getRootUrl() . substr($bi['path'], 1);
             }
         }
         if (in_array($v['id'], $is_zan)) {
             //判断是否已经点赞
             $v['is_support'] = '1';
         } else {
             $v['is_support'] = '0';
         }
         if (empty($v['data']['attach_ids'])) {
//.........这里部分代码省略.........
开发者ID:ccccy,项目名称:wuanlife,代码行数:101,代码来源:WeiboController.class.php


示例19: getTempAvatar

 public function getTempAvatar($uid)
 {
     //获取用户上传的临时头像
     $model = $this->getAvatarModel();
     $avatar = $model->getTempAvatar($uid);
     if ($avatar) {
         if (strtolower(APP_MODE) == 'sae') {
             return $avatar;
         }
         return getRootUrl() . "Uploads/Avatar/{$avatar}";
     }
     return '';
 }
开发者ID:yaomoo,项目名称:bbs,代码行数:13,代码来源:AvatarAddon.class.php


示例20: uploadAvatar

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getRoute函数代码示例发布时间:2022-05-15
下一篇:
PHP getRootPath函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap