コード例 #1
0
ファイル: function.php プロジェクト: TauThickMi/M
function isFormatUnknown($name)
{
    global $formats;
    $format = getFormat($name);
    if ($format == null) {
        return true;
    }
    foreach ($formats as $array) {
        if (in_array($format, $array)) {
            return false;
        }
    }
    return true;
}
コード例 #2
0
ファイル: file_copy.php プロジェクト: TauThickMi/M
define('ACCESS', true);
include_once 'function.php';
if (IS_LOGIN) {
    $title = 'Sao chép tập tin';
    include_once 'header.php';
    echo '<div class="title">' . $title . '</div>';
    if ($dir == null || $name == null || !is_file(processDirectory($dir . '/' . $name))) {
        echo '<div class="list"><span>Đường dẫn không tồn tại</span></div>
            <div class="title">Chức năng</div>
            <ul class="list">
                <li><img src="icon/list.png"/> <a href="index.php' . $pages['paramater_0'] . '">Danh sách</a></li>
            </ul>';
    } else {
        $dir = processDirectory($dir);
        $format = getFormat($name);
        if (isset($_POST['submit'])) {
            echo '<div class="notice_failure">';
            if (empty($_POST['path'])) {
                echo 'Chưa nhập đầy đủ thông tin';
            } else {
                if ($dir == processDirectory($_POST['path'])) {
                    echo 'Đường dẫn mới phải khác đường dẫn hiện tại';
                } else {
                    if (isPathNotPermission(processDirectory($_POST['path']))) {
                        echo 'Bạn không thể sao chép tập tin tới đường dẫn của File Manager';
                    } else {
                        if (!@copy($dir . '/' . $name, processDirectory($_POST['path']) . '/' . $name)) {
                            echo 'Sao chép tập tin thất bại';
                        } else {
                            goURL('index.php?dir=' . $dirEncode . $pages['paramater_1']);
コード例 #3
0
ファイル: edit_text.php プロジェクト: TauThickMi/M
     </div>
     <form action="edit_text.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . ($page > 1 ? '&page=' . $page : null) . '" method="post">
         <span class="bull">&bull;</span>Nội dung:<br/>
         <div class="parent_box_edit">
             <textarea class="box_edit" name="content">' . htmlspecialchars($content) . '</textarea>
         </div>
         <div class="search_replace search">
             <span class="bull">&bull;</span>Tìm kiếm:<br/>
             <input type="text" name="search" value=""/>
         </div>
         <div class="search_replace replace">
             <span class="bull">&bull;</span>Thay thế:<br/>
             <input type="text" name="replace" value=""/>
         </div>
         <div class="input_action">
             ' . ($isExecute && strtolower(getFormat($name)) == 'php' ? '<input type="checkbox" name="s_check_syntax" value="1"' . (isset($_POST['s_check_syntax']) ? ' checked="checked"' : null) . '/>Kiểm tra lỗi' : null) . '<hr/>
             <input type="submit" name="s_save" value="Lưu lại"/>
         </div>
     </form>';
 if ($pageLine > 0 && $total > 1) {
     echo page($page, $total, array(PAGE_URL_DEFAULT => 'edit_text.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'], PAGE_URL_START => 'edit_text.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '&page='));
 }
 echo '</div>
 <div class="title">Chức năng</div>
 <ul class="list">
     <li><img src="icon/edit_text_line.png"/> <a href="edit_text_line.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Sửa theo dòng</a></li>
     <li><img src="icon/download.png"/> <a href="file_download.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Tải về</a></li>
     <li><img src="icon/info.png"/> <a href="file.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Thông tin</a></li>
     <li><img src="icon/rename.png"/> <a href="file_rename.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Đổi tên</a></li>
     <li><img src="icon/copy.png"/> <a href="file_copy.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Sao chép</a></li>
     <li><img src="icon/move.png"/> <a href="file_move.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Di chuyển</a></li>
コード例 #4
0
ファイル: index.php プロジェクト: apanly/dream
            imagepng($image, null, 9);
            break;
    }
    imagedestroy($image);
    exit;
}
function getFormat($format)
{
    $ret = ['w' => 0, 'h' => 0];
    if (substr($format, 0, 1) == "/") {
        $format = substr($format, 1);
    }
    $info = explode("/", $format);
    $w_key = array_search("w", $info);
    if ($w_key !== false) {
        $ret['w'] = $info[$w_key + 1];
    }
    $h_key = array_search("h", $info);
    if ($h_key !== false) {
        $ret['h'] = $info[$h_key + 1];
    }
    return $ret;
}
$filename = $_GET['filename'];
$format = $_GET['format'];
if (!$filename || !$format) {
    echo "params filename  and  format must be assigned";
    exit;
}
$ret = getFormat($format);
resizeimage($filename, $ret['w'], $ret['h']);
コード例 #5
0
ファイル: index.php プロジェクト: TauThickMi/M
     echo '<li class="folder">
             <div>
                 <input type="checkbox" name="entry[]" value="' . $name . '"/>
                 <a href="folder_edit.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">
                     <img src="icon/folder.png"/>
                 </a>
                 <a href="index.php?dir=' . rawurlencode($path) . '">' . $name . '</a>
                 <div class="perms">
                     <a href="folder_chmod.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '" class="chmod">' . $perms . '</a>
                 </div>
             </div>
         </li>';
 } else {
     $edit = array(null, '</a>');
     $icon = 'unknown';
     $type = getFormat($name);
     $isEdit = false;
     if (in_array($type, $formats['other'])) {
         $icon = $type;
     } else {
         if (in_array($type, $formats['text'])) {
             $icon = $type;
             $isEdit = true;
         } else {
             if (in_array($type, $formats['archive'])) {
                 $icon = $type;
             } else {
                 if (in_array($type, $formats['audio'])) {
                     $icon = $type;
                 } else {
                     if (in_array($type, $formats['font'])) {
コード例 #6
0
ファイル: file_viewzip.php プロジェクト: TauThickMi/M
 }
 if ($count <= 0) {
     echo '<li class="normal"><img src="icon/empty.png"/> <span class="empty">Không có thư mục hoặc tập tin</span></li>';
 } else {
     foreach ($arrays as $key => $value) {
         $pathEncode = rawurlencode($value['path']);
         if ($value['folder']) {
             echo '<li class="folder">
                 <div>
                     <img src="icon/folder.png" style="margin-left: 5px"/>
                     <a href="file_viewzip.php?dir=' . $dirEncode . '&name=' . $name . '&path=' . $pathEncode . $pages['paramater_1'] . '">' . $value['name'] . '</a>
                 </div>
             </li>';
         } else {
             $icon = 'unknown';
             $type = getFormat($value['name']);
             if (in_array($type, $formats['other'])) {
                 $icon = $type;
             } else {
                 if (in_array($type, $formats['text'])) {
                     $icon = $type;
                 } else {
                     if (in_array($type, $formats['archive'])) {
                         $icon = $type;
                     } else {
                         if (in_array($type, $formats['audio'])) {
                             $icon = $type;
                         } else {
                             if (in_array($type, $formats['font'])) {
                                 $icon = $type;
                             } else {