갤러리#2 ( gallery_view.asp ) 내용보기 > 기술자료 | 해피정닷컴

갤러리#2 ( gallery_view.asp ) 내용보기 > 기술자료

본문 바로가기

사이트 내 전체검색

갤러리#2 ( gallery_view.asp ) 내용보기 > 기술자료

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>

댓글목록

등록된 댓글이 없습니다.


Total 198건 8 페이지
  • RSS
기술자료 목록
58
ClassicASP   15162  2008-08-02 18:01  
57
ClassicASP   35972  2008-07-16 16:44  
56
ClassicASP   12930  2008-07-10 13:38  
55
ClassicASP   12116  2008-07-01 18:28  
54
ClassicASP   12619  2008-06-23 19:58  
53
ClassicASP   11937  2008-06-23 19:54 ~ 2008-08-02 00:00  
52
ClassicASP   16914  2008-06-23 19:46 ~ 2016-10-21 00:00  
51
ClassicASP   20339  2008-06-23 19:37  
열람
ClassicASP   23219  2008-06-23 19:31 ~ 2008-05-27 00:00  
49
ClassicASP   18235  2008-06-23 19:22 ~ 2009-11-11 00:00  
48
ClassicASP   20662  2008-06-19 21:59 ~ 2018-12-01 22:44  
47
ClassicASP   17704  2008-06-14 19:57  
46
ClassicASP   13995  2008-06-11 09:54 ~ 2009-07-20 00:00  
45
ClassicASP   12558  2008-06-10 19:47 ~ 2009-10-26 00:00  
44
ClassicASP   15377  2008-05-29 22:14  
43
ClassicASP   15494  2008-05-23 23:29  
42
ClassicASP   21934  2008-05-23 23:14 ~ 2016-01-23 00:00  
41
ClassicASP   10069  2008-05-20 19:10  
40
ClassicASP   25394  2008-05-04 09:58  
39
ClassicASP   12538  2008-04-26 15:38  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.