當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Import::fileop方法代碼示例

本文整理匯總了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);
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:29,代碼來源:controller.php

示例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);
         }
     }
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:16,代碼來源:controller.php

示例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);
	}
開發者ID:jasonhzy,項目名稱:fx_demo,代碼行數:21,代碼來源:複件+controller.php

示例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');
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:40,代碼來源:controller.php

示例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;
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:11,代碼來源:controller.php

示例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));
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:51,代碼來源:controller.php

示例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;
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:15,代碼來源:controller.php

示例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>";
}
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:9,代碼來源:uploadfile.php

示例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');
 }
開發者ID:jasonhzy,項目名稱:fx_demo,代碼行數:70,代碼來源:controller.php

示例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;
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:27,代碼來源:controller.php

示例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;
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:73,代碼來源:controller.php

示例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');
 }
開發者ID:jasonhzy,項目名稱:wxfx,代碼行數:49,代碼來源:controller.php

示例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');
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:70,代碼來源:controller.php

示例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));
 }
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:26,代碼來源:controller.php

示例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);
開發者ID:zhaoshengloveqingqing,項目名稱:fenxiao,代碼行數:31,代碼來源:upload.php


注:本文中的Import::fileop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。