本文整理汇总了PHP中Import::fileop方法的典型用法代码示例。如果您正苦于以下问题:PHP Import::fileop方法的具体用法?PHP Import::fileop怎么用?PHP Import::fileop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Import
的用法示例。
在下文中一共展示了Import::fileop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mark_phpqrcode
function mark_phpqrcode($filename = "", $thisurl = '')
{
$uid = $this->Session->read('User.uid');
if (empty($filename)) {
$filename = SYS_PATH_PHOTOS . 'qcody' . DS . $uid . DS . $filename;
}
include SYS_PATH . 'inc/phpqrcode.php';
// 二维码数据
$issubscribe = 0;
if (empty($thisurl)) {
if ($uid > 0) {
$sql = "SELECT is_subscribe FROM `{$this->App->prefix()}user` WHERE user_id = '{$uid}' LIMIT 1";
$issubscribe = $this->App->findvar($sql);
}
if ($issubscribe == '0') {
$to_wecha_id = $this->get_user_parent_uid();
$thisurl = ADMIN_URL . "?toid=" . $to_wecha_id . "&tid=" . $uid;
} else {
$thisurl = ADMIN_URL . "?tid=" . $uid;
}
}
// 生成的文件名
Import::fileop()->checkDir($filename);
// 纠错级别:L、M、Q、H
$errorCorrectionLevel = 'L';
// 点的大小:1到10
$matrixPointSize = 6;
QRcode::png($thisurl, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
}
示例2: ajax_dels
function ajax_dels($id = 0)
{
if (empty($id)) {
echo "非法删除,ID为空!";
} else {
$sql = "SELECT link_logo FROM `{$this->App->prefix()}friend_link` WHERE link_id='{$id}'";
$var = $this->App->findvar($sql);
if ($this->App->delete('friend_link', 'link_id', $id)) {
Import::fileop()->delete_file(SYS_PATH . $var);
$q = dirname($var);
$h = basename($var);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_s' . DS . $h);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_b' . DS . $h);
}
}
}
示例3: mark_phpqrcode
function mark_phpqrcode($filename=""){
$uid = $this->Session->read('User.uid');
if(empty($filename)) $filename = $uid.'.png';
include(SYS_PATH.'inc/phpqrcode.php');
// 二维码数据
$thisurl = Import::basic()->thisurl();
$thisurl = @str_replace('user.php?act=myerweima&','?',$thisurl);
if(empty($thisurl)) $thisurl = ADMIN_URL."?tid=".$uid;
// 生成的文件名
$filename = SYS_PATH_PHOTOS.'qcody'.DS.$uid.DS.$filename;
Import::fileop()->checkDir($filename);
// 纠错级别:L、M、Q、H
$errorCorrectionLevel = 'L';
// 点的大小:1到10
$matrixPointSize = 6;
QRcode::png($thisurl, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
}
示例4: index
function index()
{
$id = isset($_GET['id']) && intval($_GET['id']) > 0 ? intval($_GET['id']) : 0;
if ($id > 0) {
//删除
$sql = "SELECT * FROM `{$this->App->prefix()}topic` WHERE topic_id='{$id}'";
$rows = $this->App->findrow($sql);
if (empty($rows)) {
$this->jump(ADMIN_URL . 'topic.php?type=list');
exit;
}
$topic_img = SYS_PATH . $rows['topic_img'];
$topic_flash = SYS_PATH . $rows['topic_flash '];
if (file_exists($topic_img) && is_file($topic_img)) {
Import::fileop()->delete_file($topic_img);
}
if (file_exists($topic_flash) && is_file($topic_img)) {
Import::fileop()->delete_file($topic_flash);
}
//删除数据库内容
$this->App->delete('topic', 'topic_id', $id);
$this->jump(ADMIN_URL . 'topic.php?type=list');
exit;
}
//分页
$page = isset($_GET['page']) ? $_GET['page'] : '';
if (empty($page)) {
$page = 1;
}
$start = ($page - 1) * $list;
$list = 10;
$sql = "SELECT COUNT(topic_id) FROM `{$this->App->prefix()}topic`";
$tt = $this->App->findvar($sql);
$pagelink = Import::basic()->getpage($tt, $list, $page, '?page=', true);
$this->set("pagelink", $pagelink);
$sql = "SELECT * FROM `{$this->App->prefix()}topic` ORDER BY topic_id DESC LIMIT {$start},{$list}";
$rt = $this->App->find($sql);
$this->set('rt', $rt);
$this->template('topiclist');
}
示例5: download_tpl
function download_tpl()
{
$fop = Import::fileop();
$vgoods_type = $this->App->findvar("SELECT vgoods_type FROM `{$this->App->prefix()}userconfig` WHERE type = 'basic' LIMIT 1");
if ($vgoods_type == '1') {
$fop->downloadfile(SYS_PATH . 'data/vgoodssn2.xls');
} else {
$fop->downloadfile(SYS_PATH . 'data/vgoodssn.xls');
}
exit;
}
示例6: ajax_markall
function ajax_markall($kk = 0, $type = 'nav')
{
//必须已开启静态方式才可以生成静态页面
if (empty($GLOBALS['LANG']['is_static'])) {
$rts = array('kk' => '', 'url' => '请你先开启静态方式再生成静态页面', 'type' => 'cache');
die(Import::json()->encode($rts));
}
$nav = array();
$cate = array();
$art = array();
$rts = array('kk' => '', 'url' => '', 'type' => 'end');
if ($type == 'nav') {
$nav = $this->get_nav_var($kk);
if (empty($nav)) {
$rts = array('kk' => '', 'url' => '', 'type' => 'cate');
} else {
Import::fileop()->markhtml($nav['url'], $nav['path']);
$kk = $kk + 1;
$rts = array('kk' => $kk, 'url' => '<a href="' . $nav['returnurl'] . '" target="_blank">' . $nav['returnurl'] . '</a><br />', 'type' => 'nav');
}
die(Import::json()->encode($rts));
}
if (empty($nav) && $type == 'cate') {
$cate = $this->get_category_var($kk);
if (empty($cate)) {
$rts = array('kk' => '', 'url' => '', 'type' => 'art');
} else {
Import::fileop()->markhtml($cate['url'], $cate['path']);
$kk = $kk + 1;
$rts = array('kk' => $kk, 'url' => '<a href="' . $cate['returnurl'] . '" target="_blank">' . $cate['returnurl'] . '</a><br />', 'type' => 'cate');
}
die(Import::json()->encode($rts));
}
if (empty($cate) && $type == 'art') {
$art = $this->get_article_var($kk);
if (empty($art)) {
$rts = array('kk' => '', 'url' => '', 'type' => 'index');
} else {
Import::fileop()->markhtml($art['url'], $art['path']);
$kk = $kk + 1;
$rts = array('kk' => $kk, 'url' => '<a href="' . $art['returnurl'] . '" target="_blank">' . $art['returnurl'] . '</a><br />', 'type' => 'art');
}
die(Import::json()->encode($rts));
}
if (empty($art) && $type == 'index') {
Import::fileop()->markhtml(SITE_URL, SYS_PATH . 'index.html');
$rts = array('kk' => '', 'url' => '<a href="' . SITE_URL . '/" target="_blank">' . SITE_URL . '/</a><br />', 'type' => 'end');
die(Import::json()->encode($rts));
}
die(Import::json()->encode($rts));
}
示例7: ajax_del_photos
function ajax_del_photos($dd = array())
{
$id = $dd['id'];
if ($id > 0) {
$sql = "SELECT img FROM `{$this->App->prefix()}photos` WHERE id='{$id}'";
$img = $this->App->findvar($sql);
if (!empty($img)) {
Import::fileop()->delete_file(SYS_PATH . $img);
//
}
$this->App->delete('photos', 'id', $id);
//删除
}
exit;
}
示例8: del
function del()
{
Import::fileop()->delete_file(SYS_PATH . $GLOBALS['picurl']);
$q = dirname($GLOBALS['picurl']);
$h = basename($GLOBALS['picurl']);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_s' . DS . $h);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_b' . DS . $h);
echo "<script language='javascript'> parent.document.getElementById('" . trim($_REQUEST['ty']) . "').value=''; window.location.href='uploadfile.php?action=&ty=" . $_REQUEST['ty'] . "&tyy=" . (isset($_REQUEST['tyy']) && !empty($_REQUEST['tyy']) ? trim($_REQUEST['tyy']) : trim($_REQUEST['ty'])) . "';</script>";
}
示例9: system_arg
function system_arg()
{
$sql = "SELECT * FROM `{$this->App->prefix()}systemconfig` LIMIT 1";
$rt = $this->App->findrow($sql);
if (!empty($rt['reg_give_money_data'])) {
$rt['reg_give_money_data'] = unserialize($rt['reg_give_money_data']);
$rt['give_money'] = $rt['reg_give_money_data']['give_money'];
$rt['give_money_month'] = $rt['reg_give_money_data']['give_money_month'];
$rt['give_money_month_one1'] = $rt['reg_give_money_data']['give_money_month_one1'];
$rt['give_money_month_one10'] = $rt['reg_give_money_data']['give_money_month_one10'];
$rt['give_money_month_one11'] = $rt['reg_give_money_data']['give_money_month_one11'];
$rt['give_money_month_one12'] = $rt['reg_give_money_data']['give_money_month_one12'];
}
if (!empty($_POST)) {
$ga = array('static' => '0');
$at = array();
if (isset($_POST['static'])) {
$at = $_POST['static'];
$_POST = array_diff_key($_POST, $ga);
switch ($at) {
case '0':
$_POST['is_static'] = 0;
$_POST['is_false_static'] = 0;
$_POST['is_best_static'] = 0;
break;
case '1':
$_POST['is_static'] = 1;
$_POST['is_false_static'] = 0;
$_POST['is_best_static'] = 0;
break;
case '2':
$_POST['is_static'] = 0;
$_POST['is_false_static'] = 1;
$_POST['is_best_static'] = 0;
break;
case '3':
$_POST['is_static'] = 0;
$_POST['is_false_static'] = 0;
$_POST['is_best_static'] = 1;
break;
}
}
$_POST['reg_give_money_data'] = serialize(array('give_money' => $_POST['give_money'], 'give_money_month' => $_POST['give_money_month'], 'give_money_month_one1' => $_POST['give_money_month_one1'], 'give_money_month_one10' => $_POST['give_money_month_one10'], 'give_money_month_one11' => $_POST['give_money_month_one11'], 'give_money_month_one12' => $_POST['give_money_month_one12']));
$rt['give_money'] = $_POST['give_money'];
$rt['give_money_month'] = $_POST['give_money_month'];
$rt['give_money_month_one1'] = $_POST['give_money_month_one1'];
$rt['give_money_month_one10'] = $_POST['give_money_month_one10'];
$rt['give_money_month_one11'] = $_POST['give_money_month_one11'];
$rt['give_money_month_one12'] = $_POST['give_money_month_one12'];
unset($_POST['give_money'], $_POST['give_money_month'], $_POST['give_money_month_one1'], $_POST['give_money_month_one10'], $_POST['give_money_month_one11'], $_POST['give_money_month_one12']);
if (empty($rt)) {
$this->App->insert('systemconfig', $_POST);
$this->action('system', 'add_admin_log', '添加系统设置=>参数设置');
$this->action('common', 'showdiv', $this->getthisurl());
$rt = $_POST;
} else {
$this->App->update('systemconfig', $_POST, 'type', 'basic');
$this->action('system', 'add_admin_log', '修改系统设置=>参数设置');
$this->action('common', 'showdiv', $this->getthisurl());
$rt = $_POST;
}
if (isset($_POST['is_static']) && $_POST['is_static'] == '0') {
Import::fileop()->delete_file(SYS_PATH . 'index.html');
//删除
}
}
$this->set('rt', $rt);
$this->save_basic_config();
$this->template('system_arg');
}
示例10: ajax_del_cache_goods
function ajax_del_cache_goods()
{
$goods_id = $_GET['goods_id'];
if ($goods_id > 0) {
$sql = "SELECT goods_thumb, goods_img, original_img,is_zhuanyi FROM `{$this->App->prefix()}goods_cache_list` WHERE goods_id ='{$goods_id}'";
$imgs = $this->App->findrow($sql);
if (!empty($imgs) && ($imgs['is_zhuanyi'] = '0')) {
if (!empty($imgs['goods_thumb'])) {
Import::fileop()->delete_file(SYS_PATH . $imgs['goods_thumb']);
}
//
if (!empty($imgs['goods_img'])) {
Import::fileop()->delete_file(SYS_PATH . $imgs['goods_img']);
}
//
if (!empty($imgs['original_img'])) {
Import::fileop()->delete_file(SYS_PATH . $imgs['original_img']);
}
//
unset($imgs);
}
$this->App->delete('goods_cache_list', 'goods_id', $goods_id);
} else {
die("非法删除,删除ID为空!");
}
exit;
}
示例11: upload
function upload($filename, $filedir = "")
{
if (empty($filedir) || empty($filename)) {
return false;
}
$imgobj = Import::img();
$f_name = $_FILES[$filename]['name'];
//获取上传源文件名
$t = strrchr($f_name, '.');
//图片类型
$name = time() . time() . $t;
//原始图名称
//设置生成缩略图图片的大小
$dir = basename(dirname($filedir));
$tw_s = 240;
$th_s = 240;
$tw_b = 600;
$th_b = 600;
$result = false;
switch ($dir) {
case 'articlephoto':
//文章图片
break;
case 'catephoto':
//分类图片
break;
case 'companylogo':
//客户公司图片
break;
case 'friendlogo':
//友情链接图片图片
break;
case 'site_icon':
//网站图标
break;
case 'brand':
//品牌的banner图
//品牌的banner图
case 'goods':
//商品
$tw_s = intval($GLOBALS['LANG']['th_width_s']) > 0 ? intval($GLOBALS['LANG']['th_width_s']) : 200;
$th_s = intval($GLOBALS['LANG']['th_height_s']) > 0 ? intval($GLOBALS['LANG']['th_height_s']) : 200;
$tw_b = intval($GLOBALS['LANG']['th_width_b']) > 0 ? intval($GLOBALS['LANG']['th_width_b']) : 450;
$th_b = intval($GLOBALS['LANG']['th_height_b']) > 0 ? intval($GLOBALS['LANG']['th_height_b']) : 450;
break;
case 'avatar':
$tw_s = 150;
$th_s = 150;
$tw_b = 150;
$th_b = 150;
$result = true;
break;
}
$imgname = $imgobj->upload($filename, $filedir . $name);
$other = array('banner', 'brand', 'cover', 'top_img');
if (file_exists($filedir . $name)) {
if ($dir == 'avatar') {
//头像 生成150
$imgobj->thumb($filedir . $name, $filedir . 'thumb_s' . DS . $name, $tw_s, $th_s);
//@unlink($filedir.$name);
Import::fileop()->delete_file($filedir . $name);
$imgobj->thumb($filedir . 'thumb_s' . DS . $name, $filedir . $name, $tw_b, $th_b);
//@unlink($filedir.'thumb_b'.DS.$name);
Import::fileop()->delete_file($filedir . 'thumb_b' . DS . $name);
} else {
if (!in_array($dir, $other)) {
$imgobj->thumb($filedir . $name, $filedir . 'thumb_s' . DS . $name, $tw_s, $th_s);
$imgobj->thumb($filedir . $name, $filedir . 'thumb_b' . DS . $name, $tw_b, $th_b);
}
}
}
return $name;
}
示例12: mysaidan
function mysaidan()
{
$this->title("我的晒单列表" . ' - ' . $GLOBALS['LANG']['site_name']);
$uid = $this->Session->read('User.uid');
if (empty($uid)) {
$this->jump(ADMIN_URL . 'user.php?act=login', 0, '请先登录!');
exit;
}
$id = isset($_GET['id']) ? $_GET['id'] : 0;
if ($id > 0) {
$img = $this->App->findvar("SELECT article_img FROM `{$this->App->prefix()}article` WHERE article_id='{$id}'");
if (!empty($img)) {
Import::fileop()->delete_file(SYS_PATH . $img);
//删除图片
$q = dirname($img);
$h = basename($img);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_s' . DS . $h);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_b' . DS . $h);
}
$this->App->delete('article', 'article_id', $id);
$this->jump(ADMIN_URL . 'user.php?act=mysaidan');
exit;
}
//排序
$orderby = ' ORDER BY tb1.vieworder ASC,tb1.`article_id` DESC';
//分页
$page = isset($_GET['page']) ? $_GET['page'] : '';
if (empty($page)) {
$page = 1;
}
$list = 5;
$start = ($page - 1) * $list;
$sql = "SELECT COUNT(tb1.article_id) FROM `{$this->App->prefix()}article` AS tb1";
$sql .= " LEFT JOIN `{$this->App->prefix()}article_cate` AS tb2";
$sql .= " ON tb1.cat_id = tb2.cat_id WHERE tb1.uid = '{$uid}'";
$tt = $this->App->findvar($sql);
$pagelink = Import::basic()->getpage($tt, $list, $page, '?page=', true);
$this->set("pages", $pagelink);
$sql = "SELECT tb1.*,tb2.cat_name FROM `{$this->App->prefix()}article` AS tb1";
$sql .= " LEFT JOIN `{$this->App->prefix()}article_cate` AS tb2";
$sql .= " ON tb1.cat_id = tb2.cat_id";
$sql .= " WHERE tb1.uid = '{$uid}' {$orderby} LIMIT {$start},{$list}";
$this->set('lists', $this->App->find($sql));
if (!defined(NAVNAME)) {
define('NAVNAME', "我的晒单");
}
$this->set('page', $page);
$this->template('mysaidan');
}
示例13: info
function info()
{
$this->js(array('jquery.json-1.3.js'));
$id = isset($_GET['id']) ? $_GET['id'] : 0;
if ($id > 0) {
$sql = "SELECT tb1.*,tb2.cat_name AS sname,tb3.cat_name AS bname,g.goods_name,g.goods_thumb FROM `{$this->App->prefix()}top_cate_goods` AS tb1";
$sql .= " LEFT JOIN `{$this->App->prefix()}goods` AS g ON g.goods_id = tb1.goods_id";
$sql .= " LEFT JOIN `{$this->App->prefix()}top_cate` AS tb2 ON tb2.tcid = tb1.tcid";
$sql .= " LEFT JOIN `{$this->App->prefix()}top_cate` AS tb3 ON tb3.tcid = tb2.parent_id WHERE tb1.gid='{$id}'";
$rt = $this->App->findrow($sql);
//删除原来图片
$img = $rt['img'];
if (!empty($img) && !empty($_POST['photo_img'][0]) & $img != $_POST['photo_img'][0]) {
$topic_img = SYS_PATH . $rt['img'];
if (!empty($rt['img']) && is_file($topic_img)) {
Import::fileop()->delete_file($topic_img);
$q = dirname($rt['img']);
$h = basename($rt['img']);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_s' . DS . $h);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_b' . DS . $h);
}
}
if (!empty($_POST['photo_name'])) {
foreach ($_POST['photo_name'] as $k => $name) {
$dd['tcid'] = intval($_POST['cat_id']);
if (!empty($_POST['photo_img'][$k])) {
$dd['img'] = $_POST['photo_img'][$k];
}
if (!empty($_POST['photo_url'][$k])) {
$dd['url'] = $_POST['photo_url'][$k];
}
if ($_POST['source_select'][$k] > 0) {
$dd['goods_id'] = $_POST['source_select'][$k];
}
$dd['gname'] = trim($name);
$this->App->update('top_cate_goods', $dd, 'gid', $id);
}
$this->action('common', 'showdiv', $this->getthisurl());
}
$this->set('rt', $rt);
} else {
if (!empty($_POST['photo_name'])) {
foreach ($_POST['photo_name'] as $k => $name) {
//if(empty($name)) continue;
/*$sql = "SELECT gid FROM `{$this->App->prefix()}top_cate_goods` WHERE goods_id='$gid'";
$ggid = $this->App->findvar($sql);
if($ggid>0) continue;*/
$dd['tcid'] = intval($_POST['cat_id']);
if (!empty($_POST['photo_img'][$k])) {
$dd['img'] = $_POST['photo_img'][$k];
}
if (!empty($_POST['photo_url'][$k])) {
$dd['url'] = $_POST['photo_url'][$k];
}
if ($_POST['source_select'][$k] > 0) {
$dd['goods_id'] = $_POST['source_select'][$k];
}
$dd['gname'] = trim($name);
$this->App->insert('top_cate_goods', $dd);
}
$this->action('common', 'showdiv', $this->getthisurl());
}
}
//分类列表
$this->set('catelist', $this->action('common', 'get_goods_cate_tree'));
//品牌列表
$this->set('brandlist', $this->action('common', 'get_brand_cate_tree'));
$this->set('catelist2', $this->get_goods_cate_tree());
$this->template('info');
}
示例14: ajax_delads
function ajax_delads($ids)
{
if (empty($ids)) {
echo "删除ID为空!";
}
$arr = explode('+', $ids);
$sql = "SELECT ad_img FROM `{$this->App->prefix()}ad_content` WHERE pid IN(" . @implode(',', $arr) . ")";
$imgs = $this->App->findcol($sql);
if (!empty($imgs)) {
foreach ($imgs as $vv) {
if (empty($vv)) {
continue;
}
Import::fileop()->delete_file(SYS_PATH . $vv);
//删除文件
$q = dirname($vv);
$h = basename($vv);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_s' . DS . $h);
Import::fileop()->delete_file(SYS_PATH . $q . DS . 'thumb_b' . DS . $h);
}
}
foreach ($arr as $id) {
$this->App->delete('ad_content', 'pid', $id);
}
$this->action('system', 'add_admin_log', '删除广告:ID为' . implode(',', $arr));
}
示例15: strtolower
<?php
require_once '../load.php';
@set_time_limit(1800);
//最大执行时间1800S
$sort = 12;
$f_type = strtolower("zip,jpg,rar,png,gif");
//设置可上传的文件类型
$file_size_max = 1024 * 1024 * 15;
//限制单个文件上传最大容量 最大10M
$overwrite = 0;
//是否允许覆盖相同文件,1:允许,0:不允许
$f_input = "Files";
//设置上传域名称
$attdir = SYS_PATH_PHOTOS . "temp" . DS . (empty($_SESSION['adminname']) ? 'admin' : $_SESSION['adminname']) . DS;
$fop = Import::fileop();
//文件操作对象
clearfile(SYS_PATH_PHOTOS . "temp" . DS . (empty($_SESSION['adminname']) ? 'admin' : $_SESSION['adminname']));
//遍历文件,将该库里的文件删除
//循环调用多层文件夹文件
function clearfile($dir = '')
{
global $fop;
if (empty($dir)) {
return false;
}
$file_arr = $fop->list_files($dir);
if (!empty($file_arr)) {
foreach ($file_arr as $filename) {
if (is_file($filename)) {
$fop->delete_file($filename);