ClassicASP 갤러리#2 ( gallery_view.asp ) 내용보기
페이지 정보
본문
<%@ Language=VBScript %>
<% Option Explicit %>
<%
' 작성자: 해피정닷컴 ( https://www.happyjung.com )
' 2008-06-23 : 1차 작성
' 2008-08-02 : 디비 테이블 이름 변경 tbl_gallery → hp_gallery
'
'
'
'
'
%>
<!--#include virtual="/inc/db_con.asp" -->
<%
dim str,val ' 해피정닷컴 추가 2008-05-27
' 인젝션 방지관련 https://www.happyjung.com/bbs/board.php?bo_table=lecture&wr_id=480
'function sqlCheck(str)
'...
'end function
Dim num : num = sqlCheck(request("num"))
Dim page : Page = sqlCheck(request("page"))
Dim Searchpart : SearchPart = sqlCheck(request("SearchPart"))
Dim SearchStr : SearchStr = sqlCheck(request("SearchStr"))
'### 조회수를 올린다.
SQL = "Update hp_gallery set visit=visit+1 where num="&num
Con.execute SQL
SQL = "SELECT * from hp_gallery where num="&num
Set rs = Con.execute(SQL)
Dim num : num = rs("num")
Dim name : name = rs("name")
Dim email : email = rs("email")
Dim url : url = rs("url")
Dim title : title = rs("title")
Dim content : content = rs("content")
content = Replace(content, vbCrLf,"<br>")
Dim writeday : writeday = rs("writeday")
Dim filename1 : filename1 = rs("filename1")
Dim filesize1 : filesize1 = rs("filesize1")
Dim down1 : down1 = rs("down1")
Dim visit : visit = rs("visit")
Dim i_width1 : i_width1 = rs("i_width1")
Dim i_height1 : i_height1 = rs("i_height1")
Dim ip : ip = rs("ip")
Rs.close
'### 파일의 용량에 따라.. 용량표시를 MB 냐, KB냐, BYTE 냐로 결정하는 부분
if Len(filesize1) > 0 Then
if Clng(filesize1) > 1024000 then
filesize1 = Round((Clng(filesize1)/1024000)*1000)/1000&" MByte"
elseif Clng(filesize1) > 1024 then
filesize1 = Round((Clng(filesize1)/1024)*10)/10&" KByte"
else
filesize1 = filesize1 &" Byte"
end if
end if
if Len(filesize2) > 0 Then
if Clng(filesize2) > 1024000 then
filesize2 = Round((Clng(filesize2)/1024000)*1000)/1000&" MByte"
elseif Clng(filesize2) > 1024 then
filesize2 = Round((Clng(filesize2)/1024)*10)/10&" KByte"
else
filesize2 = filesize2 &" Byte"
end if
end if
'### 작성일을 정리하는 부분.
dim yy, mm, dd, h, mi
yy = year(writeday)
mm = right("0" & month(writeday),2)
dd = right("0" & day(writeday),2)
h = right("0" & hour(writeday),2)
mi = right("0" & minute(writeday),2)
writeday = yy & "년 " & mm & "월 " & dd & "일 (" & h & ":" & mi & ")"
%>
<!--#include file="../inc/_happyjung_.asp"-->
<title>포토갤러리</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<body>
<!-- 게시판 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="padding-top:20px;"><table width="100%" border="0" cellpadding="7" cellspacing="1" bgcolor="#dadada">
<tr>
<td colspan="4" bgcolor="#f4f4f4"><img src="img/icon_02.gif" width="13" height="13" align="absmiddle"> <strong>제목 :</strong> <%= title %></td>
</tr>
<tr>
<td colspan="4" bgcolor="#ffffff"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding:0 10 0 0;"><img src="img/icon_02.gif" width="13" height="13" align="absmiddle"> <strong>날짜 :</strong> <%= writeday %></td>
<td align="right" style="padding:0 10 0 0;"><img src="img/icon_02.gif" width="13" height="13" align="absmiddle"> <strong>조회 :</strong> <%= visit %></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="4" bgcolor="#ffffff" style="padding:20 20 20 20;">
<%
if filename1 <> "" then
Dim FileExt1, x, y, p, Image_width1, FileIcon1
FileExt1 = ucase(right(filename1,3)) ' 확장자 얻기
Select Case FileExt1
Case "BMP", "GIF", "JPG"
FileIcon1 = "ok"
End Select
if FileIcon1 = "ok" then
if filename1 <> "" then
' 이미지 사이즈를 체크 하는 부분
Sub ImageSize1(ByVal f, ByRef x, ByRef y)
Set p = LoadPicture(f)
x = CLng(CDbl(p.Width) * 24 / 635) ' CLng 의 라운드 오프의 기능을 이용하고 있다.
y = CLng(CDbl(p.Height) * 24 / 635) ' CLng 의 라운드 오프의 기능을 이용하고 있다.
Set p = Nothing
End Sub
if len(filename1) <> "" and not isnull(filename1) then
if FileExt1 = "jpg" or FileExt1 = "gif" or FileExt1 = "JPG" or FileExt1 = "GIF" or FileExt1 = "BMP" then
ImageSize1 Server.MapPath("../../")&"\upload\"&filename1, x, y
if x > 660 then
Image_width1 = "660"
else
Image_width1 = x
end if
end if
end if
end if
%>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding:0 0 10 0;"><img src="../../upload/<%= filename1 %>" width="<%=Image_width1%>"></td>
</tr>
</table>
<%
end if
end if
%>
<%= CONTENT %>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="7" cellspacing="1" bgcolor="#dadada">
<tr>
<td width="60" align="center" bgcolor="#f4f4f4">작성자</td>
<td bgcolor="#ffffff"><%= name %></td>
<td width="60" align="center" bgcolor="#f4f4f4">메일</td>
<td bgcolor="#ffffff"><a href="mailto:<%= EMAIL %>"><%= email %></a></td>
</tr>
<tr>
<td align="center" bgcolor="#f4f4f4">URL</td>
<td bgcolor="#ffffff"><a href="<%= URL %>" target="_blank"><%= URL %></a></td>
<td align="center" bgcolor="#f4f4f4">첨부파일</td>
<td bgcolor="#ffffff"><span class="style19"><%= FILENAME1 %> (<%= FILESIZE1 %>) </span></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" style="padding-top:15px;"><table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#FFFFFF">
<%if session("admin") = "administrator" then%>
<a href="gallery_write.asp?page=<%= Page %>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_write.gif" border="0"></a>
<a href="gallery_edit.asp?ReactionUrl=E&num=<%= num %>&page=<%= Page %>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_modify.gif" border="0" /></a>
<a href="gallery_reply.asp?page=<%=Page %>&num=<%=num%>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_reply.gif" width="44" height="20" border="0" /></a>
<% end if%>
<%if session("admin") = "administrator" then%>
<a href="gallery_del_ok.asp?page=<%= Page %>&num=<%=num%>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>" onClick="return confirm('정말삭제할까요?')"><img src="img/bbs_adm_del.gif" width="64" height="20" border="0" /></a>
<% else %>
<a href="gallery_del.asp?page=<%= Page %>&num=<%=num%>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>&ReactionUrl=D"><img src="img/bbs_del.gif" width="44" height="20" border="0" /></a>
<% end if%></td>
<td align="right" bgcolor="#FFFFFF"><a href="gallery.asp?page=<%= Page %>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_list.gif" width="44" height="20" border="0" /></a></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<% Option Explicit %>
<%
' 작성자: 해피정닷컴 ( https://www.happyjung.com )
' 2008-06-23 : 1차 작성
' 2008-08-02 : 디비 테이블 이름 변경 tbl_gallery → hp_gallery
'
'
'
'
'
%>
<!--#include virtual="/inc/db_con.asp" -->
<%
dim str,val ' 해피정닷컴 추가 2008-05-27
' 인젝션 방지관련 https://www.happyjung.com/bbs/board.php?bo_table=lecture&wr_id=480
'function sqlCheck(str)
'...
'end function
Dim num : num = sqlCheck(request("num"))
Dim page : Page = sqlCheck(request("page"))
Dim Searchpart : SearchPart = sqlCheck(request("SearchPart"))
Dim SearchStr : SearchStr = sqlCheck(request("SearchStr"))
'### 조회수를 올린다.
SQL = "Update hp_gallery set visit=visit+1 where num="&num
Con.execute SQL
SQL = "SELECT * from hp_gallery where num="&num
Set rs = Con.execute(SQL)
Dim num : num = rs("num")
Dim name : name = rs("name")
Dim email : email = rs("email")
Dim url : url = rs("url")
Dim title : title = rs("title")
Dim content : content = rs("content")
content = Replace(content, vbCrLf,"<br>")
Dim writeday : writeday = rs("writeday")
Dim filename1 : filename1 = rs("filename1")
Dim filesize1 : filesize1 = rs("filesize1")
Dim down1 : down1 = rs("down1")
Dim visit : visit = rs("visit")
Dim i_width1 : i_width1 = rs("i_width1")
Dim i_height1 : i_height1 = rs("i_height1")
Dim ip : ip = rs("ip")
Rs.close
'### 파일의 용량에 따라.. 용량표시를 MB 냐, KB냐, BYTE 냐로 결정하는 부분
if Len(filesize1) > 0 Then
if Clng(filesize1) > 1024000 then
filesize1 = Round((Clng(filesize1)/1024000)*1000)/1000&" MByte"
elseif Clng(filesize1) > 1024 then
filesize1 = Round((Clng(filesize1)/1024)*10)/10&" KByte"
else
filesize1 = filesize1 &" Byte"
end if
end if
if Len(filesize2) > 0 Then
if Clng(filesize2) > 1024000 then
filesize2 = Round((Clng(filesize2)/1024000)*1000)/1000&" MByte"
elseif Clng(filesize2) > 1024 then
filesize2 = Round((Clng(filesize2)/1024)*10)/10&" KByte"
else
filesize2 = filesize2 &" Byte"
end if
end if
'### 작성일을 정리하는 부분.
dim yy, mm, dd, h, mi
yy = year(writeday)
mm = right("0" & month(writeday),2)
dd = right("0" & day(writeday),2)
h = right("0" & hour(writeday),2)
mi = right("0" & minute(writeday),2)
writeday = yy & "년 " & mm & "월 " & dd & "일 (" & h & ":" & mi & ")"
%>
<!--#include file="../inc/_happyjung_.asp"-->
<title>포토갤러리</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<body>
<!-- 게시판 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="padding-top:20px;"><table width="100%" border="0" cellpadding="7" cellspacing="1" bgcolor="#dadada">
<tr>
<td colspan="4" bgcolor="#f4f4f4"><img src="img/icon_02.gif" width="13" height="13" align="absmiddle"> <strong>제목 :</strong> <%= title %></td>
</tr>
<tr>
<td colspan="4" bgcolor="#ffffff"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding:0 10 0 0;"><img src="img/icon_02.gif" width="13" height="13" align="absmiddle"> <strong>날짜 :</strong> <%= writeday %></td>
<td align="right" style="padding:0 10 0 0;"><img src="img/icon_02.gif" width="13" height="13" align="absmiddle"> <strong>조회 :</strong> <%= visit %></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="4" bgcolor="#ffffff" style="padding:20 20 20 20;">
<%
if filename1 <> "" then
Dim FileExt1, x, y, p, Image_width1, FileIcon1
FileExt1 = ucase(right(filename1,3)) ' 확장자 얻기
Select Case FileExt1
Case "BMP", "GIF", "JPG"
FileIcon1 = "ok"
End Select
if FileIcon1 = "ok" then
if filename1 <> "" then
' 이미지 사이즈를 체크 하는 부분
Sub ImageSize1(ByVal f, ByRef x, ByRef y)
Set p = LoadPicture(f)
x = CLng(CDbl(p.Width) * 24 / 635) ' CLng 의 라운드 오프의 기능을 이용하고 있다.
y = CLng(CDbl(p.Height) * 24 / 635) ' CLng 의 라운드 오프의 기능을 이용하고 있다.
Set p = Nothing
End Sub
if len(filename1) <> "" and not isnull(filename1) then
if FileExt1 = "jpg" or FileExt1 = "gif" or FileExt1 = "JPG" or FileExt1 = "GIF" or FileExt1 = "BMP" then
ImageSize1 Server.MapPath("../../")&"\upload\"&filename1, x, y
if x > 660 then
Image_width1 = "660"
else
Image_width1 = x
end if
end if
end if
end if
%>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding:0 0 10 0;"><img src="../../upload/<%= filename1 %>" width="<%=Image_width1%>"></td>
</tr>
</table>
<%
end if
end if
%>
<%= CONTENT %>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="7" cellspacing="1" bgcolor="#dadada">
<tr>
<td width="60" align="center" bgcolor="#f4f4f4">작성자</td>
<td bgcolor="#ffffff"><%= name %></td>
<td width="60" align="center" bgcolor="#f4f4f4">메일</td>
<td bgcolor="#ffffff"><a href="mailto:<%= EMAIL %>"><%= email %></a></td>
</tr>
<tr>
<td align="center" bgcolor="#f4f4f4">URL</td>
<td bgcolor="#ffffff"><a href="<%= URL %>" target="_blank"><%= URL %></a></td>
<td align="center" bgcolor="#f4f4f4">첨부파일</td>
<td bgcolor="#ffffff"><span class="style19"><%= FILENAME1 %> (<%= FILESIZE1 %>) </span></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" style="padding-top:15px;"><table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#FFFFFF">
<%if session("admin") = "administrator" then%>
<a href="gallery_write.asp?page=<%= Page %>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_write.gif" border="0"></a>
<a href="gallery_edit.asp?ReactionUrl=E&num=<%= num %>&page=<%= Page %>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_modify.gif" border="0" /></a>
<a href="gallery_reply.asp?page=<%=Page %>&num=<%=num%>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_reply.gif" width="44" height="20" border="0" /></a>
<% end if%>
<%if session("admin") = "administrator" then%>
<a href="gallery_del_ok.asp?page=<%= Page %>&num=<%=num%>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>" onClick="return confirm('정말삭제할까요?')"><img src="img/bbs_adm_del.gif" width="64" height="20" border="0" /></a>
<% else %>
<a href="gallery_del.asp?page=<%= Page %>&num=<%=num%>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>&ReactionUrl=D"><img src="img/bbs_del.gif" width="44" height="20" border="0" /></a>
<% end if%></td>
<td align="right" bgcolor="#FFFFFF"><a href="gallery.asp?page=<%= Page %>&SearchPart=<%= SearchPart %>&SearchStr=<%= SearchStr %>"><img src="img/bbs_list.gif" width="44" height="20" border="0" /></a></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
댓글목록
등록된 댓글이 없습니다.