本文整理汇总了PHP中cls_image类的典型用法代码示例。如果您正苦于以下问题:PHP cls_image类的具体用法?PHP cls_image怎么用?PHP cls_image使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cls_image类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
示例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;
}
示例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);
示例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;
}
}
示例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);
示例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'];
示例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');
示例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');
示例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);
}
}
}
}
}
示例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());
//.........这里部分代码省略.........
示例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);
/* 模板赋值 */
示例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']);
}
示例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;
}
示例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);
/* 模板赋值 */