当前位置: 首页>>代码示例>>PHP>>正文


PHP gcms::rm_dir方法代码示例

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


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

示例1: array

     $ret['error'] = 'EX_MODE_ERROR';
 } else {
     $action = gcms::getVars($_POST, 'action', '');
     $ids = array();
     foreach (explode(',', $_POST['id']) as $id) {
         $ids[] = (int) $id;
     }
     if (sizeof($ids) > 0) {
         $ids = implode(',', $ids);
         if ($action == 'delete') {
             // ลบอัลบัม, ตรวจสอบ id
             $sql = "SELECT `id` FROM `" . DB_GALLERY_ALBUM . "` WHERE `id` IN ({$ids}) AND `module_id`=(SELECT `id` FROM `" . DB_MODULES . "` WHERE `owner`='gallery')";
             $ids = array();
             foreach ($db->customQuery($sql) as $item) {
                 // ลบโฟลเดอร์และรูป
                 gcms::rm_dir(DATA_PATH . "gallery/{$item['id']}/");
                 // id ที่ลบ
                 $ids[] = $item['id'];
             }
             if (sizeof($ids) > 0) {
                 $ids = implode(',', $ids);
                 // ลบอัลบัม
                 $db->query("DELETE FROM `" . DB_GALLERY_ALBUM . "` WHERE `id` IN ({$ids})");
                 // ลบรูปภาพ
                 $db->query("DELETE FROM `" . DB_GALLERY . "` WHERE `album_id` IN ({$ids})");
             }
             // กลับไปหน้าอัลบัม
             $ret['error'] = 'DELETE_SUCCESS';
             $ret['location'] = rawurlencode('index.php?module=gallery-album');
         } elseif ($action == 'deletep') {
             // ลบรูปในอัลบัม
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:admin_action.php

示例2: fwrite

 // ตรวจสอบโฟลเดอร์
 gcms::testDir($counter_dir, 0755);
 // ตรวจสอบวันใหม่
 $c = (int) @file_get_contents($counter_dir . '/index.php');
 if ($d != $c) {
     $f = @fopen($counter_dir . '/index.php', 'wb');
     if ($f) {
         fwrite($f, $d);
         fclose($f);
     }
     $f = @opendir($counter_dir);
     if ($f) {
         while (false !== ($text = readdir($f))) {
             if ($text != '.' && $text != '..') {
                 if ($text != $y) {
                     gcms::rm_dir($counter_dir . "/{$text}");
                 }
             }
         }
         closedir($f);
     }
 }
 // ตรวจสอบ + สร้าง โฟลเดอร์
 gcms::testDir("{$counter_dir}/{$y}", 0755);
 gcms::testDir("{$counter_dir}/{$y}/{$m}", 0755);
 // ip ปัจจุบัน
 $counter_ip = gcms::getip();
 // session ปัจจุบัน
 $counter_ssid = session_id();
 // วันนี้
 $counter_day = date('Y-m-d', $mmktime);
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:counter.php

示例3: session_start

<?php

// ลบไฟล์
session_start();
header("content-type: text/html; charset=UTF-8");
// config
include "../../../../bin/load.php";
if (gcms::isReferer() && gcms::isAdmin()) {
    if (isset($_POST['did'])) {
        gcms::rm_dir(ROOT_PATH . $_POST['did']);
    } elseif (isset($_POST['fid'])) {
        @unlink(ROOT_PATH . $_POST['fid']);
    }
} else {
    echo 'Do not delete!';
}
开发者ID:phannack,项目名称:GCMS,代码行数:16,代码来源:delete.php

示例4: unset

                     include CONFIG;
                 }
                 // skin ที่กำหนด
                 $config['skin'] = $theme;
                 unset($_SESSION['my_skin']);
                 // บันทึก config.php
                 if (gcms::saveconfig(CONFIG, $config)) {
                     $_SESSION['skin'] = $config['skin'];
                     $message = '<aside class=message>{LNG_TEMPLATE_SELECT_SUCCESS}</aside>';
                 } else {
                     $message = '<aside class=error>' . sprintf($lng['ERROR_FILE_READ_ONLY'], 'bin/config.php') . '</aside>';
                 }
                 $config = array_merge($save, $config);
             } elseif ($action == 'delete') {
                 // ลบ skin
                 gcms::rm_dir($dir . $theme . '/');
                 $message = '<aside class=message>{LNG_TEMPLATE_REMOVE_SUCCESS}</aside>';
             }
         }
     }
 }
 // อ่าน Theme ทั้งหมด
 $themes = array();
 $f = opendir($dir);
 while (false !== ($text = readdir($f))) {
     if ($text !== $config['skin'] && $text !== "." && $text !== "..") {
         if (is_dir($dir . "/{$text}") && is_file($dir . "/{$text}/style.css")) {
             $themes[] = $text;
         }
     }
 }
开发者ID:goragod,项目名称:php-framework-benchmark,代码行数:31,代码来源:template.php

示例5: ob_flush

         } else {
             echo '<li class=incorrect><strong>FTP Root</strong> <em>ไม่ถูกต้อง</em> กรุณาตรวจสอบจากโฮสต์ของคุณ</li>';
         }
     } else {
         echo '<li class=incorrect><strong>FTP</strong> <em>ไม่สามารถใช้งานได้</em></li>';
     }
 }
 if (is_dir(DATA_PATH)) {
     echo '<li>ตรวจสอบโฟลเดอร์ <strong>' . DATA_FOLDER . '</strong></li>';
     ob_flush();
     flush();
     $datas_dir = ROOT_PATH . "{$mmktime}/";
     if (@rename(DATA_PATH, $datas_dir)) {
         copyDir($datas_dir, DATA_PATH);
     }
     gcms::rm_dir($datas_dir);
     echo '<li class=correct>ตรวจสอบโฟลเดอร์ <strong>' . DATA_FOLDER . '</strong> <i>เรียบร้อย</i></li>';
     ob_flush();
     flush();
 }
 $files = array();
 $files[] = ROOT_PATH . 'bin/config.php';
 $files[] = ROOT_PATH . 'bin/vars.php';
 foreach ($files as $file) {
     if (!is_writeable($file)) {
         $ftp->chmod($file, 0646);
     }
     if (is_writeable($file)) {
         echo '<li class=correct>ไฟล์ <strong>' . str_replace(ROOT_PATH, '', $file) . '</strong> <i>สามารถเขียนได้</i></li>';
     } else {
         $error = true;
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:upgrade1.php


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