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


PHP zmf::jiaMi方法代码示例

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


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

示例1: init

 function init()
 {
     parent::init();
     if (zmf::config('closeSite')) {
         header("Content-type: text/html; charset=utf-8");
         exit(zmf::config('closeSiteReason'));
     }
     $this->uid = zmf::uid();
     if ($this->uid) {
         $uid = $this->uid;
         $userInfo = Users::getUserInfo($uid);
         $this->truename = $userInfo['truename'];
         $this->userInfo = $userInfo;
         $this->userCode = zmf::jiaMi('zmf#' . $this->uid);
     }
     $this->pageTitle = zmf::config('sitename');
     $this->mobileTitle = zmf::config('sitename');
     if ($this->isMobile == 'yes') {
         Yii::app()->theme = 'mobile';
     } else {
         Yii::app()->theme = 'naodong';
     }
     self::_referer();
 }
开发者ID:ph7pal,项目名称:naodong,代码行数:24,代码来源:Q.php

示例2: array

    <div class="col-xs-4 col-sm-4 text-center">
        <a href="<?php 
echo Yii::app()->createUrl('index/media', array('id' => $this->uid));
?>
" title="<?php 
echo $this->userInfo['hits'];
?>
次访问">
            <p style="font-size: 48px;"><span class="icon-bar-chart"></span></p>
            <h2><?php 
echo $this->userInfo['hits'];
?>
</h2>
        </a>
    </div>
    <div class="col-xs-4 col-sm-4 text-center" title="152次贡献">
        <p style="font-size: 48px;"><span class="icon-group"></span></p>
        <h2>152</h2>
    </div>
</div>
<hr/>
<div class="input-group">
    <span class="input-group-addon" id="basic-addon1">我的链接</span>
    <input type="text" class="form-control" placeholder="分享链接,增加贡献" value="<?php 
echo zmf::config('domain') . zmf::url('', 'index/media', array('id' => $this->uid, 'zmf' => zmf::jiaMi($this->uid)), 'l');
?>
">
    <span class="input-group-btn">
        <button class="btn btn-default" type="button">分享给好友</button>
    </span>
</div><!-- /input-group -->
开发者ID:ph7pal,项目名称:naodong,代码行数:31,代码来源:index.php

示例3: array

    <div class="photo_bar">
    <span class="nums">第<?php 
echo $theOrder;
?>
张/共<?php 
echo $total;
?>
张</span>
    <?php 
if ($preid) {
    echo CHtml::link('上一张', array('attachments/index', 'id' => zmf::jiaMi($preid)));
}
?>
/<?php 
if ($nextid) {
    echo CHtml::link('下一张', array('attachments/index', 'id' => zmf::jiaMi($nextid)));
}
?>
    <span class="back_link"><?php 
echo CHtml::link('返回文章', array('posts/index', 'id' => $data['logid']));
?>
</span>
    </div>	
<p><img src="<?php 
echo zmf::imgurl($data['logid'], $data['filePath'], 600, $data['classify']);
?>
" alt="<?php 
echo $data['fileDesc'];
?>
" width="550px"/></p>
<div class="photo_desc">
开发者ID:ph7pal,项目名称:wedding,代码行数:31,代码来源:image.php

示例4: delCookie

 public static function delCookie($key)
 {
     $key = zmf::jiaMi($key);
     $cookie = Yii::app()->request->getCookies();
     unset($cookie[$key]);
 }
开发者ID:ph7pal,项目名称:mei,代码行数:6,代码来源:zmf.php

示例5: encode

 public static function encode($id, $type = 'post')
 {
     return zmf::jiaMi($id . '#' . $type);
 }
开发者ID:ph7pal,项目名称:momo,代码行数:4,代码来源:Posts.php

示例6: actionUpload


//.........这里部分代码省略.........
     }
     if (!isset($_FILES[$fileholder]) || !is_uploaded_file($_FILES[$fileholder]["tmp_name"]) || $_FILES[$fileholder]["error"] != 0) {
         $this->jsonOutPut(0, '无效上传,请重试');
     }
     $model = new Attachments();
     $img = CUploadedFile::getInstanceByName($fileholder);
     $ext = $img->getExtensionName();
     $size = $img->getSize();
     if ($size > zmf::config('imgMaxSize')) {
         $this->jsonOutPut(0, '上传文件最大尺寸为:' . tools::formatBytes(zmf::config('imgMaxSize')));
     }
     $upExt = zmf::config("imgAllowTypes");
     if (!preg_match('/^(' . str_replace('*.', '|', str_replace(';', '', $upExt)) . ')$/i', $ext)) {
         $this->jsonOutPut(0, '上传文件扩展名必需为:' . $upExt);
     }
     $sizeinfo = getimagesize($_FILES[$fileholder]["tmp_name"]);
     if ($sizeinfo['0'] < zmf::config('imgMinWidth') or $sizeinfo[1] < zmf::config('imgMinHeight')) {
         $this->jsonOutPut(0, "要求上传的图片尺寸,宽不能不小于" . zmf::config('imgMinWidth') . "px,高不能小于" . zmf::config('imgMinHeight') . "px.");
     }
     $ctime = zmf::now();
     $uid = zmf::uid();
     $dirs = zmf::uploadDirs($ctime, 'app', $uptype, null, true);
     $fileName = uniqid() . '.' . $ext;
     $origin = $dirs['origin'];
     unset($dirs['origin']);
     $uploadedFiles = array();
     $uploadedFiles[] = array('from' => $origin . $fileName, 'to' => zmf::ftpPath($ctime, $uptype, 'origin') . $fileName);
     if (move_uploaded_file($_FILES[$fileholder]["tmp_name"], $origin . $fileName)) {
         $data = array();
         if ($uptype == 'posts') {
             $status = Posts::STATUS_DELED;
         } else {
             $status = Posts::STATUS_PASSED;
         }
         $data['uid'] = $uid;
         $data['logid'] = $logid;
         $data['filePath'] = $fileName;
         $data['fileDesc'] = $fileName;
         $data['classify'] = $uptype;
         $data['covered'] = '0';
         $data['cTime'] = time();
         $data['status'] = $status;
         $data['width'] = $sizeinfo[0];
         $data['height'] = $sizeinfo[1];
         $data['size'] = $size;
         if ($uptype == 'poi') {
             $data['areaid'] = $poiInfo['areaid'];
         }
         $model->attributes = $data;
         if ($model->validate()) {
             if ($model->save()) {
                 if ($uptype == 'poi') {
                     Posts::updateCount($logid, 'Position', 1, 'attach');
                 } elseif ($uptype == 'avatar') {
                     Users::model()->updateByPk($uid, array('avatar' => $model->id));
                 }
                 //                    $image = Yii::app()->image->load($origin . $fileName);
                 //                    $_quality = zmf::config('imgQuality');
                 //                    $quality = isset($quality) ? $quality : 100;
                 Yii::import('application.vendors.thinkphp.*');
                 require_once 'ImageGd.php';
                 if (in_array($uptype, array('group', 'avatar'))) {
                     $rate = 1;
                 } else {
                     $rate = 0.75;
                 }
                 foreach ($dirs as $dk => $_dir) {
                     $image = new ImageGd($origin . $fileName);
                     if ($dk < 600) {
                         $image->thumb($dk, $dk * $rate, 'center');
                     } else {
                         $image->thumb($dk, 10000);
                         //$image->water(Yii::app()->basePath . '/../common/images/water.png',2);
                     }
                     $image->save($_dir . $fileName);
                     $_todir = zmf::ftpPath($ctime, $uptype, $dk);
                     $uploadedFiles[] = array('id' => $model->id, 'from' => $_dir . $fileName, 'to' => $_todir . $fileName);
                 }
                 $imgsize = $reImgsize > 0 ? $reImgsize : 170;
                 $returnimg = zmf::uploadDirs($ctime, 'site', $uptype, $imgsize) . $fileName;
                 $outPutData = array('status' => 1, 'attachid' => $model->id, 'imgsrc' => $returnimg);
                 $json = CJSON::encode($outPutData);
                 if (zmf::config('ftpon')) {
                     $asyncdata = "method=ftpupload&json=" . zmf::jiaMi(CJSON::encode($uploadedFiles));
                     AsyncController::Async($asyncdata);
                 }
                 if ($uptype == 'avatar') {
                     zmf::delFCache("userInfo-{$uid}");
                 }
                 echo $json;
             } else {
                 $this->jsonOutPut(0, '写入数据库错误');
             }
         } else {
             $this->jsonOutPut(0, '数据验证错误');
         }
     } else {
         $this->jsonOutPut(0, '移动到指定文件夹出错');
     }
 }
开发者ID:ph7pal,项目名称:wedding,代码行数:101,代码来源:AttachmentsController.php


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