웹마스터 팁

원본사진은  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)
제목 글쓴이 날짜
[초허접기초] 하드디스크 용량을 구해보자..!! [13] SeePaGae 2004.01.24
제로 카운터 ip 체크형에서 쿠키 체크 형으로 바꾸기 [8] 정재원 2004.01.27
이미지 업로드시 자동으로 섬네일 이미지 만들어 주기 [2] 장정식 2004.02.02
많은 txt파일 db에 한번에 저장시키기 -_-;;(별 내용없으나 필요하신분은 보세요) [1] 추천대화상대 2004.02.11
cd키랑 비슷한거 만들기 -_-;; [12] 추천대화상대 2004.02.11
간단한 랜덤 게시물 구하는 간단한 소스입니다. [5] NS 2004.02.12
[허접팀]랜덤 이미지 불러오기( +_+)/" [9] 『처니리♂』 2004.02.12
한꼬마의 제로보드 활용법 (게시물 추출하기) [4] 한꼬마 2004.02.17
HTML,이미지,동영상 파일 열리지 않고 다운로드되도록 만들기(수정) [21] TheMics 2004.02.19
여러 DB에서 최근 게시물 추출하기 위한 소스 입니다. [6] NS 2004.02.21
폴더에 사진올려놓고 리스트자동으로 만들기 [7] 김인기 2004.02.22
[허접팁]윈엠프 리스트창에 방송정보 보여주기;;[수정] [5] file 『처니리♂』 2004.02.29
초간단 인라이브 방송여부 알아보기 프로그램. [12] 심심타 2004.03.01
함수] Exec 함수에 대한 간략한 설명 [3] NS 2004.03.05
PHP와 MYSQL연동 관련함수 [3] 백무혼 2004.03.07
드디어 PHP 5 RC1 발표(04.03.18) [8] 써니루루☆ 2004.03.19
배열의 정렬에 대한 약간의 강의 [2] ♡다솜지기♡ 2004.04.02
[국에 밥말아먹는 PHP 프로그래밍] 1-1. PHP는 뭐하는 밥이냐?! (상) (Build 2) [17] 9000㎒ 2004.04.18
트랙백 구현하기 - 1. 트랙백이란 무엇인가? [4] file TheMics 2004.04.18
엔지오 채널 따라하기 -_-& www자동 붙이기 [6] 박종찬 2004.04.18