묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
웹하드랑 비슷한 소스인데요.. 도와주세요 1/2
2002.12.30 17:36
안녕하세요.. 웹하드랑 어울동 비슷한 소스를 가져와서 이것저것 수정을 하고 있는데요.
프로그램쪽으로는 잼뱅이라 정말 중요한 기능을 수정하지 못하고 있어서요 꼭좀 부탁드릴게요
폴더 통채로 삭제하기/ 파일 여러개 삭제하기 이 2가지 기능을 첨부하고 싶습니다.
프로그램에 일각연이 있으신 선배님들 부탁드립니다. 아래 소스 뿌려놓겠습니다. 파일이 하나거든요 .. 그럼..
소스 쫘악 복사하셔서 파일하나 만드신다음에 서버 아무대나 올리시면 됩니다.
그리고 익스플로워로 실행시키시면 나옵니다... 프로그램에 일각연이 있으신분 부탁좀 드릴게요
죄송합니다. 한번에 올라가지가 않아서요.. 2개로 올렸습니다. 파일 하나로 만드신 다음에 익스플로워에서 실행시키면 됩니다.
<?php
/* Copyright 1999 by John Martin d/b/a www.ANYPORTAL.com */
/* All Rights Reserved. */
/* */
/* This software is freeware and is not in the public domain. */
/* You are hereby granted the right to freely distribute this */
/* software as long as this copyright notice remains in place. */
/* */
/* Comments or suggestions? email: andmore@alief.com */
/* */
/* This is the PHP port: AnyPortal(php)-0.1 */
/* ======================================== */
/* */
/* PHP version 2000 by Stefan@Wiesendanger.org */
/* No Rights Reserved. What for, anyhow ? */
/* */
/* Date Remarks */
/* --------- ----------------------------------------------- */
/* 25 MAY 99 original ASP version */
/* 17 SEP 99 change upload from SA-FILEUP to aspSmartUpload */
/* 10 APR 00 simplified PHP3 version */
/* 18 APR 00 most of PHP3 port working. Slight modifications */
/* 22 APR 00 modified syntax highlighting, no absolute paths */
/* revealed, PHP builtin authentication, global */
/* style sheet as callback, use apache default */
/* icons as an alternative to the wingdings font. */
/* 25 APR 00 catch some exceptions (not foolproof yet) */
/* 26 APR 00 catch some more exceptions, implicit copy */
/* function by saving somewhere else in the detail */
/* view, MD5 hashed password. */
/* 27 APR 00 Fixed authentication bug */
/* 12 MAY 00 Fixed trouble with exec() with newer versions of */
/* PHP3. Fixed bug which would send you to a non- */
/* existent address after file modifications. */
//////////////////////////////////////////////////////////////////
// TODO : Don't let the file be modified itself. Create a hash of
// it (kinda hard since it's self-referential ;-). Make better use
// of session management. Escapeshellcmd for all user input.
//////////////////////////////////////////////////////////////////
// GLOBAL PARAMETERS
// =================
// Make modifications here to suit siteman to your needs
// error_reporting(4) ; // how verbose ?
// username/password should not be system
// usernames/passwords !!
// your (hashed) username/password here
$gblPw = "hash_of_your_username_and_password" ;
$gblAuth = false ; // use builtin authentication
$gblHash = "md5" ; // hash function to use
// choose GifIcon below unless you have the M$
// WingDings font installed on your system
$gblIcon = "GifIcon" ; // MockIcon or GifIcon
// the directory below should be /icons/ or /icons/small/
// on Apache; a set of icons is included in the distribution
$gblIconLocation = "icons/" ;
// files you want to be able to edit in text mode
// and view with (primitive) syntax highlighting
$gblEditable = array( ".txt",".asa",".asp",".htm",".html",
".cfm",".php3",".php",".phtml",
".shtml",".css" ) ;
// files that will display as images on the detail page
// (useless if your browser doesn't support them)
$gblImages = array( ".jpg",".jpeg",".gif",".png",".ico",
".bmp",".xbm") ;
//////////////////////////////////////////////////////////////////
function StartHTML($title,$text="") {
$title = "Site Manager " . $title ;
$host = $GLOBALS["HTTP_HOST"] ;
$self = $GLOBALS["PHP_SELF"] ;
?>
<HTML>
<HEAD>
<TITLE><?php echo $host . " " . $title ?></TITLE>
<META NAME="description" CONTENT="PHP port of AnyPortal Site Manager">
<META NAME="keywords" CONTENT="site manager, web site maintenance">
<META NAME="robots" CONTENT="noindex">
<META HTTP-EQUIV="expires" CONTENT="0">
<LINK REL="stylesheet" TYPE="text/css"
HREF="<?php echo $self ?>?STYLE=get">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H3 ALIGN="RIGHT"><?php echo $host ?></H3>
<!--
<TABLE BORDER=0 WIDTH="100%"><TR>
<TD CLASS=INV><?//php echo $title ?></TD></TR></TABLE>
<P><?//php echo $text ?></P>-->
<?php
} // end function StartHTML
//////////////////////////////////////////////////////////////////
function EndHTML() {
?>
<HR>
<P CLASS=FTR>
<?php echo date("D, F d, Y") ?> -<?php echo date("g:i:sA") ?>
</P>
<BR><BR><BR></BODY></HTML>
<?php
} // end function EndHTML
//////////////////////////////////////////////////////////////////
function CSS() {
?>
BODY,TD,P,H1,H2,H3 { font-family:Helvetica,Arial,sans-serif; }
.BLK { color:black; }
.RED { color:red; }
.TOP { color:red; font-size:70%; } /* table headings */
.INV { color:white; background-color:navy;
font-weight:bold; font-size:120%; } /* title */
.FTR { } /* footer */
.LST { background-color:#E0E0E0; } /* table cells */
.BAR { background-color:#E0E0E0; } /* action bar */
PRE { color:blue; font-family:Lucida Console,Courier New,
Courier,sans-serif; } /* source code */
EM { color:green; font-style:normal; } /* line numbers */
.REM { color:silver; }
.XML { color:navy; background-color:yellow; }
.MCK { color:red; font-family:WingDings; } /* Mock Icons */
A:HOVER { color:red; }
<?php
} // end function CSS
//////////////////////////////////////////////////////////////////
function DetailPage($fsRoot,$relDir,$fn) {
global $gblEditable, $gblImages ;
$self = $GLOBALS["PHP_SELF"] ;
$relPath = $relDir . "/" . $fn ;
$fsPath = $fsRoot . $relPath ;
$fsDir = $fsRoot . $relDir ;
$exists = file_exists($fsPath) ;
$ext = strtolower(strrchr($relPath,".")) ;
$editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ;
$writable = Writeable($fsPath) ;
if (!$editable && !$exists)
Error("Creation unsupported for type",$relPath) ;
if (!exists && !Writeable($fsDir) )
Error("Creation denied",$relDir) ;
$text = "Use this page to view, modify or " ;
$text .= "delete a single document on this " ;
$text .= "web site." ;
$title = "(Detail Page)" ;
StartHTML($title, $text) ;
echo "<H3>삭제할 파일명 : " . $relDir . "/" . $fn . "</H3>" ;
if ($exists) { // get file info
$fsize = filesize($fsPath) ;
$fmodified = date("d/M/y G:i:s", filemtime($fsPath)) ;
$faccessed = date("d/M/y G:i:s", fileatime($fsPath)) ;
echo "<PRE>파일 크기 : " . $fsize . " Bytes<BR>" ;
echo "마지막 수정 날짜 : <B>" . $fmodified . "</B><BR>" ;
echo "마지막 확인 날짜 : <B>" . $faccessed . "</B><BR>" ;
// echo " owner: <B>" . fileowner($fsPath) . "</B><BR>" ;
// echo " group: <B>" . filegroup($fsPath) . "</B><BR>" ;
// echo " permissions: <B>" ;
// echo printf( "%o", fileperms($fsPath) ) . "</B>" ;
echo "</PRE>" ;
}
if ( $editable && ($writable || !$exists) ) {
$fh = fopen($fsPath,"a+") ;
rewind($fh) ;
$fstr = fread($fh,filesize($fsPath)) ;
fclose($fh) ;
$fstr = htmlentities( $fstr ) ;
?>
<FORM ACTION="<?php echo $self ; ?>" METHOD="POST">
<SPAN TITLE="Click [SAVE] to store updated contents.">
<B>DOCUMENT CONTENTS</B>
</SPAN><BR>
<TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php
echo($fstr) ; ?></TEXTAREA>
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE">
<INPUT TYPE="TEXT" SIZE=48 MAXLENGTH=255 NAME="RELPATH"
VALUE="<?php echo $relPath ; ?>">
<INPUT TYPE="RESET" VALUE="RESET">
<INPUT TYPE="SUBMIT" VALUE="SAVE">
</FORM>
<?php
}
/* else if ( strstr( join(" ",$gblImages), $ext ) ) {
$info = getimagesize($fsPath) ;
$tstr = "<IMG SRC="". $relPath . "" BORDER=0 " ;
$tstr .= $info[3] . " ALT="" . $fn . " - " ;
$tstr .= (int)(($fsize+1023)/1024) . "Kb">" ;
echo htmlentities($tstr) . "<BR><BR>" . $tstr ;
} */
?>
<FORM ACTION="<?php echo $self ; ?>" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="취소"><BR>
<?php
if ($exists && $writable) {
?>
<HR><SPAN TITLE="Check OK and click [DELETE] to delete.">
<B>정말로 다음 파일을 삭제 하시겠습니까? "<?php echo $fn ; ?>"? (체크후 DELETE를 눌러주세요)</B></SPAN>
<INPUT TYPE="CHECKBOX" NAME="CONFIRM">
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE">
<?php
}
echo "</FORM>" ;
EndHTML() ;
} // end function DetailPage
//////////////////////////////////////////////////////////////////
function DisplayCode($fsRoot,$relDir,$fn) {
$path = $fsRoot . $relDir . "/" . $fn ;
if (!file_exists($path)) Error("File not found",$path) ;
StartHTML("(".$relDir."/".$fn.")","");
$tstr = join("",file($path)) ;
$tstr = htmlentities($tstr) ;
// Tabs
$tstr = str_replace(chr(9)," ",$tstr) ;
// ASP tags & XML/PHP tags
$aspbeg = "<SPAN CLASS=XML><%</SPAN><SPAN CLASS=BLK>" ;
$aspend = "</SPAN><SPAN CLASS=XML>%></SPAN>" ;
$tstr = str_replace("<%",$aspbeg,$tstr) ;
$tstr = str_replace("%>",$aspend,$tstr) ;
$xmlbeg = "<SPAN CLASS=XML><?</SPAN><SPAN CLASS=BLK>" ;
$xmlend = "</SPAN><SPAN CLASS=XML>?></SPAN>" ;
$tstr = str_replace("<?",$xmlbeg,$tstr) ;
$tstr = str_replace("?>",$xmlend,$tstr) ;
// C style comment
$tstr = str_replace("/*","<SPAN CLASS=REM>/*",$tstr) ;
$tstr = str_replace("*/","*/</SPAN>",$tstr) ;
// HTML comments
$tstr = str_replace("<!--","<I CLASS=RED><!--",$tstr) ;
$tstr = str_replace("-->","--></I>",$tstr) ;
echo "<PRE>" ;
$tstr = split("n",$tstr) ;
for ($i = 0 ; $i < sizeof($tstr) ; ++$i) {
// add line numbers
echo "<BR><EM>" ;
echo substr(("000" . ($i+1)), -4) . ":</EM> " ;
$line = $tstr[$i] ;
// C++ style comments
$pos = strpos($line,"//") ;
// exceptions: two slashes aren't a script comment
if (strstr($line,"//") &&
! ($pos>0 && substr($line,$pos-1,1)==":") &&
! (substr($line,$pos,8) == "//-->") &&
! (substr($line,$pos,9) == "// -->")) {
$beg = substr($line,0,strpos($line,"//")) ;
$end = strstr($line,"//") ;
$line = $beg."<SPAN CLASS=REM>".$end."</SPAN>";
}
// shell & asp style comments
$first = substr(ltrim($line),0,1) ;
if ($first == "#" || $first == "'") {
$line = "<SPAN CLASS=REM>".$line."</SPAN>";
}
print($line) ;
} // next i
echo "</PRE>" ;
EndHTML() ;
} // end function DisplayCode
//////////////////////////////////////////////////////////////////
function MockIcon($txt) {
$tstr = "<SPAN CLASS=MCK>" ;
switch (strtolower($txt)) {
case ".bmp" :
case ".gif" :
case ".jpg" :
case ".jpeg":
case ".tif" :
case ".tiff":
$d = 176 ;
break ;
case ".doc" :
$d = 50 ;
break ;
case ".exe" :
case ".bat" :
$d = 255 ;
break ;
case ".bas" :
case ".c" :
case ".cc" :
case ".src" :
$d = 255 ;
break ;
case "file" :
$d = 51 ;
break ;
case "fldr" :
$d = 48 ;
break ;
case ".htm" :
case ".html":
case ".asa" :
case ".asp" :
case ".cfm" :
case ".php3":
case ".php" :
case ".phtml" :
case ".shtml" :
$d = 182 ;
break ;
case ".pdf" :
$d = 38 ;
break;
case ".txt" :
case ".ini" :
$d = 52 ;
break ;
case ".xls" :
$d = 252 ;
break ;
case ".zip" :
case ".arc" :
case ".sit" :
case ".tar" :
case ".gz" :
case ".tgz" :
case ".Z" :
$d = 59 ;
break ;
case "view" :
$d = 52 ;
break ;
case "up" :
$d = 199 ;
break ;
case "blank" :
return " </SPAN>" ;
break ;
default :
$d = 51 ;
}
return $tstr . chr($d) . "</SPAN>" ;
} // end function MockIcon
//////////////////////////////////////////////////////////////////
function GifIcon($txt) {
global $gblIconLocation ;
switch (strtolower($txt)) {
case ".bmp" :
case ".gif" :
case ".jpg" :
case ".jpeg":
case ".tif" :
case ".tiff":
$d = "image2.gif" ;
break ;
case ".doc" :
$d = "layout.gif" ;
break ;
case ".exe" :
case ".bat" :
$d = "screw2.gif" ;
break ;
case ".bas" :
case ".c" :
case ".cc" :
case ".src" :
$d = "c.gif" ;
break ;
case "file" :
$d = "generic.gif" ;
break ;
case "fldr" :
$d = "dir.gif" ;
break ;
case ".phps" :
$d = "phps.gif" ;
break ;
case ".php3" :
$d = "php3.gif" ;
break ;
case ".htm" :
case ".html":
case ".asa" :
case ".asp" :
case ".cfm" :
case ".php3":
case ".php" :
case ".phtml" :
case ".shtml" :
$d = "world1.gif" ;
break ;
case ".pdf" :
$d = "pdf.gif" ;
break;
case ".txt" :
case ".ini" :
$d = "text.gif" ;
break ;
case ".xls" :
$d = "box2.gif" ;
break ;
case ".zip" :
case ".arc" :
case ".sit" :
case ".tar" :
case ".gz" :
case ".tgz" :
case ".Z" :
$d = "compressed.gif" ;
break ;
case "view" :
$d = "index.gif" ;
break ;
case "up" :
$d = "back.gif" ;
break ;
case "blank" :
$d = "blank.gif" ;
break ;
default :
$d = "generic.gif" ;
}
return "<IMG SRC="$gblIconLocation" . $d . "" BORDER=0>" ;
} // end function GifIcon
프로그램쪽으로는 잼뱅이라 정말 중요한 기능을 수정하지 못하고 있어서요 꼭좀 부탁드릴게요
폴더 통채로 삭제하기/ 파일 여러개 삭제하기 이 2가지 기능을 첨부하고 싶습니다.
프로그램에 일각연이 있으신 선배님들 부탁드립니다. 아래 소스 뿌려놓겠습니다. 파일이 하나거든요 .. 그럼..
소스 쫘악 복사하셔서 파일하나 만드신다음에 서버 아무대나 올리시면 됩니다.
그리고 익스플로워로 실행시키시면 나옵니다... 프로그램에 일각연이 있으신분 부탁좀 드릴게요
죄송합니다. 한번에 올라가지가 않아서요.. 2개로 올렸습니다. 파일 하나로 만드신 다음에 익스플로워에서 실행시키면 됩니다.
<?php
/* Copyright 1999 by John Martin d/b/a www.ANYPORTAL.com */
/* All Rights Reserved. */
/* */
/* This software is freeware and is not in the public domain. */
/* You are hereby granted the right to freely distribute this */
/* software as long as this copyright notice remains in place. */
/* */
/* Comments or suggestions? email: andmore@alief.com */
/* */
/* This is the PHP port: AnyPortal(php)-0.1 */
/* ======================================== */
/* */
/* PHP version 2000 by Stefan@Wiesendanger.org */
/* No Rights Reserved. What for, anyhow ? */
/* */
/* Date Remarks */
/* --------- ----------------------------------------------- */
/* 25 MAY 99 original ASP version */
/* 17 SEP 99 change upload from SA-FILEUP to aspSmartUpload */
/* 10 APR 00 simplified PHP3 version */
/* 18 APR 00 most of PHP3 port working. Slight modifications */
/* 22 APR 00 modified syntax highlighting, no absolute paths */
/* revealed, PHP builtin authentication, global */
/* style sheet as callback, use apache default */
/* icons as an alternative to the wingdings font. */
/* 25 APR 00 catch some exceptions (not foolproof yet) */
/* 26 APR 00 catch some more exceptions, implicit copy */
/* function by saving somewhere else in the detail */
/* view, MD5 hashed password. */
/* 27 APR 00 Fixed authentication bug */
/* 12 MAY 00 Fixed trouble with exec() with newer versions of */
/* PHP3. Fixed bug which would send you to a non- */
/* existent address after file modifications. */
//////////////////////////////////////////////////////////////////
// TODO : Don't let the file be modified itself. Create a hash of
// it (kinda hard since it's self-referential ;-). Make better use
// of session management. Escapeshellcmd for all user input.
//////////////////////////////////////////////////////////////////
// GLOBAL PARAMETERS
// =================
// Make modifications here to suit siteman to your needs
// error_reporting(4) ; // how verbose ?
// username/password should not be system
// usernames/passwords !!
// your (hashed) username/password here
$gblPw = "hash_of_your_username_and_password" ;
$gblAuth = false ; // use builtin authentication
$gblHash = "md5" ; // hash function to use
// choose GifIcon below unless you have the M$
// WingDings font installed on your system
$gblIcon = "GifIcon" ; // MockIcon or GifIcon
// the directory below should be /icons/ or /icons/small/
// on Apache; a set of icons is included in the distribution
$gblIconLocation = "icons/" ;
// files you want to be able to edit in text mode
// and view with (primitive) syntax highlighting
$gblEditable = array( ".txt",".asa",".asp",".htm",".html",
".cfm",".php3",".php",".phtml",
".shtml",".css" ) ;
// files that will display as images on the detail page
// (useless if your browser doesn't support them)
$gblImages = array( ".jpg",".jpeg",".gif",".png",".ico",
".bmp",".xbm") ;
//////////////////////////////////////////////////////////////////
function StartHTML($title,$text="") {
$title = "Site Manager " . $title ;
$host = $GLOBALS["HTTP_HOST"] ;
$self = $GLOBALS["PHP_SELF"] ;
?>
<HTML>
<HEAD>
<TITLE><?php echo $host . " " . $title ?></TITLE>
<META NAME="description" CONTENT="PHP port of AnyPortal Site Manager">
<META NAME="keywords" CONTENT="site manager, web site maintenance">
<META NAME="robots" CONTENT="noindex">
<META HTTP-EQUIV="expires" CONTENT="0">
<LINK REL="stylesheet" TYPE="text/css"
HREF="<?php echo $self ?>?STYLE=get">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H3 ALIGN="RIGHT"><?php echo $host ?></H3>
<!--
<TABLE BORDER=0 WIDTH="100%"><TR>
<TD CLASS=INV><?//php echo $title ?></TD></TR></TABLE>
<P><?//php echo $text ?></P>-->
<?php
} // end function StartHTML
//////////////////////////////////////////////////////////////////
function EndHTML() {
?>
<HR>
<P CLASS=FTR>
<?php echo date("D, F d, Y") ?> -<?php echo date("g:i:sA") ?>
</P>
<BR><BR><BR></BODY></HTML>
<?php
} // end function EndHTML
//////////////////////////////////////////////////////////////////
function CSS() {
?>
BODY,TD,P,H1,H2,H3 { font-family:Helvetica,Arial,sans-serif; }
.BLK { color:black; }
.RED { color:red; }
.TOP { color:red; font-size:70%; } /* table headings */
.INV { color:white; background-color:navy;
font-weight:bold; font-size:120%; } /* title */
.FTR { } /* footer */
.LST { background-color:#E0E0E0; } /* table cells */
.BAR { background-color:#E0E0E0; } /* action bar */
PRE { color:blue; font-family:Lucida Console,Courier New,
Courier,sans-serif; } /* source code */
EM { color:green; font-style:normal; } /* line numbers */
.REM { color:silver; }
.XML { color:navy; background-color:yellow; }
.MCK { color:red; font-family:WingDings; } /* Mock Icons */
A:HOVER { color:red; }
<?php
} // end function CSS
//////////////////////////////////////////////////////////////////
function DetailPage($fsRoot,$relDir,$fn) {
global $gblEditable, $gblImages ;
$self = $GLOBALS["PHP_SELF"] ;
$relPath = $relDir . "/" . $fn ;
$fsPath = $fsRoot . $relPath ;
$fsDir = $fsRoot . $relDir ;
$exists = file_exists($fsPath) ;
$ext = strtolower(strrchr($relPath,".")) ;
$editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ;
$writable = Writeable($fsPath) ;
if (!$editable && !$exists)
Error("Creation unsupported for type",$relPath) ;
if (!exists && !Writeable($fsDir) )
Error("Creation denied",$relDir) ;
$text = "Use this page to view, modify or " ;
$text .= "delete a single document on this " ;
$text .= "web site." ;
$title = "(Detail Page)" ;
StartHTML($title, $text) ;
echo "<H3>삭제할 파일명 : " . $relDir . "/" . $fn . "</H3>" ;
if ($exists) { // get file info
$fsize = filesize($fsPath) ;
$fmodified = date("d/M/y G:i:s", filemtime($fsPath)) ;
$faccessed = date("d/M/y G:i:s", fileatime($fsPath)) ;
echo "<PRE>파일 크기 : " . $fsize . " Bytes<BR>" ;
echo "마지막 수정 날짜 : <B>" . $fmodified . "</B><BR>" ;
echo "마지막 확인 날짜 : <B>" . $faccessed . "</B><BR>" ;
// echo " owner: <B>" . fileowner($fsPath) . "</B><BR>" ;
// echo " group: <B>" . filegroup($fsPath) . "</B><BR>" ;
// echo " permissions: <B>" ;
// echo printf( "%o", fileperms($fsPath) ) . "</B>" ;
echo "</PRE>" ;
}
if ( $editable && ($writable || !$exists) ) {
$fh = fopen($fsPath,"a+") ;
rewind($fh) ;
$fstr = fread($fh,filesize($fsPath)) ;
fclose($fh) ;
$fstr = htmlentities( $fstr ) ;
?>
<FORM ACTION="<?php echo $self ; ?>" METHOD="POST">
<SPAN TITLE="Click [SAVE] to store updated contents.">
<B>DOCUMENT CONTENTS</B>
</SPAN><BR>
<TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php
echo($fstr) ; ?></TEXTAREA>
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE">
<INPUT TYPE="TEXT" SIZE=48 MAXLENGTH=255 NAME="RELPATH"
VALUE="<?php echo $relPath ; ?>">
<INPUT TYPE="RESET" VALUE="RESET">
<INPUT TYPE="SUBMIT" VALUE="SAVE">
</FORM>
<?php
}
/* else if ( strstr( join(" ",$gblImages), $ext ) ) {
$info = getimagesize($fsPath) ;
$tstr = "<IMG SRC="". $relPath . "" BORDER=0 " ;
$tstr .= $info[3] . " ALT="" . $fn . " - " ;
$tstr .= (int)(($fsize+1023)/1024) . "Kb">" ;
echo htmlentities($tstr) . "<BR><BR>" . $tstr ;
} */
?>
<FORM ACTION="<?php echo $self ; ?>" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="취소"><BR>
<?php
if ($exists && $writable) {
?>
<HR><SPAN TITLE="Check OK and click [DELETE] to delete.">
<B>정말로 다음 파일을 삭제 하시겠습니까? "<?php echo $fn ; ?>"? (체크후 DELETE를 눌러주세요)</B></SPAN>
<INPUT TYPE="CHECKBOX" NAME="CONFIRM">
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE">
<?php
}
echo "</FORM>" ;
EndHTML() ;
} // end function DetailPage
//////////////////////////////////////////////////////////////////
function DisplayCode($fsRoot,$relDir,$fn) {
$path = $fsRoot . $relDir . "/" . $fn ;
if (!file_exists($path)) Error("File not found",$path) ;
StartHTML("(".$relDir."/".$fn.")","");
$tstr = join("",file($path)) ;
$tstr = htmlentities($tstr) ;
// Tabs
$tstr = str_replace(chr(9)," ",$tstr) ;
// ASP tags & XML/PHP tags
$aspbeg = "<SPAN CLASS=XML><%</SPAN><SPAN CLASS=BLK>" ;
$aspend = "</SPAN><SPAN CLASS=XML>%></SPAN>" ;
$tstr = str_replace("<%",$aspbeg,$tstr) ;
$tstr = str_replace("%>",$aspend,$tstr) ;
$xmlbeg = "<SPAN CLASS=XML><?</SPAN><SPAN CLASS=BLK>" ;
$xmlend = "</SPAN><SPAN CLASS=XML>?></SPAN>" ;
$tstr = str_replace("<?",$xmlbeg,$tstr) ;
$tstr = str_replace("?>",$xmlend,$tstr) ;
// C style comment
$tstr = str_replace("/*","<SPAN CLASS=REM>/*",$tstr) ;
$tstr = str_replace("*/","*/</SPAN>",$tstr) ;
// HTML comments
$tstr = str_replace("<!--","<I CLASS=RED><!--",$tstr) ;
$tstr = str_replace("-->","--></I>",$tstr) ;
echo "<PRE>" ;
$tstr = split("n",$tstr) ;
for ($i = 0 ; $i < sizeof($tstr) ; ++$i) {
// add line numbers
echo "<BR><EM>" ;
echo substr(("000" . ($i+1)), -4) . ":</EM> " ;
$line = $tstr[$i] ;
// C++ style comments
$pos = strpos($line,"//") ;
// exceptions: two slashes aren't a script comment
if (strstr($line,"//") &&
! ($pos>0 && substr($line,$pos-1,1)==":") &&
! (substr($line,$pos,8) == "//-->") &&
! (substr($line,$pos,9) == "// -->")) {
$beg = substr($line,0,strpos($line,"//")) ;
$end = strstr($line,"//") ;
$line = $beg."<SPAN CLASS=REM>".$end."</SPAN>";
}
// shell & asp style comments
$first = substr(ltrim($line),0,1) ;
if ($first == "#" || $first == "'") {
$line = "<SPAN CLASS=REM>".$line."</SPAN>";
}
print($line) ;
} // next i
echo "</PRE>" ;
EndHTML() ;
} // end function DisplayCode
//////////////////////////////////////////////////////////////////
function MockIcon($txt) {
$tstr = "<SPAN CLASS=MCK>" ;
switch (strtolower($txt)) {
case ".bmp" :
case ".gif" :
case ".jpg" :
case ".jpeg":
case ".tif" :
case ".tiff":
$d = 176 ;
break ;
case ".doc" :
$d = 50 ;
break ;
case ".exe" :
case ".bat" :
$d = 255 ;
break ;
case ".bas" :
case ".c" :
case ".cc" :
case ".src" :
$d = 255 ;
break ;
case "file" :
$d = 51 ;
break ;
case "fldr" :
$d = 48 ;
break ;
case ".htm" :
case ".html":
case ".asa" :
case ".asp" :
case ".cfm" :
case ".php3":
case ".php" :
case ".phtml" :
case ".shtml" :
$d = 182 ;
break ;
case ".pdf" :
$d = 38 ;
break;
case ".txt" :
case ".ini" :
$d = 52 ;
break ;
case ".xls" :
$d = 252 ;
break ;
case ".zip" :
case ".arc" :
case ".sit" :
case ".tar" :
case ".gz" :
case ".tgz" :
case ".Z" :
$d = 59 ;
break ;
case "view" :
$d = 52 ;
break ;
case "up" :
$d = 199 ;
break ;
case "blank" :
return " </SPAN>" ;
break ;
default :
$d = 51 ;
}
return $tstr . chr($d) . "</SPAN>" ;
} // end function MockIcon
//////////////////////////////////////////////////////////////////
function GifIcon($txt) {
global $gblIconLocation ;
switch (strtolower($txt)) {
case ".bmp" :
case ".gif" :
case ".jpg" :
case ".jpeg":
case ".tif" :
case ".tiff":
$d = "image2.gif" ;
break ;
case ".doc" :
$d = "layout.gif" ;
break ;
case ".exe" :
case ".bat" :
$d = "screw2.gif" ;
break ;
case ".bas" :
case ".c" :
case ".cc" :
case ".src" :
$d = "c.gif" ;
break ;
case "file" :
$d = "generic.gif" ;
break ;
case "fldr" :
$d = "dir.gif" ;
break ;
case ".phps" :
$d = "phps.gif" ;
break ;
case ".php3" :
$d = "php3.gif" ;
break ;
case ".htm" :
case ".html":
case ".asa" :
case ".asp" :
case ".cfm" :
case ".php3":
case ".php" :
case ".phtml" :
case ".shtml" :
$d = "world1.gif" ;
break ;
case ".pdf" :
$d = "pdf.gif" ;
break;
case ".txt" :
case ".ini" :
$d = "text.gif" ;
break ;
case ".xls" :
$d = "box2.gif" ;
break ;
case ".zip" :
case ".arc" :
case ".sit" :
case ".tar" :
case ".gz" :
case ".tgz" :
case ".Z" :
$d = "compressed.gif" ;
break ;
case "view" :
$d = "index.gif" ;
break ;
case "up" :
$d = "back.gif" ;
break ;
case "blank" :
$d = "blank.gif" ;
break ;
default :
$d = "generic.gif" ;
}
return "<IMG SRC="$gblIconLocation" . $d . "" BORDER=0>" ;
} // end function GifIcon