本文整理汇总了PHP中down_home函数的典型用法代码示例。如果您正苦于以下问题:PHP down_home函数的具体用法?PHP down_home怎么用?PHP down_home使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了down_home函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extGetParam
$GLOBALS["direction"] = extGetParam($_REQUEST, 'direction', 'ASC');
// show hidden files in QuiXplorer: (hide files starting with '.', as in Linux/UNIX)
$GLOBALS["show_hidden"] = true;
// filenames not allowed to access: (uses PCRE regex syntax)
$GLOBALS["no_access"] = "^\\.ht";
// user permissions bitfield: (1=modify, 2=password, 4=admin, add the numbers)
$GLOBALS["permissions"] = 1;
$GLOBALS['file_mode'] = 'file';
//------------------------------------------------------------------------------
$GLOBALS['ext_File'] = new ext_File();
$abs_dir = get_abs_dir($GLOBALS["dir"]);
if (!file_exists($GLOBALS["home_dir"])) {
if (!file_exists($GLOBALS["home_dir"] . $GLOBALS["separator"])) {
if (!empty($GLOBALS["require_login"])) {
$extra = "<a href=\"" . ext_make_link("logout", NULL, NULL) . "\">" . $GLOBALS["messages"]["btnlogout"] . "</A>";
} else {
$extra = NULL;
}
$GLOBALS['ERROR'] = $GLOBALS["error_msg"]["home"];
}
}
if (!down_home($abs_dir)) {
ext_Result::sendResult('', false, $GLOBALS["dir"] . " : " . $GLOBALS["error_msg"]["abovehome"]);
$dir = $GLOBALS['dir'] = $_SESSION['ext_dir'] = '';
return false;
}
if (!is_dir($abs_dir) && !is_dir($abs_dir . $GLOBALS["separator"])) {
$GLOBALS['ERROR'] = $abs_dir . " : " . $GLOBALS["error_msg"]["direxist"];
$dir = $GLOBALS['dir'] = $_SESSION['ext_dir'] = '';
}
//------------------------------------------------------------------------------
示例2: copy_move_items
/**
* File/Directory Copy & Move Functions
*/
function copy_move_items($dir)
{
// copy/move file/dir
$action = extGetParam($_REQUEST, 'action');
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult($action, false, $GLOBALS["error_msg"]["accessfunc"]);
}
// Vars
$first = extGetParam($GLOBALS['__POST'], 'first');
if ($first == "y") {
$new_dir = $dir;
} else {
$new_dir = stripslashes($GLOBALS['__POST']["new_dir"]);
}
if ($new_dir == ".") {
$new_dir = "";
}
$cnt = count($GLOBALS['__POST']["selitems"]);
// DO COPY/MOVE
// ALL OK?
if (!@$GLOBALS['ext_File']->file_exists(get_abs_dir($new_dir))) {
ext_Result::sendResult($action, false, get_abs_dir($new_dir) . ": " . $GLOBALS["error_msg"]["targetexist"]);
}
if (!get_show_item($new_dir, "")) {
ext_Result::sendResult($action, false, $new_dir . ": " . $GLOBALS["error_msg"]["accesstarget"]);
}
if (!down_home(get_abs_dir($new_dir))) {
ext_Result::sendResult($action, false, $new_dir . ": " . $GLOBALS["error_msg"]["targetabovehome"]);
}
// copy / move files
$err = false;
for ($i = 0; $i < $cnt; ++$i) {
$tmp = basename(stripslashes($GLOBALS['__POST']["selitems"][$i]));
$new = basename(stripslashes($GLOBALS['__POST']["selitems"][$i]));
if (ext_isFTPMode()) {
$abs_item = get_item_info($dir, $tmp);
$abs_new_item = get_item_info('/' . $new_dir, $new);
} else {
$abs_item = get_abs_item($dir, $tmp);
$abs_new_item = get_abs_item($new_dir, $new);
}
$items[$i] = $tmp;
// Check
if ($new == "") {
$error[$i] = $GLOBALS["error_msg"]["miscnoname"];
$err = true;
continue;
}
if (!@$GLOBALS['ext_File']->file_exists($abs_item)) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $tmp)) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
if (@$GLOBALS['ext_File']->file_exists($abs_new_item)) {
$error[$i] = $GLOBALS["error_msg"]["targetdoesexist"];
$err = true;
continue;
}
// Copy / Move
if ($action == "copy") {
if (@is_link($abs_item) || get_is_file($abs_item)) {
// check file-exists to avoid error with 0-size files (PHP 4.3.0)
if (ext_isFTPMode()) {
$abs_item = '/' . $dir . '/' . $abs_item['name'];
}
$ok = @$GLOBALS['ext_File']->copy($abs_item, $abs_new_item);
//||@file_exists($abs_new_item);
} elseif (@get_is_dir($abs_item)) {
$copy_dir = ext_isFTPMode() ? '/' . $dir . '/' . $abs_item['name'] . '/' : $abs_item;
if (ext_isFTPMode()) {
$abs_new_item .= '/';
}
$ok = $GLOBALS['ext_File']->copy_dir($copy_dir, $abs_new_item);
}
} else {
$ok = $GLOBALS['ext_File']->rename($abs_item, $abs_new_item);
}
if ($ok === false || PEAR::isError($ok)) {
$error[$i] = $action == "copy" ? $GLOBALS["error_msg"]["copyitem"] : $GLOBALS["error_msg"]["moveitem"];
if (PEAR::isError($ok)) {
$error[$i] .= ' [' . $ok->getMessage() . ']';
}
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
//.........这里部分代码省略.........
示例3: copy_move_items
//.........这里部分代码省略.........
} else {
$newitem = $selitem;
}
$s_item = $selitem;
if (strlen($s_item) > 50) {
$s_item = substr($s_item, 0, 47) . "...";
}
echo "<tr><td><img src=\"" . _QUIXPLORER_URL . "/images/information.png\" align=\"absmiddle\" alt=\"\">";
// old name
echo "<input type=\"hidden\" name=\"selitems[]\" value=\"";
echo $selitem . "\"> " . $s_item . " ";
// New Name
echo "</td><td><input type=\"text\" size=\"25\" name=\"newitems[]\" value=\"";
echo $newitem . "\"></td></tr>\n";
}
// Submit & Cancel
echo "</table><br /><table><tr>\n<td>";
echo "<input type=\"submit\" value=\"";
echo $action != "move" ? $GLOBALS["messages"]["btncopy"] : $GLOBALS["messages"]["btnmove"];
echo "\" onclick=\"javascript:Execute();\"></td>\n<td>";
echo "<input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"];
echo "\" onclick=\"javascript:location='" . make_link("list", $dir, NULL);
echo "';\"></td>\n</tr></table><br /></form>\n";
return;
}
// DO COPY/MOVE
// ALL OK?
if (!@$GLOBALS['nx_File']->file_exists(get_abs_dir($new_dir))) {
show_error(get_abs_dir($new_dir) . ": " . $GLOBALS["error_msg"]["targetexist"]);
}
if (!get_show_item($new_dir, "")) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["accesstarget"]);
}
if (!down_home(get_abs_dir($new_dir))) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetabovehome"]);
}
// copy / move files
$err = false;
for ($i = 0; $i < $cnt; ++$i) {
$tmp = stripslashes($GLOBALS['__POST']["selitems"][$i]);
$new = basename(stripslashes($GLOBALS['__POST']["newitems"][$i]));
if (nx_isFTPMode()) {
$abs_item = get_item_info($dir, $tmp);
$abs_new_item = get_item_info('/' . $new_dir, $new);
} else {
$abs_item = get_abs_item($dir, $tmp);
$abs_new_item = get_abs_item($new_dir, $new);
}
$items[$i] = $tmp;
// Check
if ($new == "") {
$error[$i] = $GLOBALS["error_msg"]["miscnoname"];
$err = true;
continue;
}
if (!@$GLOBALS['nx_File']->file_exists($abs_item)) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $tmp)) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
if (@$GLOBALS['nx_File']->file_exists($abs_new_item)) {
示例4: unzip_item
function unzip_item($dir)
{
_debug("unzip_item({$dir})");
global $home_dir;
// copy and move are only allowed if the user may read and change files
if (!permissions_grant_all($dir, NULL, array("read", "create"))) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
// Vars
$new_dir = isset($GLOBALS['__POST']["new_dir"]) ? stripslashes($GLOBALS['__POST']["new_dir"]) : $dir;
$_img = $GLOBALS["baricons"]["unzip"];
// Get Selected Item
if (!isset($GLOBALS['__POST']["item"]) && isset($GLOBALS['__GET']["item"])) {
$s_item = $GLOBALS['__GET']["item"];
} elseif (isset($GLOBALS['__POST']["item"])) {
$s_item = $GLOBALS['__POST']["item"];
}
$dir_extract = "{$home_dir}/{$new_dir}";
if ($new_dir != "") {
$dir_extract .= "/";
}
$zip_name = "{$home_dir}/{$dir}/{$s_item}";
// Get New Location & Names
if (!isset($GLOBALS['__POST']["confirm"]) || $GLOBALS['__POST']["confirm"] != "true") {
show_header($GLOBALS["messages"]["actunzipitem"]);
// JavaScript for Form:
// Select new target directory / execute action
?>
<script language="JavaScript1.2" type="text/javascript">
<!--
function NewDir(newdir) {
document.selform.new_dir.value = newdir;
document.selform.submit();
}
function Execute() {
document.selform.confirm.value = "true";
}
//-->
</script><?php
// "Copy / Move from .. to .."
$s_dir = $dir;
if (strlen($s_dir) > 40) {
$s_dir = "..." . substr($s_dir, -37);
}
$s_ndir = $new_dir;
if (strlen($s_ndir) > 40) {
$s_ndir = "..." . substr($s_ndir, -37);
}
echo "<!-- dirextr = " . $dir_extract . " -->\n";
echo "<!-- zipname = " . $zip_name . " -->\n";
echo "<CENTER><BR><BR><IMG SRC=\"" . $_img . "\" align=\"ABSMIDDLE\" ALT=\"\"> ";
echo "<IMG SRC=\"" . $GLOBALS["baricons"]["unzipto"] . "\" align=\"ABSMIDDLE\" ALT=\"\">\n";
// Form for Target Directory & New Names
echo "<BR><BR><FORM name=\"selform\" method=\"post\" action=\"";
echo make_link("post", $dir, NULL) . "\"><TABLE>\n";
echo "<INPUT type=\"hidden\" name=\"do_action\" value=\"" . $GLOBALS["action"] . "\">\n";
echo "<INPUT type=\"hidden\" name=\"confirm\" value=\"false\">\n";
//echo "<INPUT type=\"hidden\" name=\"dir\" value=\"n\">\n";
echo "<INPUT type=\"hidden\" name=\"new_dir\" value=\"" . $new_dir . "\">\n";
// List Directories to select Target
dir_print(dir_list($new_dir), $new_dir);
echo "</TABLE><BR><TABLE>\n";
// Print Text Inputs to change Names
echo "<TR><TD><IMG SRC=\"" . $GLOBALS["baricons"]["zip"] . "\" align=\"ABSMIDDLE\" ALT=\"\">";
echo "<INPUT type=\"hidden\" name=\"item\" value=\"" . $s_item . "\"> " . $s_item . " ";
// Submit & Cancel
echo "</TABLE><BR><TABLE><TR>\n<TD>";
echo "<INPUT type=\"submit\" value=\"";
echo $GLOBALS["messages"]["btnunzip"];
echo "\" onclick=\"javascript:Execute();\"></TD>\n<TD>";
echo "<input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"];
echo "\" onClick=\"javascript:location='" . make_link("list", $dir, NULL);
echo "';\"></TD>\n</TR></FORM></TABLE><BR><BR><BR>\n";
return;
}
// DO COPY/MOVE
// ALL OK?
if (!@file_exists(get_abs_dir($new_dir))) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetexist"]);
}
if (!get_show_item($new_dir, "")) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["accesstarget"]);
}
if (!down_home(get_abs_dir($new_dir))) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetabovehome"]);
}
// copy / move files
$err = false;
/*for($i=0;$i<$cnt;++$i) {
$tmp = stripslashes($GLOBALS['__POST']["selitems"][$i]);
$new = basename(stripslashes($GLOBALS['__POST']["newitems"][$i]));
$abs_item = get_abs_item($dir,$tmp);
$abs_new_item = get_abs_item($new_dir,$new);
$items[$i] = $tmp;
// Check
if($new=="") {
$error[$i]= $GLOBALS["error_msg"]["miscnoname"];
$err=true; continue;
//.........这里部分代码省略.........
示例5: unzip_item
//.........这里部分代码省略.........
$newitem=stripslashes($GLOBALS['__POST']["newitems"][$i]);
if($first=="y") $newitem=$selitem;
} else {$newitem=$selitem;}
$s_item=$selitem; if(strlen($s_item)>50) $s_item=substr($s_item,0,47)."...";
echo "<TR><TD><IMG SRC=\"".$GLOBALS["baricons"]["info"]."\" align=\"ABSMIDDLE\" ALT=\"\">";
// Old Name
echo "<INPUT type=\"hidden\" name=\"selitems[]\" value=\"";
echo $selitem."\"> ".$s_item." ";
// New Name
echo "</TD><TD><INPUT type=\"text\" size=\"25\" name=\"newitems[]\" value=\"";
echo $newitem."\"></TD></TR>\n";
}*/
echo "<TR><TD>";
//<IMG SRC=\"" . $GLOBALS["baricons"]["zip"] . "\" align=\"ABSMIDDLE\" ALT=\"\">";
echo "<INPUT type=\"hidden\" name=\"item\" value=\"" . $s_item . "\"> " . $s_item . " ";
// Submit & Cancel
echo "</TABLE><BR><TABLE><TR>\n<TD>";
if ($new_dir == 'hn') {
echo "<INPUT type=\"submit\" value=\"Rozbaliť archív\" onclick=\"javascript:Execute();\" style=\"color:#fff;background:#337ab7;display:inline-block;padding:6px 12px;font-size:16px;text-decoration:none;font-weight:400;line-height:1.4;text-align:center;white-space:nowrap;vertical-align:middle;border:1px solid #2e6da4;border-radius:4px;\">";
}
echo "</TD>\n<TD>Rovnako bude pomenovaný slug pre vydanie Horezza News. Pre zmenu názvu, je potrebné zmeniť názov ZIP súboru, pred nahraním.<br>";
echo "<input type=\"button\" value=\"Zrušiť\" onClick=\"javascript:location='" . make_link("list", $dir, NULL);
echo "';\" style=\"color:#333;background:#fff;display:inline-block;padding:6px 12px;font-size:16px;text-decoration:none;font-weight:400;line-height:1.4;text-align:center;white-space:nowrap;vertical-align:middle;border:1px solid #ccc;border-radius:4px;\"></TD>\n</TR></FORM></TABLE><BR>\n";
return;
}
// DO COPY/MOVE
// ALL OK?
if (!@file_exists(get_abs_dir($new_dir))) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetexist"]);
}
if (!get_show_item($new_dir, "")) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["accesstarget"]);
}
if (!down_home(get_abs_dir($new_dir))) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetabovehome"]);
}
// copy / move files
$err = false;
/*for($i=0;$i<$cnt;++$i) {
$tmp = stripslashes($GLOBALS['__POST']["selitems"][$i]);
$new = basename(stripslashes($GLOBALS['__POST']["newitems"][$i]));
$abs_item = get_abs_item($dir,$tmp);
$abs_new_item = get_abs_item($new_dir,$new);
$items[$i] = $tmp;
// Check
if($new=="") {
$error[$i]= $GLOBALS["error_msg"]["miscnoname"];
$err=true; continue;
}
if(!@file_exists($abs_item)) {
$error[$i]= $GLOBALS["error_msg"]["itemexist"];
$err=true; continue;
}
if(!get_show_item($dir, $tmp)) {
$error[$i]= $GLOBALS["error_msg"]["accessitem"];
$err=true; continue;
}
if(@file_exists($abs_new_item)) {
$error[$i]= $GLOBALS["error_msg"]["targetdoesexist"];
$err=true; continue;
}
*/
// Copy / Move
//if($GLOBALS["action"]=="copy") {
//if($GLOBALS["action"]=="unzip") {
示例6: copy_move_items
//.........这里部分代码省略.........
if ($first == "y") {
$newitem = $selitem;
}
} else {
$newitem = $selitem;
}
$s_item = $selitem;
if (strlen($s_item) > 50) {
$s_item = substr($s_item, 0, 47) . "...";
}
echo "<TR><TD><IMG SRC=\"_img/_info.gif\" align=\"ABSMIDDLE\" ALT=\"\">";
// Old Name
echo "<INPUT type=\"hidden\" name=\"selitems[]\" value=\"";
echo htmlspecialchars($selitem) . "\"> " . htmlspecialchars($s_item) . " ";
// New Name
echo "</TD><TD><INPUT type=\"text\" size=\"25\" name=\"newitems[]\" value=\"";
echo htmlspecialchars($newitem) . "\"></TD></TR>\n";
}
// Submit & Cancel
echo "</TABLE><BR><TABLE><TR>\n<TD>";
echo "<INPUT type=\"submit\" value=\"";
echo $GLOBALS["action"] != "move" ? $GLOBALS["messages"]["btncopy"] : $GLOBALS["messages"]["btnmove"];
echo "\" onclick=\"javascript:Execute();\"></TD>\n<TD>";
echo "<input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"];
echo "\" onClick=\"javascript:location='" . make_link("list", $dir, NULL);
echo "';\"></TD>\n</TR></FORM></TABLE><BR>\n";
return;
}
// DO COPY/MOVE
// ALL OK?
if (!@file_exists(get_abs_dir($new_dir))) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetexist"]);
}
if (!get_show_item($new_dir, "")) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["accesstarget"]);
}
if (!down_home(get_abs_dir($new_dir))) {
show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetabovehome"]);
}
// copy / move files
$err = false;
for ($i = 0; $i < $cnt; ++$i) {
$tmp = $GLOBALS['__POST']["selitems"][$i];
$new = basename($GLOBALS['__POST']["newitems"][$i]);
$abs_item = get_abs_item($dir, $tmp);
$abs_new_item = get_abs_item($new_dir, $new);
$items[$i] = $tmp;
// Check
if ($new == "") {
$error[$i] = $GLOBALS["error_msg"]["miscnoname"];
$err = true;
continue;
}
if (!@file_exists($abs_item)) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $tmp)) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
if (@file_exists($abs_new_item)) {
$error[$i] = $GLOBALS["error_msg"]["targetdoesexist"];
$err = true;
continue;
}
// Copy / Move
if ($GLOBALS["action"] == "copy") {
if (@is_link($abs_item) || @is_file($abs_item)) {
// check file-exists to avoid error with 0-size files (PHP 4.3.0)
$ok = @copy($abs_item, $abs_new_item);
//||@file_exists($abs_new_item);
} elseif (@is_dir($abs_item)) {
$ok = copy_dir($abs_item, $abs_new_item);
}
} else {
$ok = @rename($abs_item, $abs_new_item);
}
if ($ok === false) {
$error[$i] = $GLOBALS["action"] == "copy" ? $GLOBALS["error_msg"]["copyitem"] : $GLOBALS["error_msg"]["moveitem"];
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n";
}
show_error($err_msg);
}
header("Location: " . make_link("list", $dir, NULL));
}