Beispiel #1
0
    closedir($a);
    foreach ($dirs as $d) {
        $d2 = ($dire == ".//" ? "" : $dire) . $d;
        $d3 = $dir != $root ? "dir=" . $dir . "&" : "";
        print "<tr><td><a href=\"?dir=" . $d2 . "\">" . $d . "</a></td><td>Directory</td>";
        print "<td>" . getPerms($d2) . "</td><td>" . dirsize($d2) . " kb</td><td>" . getLastModific($d2) . "</td>";
        print "<td><a href=\"?" . $d3 . "mode=deletedir&d=" . $d . "\">D</a>&nbsp;";
        print "<a href=\"?" . $d3 . "mode=rename&file=" . $d . "\">R</a></td></tr>";
    }
    foreach ($files as $file) {
        $file2 = $dire . $file;
        $d3 = $dir != $root ? "dir=" . $dir . "&" : "";
        print "<tr><td><a target=\"_blank\" href=\"" . $file2 . "\">" . $file . "</a></td>";
        $ex = pathinfo($file2);
        print "<td>File " . (empty($ex['extension']) ? "sconosciuto" : $ex['extension']) . "</td>";
        print "<td>" . getPerms($file2) . "</td><td>" . Size($file2) . " kb</td><td>" . getLastModific($file2) . "</td>";
        print "<td><a title='Edit' href=\"?" . $d3 . "mode=edit&file=" . $file . "\">E</a>&nbsp;";
        print "<a title='Delete' href=\"?" . $d3 . "mode=delete&file=" . $file . "\">D</a>&nbsp;";
        print "<a title='Rename' href=\"?" . $d3 . "mode=rename&file=" . $file . "\">R</a>&nbsp;";
        //print "<a title='Move' href=\"?".$d3."mode=move&file=".$file."\">M</a></td></tr>";
    }
    ?>

			</table>

			<?php 
    if (isset($_GET['mode']) && $_GET['mode'] == "rename") {
        ?>

			<form action="" name="rename" method="post">
Beispiel #2
0
function home()
{
    global $os, $meurl, $folder, $ufolder, $filefolder, $HTTP_HOST;
    maintop("主页");
    echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=100% class='mytable'><form method='post'>\n";
    $content1 = "";
    $content2 = "";
    $count = "0";
    $folder = iconv("UTF-8", "GBK", $folder);
    $style = opendir($folder);
    $a = 1;
    $b = 1;
    if ($folder) {
        $_SESSION['folder'] = $ufolder;
    }
    while ($stylesheet = readdir($style)) {
        $ulfolder = $folder;
        $sstylesheet = $stylesheet;
        if ($os !== 'windows') {
            $qx = "<td>" . substr(sprintf('%o', fileperms($ulfolder . $sstylesheet)), -3) . "</td>";
        } else {
            $qx = '';
        }
        if ($stylesheet !== "." && $stylesheet !== "..") {
            if (is_dir($folder . $stylesheet) && is_readable($folder . $stylesheet)) {
                $stylesheet = iconv("GBK", "UTF-8", $stylesheet);
                $folder = iconv("GBK", "UTF-8", $folder);
                $content1[$a] = "<tr width=100% ><td><input name='select_item[d][{$stylesheet}]' type='checkbox' id='{$stylesheet}' onclick='One({$stylesheet})' class=\"checkbox\" value='" . $folder . $stylesheet . "' /></td>\n" . "<td><a href=\"" . $meurl . "?op=home&folder=" . $folder . $stylesheet . "/\">" . $stylesheet . "</a></td>\n" . "<td>" . Size(dirSize($folder . $stylesheet)) . "</td>" . "<td><a href=\"" . $meurl . "?op=home&folder=" . htmlspecialchars($folder . $stylesheet) . "/\">打开</a></td>\n" . "<td><a href=\"" . $meurl . "?op=ren&file=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">重命名</a></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>查看</a></td>\n" . $qx . "</tr>\n";
                $a++;
                $folder = iconv("UTF-8", "GBK", $folder);
            } elseif (!is_dir($folder . $stylesheet) && is_readable($folder . $stylesheet)) {
                $arr = explode('.', $folder . $stylesheet);
                $arr = end($arr);
                if ($arr == 'zip' || $arr == 'gz' || $arr == 'tar' || $arr == 'gzip') {
                    #判断是否是zip文件
                    $stylesheet = iconv("GBK", "UTF-8", $stylesheet);
                    $folder = iconv("GBK", "UTF-8", $folder);
                    $content2[$b] = "<tr width=100%><td><input name='select_item[f][{$stylesheet}]' type='checkbox' id='{$stylesheet}' class=\"checkbox\" value='" . $folder . $stylesheet . "' /></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>" . $stylesheet . "</a></td>\n" . "<td>" . Size(filesize($ufolder . $sstylesheet)) . "</td>" . "<td></td>\n" . "<td><a href=\"" . $meurl . "?op=ren&file=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">重命名</a></td>\n" . "<td><a href=\"" . $meurl . "?op=unz&dename=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">提取</a></td>\n" . $qx . "</tr>\n";
                    $b++;
                    $folder = iconv("UTF-8", "GBK", $folder);
                } elseif ($arr == 'gif' || $arr == 'png' || $arr == 'bmp' || $arr == 'png5' || $arr == 'psd') {
                    $stylesheet = iconv("GBK", "UTF-8", $stylesheet);
                    $folder = iconv("GBK", "UTF-8", $folder);
                    $content2[$b] = "<tr width=100%><td><input name='select_item[f][{$stylesheet}]' type='checkbox' id='{$stylesheet}' class=\"checkbox\" value='" . $folder . $stylesheet . "' /></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>" . $stylesheet . "</a></td>\n" . "<td>" . Size(filesize($ufolder . $sstylesheet)) . "</td>" . "<td></td>\n" . "<td><a href=\"" . $meurl . "?op=ren&file=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">重命名</a></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>查看</a></td>\n" . $qx . "</tr>\n";
                    $b++;
                    $folder = iconv("UTF-8", "GBK", $folder);
                } else {
                    $stylesheet = iconv("GBK", "UTF-8", $stylesheet);
                    $folder = iconv("GBK", "UTF-8", $folder);
                    $content2[$b] = "<tr width=100%><td><input name='select_item[f][{$stylesheet}]' type='checkbox' id='{$stylesheet}' class=\"checkbox\" value='" . $folder . $stylesheet . "' /></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>" . $stylesheet . "</a></td>\n" . "<td>" . Size(filesize($ufolder . $sstylesheet)) . "</td>" . "<td><a href=\"" . $meurl . "?op=edit&fename=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">编辑</a></td>\n" . "<td><a href=\"" . $meurl . "?op=ren&file=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">重命名</a></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>查看</a></td>\n" . $qx . "</tr>\n";
                    $b++;
                    $folder = iconv("UTF-8", "GBK", $folder);
                }
            }
            $count++;
        }
    }
    closedir($style);
    $lu = explode('/', $ufolder);
    array_pop($lu);
    $u = '';
    echo '<div class="title">';
    foreach ($lu as $v) {
        $u = $u . $v . '/';
        echo '<a href="' . $meurl . '?op=home&folder=' . $u . '">' . $v . '</a> » ';
    }
    echo "文件\n" . "<span class='right'>共有 " . $count . " 个文件</span></div>" . "<div style=\"position:fixed;bottom:0;margin-left:3px;\"><input type=\"checkbox\" id=\"check\" onclick=\"Check()\"> <input class='button' name='action' type='submit' value='移动' /> <input class='button' name='action' type='submit' value='复制' /> <input class='button' name='action' type='submit' onclick=\"return confirm('点击确认后,选中的文件将作为Backup-time.zip创建!')\"  value='压缩' /> <input class='button' name='action' type='submit' onclick=\"return confirm('您真的要删除选中的文件吗?')\" value='删除' /> <input class='button' name='action' type='submit' onclick=\"var t=document.getElementById('chmod').value;return confirm('将这些文件的权限修改为'+t+'?如果是文件夹,将会递归文件夹内所有内容!')\" value='权限' /> <input type=\"text\" class=\"text\" stlye=\"vertical-align:text-top;\" size=\"3\" id=\"chmod\" name=\"chmod\" value=\"0755\"></div>";
    if ($os !== 'windows') {
        $qx = "<th width=40>权限</th>\n";
    } else {
        $qx = '';
    }
    echo "<tr class='headtable' width=100%>" . "<script>function Check() {\n            var collid = document.getElementById(\"check\")\n            var coll = document.getElementsByTagName('input')\n            if (collid.checked){\n                for(var i = 0; i < coll.length; i++)\n                    coll[i].checked = true;\n            }else{\n                for(var i = 0; i < coll.length; i++)\n                    coll[i].checked = false;\n            }\n         }</script>" . "<th width=20></th>\n" . "<th>文件名</th>\n" . "<th width=65>大小</th>\n" . "<th width=45>打开</th>\n" . "<th width=55>重命名</th>\n" . "<th width=40>查看</th>\n" . $qx . "</tr>";
    if ($ufolder !== "./") {
        $count = substr_count($ufolder, "/");
        $last = explode('/', $ufolder);
        $i = 1;
        $back = ".";
        while ($i < $count - 1) {
            $back = $back . "/" . $last[$i];
            $i++;
        }
        if ($os == 'windows') {
            $qx = "";
        } else {
            $qx = "<td></td>";
        }
        echo "<tr width=100%><td></td><td><a href=\"" . $meurl . "?op=home&folder=" . $back . "/" . "\">上级目录</a></td><td></td><td></td><td></td><td></td>{$qx}</tr>";
    }
    for ($a = 1; $a < count($content1) + 1; $a++) {
        if (empty($content1)) {
        } else {
            echo @$content1[$a];
        }
    }
    for ($b = 1; $b < count($content2) + 1; $b++) {
        echo @$content2[$b];
    }
    echo "</table></form>";
    mainbottom();
}
Beispiel #3
0
    return $bytes;
}
// Convert to lower case so we are not case-sensitive
for ($i = 0; isset($excludedFiles[$i]); $i++) {
    $excludedFiles[$i] = strtolower(ltrim($excludedFiles[$i], '.'));
}
$excludedFiles = array_merge($excludedFiles, array('.', '..'));
// Loop through directory
$count = 0;
if ($handle = opendir('server/')) {
    while (false !== ($file = readdir($handle))) {
        $extn = explode('server/', $file);
        $extn = array_pop($extn);
        // Only echo links for files that don't match our rules
        if (!in_array(strtolower($file), $excludedFiles) && !in_array(strtolower($extn), $excludedExtensions)) {
            $count++;
            //Load up movie, I guess we can just use the default HTML5 vidya playa!
            print "<tr>\n              <td><i class='glyphicon glyphicon-folder-open'></i></td>\n              <td><a href='view.php?view=" . $file . "'>" . $file . "</a></td>\n              <td>" . Size("server/" . $file) . "</td>\n              <td style='text-transform: uppercase;'>" . pathinfo("server/" . $file, PATHINFO_EXTENSION) . "</td>\n            </tr>";
        }
    }
    closedir($handle);
}
?>

        </tbody>
        </table>
    </div>


</div>
Beispiel #4
0
			
			<tr class="row2">
            	<td align="center"><input name="chk_id[]" type="checkbox" id="chk_id[]" value="<?php 
        echo $filename;
        ?>
"></td>
                 <td align="center"><?php 
        echo date("m-d-Y H:i:s", filemtime($dir . $dirfile['file']));
        ?>
</td>
            	<td align="center"><?php 
        echo $dirfile['file'];
        ?>
</td>
                <td align="center"><?php 
        echo Size($dir . $dirfile['file']);
        ?>
</td>
                <td align="center">
                	<?php 
        if (preg_match("/\\.sql\$/i", $dirfile['file'])) {
            echo 'SQL';
        } elseif (preg_match("/\\.gz\$/i", $dirfile['file'])) {
            echo "GZip";
        } elseif (preg_match("/\\.zip\$/i", $dirfile['file'])) {
            echo "Zip";
        } elseif (preg_match("/\\.csv\$/i", $dirfile['file'])) {
            echo "CSV";
        } else {
            echo "Misc";
        }
Beispiel #5
0
            if ($dirfile != "." && $dirfile != ".." && $dirfile != basename($_SERVER["SCRIPT_FILENAME"])) {
                if (!$dirhead) {
                    $dirhead = true;
                }
                ?>
			<tr class="row2">
                 <td align="center"><?php 
                echo date("m-d-Y H:i:s", filemtime($mr['upload_dir'] . $dirfile));
                ?>
</td>
            	<td align="center"><?php 
                echo $dirfile;
                ?>
</td>
                <td align="center"><?php 
                echo Size($mr['upload_dir'] . $dirfile);
                ?>
</td>
               
                <td align="center">
                	<?php 
                if (preg_match("/\\.sql\$/i", $dirfile)) {
                    echo 'SQL';
                } elseif (preg_match("/\\.gz\$/i", $dirfile)) {
                    echo "GZip";
                } elseif (preg_match("/\\.zip\$/i", $dirfile)) {
                    echo "Zip";
                } elseif (preg_match("/\\.csv\$/i", $dirfile)) {
                    echo "CSV";
                } else {
                    echo "Misc";
Beispiel #6
0
							<th>Format</th>
							<th>Resolution</th>
							<th>Quality</th>
							<th>Size</th>
							<th>Download</th>
						</tr>
					</thead>
					<tbody>
<?php 
foreach ($avail_formats as $vid) {
    echo '						<tr>';
    echo '							<td><strong>' . $vid['itag'] . '</strong></td>';
    echo '							<td>' . $vid['type'] . '</td>';
    echo '							<td>' . $vid['res'] . '</td>';
    echo '							<td>' . $vid['quality'] . '</td>';
    echo '							<td>' . Size(get_size($vid['url'])) . '</td>';
    if ($config['VideoLinkMode'] == 'direct') {
        echo '							<td><a href="' . $vid['url'] . '" class="btn btn-primary" role="button">Download</a></td>';
    } else {
        echo '							<td><a href="' . $vid['proxy'] . '" class="btn btn-primary" role="button">Download</a></td>';
    }
    echo '						</tr>';
}
?>
					</tbody>
				</table>
			</div>
<?php 
if ($debug) {
    echo "<pre>{$video_info}</pre>";
}
function root()
{
    global $meurl, $folder, $ufolder, $filefolder, $HTTP_HOST, $config_file, $php_self;
    maintop("Root");
    echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=100% class='mytable'><form method='post'>\n";
    $content1 = "";
    $content2 = "";
    $count = "0";
    $folder = iconv("UTF-8", "GBK", $folder);
    $style = opendir($folder);
    $a = 1;
    $b = 1;
    if ($folder) {
        $_SESSION['folder'] = $ufolder;
    }
    while ($stylesheet = readdir($style)) {
        if ($stylesheet !== "." && $stylesheet !== ".." && $stylesheet !== $php_self && $stylesheet !== basename($config_file)) {
            if (is_dir($folder . $stylesheet) && is_readable($folder . $stylesheet)) {
                $sstylesheet = $stylesheet;
                $stylesheet = iconv("GBK", "UTF-8", $stylesheet);
                $ulfolder = $folder;
                $folder = iconv("GBK", "UTF-8", $folder);
                $content1[$a] = "<tr width=100%><td><input name='select_item[d][{$stylesheet}]' type='checkbox' id='{$stylesheet}' onclick='One({$stylesheet})' class=\"checkbox\" value='" . $folder . $stylesheet . "' /></td>\n" . "<td><a href=\"" . $meurl . "?op=root&folder=" . $folder . $stylesheet . "/\">" . $stylesheet . "</a></td>\n" . "<td>" . Size(dirSize($folder . $stylesheet)) . "</td>" . "<td><a href=\"" . $meurl . "?op=root&folder=" . htmlspecialchars($folder . $stylesheet) . "/\">Enter</a></td>\n" . "<td><a href=\"" . $meurl . "?op=ren&file=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">Rename</a></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>View</a></td>\n" . "<td>" . substr(sprintf('%o', fileperms($ulfolder . $sstylesheet)), -3) . "</td></tr>\n";
                $a++;
                $folder = iconv("UTF-8", "GBK", $folder);
            } elseif (!is_dir($folder . $stylesheet) && is_readable($folder . $stylesheet)) {
                if (preg_match("/.zip\$/i", $folder . $stylesheet)) {
                    $sstylesheet = $stylesheet;
                    $ulfolder = $folder;
                    $stylesheet = iconv("GBK", "UTF-8", $stylesheet);
                    $folder = iconv("GBK", "UTF-8", $folder);
                    $content2[$b] = "<tr width=100%><td><input name='select_item[f][{$stylesheet}]' type='checkbox' id='{$stylesheet}' class=\"checkbox\" value='" . $folder . $stylesheet . "' /></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>" . $stylesheet . "</a></td>\n" . "<td>" . Size(filesize($ufolder . $sstylesheet)) . "</td>" . "<td></td>\n" . "<td><a href=\"" . $meurl . "?op=ren&file=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">Rename</a></td>\n" . "<td><a href=\"" . $meurl . "?op=unz&dename=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">Unzip</a></td>\n" . "<td>" . substr(sprintf('%o', fileperms($ulfolder . $sstylesheet)), -3) . "</a></td></tr>\n";
                    $b++;
                    $folder = iconv("UTF-8", "GBK", $folder);
                } else {
                    $sstylesheet = $stylesheet;
                    $ulfolder = $folder;
                    $stylesheet = iconv("GBK", "UTF-8", $stylesheet);
                    $folder = iconv("GBK", "UTF-8", $folder);
                    $content2[$b] = "<tr width=100%><td><input name='select_item[f][{$stylesheet}]' type='checkbox' id='{$stylesheet}' class=\"checkbox\" value='" . $folder . $stylesheet . "' /></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>" . $stylesheet . "</a></td>\n" . "<td>" . Size(filesize($ufolder . $sstylesheet)) . "</td>" . "<td><a href=\"" . $meurl . "?op=edit&fename=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">Edit</a></td>\n" . "<td><a href=\"" . $meurl . "?op=ren&file=" . htmlspecialchars($stylesheet) . "&folder={$folder}\">Rename</a></td>\n" . "<td><a href=\"" . $folder . $stylesheet . "\" target='_blank'>View</a></td>\n" . "<td>" . substr(sprintf('%o', fileperms($ulfolder . $sstylesheet)), -3) . "</a></td></tr>\n";
                    $b++;
                    $folder = iconv("UTF-8", "GBK", $folder);
                }
            }
            $count++;
        }
    }
    closedir($style);
    echo "Current directory: {$ufolder}\n" . "<div style=\"position:fixed;bottom:0;margin-left:2px;\"><input type=\"checkbox\" id=\"check\" onclick=\"Check()\"> <input class='button' name='action' type='submit' value='move' /> <input class='button' name='action' type='submit' value='copy' /> <input class='button' name='action' type='submit' onclick=\"return confirm('Click OK, the selected file will create as Backup-time.zip!')\"  value='zip' /> <input class='button' name='action' type='submit' onclick=\"return confirm('Are you sure you to delete the selected file?')\" value='delete' /> <input class='button' name='action' type='submit' onclick=\"var t=document.getElementById('chmod').value;return confirm('Modify the permissions of these files'+t+'?If it is a folder, the operating will be do for all contents!')\" value='permissions' /> <input type=\"text\" class=\"text\" stlye=\"vertical-align:text-top;\" size=\"3\" id=\"chmod\" name=\"chmod\" value=\"0755\"></div>" . "<br>File Numbers: " . $count . "<br><br>";
    echo "<tr class='table' width=100%>" . "<script>function Check(){\r\n            var collid = document.getElementById(\"check\")\r\n            var coll = document.getElementsByTagName('input')\r\n            if (collid.checked){\r\n                for(var i = 0; i < coll.length; i++)\r\n                    coll[i].checked = true;\r\n            }else{\r\n                for(var i = 0; i < coll.length; i++)\r\n                    coll[i].checked = false;\r\n            }\r\n         }</script>" . "<td width=20></td>\n" . "<td>FileName</td>\n" . "<td width=65>Size</td>\n" . "<td width=45>Enter</td>\n" . "<td width=55>Rename</td>\n" . "<td width=45>View</td>\n" . "<td width=30>Permissions</td>\n" . "</tr>";
    if ($ufolder !== "./") {
        $count = substr_count($ufolder, "/");
        $last = explode('/', $ufolder);
        $i = 1;
        $back = ".";
        while ($i < $count - 1) {
            $back = $back . "/" . $last[$i];
            $i++;
        }
        echo "<tr width=100%><td></td><td><a href=\"" . $meurl . "?op=root&folder=" . $back . "/" . "\">parent directory</a></td><td></td><td></td><td></td><td></td><td></td></tr>";
    }
    for ($a = 1; $a < count($content1) + 1; $a++) {
        $tcoloring = $a % 2 ? '#DEDEDE' : '#ededed';
        if (empty($content1)) {
        } else {
            echo @$content1[$a];
        }
    }
    for ($b = 1; $b < count($content2) + 1; $b++) {
        $tcoloring = $a++ % 2 ? '#DEDEDE' : '#ededed';
        echo @$content2[$b];
    }
    echo "</table></form>";
    mainbottom();
}