웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
폴더에 사진올려놓고 리스트자동으로 만들기
2004.02.22 17:35
원본사진은 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)
작은사진은 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)
댓글 7
-
그냥이렇게。
2004.02.23 12:31
-
9000㎒
2004.02.23 18:49
이게 Javascript 코너에 올라와있었다면 믿으시겠어요?! [킁킁;]
어쨋거나 좋은 소스입니다 [-_-] -
NS
2004.02.24 06:21
A... Ju Gun Ju Doo Sa Yong hat Dun Bang Bub i Gun Yo ..
IME ga mat teng i ga so ;;
http://minolove.net/photogall.php -
9000㎒
2004.02.24 09:56
NS // 뭔소린지 몰라 그냥 해석해버렸습니다?!
아 주군주두(?) 사용했던 방법이군요
IME가 맛탱이가 가서;; -
FriZeX
2004.02.24 14:20
아... 저건 저도 사용했던 방법이군요 :-) -
エジ
2004.03.01 15:36
ㅓ는 eo 이고 ㅗ는 o인데-ㅁ-;; -
명경지수
2005.04.12 08:34
사진을 클릭하면 사진이 아주 조그만 창으로 보일동말동 뜨고 원래 화면이 페이지를 찾을 수 없다는 에러페이지로 변하는데 왜 그럴까요?
제목 | 글쓴이 | 날짜 |
---|---|---|
[초간단 자바스크립트!] 튀어나오는 글자..-_-;; | ∑Ztxy | 2004.01.18 |
[초간단 자바스크립트!] 이미지 갤러리 [2] | ∑Ztxy | 2004.01.18 |
[초간단 자바스크립트!] 색깔바뀌는 메뉴 [3] | ∑Ztxy | 2004.01.19 |
전체화면에서 스크롤바 없애기 [7] | 이태식 | 2004.01.23 |
[초간단 자바스크립트!] 자바로 로그인폼 만들기 [3] | ∑Ztxy | 2004.01.26 |
인풋(코멘트)창 크기 조정 | 정재원 | 2004.01.27 |
[초간단 자바스크립트!] 자바로 홈페이지를부드럽게!!(1) [4] | ∑Ztxy | 2004.01.27 |
세이클럽 스크롤바 [7] | 세강 :D | 2004.02.01 |
앞,뒤,새로고침 만들기 [2] | piasol | 2004.02.01 |
주소창에 아이콘을 달자(다음,엠파스처럼) [3] | piasol | 2004.02.01 |
Select 태그 관련 스크립트 [12] | Zective | 2004.02.04 |
[초간단 자바스크립트!] 플래시 FullSize로 보여주기 [4] | ∑Ztxy | 2004.02.05 |
페이지 내에 주소창 달기 [1] | piasol | 2004.02.09 |
BGM Player (배경 음악) [17] | 장진석 | 2004.02.16 |
XML+JS 연동 다중셀렉트 | 투헤븐 | 2004.02.16 |
벅스뮤직 플레이어 스크립트 추출기 [4] | 이녀석 | 2004.02.16 |
우뚜같은 포워딩 페이지에서 프레임 깨기.(프레임 없애기) [17] | 김영성 | 2004.02.19 |
회원 가입 페이지 이젠 끝이다 [5] | 윌 | 2004.03.03 |
벅스뮤직 음악듣기 및 시작 정지 버튼 넣기(기타 음악파일도...) [3] | 카멜롯™ | 2004.03.04 |
방문자 OS보여주기 [5] | 구조반 | 2004.03.05 |
opendir함수와 readdir함수를 이용해서 파일들을 읽어온 다음에 반복문으로 이미지를 뿌리고 자바스크립트와 완벽한 조화를 이뤄네는 프로그램이군요...
대단합니다... 나중에 갤러리 쓸 때 써먹어야 겠네요...