웹마스터 팁

원본사진은  photo           에 만들고  
작은사진은  photo/small  에 만든다

// photo/index.php 의 내용 ============================
<style>
<!--
        .menu         {font-size: 9pt; line-height: 12pt; color: #FFFFFF;}
        .text         {font-size: 10pt; line-height: 16pt; color: #000000;}
        .text2         {font-size: 9pt; line-height: 10pt; color: #000000;}
        body, table, tr, td, th{
                  color: 000000;
                  font-family: 굴림, verdana, arial, helvetica, sans-serif;
                  font-size: 9pt;
                  }
        .copy         {font-size: 8pt; line-height: 11pt; color: #333333;}
        a:tr         {font-size: 9pt; line-height: 14pt; color: #000000;}
        a:link  { text-decoration : none; color: #000000;}
        a:visited  { text-decoration : none; color: #000000;}
        a:hover  { text-decoration : none; color: blue;}
//-->
</style>

<?php

function phpls($dir)
{
        $handle=opendir($dir);
        while ($file = readdir($handle))
        {
                $list[] = $file;
        }
        closedir($handle);
        return $list;
}

$dir="./small/";          // 현재 디렉토리

$dir=phpls($dir);
print"
        <script language=JavaScript>
        <!--
        function MM_openBrWindow(theURL,winName,features) { //v2.0
        window.open(theURL,winName,features);
        }
        //-->
        </script>
        <body bgcolor=#FFFFFF topmargin=0 leftmargin=0 background=t_back.gif>
        <br>
        <table width=100% border=1 cellpadding=0 cellspacing=1 ><tr>";
$aa=0;

while (list($key,$value) = each($dir))
{
        if (strlen($value)>5) { $value1="./".$value;  }
        if ($value) {
        if (eregi(".JPG",$value1)) {
                $img .= "<td valign=top width=150 align=center>
                        <a href='javascript:;' onClick="MM_openBrWindow('img_view.php?card=$value','','scrollbars=yes,width=800,height=600')" alt='$value1'>
                        $key: $value1<br><img src='small/$value1' border=0 width=114  style="cursor:hand;" border=0 alt='$value1'></a>
                        </td>";
        }        
        
if ($key%6==0) { $img .= "</tr><tr>"; }
}
}
$img .= "</table>";
?>
<?=$img?>
<meta http-equiv="page-enter" content="revealtrans(duration=1, transition=18)">




//photo/img_view.php 의 내용  ==============================================

<html>
<head>
<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
        <script language=JavaScript>
        <!--
        function MM_openBrWindow(theURL,winName,features) { //v2.0
        window.open(theURL,winName,features,1);
        }
        //-->
        </script>

<style type="text/css">
<!--
a {text-decoration:none;color:white;}
a.hover {text-decoration:under-line;text-transform:uppercase;color:black;}
.unnamed1 {font-family:"굴림";font-size:12px;font-style:normal;line-height:normal;}
//-->
</style>
</head>
<body bgcolor="363636" topmargin=0 leftmargin=0  onload=resize()>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
  <tr>
    <td align="center">
    <?
    
function img_resize($filename,$pixel)
{
$image_size = GetImageSize($filename);

if($image_size[0])
{
   if($image_size[0] > $pixel)
   {
     $resize = $pixel / $image_size[0];
     $re_height = (int)($image_size[1] * $resize);
     $upload_image2 =" width=$pixel height=$re_height ";
   }
   if($image_size[1] > $pixel)
   {
     $resize = $pixel / $image_size[1];
     $re_width = (int)($image_size[0] * $resize);
     $upload_image2 =" width=$re_width height=$pixel ";
   }
}

$upload_image1="<img src="$filename" ";
//if($image_size) if($image_size[0] > $pixel) $upload_image2 =" width=$pixel height=$re_height ";
$upload_image = $upload_image1.$upload_image2."  name='img_view' onclick="javascript:window.close();" style="cursor:hand;" border=0 alt='$filename'>";
//print"<br>$upload_image;";
return $upload_image;
}

    
$card1="./".$card;
$filename = "./".$card;
$pixel = "700";

$imgg= img_resize($filename,$pixel);

?>        
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td ><font color="#FFFFFF">                                
          <?
         print"$imgg";
          ?>

           <meta http-equiv="page-enter" content="revealtrans(duration=1, transition=18)">
          </td>
          <td width="16" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<script language=javascript>
<!--
self.moveTo(0,0)
        var p_height, p_width;
        p_width = document.img_view.width+10;
        p_height = document.img_view.height+10;
        self.resizeTo(p_width, p_height);
        //-->
</script>

//=================================================================

하면 자동으로 사진 리스트 만들고 그것을 클릭하면 큰사진 보여주고 .하는 프로그램입니다.
프로그램 여기저기 조림한거라 프로님들께서 조금 다듬어 주세요...


* Zective님에 의해서 게시물 이동되었습니다 (2004-02-22 19:43)
제목 글쓴이 날짜
도메인 변경 또는 설치 폴더 변경시 이미지 주소변경하기 file 해피정닷컴 2018.06.08
.htaccess 를 이용해서 도메인 접속시 xe폴더로 자동 이동 시키기 [3] file Double'U' 2014.09.25
FTP로 폴더가 삭제가 안될때~! [6] file 웹엔진 2012.01.30
사이트접속시 제로보드XE폴더로 이동되게 하는 쉬운방법 [8] 부찬™ 2007.08.17
화일첨부 디렉토리의 빈 폴더 삭제... [13] 카르마 2012.01.20
XE 설치 시 안전한 폴더권한 설정하기 (chown 사용) 컴토피아 2014.08.07
사이트 주소로 접속했을때 XE 폴더로 이동하기 팁 [42] 베니 2007.08.16
홈페이지 접속시 XE를 바로 실행하기(XE를 /xe/ 폴더에 설치한 경우) [5] Firstlove 2011.06.12
XE 를 루트로 옮기는 방법과 문제 대응책 정리 (도메인 접속시 xe폴더로 이동 없이 바로 사이트 뜨게 하기) [8] file Gekkou 2009.12.06
grep로 하위 폴더내 파일까지 내용 검색하기 fsfsdas 2011.02.20
wo.to (유료서버) 의 아파치 폴더 인증 방법. 이성헌 2005.12.15
네임서버 설정 ver.1 [/etc 폴더편] [2] 손택수 2002.10.24
제로보드 data 폴더 일괄적으로 소유권 변경 스크립트 [2] 라지엘 2002.07.01
[리눅스]proftp 에서 사용자가 상위 폴더로 이동을 못하게... [3] teenteenv 2002.02.22
웹 계정에서 지워지지 않는 폴더 및 파일 삭제하는 방법 [3] Rising.kr 2008.01.24
폴더에 사진올려놓고 리스트자동으로 만들기 [7] 김인기 2004.02.22
[추천 팁] 폴더내의 파일중에서 특정정보만 뽑아오기. [2] M2Vis 2002.07.12
폴더에 올린 mp3를 자동으로 podcast로 만들어주는 소스... ^^ [2] 하얀마법 2010.09.11
files 폴더안의 cache 폴더/파일 1초만에 지우기 [3] 999 2010.06.21
설치하여 사용 중이던 XE의 폴더 옮기기 [1] file 영구만세 2009.12.02