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

PHP get_cover函数代码示例

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

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



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

示例1: _thumb_media_id

 function _thumb_media_id($cover_id)
 {
     $cover = get_cover($cover_id);
     $driver = C('PICTURE_UPLOAD_DRIVER');
     if ($driver != 'Local' && !file_exists(SITE_PATH . $cover['path'])) {
         // 先把图片下载到本地
         $pathinfo = pathinfo(SITE_PATH . $cover['path']);
         mkdirs($pathinfo['dirname']);
         $content = wp_file_get_contents($cover['url']);
         $res = file_put_contents(SITE_PATH . $cover['path'], $content);
         if ($res) {
             return '';
         }
     }
     $path = $cover['path'];
     if (!$path) {
         return '';
     }
     $param['type'] = 'thumb';
     $param['media'] = '@' . realpath(SITE_PATH . $path);
     $url = 'https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=' . get_access_token();
     $res = post_data($url, $param, true);
     if (isset($res['errcode']) && $res['errcode'] != 0) {
         return '';
     }
     $map['cover_id'] = $cover_id;
     $map['manager_id'] = $this->mid;
     $this->where($map)->setField('thumb_media_id', $res['media_id']);
     return $res['media_id'];
 }
开发者ID:walkingmanc,项目名称:weshop,代码行数:30,代码来源:MaterialModel.class.php


示例2: render

 public function render($data)
 {
     $content = '<span class="bld">' . $data['field']['alias'] . '</span>:';
     //检测是否过期隐藏
     if ($data['overed'] && $data['field']['over_hidden']) {
         $content .= '<span class="cred" id="' . $data['data']['field']['name'] . '">过期隐藏</span>';
         return $content;
     }
     $content .= '<span  id="' . $data['data']['field']['name'] . '">';
     switch ($data['field']['input_type']) {
         case IT_SINGLE_TEXT:
             //单行文本
         //单行文本
         case IT_MULTI_TEXT:
             //多行文本
             $content .= op_h($data['data']['data'][0]);
             break;
         case IT_EDITOR:
             //编辑器
             $content .= "<br/>" . op_h($data['data']['data'][0]);
             break;
         case IT_DATE:
             //日期
             $content .= date('Y-m-d', $data['data']['data'][0]);
             //dump($data['data']['data'][0]);exit;
             break;
             //选择框
         //选择框
         case IT_SELECT:
             //下拉框
             $content .= op_t($data['data']['data'][0]);
             break;
         case IT_RADIO:
             //单选框
             $content .= op_t($data['data']['data'][0]);
             break;
         case IT_PIC:
             //单图片
             if (intval($data['data']['data'][0]) == 0) {
                 return '';
             }
             $content .= '<a class="pic_field" target="_blank" href="' . get_cover($data['data']['data'][0], 'path') . '"><img title="点击查看大图"  class="pic_size" src="' . getThumbImageById($data['data']['data'][0], 100, 100) . '"></a>';
             break;
         case IT_CHECKBOX:
             $content .= $data['data']['data'][0] . '&nbsp;&nbsp;';
             break;
     }
     $content .= '</span>';
     echo $content;
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:50,代码来源:DisplayRenderWidget.class.php


示例3: reformatData

 function reformatData($project)
 {
     $data['project_index'] = $project['id'];
     //项目编号
     $data['project_name'] = $project['project_name'];
     //项目名称
     $data['project_stage'] = $this->stageConvertor($project['stage']);
     //项目阶段
     $data['project_type'] = get_code_name($project['industry']);
     //项目类型
     $data['project_abstract'] = $project['abstract'];
     //项目简介
     $data['project_cover'] = 'http://' . $_SERVER['HTTP_HOST'] . get_cover($project['cover'], 'path');
     //封面url
     $data['project_province'] = getDistrict($project['province']);
     //省
     $data['project_city'] = getDistrict($project['city']);
     //市
     $data['project_companyname'] = $project['company_name'];
     //公司名称
     $data['project_leader'] = get_membername($project['leader_id']);
     //项目发起人
     $data['project_financinglimit'] = $project['need_fund'];
     //目标融资额
     if ($data['project_stage'] == 1) {
         $data['project_valuation'] = 0;
         //项目最终估值
     } else {
         $data['project_valuation'] = M('ProjectFund')->where(array('project_id' => $project['id']))->getField('final_valuation');
         //项目最终估值
     }
     $data['project_mininvestment'] = $project['follow_fund'];
     //起投额
     $data['project_raisedfund'] = $project['has_fund'];
     //完成金额
     $data['project_investornumber'] = $project['investor_count'];
     //投资人数
     $data['project_detailurl'] = 'http://' . $_SERVER['HTTP_HOST'] . '/project/detail/id/' . $project['id'];
     //项目url
     $data['project_details'] = M('ProjectInfo')->where(array('project_id' => $project['id']))->getField('description');
     //项目详细详情
     $data['project_details'] = str_replace('"/Uploads', '"http://' . $_SERVER['HTTP_HOST'] . "/Uploads/", $data['project_details']);
     if ($project['team']) {
         $data['project_team'] = $project['team'];
     }
     return $data;
 }
开发者ID:rainly123,项目名称:zyzm,代码行数:47,代码来源:ProjectInfoModel.class.php


示例4: update

 public function update()
 {
     $id = $_GET['id'];
     if (!$id) {
         echo '非法操作';
         exit;
     }
     $v = D('ProjectInfoView')->where(array('p.stage' => array('egt', 1), 'p.status' => 9, 'p.id' => $id))->find();
     if (!$v) {
         echo '指定项目不存在。';
         exit;
     }
     include_once APP_PATH . 'Admin/zczj/zczj.api.php';
     //===============初始化==================//
     $options = array('debug' => true, 'UserName' => 'jumuzhongchou', 'PassWord' => 'jumuzhongchou123', 'PlatId' => 2);
     $zczj = new \zczj($options);
     $var = get_cover($v['cover']);
     $filename = basename(APP_PATH . substr($var['path'], 1));
     //echo $filename;
     //echo getimagesize(substr($var['path'], 1)); die();
     //echo @file_get_contents(substr($var['path'], 1)); die();
     if ($v['stage'] == 1) {
         $state = 1;
     } else {
         if ($v['stage'] == 4) {
             $state = 2;
         } else {
             if ($v['stage'] >= 8) {
                 $state = 3;
             }
         }
     }
     $desc = str_replace('"/Uploads/', '"http://www.dreammove.cn/Uploads/', $v['description']);
     $pics = M('ProjectTemp')->where(array('project_id' => $id, 'temp_type' => 1))->order('sort')->limit(6)->select();
     foreach ($pics as $k1 => $v1) {
         $path = get_cover($v1['info_key'], 'path');
         $desc = $desc . '<p><img src="http://www.dreammove.cn' . $path . '"/></p>';
     }
     $projects = array('PlatProjectID' => $v['id'], 'projectName' => $v['project_name'], 'description' => $desc, 'currentAmount' => $v['has_fund'], 'targetAmount' => $v['need_fund'], 'endTime' => NULL, 'targetDay' => 30, 'projectSponsor' => get_membername($v['uid']), 'support' => $v['follow'], 'state' => $state, 'projectCategoryId' => 23673, 'fileBytes' => @file_get_contents(substr($var['path'], 1)), 'fileName' => $filename, 'url' => "http://www.dreammove.cn/Project/detail/id/" . $v['id'] . '.html');
     $ret = $zczj->projectsAdd($projects);
     //dump($ret); die();
     if ($ret->Result) {
         echo "处理成功.";
     } else {
         echo $ret->Message;
     }
 }
开发者ID:rainly123,项目名称:zyzm,代码行数:47,代码来源:ZczjController.class.php


示例5: show

 public function show()
 {
     $visa_id = I('get.id');
     if (empty($visa_id)) {
         $this->error();
     }
     $Visa = M('Visa');
     $map = array();
     $map['visa_id'] = $visa_id;
     $map['status'] = 1;
     $detail = $Visa->where($map)->find();
     $detail['image'] = get_cover($detail['cover_id'], 'path');
     $detail['is_yaoqing'] = $detail['is_yaoqing'] ? '需要' : '不需要';
     $detail['is_mianshi'] = $detail['is_mianshi'] ? '需要' : '不需要';
     $this->assign('detail', $detail);
     $this->display();
 }
开发者ID:bjjfsd,项目名称:youweihui,代码行数:17,代码来源:VisaController.class.php


示例6: _after_find

 /**
  * 查找后置操作
  * @author jry <[email protected]>
  */
 protected function _after_find(&$result, $options)
 {
     $result['avatar_url'] = get_cover($result['avatar'], 'avatar');
     // 用户识别label
     if (D('Admin/Module')->where('name="User" and status="1"')->count()) {
         $cert_info = D('User/Cert')->isCert($result['id']);
     }
     if ($cert_info) {
         $result['label'] = $cert_info['cert_title'] . '(' . $result['id'];
     } else {
         $result['label'] = $result['nickname'] . '(' . $result['id'];
     }
     if ($result['email']) {
         $result['label'] = $result['label'] . '-' . $result['email'];
     }
     $result['label'] = $result['label'] . ')';
 }
开发者ID:applemin,项目名称:tangguo,代码行数:21,代码来源:UserModel.class.php


示例7: show

 public function show($id = 0)
 {
     if (empty($id)) {
         $this->error('无效参数');
     }
     $Line = M('Line');
     $line_info = $Line->find($id);
     // 线路信息
     $line_info['images'] = explode(',', $line_info['images']);
     foreach ($line_info['images'] as $key => $val) {
         $line_info['images'][$key] = get_cover($val, 'path');
     }
     $line_info['xingcheng'] = unserialize($line_info['xingcheng']);
     $line_info['remark'] = unserialize($line_info['remark']);
     // 套餐信息
     $map = array('line_id' => $id, 'end_time' => array('egt', strtotime('+' . $line_info['earlier_date'] . 'day')));
     $line_tc = M('LineTc')->where($map)->select();
     if (empty($line_tc)) {
         $this->error('没有报价方案');
     }
     $default_tc = array();
     foreach ($line_tc as $key => $value) {
         if ($value['is_default']) {
             $default_tc = $value;
             break;
         }
     }
     if (empty($default_tc)) {
         $default_tc = $line_tc[0];
     }
     $map = array('product_id' => $id, 'status' => 1);
     $comment_lists = M('Comment')->where($map)->select();
     $this->assign('comment_lists', $comment_lists);
     $this->assign('line_info', $line_info);
     $this->assign('line_tc', $line_tc);
     $this->assign('default_tc', $default_tc);
     $this->display();
 }
开发者ID:lampge,项目名称:youweihui,代码行数:38,代码来源:LineController.class.php


示例8: detail

 public function detail($id = 0)
 {
     if (!($id && is_numeric($id))) {
         echo json_e('', 2);
         exit;
     }
     $Document = D('Document');
     $info = $Document->detail($id);
     //        多张图片预留处理
     /*        if(!empty($info['pics'])){
                 $pics= explode(',',$info['pics']);
             }else {
                 $pics = "";
             }*/
     $pic = get_cover($info['cover_id']);
     $info['path'] = $pic['path'];
     if (!$info) {
         echo json_e();
         exit;
     } else {
         echo json_e($info);
         exit;
     }
 }
开发者ID:gitchenze,项目名称:soloshop,代码行数:24,代码来源:InterfaceController.class.php


示例9: sendIssue

 public function sendIssue()
 {
     $this->requireLogin();
     $aIssue_id = I('issue_id', '', 'intval');
     $aId = I('id', 0, 'intval');
     $aCover_id = I('cover_id', '', 'intval');
     $aTitle = I('title', '', 'op_t');
     $aUrl = I('url', '', 'op_h');
     $aContent = I('content', '', 'op_h');
     $attach_id = I('attach_id', '', 'op_t');
     $attach_ids = explode(',', $attach_id);
     if (!$aCover_id) {
         $this->apiError('请上传封面。');
     }
     if ($aTitle == '') {
         $this->apiError('请输入标题。');
     }
     if ($aIssue_id == 0) {
         $this->apiError('请选择分类。');
     }
     if ($aContent == '') {
         $this->apiError('请输入内容。');
     }
     if ($aUrl == '') {
         $this->apiError('请输入网址。');
     }
     foreach ($attach_ids as $k => $v) {
         $aContent .= "<p><img src='" . get_cover($v, 'path') . "'/></p>";
     }
     unset($v);
     $aContent = str_replace("\\", '', $aContent);
     $isEdit = $aId ? true : false;
     $this->requireIssueAllowPublish($aIssue_id);
     if ($isEdit) {
         $data = array('id' => intval($aId), 'title' => $aTitle, 'content' => $aContent, 'parse' => 0, 'cover_id' => intval($aCover_id), 'issue_id' => intval($aIssue_id), 'url' => $aUrl);
         $result = D('Issue/IssueContent')->where(array('id' => $aId))->save($data);
         if (!$result) {
             $this->apiError('编辑失败:' . $this->getError());
         }
     } else {
         $data = array('uid' => is_login(), 'title' => $aTitle, 'content' => $aContent, 'parse' => 0, 'cover_id' => intval($aCover_id), 'issue_id' => intval($aIssue_id), 'url' => $aUrl);
         /*  $before = getMyScore();
             $tox_money_before = getMyToxMoney();*/
         $data = D('Issue/IssueContent')->create($data);
         if (!$data) {
             return false;
         }
         $result = D('Issue/IssueContent')->add($data);
         /*
                     $after = getMyScore();
                     $tox_money_after = getMyToxMoney();*/
         if (!$result) {
             $this->apiError('发表失败:' . $this->getError());
         }
         $aId = $result;
     }
     //显示成功消息
     /*$message = $isEdit ? '编辑成功。' : '发表成功。' . getScoreTip($before, $after) . getToxMoneyTip($tox_money_before, $tox_money_after);*/
     //返回成功消息
     $row = D('Issue/IssueContent')->where('id=' . $aId)->find();
     $this->apiSuccess($row);
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:62,代码来源:IssueController.class.php


示例10: isset

            </div>
        </div>
        
         <div class="form-item">
						<label class="item-label">战队图腾</label>
						<input type="file" id="upload_picture">
						<input type="hidden" name="cover" id="cover" value="<?php 
echo isset($team['cover']) && $team['cover'] !== "" ? $team['cover'] : '';
?>
"/>
						<div class="upload-img-box">
						<?php 
if (!empty($team['cover'])) {
    ?>
<div class="upload-pre-item"><img src="<?php 
    echo get_cover($team["cover"], 'url');
    ?>
"/></div><?php 
}
?>
						</div>
					</div>
					<script type="text/javascript">
					//上传图片
				    /* 初始化上传插件 */
					$("#upload_picture").uploadify({
				        "height"          : 30,
				        "swf"             : "/Public/static/uploadify/uploadify.swf",
				        "fileObjName"     : "download",
				        "buttonText"      : "上传图片",
				        "uploader"        : "<?php 
开发者ID:nullog,项目名称:zhanglubao,代码行数:31,代码来源:d27108124fc4c40dea75fecb6f4d8d97.php


示例11: isset

">
	</div>
</div>

<div class="form-item"><label class="item-label">大赛封面</label> <input
	type="file" id="upload_picture"> <input type="hidden"
	name="cover" id="cover" value="<?php 
echo isset($match['cover']) && $match['cover'] !== "" ? $match['cover'] : '';
?>
" />
<div class="upload-img-box"><?php 
if (!empty($match['cover'])) {
    ?>
<div class="upload-pre-item"><img
	src="<?php 
    echo get_cover($match["cover"], 'url');
    ?>
" /></div><?php 
}
?>
</div>
</div>
<script type="text/javascript">
					//上传图片
				    /* 初始化上传插件 */
					$("#upload_picture").uploadify({
				        "height"          : 30,
				        "swf"             : "/Public/static/uploadify/uploadify.swf",
				        "fileObjName"     : "download",
				        "buttonText"      : "上传图片",
				        "uploader"        : "<?php 
开发者ID:nullog,项目名称:zhanglubao,代码行数:31,代码来源:08128f39e1b95e9bf65669b9d9adad21.php


示例12: get_cover

                                <input type="hidden" name="config[<?php 
                    echo $o_key;
                    ?>
]" id="cover_id_<?php 
                    echo $o_key;
                    ?>
" value="<?php 
                    echo $form['value'];
                    ?>
"/>
                                <div class="upload-img-box">
                                  <?php 
                    if (!empty($form['value'])) {
                        ?>
<div class="upload-pre-item"><img width="120" height="120" src="/weiphp2.0<?php 
                        echo get_cover($form['value'], 'path');
                        ?>
"/></div><?php 
                    }
                    ?>
                                </div>
                              </div>
                              <script type="text/javascript">
                                    //上传图片
                                    /* 初始化上传插件 */
                                    $("#upload_picture_<?php 
                    echo $o_key;
                    ?>
").uploadify({
                                        "height"          : 120,
                                        "swf"             : "/weiphp2.0/Public/static/uploadify/uploadify.swf",
开发者ID:skylei,项目名称:sae_weiphp,代码行数:31,代码来源:cc8882575a2473af8ca684b4904c7d8e.php


示例13: get_cover

<td><?php 
                echo $order["place"];
                ?>
</td>
<td><?php 
                echo $order["url"];
                ?>
</td>

						

						 <td><img src="<?php 
                echo get_cover($order["icon"], 'path');
                ?>
"  width="100" height="50"/>(670*400) <a title="编辑" href="<?php 
                echo get_cover($order["icon"], 'path');
                ?>
" target='_blank'>查看大图</a></td>
                        <td><?php 
                echo $order["status"];
                ?>
</td>
                         <td><?php 
                echo date('Y-m-d H:i:s', $order["create_time"]);
                ?>
</td>
					<td>
                            <a title="编辑" href="<?php 
                echo U('edit?id=' . $order['id']);
                ?>
">编辑</a>
开发者ID:a1357479,项目名称:techan,代码行数:31,代码来源:176a5b3b0ba55302e03dbe584fc1f56b.php


示例14: show

 public function show($order_id = '')
 {
     if (empty($order_id)) {
         $this->error('非法参数...');
     }
     $order_info = M('Order')->where(array('order_id' => $order_id))->find();
     if (empty($order_info)) {
         $this->error('订单不存在...');
     }
     $order_info['reserve_info'] = unserialize($order_info['reserve_info']);
     $order_info['order_status_text'] = order_status_text($order_info['order_status']);
     $order_info['pay_status_text'] = pay_status_text($order_info['pay_status']);
     switch ($order_info['order_type']) {
         case 'line':
             $line = M('Line')->field('title,images,starting')->where(array('line_id' => $order_info['product_id']))->find();
             if ($line) {
                 $order_info['title'] = $line['title'];
                 $order_info['image'] = get_cover(array_shift(explode(',', $line['images'])), 'path');
                 $order_info['starting'] = $line['starting'];
             } else {
                 $order_info['title'] = '不存在';
                 $order_info['image'] = '';
                 $order_info['starting'] = '';
             }
             break;
         default:
             break;
     }
     // echo '<pre>'; print_r($order_info); echo '</pre>';
     $this->assign('order_info', $order_info);
     $this->meta_title = '线路列表';
     $this->display();
 }
开发者ID:lampge,项目名称:youweihui,代码行数:33,代码来源:OrderController.class.php


示例15: foreach

    $__LIST__ = $viewlist;
    if (count($__LIST__) == 0) {
        echo "";
    } else {
        foreach ($__LIST__ as $key => $vo) {
            $mod = $i % 2;
            ++$i;
            ?>
<dd><a class="details_right_img" href="<?php 
            echo U('Article/detail?id=' . $vo['id']);
            ?>
" title="<?php 
            echo $vo["title"];
            ?>
"><img src="<?php 
            echo get_cover($vo["cover_id"], 'path');
            ?>
"  alt="<?php 
            echo $vo["title"];
            ?>
" style="display: inline-block;"></a><a href="<?php 
            echo U('Article/detail?id=' . $vo['id']);
            ?>
" class="details_right_title" title="<?php 
            echo $vo["title"];
            ?>
"><?php 
            echo $vo["title"];
            ?>
</a><span class="fwb mcm_title_price">¥<span class="red"><?php 
            echo get_good_price($vo["id"]);
开发者ID:norain2050,项目名称:yershop,代码行数:31,代码来源:0a19fa9b4a7f23f256fc04046be7f2b6.php


示例16: member

 /**
  * 活动成员
  * @param int $id
  * @param string $tip
  * autor:xjw129xjt
  */
 public function member($id = 0, $tip = 'all')
 {
     if ($tip == 'sign') {
         $map['status'] = 0;
     }
     if ($tip == 'attend') {
         $map['status'] = 1;
     }
     $event_content = $this->eventModel->where(array('status' => 1, 'id' => $id))->find();
     if (!$event_content) {
         $this->error('活动不存在!');
     }
     $map['event_id'] = $id;
     $member = $this->eventAttendModel->where($map)->select();
     foreach ($member as &$v) {
         $v['user_info'] = query_user(array('uid', 'nickname', 'space_url', 'avatar32', 'avatar64'), $v['uid']);
         if ($v['image']) {
             $v['image_info'] = '<div class="popup-gallery"><a class="popup" href="' . get_cover($v['image'], 'path') . '"><img src="' . getThumbImageById($v['image'], 50, 50) . '"/></a></div>';
         }
         $v['attach_info'] = D('File')->find($v['attach']);
         $v['attach_info']['link'] = get_pic_src($v['attach_info']['savepath'] . $v['attach_info']['savename']);
         if ($v['status'] == 0) {
             $v['status_info'] = '待审核';
         }
         if ($v['status'] == 1) {
             $v['status_info'] = '已审核';
         }
     }
     unset($v);
     $this->assign('all_count', $this->eventAttendModel->where(array('event_id' => $id))->count());
     $this->assign('sign_count', $this->eventAttendModel->where(array('event_id' => $id, 'status' => 0))->count());
     $this->assign('attend_count', $this->eventAttendModel->where(array('event_id' => $id, 'status' => 1))->count());
     $this->assign('event_member', $member);
     $this->assign('event_content', $event_content);
     $this->assign('tip', $tip);
     $this->setTitle($event_content['title'] . '——活动');
     $this->setKeywords($event_content['title'] . ',活动');
     $tmp = 'attend';
     $this->display($tmp);
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:46,代码来源:EventController.class.php


示例17: get_cover

">礼品活动</a></li>
            </ul>
        </div><!--nav end-->
        <div class="clear"></div>
    </div><!--top2 end-->

       
    </div>
    <div class="main">
        <div class="position">
            您现在的位置是:&nbsp;<a href="index.html">积分商城首页</a>&nbsp;&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp;&nbsp;<a href="gift.html">积分礼品</a>&nbsp;&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp;&nbsp;<a href="product.html">INBIKE骑行头盔</a>
        </div><!--position end-->
        <div class="product">
            <form id="good_form">
            <div class="pic"><img src="<?php 
echo get_cover($info["cover_id"], 'path');
?>
" width="280" height="313"></div>
            <div class="right">
                <div class="price">
                    <p class="tit"><?php 
echo $info["title"];
?>
</p>
                    <p class="old">市场价:
                        <?php 
echo $info["marketprice"];
?>
                    </p>
                    <p class="new">兑换积分:<span><span><?php 
echo $info["jifen"];
开发者ID:kevins1022,项目名称:tpshop,代码行数:31,代码来源:c860508c2ebd9b7e4ea457b499dcef94.php


示例18: _after_find

 /**
  * 查找后置操作
  * @author jry <[email protected]>
  */
 protected function _after_find(&$result, $options)
 {
     if ($result['cover']) {
         $result['cover_url'] = get_cover($result['cover'], 'default');
     }
 }
开发者ID:lipeng-github,项目名称:corethink,代码行数:10,代码来源:SliderModel.class.php


示例19: get_user_info

/**
 * 根据用户ID获取用户信息
 * @param  integer $id 用户ID
 * @param  string $field
 * @return array  用户信息
 * @author jry <[email protected]>
 */
function get_user_info($id, $field)
{
    $userinfo = D('Admin/User')->find($id);
    $userinfo['avatar_url'] = get_cover($userinfo['avatar'], 'avatar');
    if ($userinfo[$field]) {
        return $userinfo[$field];
    }
    return $userinfo;
}
开发者ID:lipeng-github,项目名称:corethink,代码行数:16,代码来源:function.php


示例20: display

 /**
  * $solist 判断是否属于选择返回数据的列表页,如果是在列表页->display('admin_solist');@mingyangliu
  * */
 public function display($solist = '')
 {
     //key类型的等价转换
     //map转换成text
     $this->convertKey('map', 'text', function ($value, $key) {
         return $key['opt'][$value];
     });
     //uid转换成text
     $this->convertKey('uid', 'text', function ($value) {
         $value = query_user(array('nickname', 'uid', 'space_url'), $value);
         return "<a href='" . $value['space_url'] . "' target='_blank'>[{$value[uid]}]" . $value['nickname'] . '</a>';
     });
     //nickname转换成text
     $this->convertKey('nickname', 'text', function ($value) {
         $value = query_user(array('nickname', 'uid', 'space_url'), $value);
         exit;
         return "<a href='" . $value['space_url'] . "' target='_blank'>[{$value[uid]}]" . $value['nickname'] . '</a>';
     });
     //time转换成text
     $this->convertKey('time', 'text', function ($value) {
         if ($value != 0) {
             return time_format($value);
         } else {
             return '-';
         }
     });
     //trunctext转换成text
     $this->convertKey('trunktext', 'text', function ($value, $key) {
         $length = $key['opt'];
         return msubstr($value, 0, $length);
     });
     //text转换成html
     $this->convertKey('text', 'html', function ($value) {
         return $value;
     });
     //link转换为html
     $this->convertKey('link', 'html', function ($value, $key, $item) {
         $value = htmlspecialchars($value);
         $getUrl = $key['opt'];
         $url = $getUrl($item);
         //允许字段为空,如果字段名为空将标题名填充到A变现里
         if (!$value) {
             return "<a href=\"{$url}\" target=\"_blank\">" . $key['title'] . "</a>";
         } else {
             return "<a href=\"{$url}\" target=\"_blank\">{$value}</a>";
         }
     });
     //如果icon为空
     $this->convertKey('icon', 'html', function ($value, $key, $item) {
         $value = htmlspecialchars($value);
         if ($value == '') {
             $html = "无";
         } else {
             $html = "<i class=\"{$value}\"></i> {$value}";
         }
         return $html;
     });
     //image转换为图片
     $this->convertKey('image', 'html', function ($value, $key, $item) {
         if (intval($value)) {
             //value是图片id
             $value = htmlspecialchars($value);
             $sc_src = get_cover($value, 'path');
             $src = getThumbImageById($value, 80, 80);
             $sc_src = $sc_src == '' ? $src : $sc_src;
             $html = "<div class='popup-gallery'><a title=\"查看大图\" href=\"{$sc_src}\"><img src=\"{$sc_src}\"/ style=\"width:80px;height:80px\"></a></div>";
         } else {
             //value是图片路径
             $sc_src = $value;
             $html = "<div class='popup-gallery'><a title=\"查看大图\" href=\"{$sc_src}\"><img src=\"{$sc_src}\"/ style=\"border-radius:100%;\"></a></div>";
         }
         return $html;
     });
     //doaction转换为html
     $this->convertKey('doaction', 'html', function ($value, $key, $item) {
         $actions = $key['opt']['actions'];
         $result = array();
         foreach ($actions as $action) {
             $getUrl = $action['get_url'];
             $linkText = $action['text'];
             $url = $getUrl($item);
             if (isset($action['opt'])) {
                 $content = array();
                 foreach ($action['opt'] as $key => $value) {
                     $value = htmlspecialchars($value);
                     $content[] = "{$key}=\"{$value}\"";
                 }
                 $content = implode(' ', $content);
                 if (isset($action['opt']['data-role']) && $action['opt']['data-role'] == "modal_popup") {
                     //模态弹窗
                     $result[] = "<a href=\" javascrapt:void(0);\" modal-url=\"{$url}\" " . $content . ">{$linkText}</a>";
                 } else {
                     $result[] = "<a href=\"{$url}\" " . $content . ">{$linkText}</a>";
                 }
             } else {
                 $result[] = "<a href=\"{$url}\">{$linkText}</a>";
             }
//.........这里部分代码省略.........
开发者ID:tmac1997,项目名称:DormitoryWebsite,代码行数:101,代码来源:AdminListBuilder.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_cover_id函数代码示例发布时间:2022-05-15
下一篇:
PHP get_courses_wmanagers函数代码示例发布时间: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