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

PHP cls_image类代码示例

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

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



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

示例1: sms_make_images

function sms_make_images()
{
    global $_FILES, $Name, $Title;
    $res = runsql("select * from sms_images_types");
    while ($im = mysql_fetch_array($res)) {
        $f = $_FILES['Image'];
        //print $im[Name_rus];
        $image = new cls_image($f);
        $im[Name_rus] = str_replace("x", "х", $im[Name_rus]);
        $ar = explode("х", $im[Name_rus]);
        //print "-$ar[0] $ar[1]-<br>";
        $image->newWidth = $ar[0];
        $image->newHeight = $ar[1];
        $image->mix = "";
        $image->fix = "width";
        $image->mixpos = "";
        //print "1";
        $Small = new cls_image($image->imageResize());
        $id = $im[TypeID];
        $img1 = addslashes($Small->contents);
        $image = new cls_image($f);
        $image->newWidth = $ar[0];
        $image->newHeight = $ar[1];
        $image->fix = "width";
        $image->mix = "image.png";
        $image->mixpos = "center";
        //print "2";
        $Small2 = new cls_image($image->imageResize());
        //print "1 $ar[0] $ar[1] $Small2->contents";
        //exit;
        $img2 = addslashes($Small2->contents);
        mysql_query("insert into sms_images (\r\nName,Title,Preview,Image,Date,ImageDate,TypeID) values\r\n(\r\n'{$Name}',\r\n'{$Title}',\r\n\r\n'{$img1}',\r\n'{$img2}',\r\nunix_timestamp(),\r\nunix_timestamp(),\r\n'{$id}'\r\n)");
        image_sms(mysql_insert_id(), $id, $Title, $id);
    }
}
开发者ID:dapfru,项目名称:gladiators,代码行数:35,代码来源:config.php


示例2: SaveHTTPFile

function SaveHTTPFile($fFileHTTPPath, $fFileSavePath, $fFileSaveName)
{
    //记录程序开始的时间
    $BeginTime = getmicrotime();
    //取得文件名
    $fFileSaveName = $fFileSavePath . "/" . $fFileSaveName;
    make_dir(dirname($fFileSaveName));
    //取得文件的内容
    ob_start();
    readfile($fFileHTTPPath);
    $img = ob_get_contents();
    ob_end_clean();
    //$size = strlen($img);
    //保存到本地
    $fp2 = @fopen($fFileSaveName, "a");
    fwrite($fp2, $img);
    fclose($fp2);
    /*加水印代码*/
    require_once ROOT_PATH . 'includes/cls_image.php';
    $ext = get_extension($fFileSaveName);
    $fFileSaveName = convert_GIF_to_JPG($fFileSaveName);
    if (CopyFiles($fFileSaveName)) {
        $image = new cls_image();
        $image->add_watermark($fFileSaveName, '', '../../../../' . $GLOBALS['waterMark']['watermark'], $GLOBALS['waterMark']['watermark_place'], $GLOBALS['waterMark']['watermark_alpha']);
    }
    if ($ext == 'gif' || $ext == '.gif') {
        back_JPG_to_GIF($fFileSaveName);
    }
    /*加水印代码--end*/
    //记录程序运行结束的时间
    $EndTime = getmicrotime();
    //返回运行时间
    return $EndTime - $BeginTime;
}
开发者ID:norain2050,项目名称:benhu,代码行数:34,代码来源:ServerXMLHTTP.php


示例3: get_img

function get_img($img_url = '')
{
    $cls_imageobj = new cls_image();
    $data = file_get_contents($img_url);
    $dir = date('Ym');
    $filename = cls_image::random_filename();
    $imgDir = $cls_imageobj->images_dir . '/' . $dir . '/source_img/' . $filename . '.jpg';
    $dir = ROOT_PATH . $imgDir;
    $fp = @fopen($dir, "w");
    @fwrite($fp, $data);
    fclose($fp);
    return $imgDir;
}
开发者ID:dlpc,项目名称:ecshop,代码行数:13,代码来源:souwu_img.php


示例4: values

 $brand_id = 0;
 if (!empty($good_brand)) {
     $sql = 'INSERT INTO ' . $ecs->table('brand') . " (brand_name, is_show)" . " values('" . $good_brand . "', '1')";
     $db->query($sql);
     $brand_id = $db->insert_Id();
 }
 if (!empty($good_category)) {
     $sql = 'INSERT INTO ' . $ecs->table('category') . " (cat_name, parent_id, is_show)" . " values('" . $good_category . "', '0', '1')";
     $db->query($sql);
     $cat_id = $db->insert_Id();
     //货号
     require_once ROOT_PATH . 'admin/includes/lib_goods.php';
     $max_id = $db->getOne("SELECT MAX(goods_id) + 1 FROM " . $ecs->table('goods'));
     $goods_sn = generate_goods_sn($max_id);
     include_once ROOT_PATH . 'includes/cls_image.php';
     $image = new cls_image($_CFG['bgcolor']);
     if (!empty($good_name)) {
         /* 检查图片:如果有错误,检查尺寸是否超过最大值;否则,检查文件类型 */
         if (isset($_FILES['goods_img']['error'])) {
             // 最大上传文件大小
             $php_maxsize = ini_get('upload_max_filesize');
             $htm_maxsize = '2M';
             // 商品图片
             if ($_FILES['goods_img']['error'] == 0) {
                 if (!$image->check_img_type($_FILES['goods_img']['type'])) {
                     sys_msg($_LANG['invalid_goods_img'], 1, array(), false);
                 }
             } elseif ($_FILES['goods_img']['error'] == 1) {
                 sys_msg(sprintf($_LANG['goods_img_too_big'], $php_maxsize), 1, array(), false);
             } elseif ($_FILES['goods_img']['error'] == 2) {
                 sys_msg(sprintf($_LANG['goods_img_too_big'], $htm_maxsize), 1, array(), false);
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:index.php


示例5: upload_article_file

function upload_article_file($upload)
{
    if (!make_dir("../" . DATA_DIR . "/article")) {
        /* 创建目录失败 */
        return false;
    }
    $filename = cls_image::random_filename() . substr($upload['name'], strpos($upload['name'], '.'));
    $path = ROOT_PATH . DATA_DIR . "/article/" . $filename;
    if (move_upload_file($upload['tmp_name'], $path)) {
        return DATA_DIR . "/article/" . $filename;
    } else {
        return false;
    }
}
开发者ID:norain2050,项目名称:mhFault,代码行数:14,代码来源:article.php


示例6: define

/**
 * ECSHOP 广告管理程序
 * ============================================================================
 * * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
 * 网站地址: http://www.ecshop.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: liubo $
 * $Id: ads.php 17217 2011-01-19 06:29:08Z liubo $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
include_once ROOT_PATH . 'includes/cls_image.php';
$image = new cls_image($_CFG['bgcolor']);
$exc = new exchange($ecs->table("ad"), $db, 'ad_id', 'ad_name');
/* act操作项的初始化 */
if (empty($_REQUEST['act'])) {
    $_REQUEST['act'] = 'list';
} else {
    $_REQUEST['act'] = trim($_REQUEST['act']);
}
/*------------------------------------------------------ */
//-- 广告列表页面
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    $pid = !empty($_REQUEST['pid']) ? intval($_REQUEST['pid']) : 0;
    $smarty->assign('ur_here', $_LANG['ad_list']);
    $smarty->assign('action_link', array('text' => $_LANG['ads_add'], 'href' => 'ads.php?act=add'));
    $smarty->assign('pid', $pid);
开发者ID:Ryan007,项目名称:mybb,代码行数:31,代码来源:ads.php


示例7: define

/**
 * ECSHOP 分销商管理程序
 * ============================================================================
 * * 版权所有 2008-2015 秦皇岛商之翼网络科技有限公司,并保留所有权利。
 * 网站地址: http://www.68ecshop.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: dqy $
 * $Id: distributor.php 17217 2011-01-19 06:29:08Z dqy $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
include_once ROOT_PATH . '/includes/cls_image.php';
$image = new cls_image($_CFG['bgcolor']);
$exc = new exchange($ecs->table('users'), $db, 'user_id', 'user_name');
/*------------------------------------------------------ */
//-- 分销商列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    $sql = "SELECT rank_id, rank_name, min_points FROM " . $ecs->table('user_rank') . " ORDER BY min_points ASC ";
    $rs = $db->query($sql);
    $ranks = array();
    while ($row = $db->FetchRow($rs)) {
        $ranks[$row['rank_id']] = $row['rank_name'];
    }
    $smarty->assign('user_ranks', $ranks);
    $smarty->assign('ur_here', $_LANG['01_users_list']);
    //判断是否是分销商
    $distrib_rank = $_CFG['distrib_rank'];
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:distributor.php


示例8: clear_cache_files

    /* 清除缓存 */
    clear_cache_files();
    /* 提示信息 */
    $links[] = array('href' => 'supplier_rebate.php?act=list', 'text' => '返回本期佣金列表');
    sys_msg('恭喜,处理成功!', 0, $links);
} elseif ($_REQUEST['act'] == 'finish') {
    /* 检查权限 */
    admin_priv('supplier_rebate');
    /* 提交值 */
    $rebate_id = intval($_POST['id']);
    $remark = isset($_POST['remark']) ? addslashes($_POST['remark']) : '';
    if (($rebates = rebateHave($rebate_id)) === false) {
        sys_msg('该返佣记录不存在!');
    }
    include_once ROOT_PATH . '/includes/cls_image.php';
    $image = new cls_image($_CFG['bgcolor']);
    if ($_FILES['rebate_img']['size'] <= 0) {
        sys_msg('汇票凭证必须上传!');
    }
    if ($_FILES['rebate_img']['error'] == 0) {
        if (!$image->check_img_type($_FILES['rebate_img']['type'])) {
            sys_msg($_LANG['invalid_goods_thumb'], 1, array(), false);
        }
    }
    $dir = 'rebate/' . local_date("Ymd", gmtime()) . '/' . $rebates['supplier_id'];
    $rebate_img = $image->upload_image($_FILES['rebate_img'], $dir);
    $rebate = array('is_pay_ok' => 1, 'pay_time' => gmtime(), 'rebate_img' => $rebate_img, 'status' => 4);
    /* 保存返佣信息 */
    $db->autoExecute($ecs->table('supplier_rebate'), $rebate, 'UPDATE', "rebate_id = '" . $rebate_id . "'");
    $loginfo = array('rebateid' => $rebate_id, 'addtime' => $addtime, 'reason' => '佣金' . createSign($rebates['rebate_id'], $rebates['supplier_id']) . '转帐:' . $rebates['payable_price'], 'supplier_money' => $rebates['payable_price'], 'doman' => '平台方:' . $_SESSION['user_name'], 'supplier_id' => $rebates['supplier_id']);
    $db->autoExecute($ecs->table('supplier_money_log'), $loginfo, 'INSERT');
开发者ID:firsteam,项目名称:falcons,代码行数:31,代码来源:supplier_rebate.php


示例9: define

/**
 * ECSHOP 包装管理程序
 * ============================================================================
 * * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
 * 网站地址: http://www.ecshop.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: liubo $
 * $Id: pack.php 17217 2011-01-19 06:29:08Z liubo $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
include_once ROOT_PATH . 'includes/cls_image.php';
$image = new cls_image($_CFG['bgcolor']);
$exc = new exchange($ecs->table("pack"), $db, 'pack_id', 'pack_name');
/*------------------------------------------------------ */
//-- 包装列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    $smarty->assign('ur_here', $_LANG['06_pack_list']);
    $smarty->assign('action_link', array('text' => $_LANG['pack_add'], 'href' => 'pack.php?act=add'));
    $smarty->assign('full_page', 1);
    $packs_list = packs_list();
    $smarty->assign('packs_list', $packs_list['packs_list']);
    $smarty->assign('filter', $packs_list['filter']);
    $smarty->assign('record_count', $packs_list['record_count']);
    $smarty->assign('page_count', $packs_list['page_count']);
    assign_query_info();
    $smarty->display('pack_list.htm');
开发者ID:zhendeguoke1008,项目名称:ecshop,代码行数:31,代码来源:pack.php


示例10: process_image


//.........这里部分代码省略.........
                /* 出错处理 */
                if (!$goods_thumb) {
                    $msg = sprintf($GLOBALS['_LANG']['error_pos'], $row['goods_id']) . "\n" . $GLOBALS['image']->error_msg();
                    if ($silent) {
                        $GLOBALS['err_msg'][] = $msg;
                        continue;
                    } else {
                        make_json_error($msg);
                    }
                }
                /* 重新格式化图片名称 */
                $goods_thumb = reformat_image_name('goods_thumb', $row['goods_id'], $goods_thumb, 'thumb');
                if ($change || empty($row['goods_thumb'])) {
                    if ($row['goods_thumb'] != $goods_thumb) {
                        $sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . " SET goods_thumb = '{$goods_thumb}' WHERE goods_id = '" . $row['goods_id'] . "'";
                        $GLOBALS['db']->query($sql);
                        /* 防止原图被删除 */
                        if ($row['goods_thumb'] != $row['original_img']) {
                            @unlink(ROOT_PATH . $row['goods_thumb']);
                        }
                    }
                } else {
                    replace_image($goods_thumb, $row['goods_thumb'], $row['goods_id'], $silent);
                }
            }
        }
    } else {
        /* 遍历商品相册 */
        $sql = "SELECT album.goods_id, album.img_id, album.img_url, album.thumb_url, album.img_original FROM " . $GLOBALS['ecs']->table('goods_gallery') . " AS album " . $GLOBALS['album_where'];
        $res = $GLOBALS['db']->SelectLimit($sql, $page_size, ($page - 1) * $page_size);
        while ($row = $GLOBALS['db']->fetchRow($res)) {
            $thumb_url = '';
            $image = '';
            /* 水印 */
            if ($watermark && file_exists(ROOT_PATH . $row['img_original'])) {
                if (empty($row['img_url'])) {
                    $dir = dirname(ROOT_PATH . $row['img_original']) . '/';
                } else {
                    $dir = dirname(ROOT_PATH . $row['img_url']) . '/';
                }
                $file_name = cls_image::unique_name($dir);
                $file_name .= cls_image::get_filetype(empty($row['img_url']) ? $row['img_original'] : $row['img_url']);
                copy(ROOT_PATH . $row['img_original'], $dir . $file_name);
                $image = $GLOBALS['image']->add_watermark($dir . $file_name, '', $GLOBALS['_CFG']['watermark'], $GLOBALS['_CFG']['watermark_place'], $GLOBALS['_CFG']['watermark_alpha']);
                if (!$image) {
                    @unlink($dir . $file_name);
                    $msg = sprintf($GLOBALS['_LANG']['error_pos'], $row['goods_id']) . "\n" . $GLOBALS['image']->error_msg();
                    if ($silent) {
                        $GLOBALS['err_msg'][] = $msg;
                        continue;
                    } else {
                        make_json_error($msg);
                    }
                }
                /* 重新格式化图片名称 */
                $image = reformat_image_name('gallery', $row['goods_id'], $image, 'goods');
                if ($change || empty($row['img_url']) || $row['img_original'] == $row['img_url']) {
                    if ($image != $row['img_url']) {
                        $sql = "UPDATE " . $GLOBALS['ecs']->table('goods_gallery') . " SET img_url='{$image}' WHERE img_id='{$row['img_id']}'";
                        $GLOBALS['db']->query($sql);
                        if ($row['img_original'] != $row['img_url']) {
                            @unlink(ROOT_PATH . $row['img_url']);
                        }
                    }
                } else {
                    replace_image($image, $row['img_url'], $row['goods_id'], $silent);
                }
            }
            /* 缩略图 */
            if ($thumb) {
                if (empty($row['thumb_url'])) {
                    $dir = dirname(ROOT_PATH . $row['img_original']) . '/';
                } else {
                    $dir = dirname(ROOT_PATH . $row['thumb_url']) . '/';
                }
                $thumb_url = $GLOBALS['image']->make_thumb(ROOT_PATH . $row['img_original'], $GLOBALS['_CFG']['thumb_width'], $GLOBALS['_CFG']['thumb_height'], $dir);
                if (!$thumb_url) {
                    $msg = sprintf($GLOBALS['_LANG']['error_pos'], $row['goods_id']) . "\n" . $GLOBALS['image']->error_msg();
                    if ($silent) {
                        $GLOBALS['err_msg'][] = $msg;
                        continue;
                    } else {
                        make_json_error($msg);
                    }
                }
                /* 重新格式化图片名称 */
                $thumb_url = reformat_image_name('gallery_thumb', $row['goods_id'], $thumb_url, 'thumb');
                if ($change || empty($row['thumb_url'])) {
                    if ($thumb_url != $row['thumb_url']) {
                        $sql = "UPDATE " . $GLOBALS['ecs']->table('goods_gallery') . " SET thumb_url='{$thumb_url}' WHERE img_id='{$row['img_id']}'";
                        $GLOBALS['db']->query($sql);
                        @unlink(ROOT_PATH . $row['thumb_url']);
                    }
                } else {
                    replace_image($thumb_url, $row['thumb_url'], $row['goods_id'], $silent);
                }
            }
        }
    }
}
开发者ID:YangZeSummer,项目名称:NanJingSecond-Hand,代码行数:101,代码来源:picture_batch.php


示例11: set_form_params

 function set_form_params($str, $i)
 {
     global $search, $site_url, $engine_path, $r, $REMOTE_ADDR, $HTTP_POST_FILES, $HTTP_POST_VARS, $HTTP_GET_VARS, $id, $secpass, $lang, $auth, $er;
     $ndate = 0;
     $st = $str;
     if (count($HTTP_GET_VARS) > count($HTTP_POST_VARS)) {
         $HTTP_POST_VARS = $HTTP_GET_VARS;
     }
     if ($HTTP_POST_VARS['numrows']) {
         $mult = 1;
     }
     if (!$HTTP_POST_VARS['Time']) {
         $Time = mktime();
     }
     if (!$HTTP_POST_VARS['Date']) {
         $Date = mktime();
     }
     if (!$HTTP_POST_VARS['IP']) {
         $IP = $REMOTE_ADDR;
     }
     if ($this->act == "select") {
         $inner = $this->document->getElementsByTagName("header");
         $fields = $inner[0]->getElementsByTagName("item");
     } else {
         $inner = $this->document->getElementsByTagName("fields");
         $fields = $inner[0]->getElementsByTagName("field");
     }
     foreach ($fields as $field) {
         $item = $this->getTemplateControl($field);
         //$name=$field->getAttribute("name","no");
         $name = $item->name;
         if ($name == "IP") {
             ${$name} = $REMOTE_ADDR;
         }
         $items[$name] = $item;
         if ($item->default && !$HTTP_POST_VARS[$name]) {
             $HTTP_POST_VARS[$name] = $item->default;
         } elseif ($item->type == "stringlike") {
             $HTTP_POST_VARS[$name] = "%{$HTTP_POST_VARS[$name]}%";
         }
         if ($HTTP_POST_VARS[$name] == "%%") {
             $HTTP_POST_VARS[$name] = "%";
         }
         if ($mult) {
             $f['name'] = $HTTP_POST_FILES[$name]['name'][$i];
             $f['tmp_name'] = $HTTP_POST_FILES[$name]['tmp_name'][$i];
             $f['size'] = $HTTP_POST_FILES[$name]['size'][$i];
             $f['type'] = $HTTP_POST_FILES[$name]['type'][$i];
         } else {
             $f = $HTTP_POST_FILES[$name];
         }
         $type = $item->type;
         if (($type == "file" || $type == "image" || $type == "flag") && $f[name]) {
             $file = fopen($f['tmp_name'], "r");
             //print $f[name].$f['tmp_name'];
             //exit;
             if (!$file) {
                 $er = sysmessage(4) . "<br>";
             }
             $fname = $f['tmp_name'];
             $maxsize = $field->getAttribute("maxsize", '');
             $format = $field->getAttribute("format", '');
             if (!strstr($format, strtolower(substr($f['name'], strpos($f['name'], ".") + 1))) && $format) {
                 $er = sysmessage(5) . " .{$format}!<br>";
             }
             ${$name} = fread($file, filesize($fname));
             //обработка файлов--------------------
             if ($item->type == "file" && $f[name]) {
                 if (!$id) {
                     $q = select("select 1+max(" . $name . "ID) from " . $this->table);
                 } else {
                     $q[0] = $id;
                 }
                 $dir = "files/" . $q[0] . "." . substr($f['name'], 1 + strpos($f['name'], "."));
                 move_uploaded_file($fname, $engine_path . $dir);
                 ${$name} = $site_url . $dir;
                 //print $par_val;
                 //exit;
             }
         }
         if (($type == "flag" || $type == "image") && $f[name]) {
             $image = new cls_image($f);
             $image->maxsize = $field->getAttribute("maxsize", '');
             $image->mix = $field->getAttribute("mix", '');
             $image->mixpos = $field->getAttribute("mixpos", '');
             if ($width = $field->getAttribute("width", '')) {
                 $image->newWidth = $width;
                 $image->fix = "width";
             }
             if ($height = $field->getAttribute("height", '')) {
                 $image->newHeight = $height;
                 $image->fix = "height";
             }
             $image->check();
             ${$name} = $image->contents;
             $Type = $image->type;
             $ph[$name] = 1;
             $ph['Small'] = 1;
             if ($image->type != "gif") {
                 $Small = new cls_image($image->imageResize());
//.........这里部分代码省略.........
开发者ID:dapfru,项目名称:gladiators,代码行数:101,代码来源:cls_form_dinamo.php


示例12: define

 * ECSHOP 商品分类管理程序
 * ============================================================================
 * * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
 * 网站地址: http://www.ecshop.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: liubo $
 * $Id: category.php 17217 2011-01-19 06:29:08Z liubo $
*/
define('IN_ECTOUCH', true);
require dirname(__FILE__) . '/includes/init.php';
// 新增加的开始
include_once ROOT_PATH . 'include/cls_image.php';
$image = new cls_image($_CFG['bgcolor']);
// 新增加的结束
$exc = new exchange($ecs->table("category"), $db, 'cat_id', 'cat_name');
/* act操作项的初始化 */
if (empty($_REQUEST['act'])) {
    $_REQUEST['act'] = 'list';
} else {
    $_REQUEST['act'] = trim($_REQUEST['act']);
}
/*------------------------------------------------------ */
//-- 商品分类列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    /* 获取分类列表 */
    $cat_list = cat_list(0, 0, false);
    /* 模板赋值 */
开发者ID:will0306,项目名称:bianli100,代码行数:31,代码来源:category.php


示例13: define

 * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。
 * 网站地址: http://www.ecshop.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: liuhui $
 * $Id: group_buy.php 17063 2010-03-25 06:35:46Z liuhui $
 */

define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
require_once(ROOT_PATH . 'includes/lib_goods.php');
require_once(ROOT_PATH . 'includes/lib_order.php');
include_once(ROOT_PATH . '/includes/cls_image.php');
$image = new cls_image($_CFG['bgcolor']);
$exc = new exchange($ecs->table('goods_activity'), $db, 'act_id', 'act_name');

/* 检查权限 */
admin_priv('group_by');

/* act操作项的初始化 */
if (empty($_REQUEST['act']))
{
    $_REQUEST['act'] = 'list';
}
else
{
    $_REQUEST['act'] = trim($_REQUEST['act']);
}
开发者ID:norain2050,项目名称:mhFault,代码行数:30,代码来源:group_buy.php


示例14: elseif

 } elseif (empty($adArr['url'])) {
     $error = '广告链接不能为空';
 } elseif (empty($img)) {
     $error = '图片不能为空';
 } elseif (empty($adArr['file'])) {
     $error = '使用页面不能为空';
 }
 if (isset($error)) {
     sys_msg($error, 0, $link);
 }
 $old_img = $db->getOne("SELECT img FROM " . $ecs->table('ad_new') . " WHERE ad_name = '{$adArr['ad_name']}'");
 if ($db->getOne("SELECT id FROM " . $ecs->table('ad_new') . " WHERE ad_name = '{$adArr['ad_name']}' AND id <> {$id} AND admin_agency_id = {$adArr['admin_agency_id']}")) {
     sys_msg('广告名称已存在', 0, $link);
 }
 if (isset($img['error']) && $img['error'] == 0) {
     $image = new cls_image($_CFG['bgcolor']);
     //实例化图片处理函数
     if ($image->check_img_type($img['type'])) {
         $img_name = $image->upload_image($img, '');
     }
     if (!$img_name) {
         sys_msg('上传图片失败', 1);
     }
     $adArr['img'] = $img_name;
     if (!$db->getOne("SELECT id FROM " . $ecs->table('ad_new') . " WHERE img ='{$old_img}' AND id<>{$id}")) {
         @unlink('../' . $old_img);
     }
 }
 if (!isset($adArr['img'])) {
     $adArr['img'] = $outer_img;
 }
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:new_ads.php


示例15: define

 * ECSHOP 商品分类管理程序
 * ============================================================================
 * * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
 * 网站地址: http://www.ecshop.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: liubo $
 * $Id: category.php 17217 2011-01-19 06:29:08Z liubo $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
/***修改:分类属性添加图片***/
include_once ROOT_PATH . 'includes/cls_image.php';
$image = new cls_image($_CFG['bgcolor']);
/***修改:分类属性添加图片结束***/
$exc = new exchange($ecs->table("category"), $db, 'cat_id', 'cat_name');
/* act操作项的初始化 */
if (empty($_REQUEST['act'])) {
    $_REQUEST['act'] = 'list';
} else {
    $_REQUEST['act'] = trim($_REQUEST['act']);
}
/*------------------------------------------------------ */
//-- 商品分类列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    /* 获取分类列表 */
    $cat_list = cat_list(0, 0, false);
    /* 模板赋值 */
开发者ID:YangZeSummer,项目名称:NanJingSecond-Hand,代码行数:31,代码来源:category.php


示例16: gd_version_tianxin100

function gd_version_tianxin100()
{
    include_once ROOT_PATH . 'include/cls_image_tianxin.php';
    return cls_image::gd_version();
}
开发者ID:seanguo166,项目名称:microdistribution,代码行数:5,代码来源:lib_base.php


示例17: get_gd_version

/**
 * 获得GD的版本号
 *
 * @access  public
 * @return  string     返回版本号,可能的值为0,1,2
 */
function get_gd_version()
{
    include_once ROOT_PATH . 'includes/cls_image.php';
    $image = new cls_image();
    return $image->gd_version();
}
开发者ID:jiusanzhou,项目名称:ecapi,代码行数:12,代码来源:lib_installer.php


示例18: round

 if ($favourable['act_type'] == FAT_GOODS) {
     $favourable['act_type_ext'] = round($favourable['act_type_ext']);
 }
 /* 保存数据 */
 if ($is_add) {
     $db->autoExecute($ecs->table('favourable_activity'), $favourable, 'INSERT');
     $favourable['act_id'] = $db->insert_id();
 } else {
     $db->autoExecute($ecs->table('favourable_activity'), $favourable, 'UPDATE', "act_id = '{$favourable['act_id']}'");
 }
 //代表图片上传
 if ($_FILES['logo']['size']) {
     $save['supplier_id'] = 0;
     //自营运营商
     include_once ROOT_PATH . 'includes/cls_image.php';
     $image = new cls_image($_CFG['bgcolor']);
     $logo_path .= $save['supplier_id'];
     $logo_name = "original" . $save['supplier_id'] . '_' . $favourable['act_id'] . substr($_FILES['logo']['name'], -4);
     $picinfo = $image->upload_image($_FILES['logo'], $logo_path, $logo_name);
     $parray = pathinfo($picinfo);
     if ($picinfo) {
         $create_pic_info = array('580x260' => array('width' => 580, 'height' => 260));
         foreach ($create_pic_info as $key => $val) {
             $path = ROOT_PATH . $parray['dirname'] . '/';
             $image->create_pic_name = "original" . $save['supplier_id'] . '_' . $favourable['act_id'] . "_" . $key;
             $pinfo = $image->make_thumb(ROOT_PATH . $picinfo, $val['width'], $val['height'], $path);
         }
         $save['logo'] = '/' . $pinfo;
     }
     $pic_sql = "update " . $ecs->table('favourable_activity') . " set logo='" . $save['logo'] . "' where act_id=" . $favourable['act_id'];
     $db->query($pic_sql);
开发者ID:firsteam,项目名称:falcons,代码行数:31,代码来源:favourable.php


示例19: define

<?php

define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
include_once ROOT_PATH . 'includes/cls_image.php';
$image = new cls_image($_CFG['bgcolor']);
$exc = new exchange($ecs->table("card"), $db, 'card_id', 'card_name');
/*------------------------------------------------------ */
//-- 包装列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    assign_query_info();
    $smarty->assign('ur_here', $_LANG['07_card_list']);
    $smarty->assign('action_link', array('text' => $_LANG['card_add'], 'href' => 'card.php?act=add'));
    $smarty->assign('full_page', 1);
    $cards_list = cards_list();
    $smarty->assign('card_list', $cards_list['card_list']);
    $smarty->assign('filter', $cards_list['filter']);
    $smarty->assign('record_count', $cards_list['record_count']);
    $smarty->assign('page_count', $cards_list['page_count']);
    $smarty->display('card_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $cards_list = cards_list();
    $smarty->assign('card_list', $cards_list['card_list']);
    $smarty->assign('filter', $cards_list['filter']);
    $smarty->assign('record_count', $cards_list['record_count']);
    $smarty->assign('page_count', $cards_list['page_count']);
    $sort_flag = sort_flag($cards_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('card_list.htm'), '', array('filter' => $cards_list['filter'], 'page_count' => $cards_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
开发者ID:duynhan07,项目名称:ecshop-vietnam,代码行数:31,代码来源:card.php


示例20: date

    //新文件名
    $thumb_file_name = date("His") . rand(10000, 99999);
    $new_file_name = $thumb_file_name . '.' . $file_ext;
    //移动文件
    $file_path = $save_path . $new_file_name;
    if (move_uploaded_file($tmp_name, $file_path) === false) {
        alert("上传文件失败。");
    }
    @chmod($file_path, 0644);
    $file_url = $save_url . $new_file_name;
    $type = $_FILES['imgFile']['type'];
    $type1 = substr($type, 0, 5);
    //判断上传是否是图片
    if ($type1 == 'image') {
        require_once 'cls_image.php';
        $images = new cls_image();
        if ($filename = $images->make_thumb($file_path, 600, '', $save_path, $thumb_file_name)) {
            $file_url = $save_url . $filename;
        } else {
            alert($images->error_msg);
        }
    }
    header('Content-type: text/html; charset=UTF-8');
    $json = new Services_JSON();
    echo $json->encode(array('error' => 0, 'url' => $file_url));
    exit;
}
function alert($msg)
{
    header('Content-type: text/html; charset=UTF-8');
    $json = new Services_JSON();
开发者ID:skyshow,项目名称:government,代码行数:31,代码来源:upload_json.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP cls_mysql类代码示例发布时间:2022-05-23
下一篇:
PHP clsTinyButStrong类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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