本文整理汇总了PHP中get_image_type函数的典型用法代码示例。如果您正苦于以下问题:PHP get_image_type函数的具体用法?PHP get_image_type怎么用?PHP get_image_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_image_type函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remote_ftp
/**
*
*
* Framework ºËÐÄ¿ò¼Ü
*
*
* @copyright Copyright (c) 2007-2013 ShopNC Inc. (http://www.shopnc.net)
* @license http://www.shopnc.net/
* @link http://www.shopnc.net/
* @since File available since Release v1.1
*/
function remote_ftp($path, $file, $ifdel = TRUE)
{
$image_full_path = $path . "/" . $file;
ftpcmd("upload", $image_full_path);
$_ext = "." . get_image_type($image_full_path);
if (!ftpcmd("error")) {
ftpcmd("upload", $image_full_path . "_max" . $_ext);
}
if (!ftpcmd("error")) {
ftpcmd("upload", $image_full_path . "_mid" . $_ext);
}
if (!ftpcmd("error")) {
ftpcmd("upload", $image_full_path . "_small" . $_ext);
}
if (!ftpcmd("error")) {
ftpcmd("upload", $image_full_path . "_tiny" . $_ext);
}
if (!ftpcmd("error")) {
ftpcmd("upload", $image_full_path . "_240x240" . $_ext);
}
if (!ftpcmd("error")) {
if ($ifdel) {
@unlink(BasePath . "/" . $image_full_path);
@unlink(BasePath . "/" . $image_full_path . "_max" . $_ext);
@unlink(BasePath . "/" . $image_full_path . "_mid" . $_ext);
@unlink(BasePath . "/" . $image_full_path . "_small" . $_ext);
@unlink(BasePath . "/" . $image_full_path . "_tiny" . $_ext);
@unlink(BasePath . "/" . $image_full_path . "_240x240" . $_ext);
}
return c("ftp_access_url") . "/" . $path;
}
return FALSE;
}
示例2: remote_ftp
/**
* 通过FTP同步图片到远程服务器
*
* @param string $path 图片路径(upload/store/goods/4)
* @param string $file 图片名称(含年月日2012/06/12/03f625d923bfb1ca84355007487ed68b.jpg)
* @param boolean $ifdel 是否删除本地图片,目前淘宝导入的图片上传到远程时,不会删除本地图片
* @return string 远程图片路径部分
*/
function remote_ftp($path, $file, $ifdel = true)
{
$image_full_path = $path . '/' . $file;
ftpcmd('upload', $image_full_path);
$_ext = '.' . get_image_type($image_full_path);
if (!ftpcmd('error')) {
ftpcmd('upload', $image_full_path . '_max' . $_ext);
}
if (!ftpcmd('error')) {
ftpcmd('upload', $image_full_path . '_mid' . $_ext);
}
if (!ftpcmd('error')) {
ftpcmd('upload', $image_full_path . '_small' . $_ext);
}
if (!ftpcmd('error')) {
ftpcmd('upload', $image_full_path . '_tiny' . $_ext);
}
if (!ftpcmd('error')) {
ftpcmd('upload', $image_full_path . '_240x240' . $_ext);
}
if (!ftpcmd('error')) {
if ($ifdel) {
@unlink(BASE_PATH . '/' . $image_full_path);
@unlink(BASE_PATH . '/' . $image_full_path . '_max' . $_ext);
@unlink(BASE_PATH . '/' . $image_full_path . '_mid' . $_ext);
@unlink(BASE_PATH . '/' . $image_full_path . '_small' . $_ext);
@unlink(BASE_PATH . '/' . $image_full_path . '_tiny' . $_ext);
@unlink(BASE_PATH . '/' . $image_full_path . '_240x240' . $_ext);
}
return C('ftp_access_url') . '/' . $path;
}
return false;
}
示例3: voucher_listOp
public function voucher_listOp()
{
//检查过期的代金券,状态设置为过期(vouchet_state=3)
$this->check_voucher_expire();
$model = Model();
$where = array('voucher_owner_id' => $_SESSION['member_id']);
if (intval($_GET['select_detail_state']) > 0) {
$where['voucher_state'] = intval($_GET['select_detail_state']);
}
$field = "voucher_id,voucher_code,voucher_title,voucher_desc,voucher_start_date,voucher_end_date,voucher_price,voucher_limit,voucher_state,voucher_order_id,voucher_store_id,store_name,store_id,store_domain";
$list = $model->table('voucher,store')->field($field)->join('inner')->on('voucher.voucher_store_id = store.store_id')->where($where)->order('voucher_id desc')->page(10)->select();
if (is_array($list)) {
foreach ($list as $key => $val) {
if (!$val['voucher_t_customimg'] || !file_exists(BasePath . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $val['voucher_t_customimg'])) {
$list[$key]['voucher_t_customimg'] = defaultGoodsImage('tiny');
} else {
$list[$key]['voucher_t_customimg'] = SiteUrl . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $val['voucher_t_customimg'] . "_small." . get_image_type($val['voucher_t_customimg']);
}
}
}
Tpl::output('list', $list);
Tpl::output('show_page', $model->showpage(2));
//查询会员信息
$this->get_member_info();
$this->profile_menu('voucher_list');
Tpl::output('menu_sign', 'myvoucher');
Tpl::output('menu_sign_url', 'index.php?act=member_voucher');
Tpl::output('menu_sign1', 'member_voucher');
Tpl::showpage('member_voucher.list');
}
示例4: indexOp
public function indexOp()
{
$model = Model();
//开启代金券功能后查询代金券相应信息
if (C('voucher_allow') == 1) {
//查询已兑换代金券券数量
$vouchercount = 0;
if ($_SESSION['is_login'] == '1') {
$vouchercount = $model->table('voucher')->where(array('voucher_owner_id' => $_SESSION['member_id'], 'voucher_state' => $this->voucherstate_arr['unused'][0]))->count();
}
Tpl::output('vouchercount', $vouchercount);
//查询代金券面额
$pricelist = $model->table('voucher_price')->order('voucher_price asc')->select();
Tpl::output('pricelist', $pricelist);
//查询代金券列表
$field = 'voucher_template.*,store.store_id,store.store_label,store.store_name,store.store_domain';
$on = 'voucher_template.voucher_t_store_id=store.store_id';
$new_voucher = $model->table('voucher_template,store')->field($field)->join('left')->on($on)->where(array('voucher_t_state' => $this->templatestate_arr['usable'][0], 'voucher_t_end_date' => array('gt', time())))->limit(16)->select();
if (!empty($new_voucher)) {
foreach ($new_voucher as $k => $v) {
if (!empty($v['voucher_t_customimg'])) {
$v['voucher_t_customimg'] = SiteUrl . DS . ATTACH_VOUCHER . DS . $v['voucher_t_store_id'] . DS . $v['voucher_t_customimg'] . "_small." . get_image_type($v['voucher_t_customimg']);
} else {
$v['voucher_t_customimg'] = defaultGoodsImage('small');
}
if (!empty($v['store_label'])) {
$v['store_label'] = SiteUrl . DS . ATTACH_STORE . DS . $v['store_label'];
}
$v['voucher_t_limit'] = intval($v['voucher_t_limit']);
$new_voucher[$k] = $v;
}
}
Tpl::output('new_voucher', $new_voucher);
}
//开启积分兑换功能后查询代金券相应信息
if (C('pointprod_isuse') == 1) {
//最新积分兑换商品
$model_pointsprod = Model('pointprod');
$new_pointsprod = $model_pointsprod->getPointProdListNew('*', array('pgoods_show' => 1, 'pgoods_state' => 0), 'pgoods_sort asc,pgoods_id desc', 16);
Tpl::output('new_pointsprod', $new_pointsprod);
//兑换排行
$converlist = $model_pointsprod->getPointProdListNew('*', array('pgoods_show' => 1, 'pgoods_state' => 0), 'pgoods_salenum desc,pgoods_id desc', 3);
Tpl::output('converlist', $converlist);
}
//SEO
Model('seo')->type('point')->show();
Tpl::showpage('pointprod');
}
示例5: orderlistOp
/**
* 兑换信息列表
*/
public function orderlistOp()
{
//条件
$condition_arr = array();
$condition_arr['point_buyerid'] = $_SESSION['member_id'];
//分页
$page = new Page();
$page->setEachNum(10);
$page->setStyle('admin');
//兑换信息列表
$pointorder_model = Model('pointorder');
$order_list = $pointorder_model->getPointOrderList($condition_arr, $page, 'simple');
$order_idarr = array();
$order_listnew = array();
if (is_array($order_list) && count($order_list) > 0) {
foreach ($order_list as $k => $v) {
$v['point_orderstatetext'] = $this->pointorder_state($v['point_orderstate']);
$order_idarr[] = $v['point_orderid'];
$order_listnew[$v['point_orderid']] = $v;
}
}
//查询兑换商品
if (is_array($order_idarr) && count($order_idarr) > 0) {
$order_idstr = implode(',', $order_idarr);
$prod_list = $pointorder_model->getPointOrderProdList(array('prod_orderid_in' => $order_idstr), '');
if (is_array($prod_list) && count($prod_list) > 0) {
foreach ($prod_list as $v) {
if (isset($order_listnew[$v['point_orderid']])) {
$v['point_goodsimage'] = ATTACH_POINTPROD . DS . $v['point_goodsimage'] . '_small.' . get_image_type($v['point_goodsimage']);
$order_listnew[$v['point_orderid']]['prodlist'][] = $v;
}
}
}
}
//信息输出
Tpl::output('payment_list', $payment_list);
Tpl::output('order_list', $order_listnew);
Tpl::output('page', $page->show());
//查询会员信息
$this->get_member_info();
self::profile_menu('pointorder', 'orderlist');
Tpl::output('menu_sign', 'pointorder');
Tpl::output('menu_sign_url', 'index.php?act=member_pointorder&op=orderlist');
Tpl::output('menu_sign1', 'pointorder_list');
Tpl::showpage('member_pointorder');
}
示例6: pointvoucherOp
/**
* 代金券列表
*/
public function pointvoucherOp()
{
$model = Model();
//查询会员信息
$member_info = $model->table('member')->field('member_points')->where(array('member_id' => $_SESSION['member_id']))->find();
Tpl::output('member_info', $member_info);
//查询已兑换代金券券数量
$vouchercount = 0;
if ($_SESSION['is_login'] == '1') {
$vouchercount = $model->table('voucher')->where(array('voucher_owner_id' => $_SESSION['member_id'], 'voucher_state' => $this->voucherstate_arr['unused'][0]))->count();
}
Tpl::output('vouchercount', $vouchercount);
//查询代金券面额
$pricelist = $model->table('voucher_price')->order('voucher_price asc')->select();
$voucherlist = array();
if (!empty($pricelist)) {
foreach ($pricelist as $k => $v) {
$voucherlist[$v['voucher_price']]['price'] = $v;
}
}
//查询代金券列表
$field = 'voucher_template.*,store.store_id,store.store_label,store.store_name,store.store_domain';
$on = 'voucher_template.voucher_t_store_id=store.store_id';
$voucher = $model->table('voucher_template,store')->field($field)->join('left')->on($on)->where(array('voucher_t_state' => $this->templatestate_arr['usable'][0], 'voucher_t_end_date' => array('gt', time())))->select();
if (!empty($voucher)) {
foreach ($voucher as $k => $v) {
if (!empty($v['voucher_t_customimg'])) {
$v['voucher_t_customimg'] = SiteUrl . DS . ATTACH_VOUCHER . DS . $v['voucher_t_store_id'] . DS . $v['voucher_t_customimg'] . "_small." . get_image_type($v['voucher_t_customimg']);
} else {
$v['voucher_t_customimg'] = defaultGoodsImage('small');
}
if (!empty($v['store_label'])) {
$v['store_label'] = SiteUrl . DS . ATTACH_STORE . DS . $v['store_label'];
}
$v['voucher_t_limit'] = intval($v['voucher_t_limit']);
if (!empty($voucherlist[$v['voucher_t_price']])) {
$voucherlist[$v['voucher_t_price']]['voucher'][] = $v;
}
}
}
Tpl::output('voucherlist', $voucherlist);
Tpl::showpage('pointvoucher');
}
示例7: defaultGoodsImage
/**
* 取得商品默认大小图片
*
* @param string $key 图片大小 small tiny
* @return string
*/
function defaultGoodsImage($key)
{
return ATTACH_COMMON . DS . C('default_goods_image') . '_' . $key . '.' . get_image_type(C('default_goods_image'));
}
示例8: insert_record
$datamt['id'] = $datamtold->id;
}
$idt = insert_record("apps_reading_texts", $datamt);
if ($_FILES['varimage']['tmp_name'][$key]) {
list($width, $height, $type, $attr) = getimagesize($_FILES['varimage']['tmp_name'][$key]);
if ($width > 320 || $height > 250) {
$image = new SimpleImage();
$image->load($_FILES['varimage']['tmp_name'][$key]);
if ($width > $height) {
$image->resizeToWidth(320);
} else {
$image->resizeToHeight(250);
}
$image->save($CFG['dirroot'] . "/datas/reading/image/{$id}_{$idt}." . get_image_type($_FILES['varimage']['tmp_name'][$key]));
} else {
move_uploaded_file($_FILES['varimage']['tmp_name'][$key], $CFG['dirroot'] . "/datas/reading/image/{$id}_{$idt}." . get_image_type($_FILES['varimage']['tmp_name'][$key]));
}
}
}
}
if ($_FILES['soundtext']['tmp_name']) {
move_uploaded_file($_FILES['soundtext']['tmp_name'], $CFG['dirroot'] . "/datas/reading/soundtext/{$id}.mp3");
}
$status = statusmessage($title . ' - Content added - ' . ' <a href="index.php?type=apps_reading&act=edit&id=' . $id . '">[Edit content]</a> <a href="#" onclick="$(\'#formadd\').show();return false;">[Add new content]</a>');
unset($id);
}
}
if ($act == "edit" && !empty($id)) {
$data = get_record("apps_reading", array("id" => $id));
if (!empty($data->video)) {
$actype = $data->video;
示例9: foreach
<div class="goods-gallery"> <a class='sample_demo' id="select_s" href="index.php?act=flea_album&op=pic_list&item=des" style="display:none;"><?php
echo $lang['nc_submit'];
?>
</a>
<ul class="list">
<?php
if (!empty($output['pic_list'])) {
?>
<?php
foreach ($output['pic_list'] as $v) {
?>
<li onclick="insert_editor('<?php
echo ATTACH_FLEAS . DS . $_SESSION['member_id'] . DS . $v['file_name'] . '_max.' . get_image_type($v['file_name']);
?>
');"> <a href="JavaScript:void(0);"> <span class="thumb size90"> <i></i> <img src="<?php
echo SiteUrl . DS . ATTACH_FLEAS . DS . $_SESSION['member_id'] . DS . $v['file_name'] . '_small.' . get_image_type($v['file_name']);
?>
" onload="javascript:DrawImage(this,90,90);" onerror="this.src='<?php
echo ATTACH_COMMON . DS . $GLOBALS['setting_config']['default_goods_image'];
?>
'" title='<?php
echo $v['file_name'];
?>
'/> </span> </a> </li>
<?php
}
?>
<?php
} else {
?>
<?php
示例10: get_image_type
&mid=<?php
echo $output['master_id'];
if (!empty($_GET['sort'])) {
?>
&sort=<?php
echo $_GET['sort'];
}
?>
" title="<?php
echo $v['ap_name'];
?>
"> <img id="img_<?php
echo $v['ap_id'];
?>
" src="<?php
echo SiteUrl . DS . ATTACH_MALBUM . DS . $output['master_id'] . DS . $v['ap_cover'] . '_240x240.' . get_image_type($v['ap_cover']);
?>
"></a></span> </dt>
<dd> <span class="pinterest-addtime"><?php
echo $lang['album_plist_upload_time'] . $lang['nc_colon'] . date("Y-m-d", $v['upload_time']);
?>
</span><!--<span class="ops-comment"><a href="index.php?act=member_snshome&op=goodsinfo&type=like&mid=<?php
echo $v['share_memberid'];
?>
&id=<?php
echo $v['share_id'];
?>
" title="<?php
echo $lang['sns_comment'];
?>
"><i></i></a><em><?php
示例11: getPointProdInfoNew
/**
* 礼品信息单条
*
* @param array $condition 条件数组
* @param array $field 查询字段
*/
public function getPointProdInfoNew($where = '', $field = '*')
{
$prodinfo = $this->table('points_goods')->where($where)->find();
if (!empty($prodinfo)) {
$prodinfo['pgoods_image_small'] = ATTACH_POINTPROD . DS . $prodinfo['pgoods_image'] . '_small.' . get_image_type($prodinfo['pgoods_image']);
$prodinfo['pgoods_image'] = ATTACH_POINTPROD . DS . $prodinfo['pgoods_image'];
$prodinfo['ex_state'] = $this->getPointProdExstate($prodinfo);
}
return $prodinfo;
}
示例12: album_pic_delOp
/**
* 图片删除
*/
public function album_pic_delOp()
{
if (empty($_GET['id'])) {
showDialog(Language::get('album_parameter_error'));
}
if (!empty($_GET['id']) && is_array($_GET['id'])) {
$id = $_GET['id'];
} else {
$id[] = intval($_GET['id']);
}
// 模型
$model = Model();
foreach ($id as $v) {
$v = intval($v);
if ($v <= 0) {
continue;
}
$ap_info = $model->table('sns_albumpic')->where(array('ap_id' => $v, 'member_id' => $_SESSION['member_id']))->find();
if (empty($ap_info)) {
continue;
}
@unlink(BasePath . DS . ATTACH_MALBUM . DS . $_SESSION['member_id'] . DS . $ap_info['ap_cover']);
@unlink(BasePath . DS . ATTACH_MALBUM . DS . $_SESSION['member_id'] . DS . $ap_info['ap_cover'] . '_240x240.' . get_image_type($ap_info['ap_cover']));
@unlink(BasePath . DS . ATTACH_MALBUM . DS . $_SESSION['member_id'] . DS . $ap_info['ap_cover'] . '_max.' . get_image_type($ap_info['ap_cover']));
$model->table('sns_albumpic')->delete($ap_info['ap_id']);
}
showDialog(Language::get('album_class_pic_del_succeed'), 'reload', 'succ');
}
示例13: getMicroshopDefaultImage
function getMicroshopDefaultImage()
{
return ATTACH_COMMON . DS . C('default_goods_image') . '_small' . get_image_type(C('default_goods_image'));
}
示例14: del_picOp
/**
* 删除图片
*/
public function del_picOp()
{
$id = intval($_GET['id']);
if ($id <= 0) {
showMessage(Language::get('wrong_argument'));
}
$model = Model();
$ap_info = $model->table('sns_albumpic')->find($id);
if (!empty($ap_info)) {
@unlink(BasePath . DS . ATTACH_MALBUM . DS . $ap_info['member_id'] . DS . $ap_info['ap_cover']);
@unlink(BasePath . DS . ATTACH_MALBUM . DS . $ap_info['member_id'] . DS . $ap_info['ap_cover'] . '_240x240.' . get_image_type($ap_info['ap_cover']));
@unlink(BasePath . DS . ATTACH_MALBUM . DS . $ap_info['member_id'] . DS . $ap_info['ap_cover'] . '_max.' . get_image_type($ap_info['ap_cover']));
$model->table('sns_albumpic')->delete($id);
}
showMessage(Language::get('nc_common_del_succ'));
}
示例15: templatedelOp
/**
* 删除代金券
*/
public function templatedelOp()
{
$t_id = intval($_GET['tid']);
if ($t_id <= 0) {
showMessage(Language::get('wrong_argument'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error');
}
$model = Model();
//查询模板信息
$param = array();
$param['voucher_t_id'] = $t_id;
$param['voucher_t_store_id'] = $_SESSION['store_id'];
$param['voucher_t_giveout'] = array('elt', '0');
//会员没领取过代金券才可删除
$t_info = $model->table('voucher_template')->where($param)->find();
if (empty($t_info)) {
showMessage(Language::get('wrong_argument'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error');
}
$rs = $model->table('voucher_template')->where(array('voucher_t_id' => $t_info['voucher_t_id']))->delete();
if ($rs) {
//删除自定义的图片
if (trim($t_info['voucher_t_customimg'])) {
@unlink(BasePath . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $t_info['voucher_t_customimg']);
@unlink(BasePath . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $t_info['voucher_t_customimg'] . "_small." . get_image_type($t_info['voucher_t_customimg']));
}
showDialog(Language::get('nc_common_del_succ'), 'reload', 'succ');
} else {
showDialog(Language::get('nc_common_del_fail'));
}
}