当前位置: 首页>>代码示例>>PHP>>正文


PHP Str::changeLoad方法代码示例

本文整理汇总了PHP中Str::changeLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::changeLoad方法的具体用法?PHP Str::changeLoad怎么用?PHP Str::changeLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Str的用法示例。


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

示例1: foreach

    </div>
    <div class="bd">

        <ul class="lists">
            <?php 
foreach ($recommend as $key => $item) {
    ?>
            <li>

                <a class="photo" href="/<?php 
    echo $item['id'];
    ?>
.html" target="photo">

                    <img src="<?php 
    echo URL::domain() . Str::changeLoad($thumb->create($item['img_dir'] . '/' . $item['picname'], 130, 130));
    ?>
" />
                </a>
                <span class="info">
                    <a class="photo_id" href="/<?php 
    echo $item['id'];
    ?>
.html" title="<?php 
    echo $item['custom_name'];
    ?>
"target="photo"><?php 
    echo Str::slice($item['custom_name'], 15, '...');
    ?>
</a><br />
                    会员:<?php 
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:31,代码来源:index.php

示例2: action_zoom

 /**
  * 图片集合
  */
 public function action_zoom()
 {
     $this->template->pid = $pid = (int) $this->getQuery('id');
     $this->template->zoom = $zoom = trim($this->getQuery('zoom'));
     $this->template->info = $info = ORM::factory('img')->select('imgs.*', 'u.username', 'd.disk_domain')->join(array('users', 'u'))->on('u.uid', '=', 'imgs.userid')->join(array('img_disks', 'd'))->on('d.disk_domain', '=', 'imgs.disk_id')->where('imgs.id', '=', (int) $pid)->find();
     if (empty($info->picname)) {
         $this->show_message('非法访问', 0, array(), true);
     }
     $url = URL::domain();
     $picname = $info->disk_name . '/' . $info->picname;
     $imRule = Str::changeLoad($picname, true);
     if ($zoom == 'medium') {
         $picname = $this->thumb->create($picname, 640, 640, 's');
         $imRule = Str::changeLoad($picname);
     } elseif ($zoom == 'thumb') {
         $picname = $this->thumb->create($picname, 130, 130);
         $imRule = Str::changeLoad($picname);
     }
     $this->template->picinfo = $picinfo = @getimagesize($picname);
     $this->template->picname = $url . $imRule;
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:24,代码来源:pic.php

示例3: foreach

        <ul class="back">
          <li><a href="/">返回首页</a></li>
        </ul>
      </div>
      <div class="bd">
        <ul class="lists">
         <?php 
foreach ($pagination as $k => $img) {
    ?>
          <li style="height:200px;">
              <a class="photo" href="/<?php 
    echo $img['id'];
    ?>
.html" target="photo" style="height:130px; width:130px;">
                  <img src="<?php 
    echo URL::domain() . Str::changeLoad($thumb->create($img['disk_name'] . '/' . $img['picname'], 130, 130));
    ?>
" />
               </a>
              <span class="info"> <a class="photo_id" href="/<?php 
    echo $img['id'];
    ?>
.html" title='查看图片详情'><?php 
    echo Str::slice($img['custom_name'], 15, '...');
    ?>
</a><br />
            <strong>&nbsp;浏览<?php 
    echo $img['click'];
    ?>
次</strong> </span> </li>
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:30,代码来源:person.php

示例4: date

?>
</h2>
        <div class="clearfloat"></div>
        <span class="upload_time" style="float:left;">上传用户:【<?php 
echo $imgInfo['username'];
?>
】 上传于<?php 
echo date('Y-m-d', $imgInfo['uploadtime']);
?>
 </span><span class="back"><a href="javascript:" onclick="report(this);">举报</a><a href="/">返回首页</a> </span> </div>
        <div class="clearfloat"></div>
        <div style="border-bottom:4px solid #85C64E;"></div>
      <div class="pic">
      <br />
      <img src="<?php 
echo URL::domain() . Str::changeLoad($thumb->create($imgInfo['img_dir'] . '/' . $imgInfo['picname'], 640, 640, 's'));
?>
"  alt="<?php 
echo $imgInfo['custom_name'];
?>
"/><br />
          <br />
         <a class="img" href="/pic/zoom?id=<?php 
echo $imgInfo['id'];
?>
">查看原图 </a> </div>
    </div>
    <div class="comment">
      <div class="title">
        <h2>留言评论</h2>
        <sub>+Message&nbsp;comment</sub> </div>
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:31,代码来源:view.php

示例5: action_add

 /**
  * 添加专题
  *
  */
 public function action_add()
 {
     $this->checklogin();
     $this->template->pageTitle = '添加专题';
     $this->_add_css('styles/album/add_topics.css');
     $this->_add_script('scripts/copy.js');
     $specialpic = ORM::factory('specialpic');
     if ($this->isPost()) {
         $post = Validate::factory($this->getPost())->filter(TRUE, 'trim')->rule('title', 'not_empty')->rule('content', 'not_empty');
         if ($post->check()) {
             $specialpic->values($post);
             $specialpic->uid = $this->auth['uid'];
             $specialpic->save();
             $specialpic->sid;
             // 添加专题标签
             $tag = new Tags();
             $tags = trim($this->getPost('tags'));
             $tags = explode(' ', $tags);
             $tag->add($specialpic->sid, 'img_subject', $tags, $this->auth['uid']);
             $links[] = array('text' => '返回专题列表', 'href' => '/picsubject/list');
             $this->show_message('发现专题图片操作成功。', 1, $links, true);
         } else {
             // 校验失败,获得错误提示
             $str = '';
             $this->template->registerErr = $errors = $post->errors('default/pic/pic');
             foreach ($errors as $item) {
                 $str .= $item . '<br>';
             }
             $this->show_message($str);
         }
     }
     $pid = $this->getQuery('id');
     $arr = explode('-', $pid);
     $select = DB::select('imgs.picname', 'imgs.userid', 'imgs.custom_name', 'd.disk_domain', 'd.disk_name', array('imgs.disk_name', 'img_dir'))->from('imgs')->join(array('img_disks', 'd'))->on('d.disk_domain', '=', 'imgs.disk_id')->where('imgs.id', 'in', $arr)->where('imgs.userid', '=', $this->auth['uid']);
     $rows = $select->execute()->as_array();
     $str = '';
     foreach ($rows as $item) {
         $temp_img = $item['img_dir'] . '/' . $item['picname'];
         list($width, $height) = getimagesize($temp_img);
         if ($width >= 640) {
             $temp_img = $this->thumb->create($temp_img, 640, 640, 's');
             $temp_img = Str::changeLoad($temp_img, false);
         } else {
             $temp_img = Str::changeLoad($temp_img, true);
         }
         $str .= '<p>' . "<img src=\"" . URL::domain() . $temp_img . '" alt="' . $item['custom_name'] . '"/></p><p style="text-align:center;">' . $item['custom_name'] . '</p>';
     }
     $this->template->content = $str;
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:53,代码来源:picsubject.php


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