<%
'내용보기 시작
'내용보기 시작
'FileExists 함수를 이용해 보세요. 이용해서 이미지가 있는지 없는지 먼져 확인하낟.
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
sid = ReplaceString(Request("sid"))
If sid <> "" Then
Sql = "SELECT * FROM "& strCode &" where sid="& sid '생성 되어있는 게시판 불러오기
Set Rs=Server.CreateObject("ADODB.RecordSet")
RS.Open Sql,db,1
if Not(RS.Eof or RS.Bof) Then
sid = RS("sid")
subject = RS("subject")
name = RS("name")
notice = RS("notice")
contents = RS("contents")
password = RS("password")
ip = RS("ip")
visited = RS("visited")
'contents = replace(contents,chr(13) & chr(10)," ")
writeday = RS("writeday")
end if
'기존게시물을 옴겨서 작업한경우실행
'기존게시물을 옴겨서 작업한경우실행
'Select Case strCode
' Case "essay_board"
' strSQL = "select top 1 * from board_img where B_Code="& sid &" and B_Name='"& strCode &"' order by idx"
' Set IRS = Server.CreateObject("Adodb.recordset")
' IRS.open strSQL,DB,1
' if Not(IRS.Eof or IRS.Bof) Then
' FileName = IRS("B_File")
' end If
' IRS.Close
' Set IRS = Nothing
'End Select
'기존게시물을 옴겨서 작업한경우실행
'기존게시물을 옴겨서 작업한경우실행
'===========================================================================
Rs.close
set Rs=nothing
'해당글의 조회수 증가시키기================================================
strSQL = "UPDATE " & strCode & " SET visited = visited + 1 WHERE sid = " & sid
DB.Execute strSQL,,128
'==========================================================================
%>
| |
<%=subject%> |
조회 <%=visited%> |
|
| |
<%=Name%> |
<%=writeday%> |
<%=contents%> |
<% '올린 이미지 표시 아이피 표시
strSQL = "select * from board_img where B_Code="& sid &" and B_Name='"& strCode &"' order by idx"
Set IRS = Server.CreateObject("Adodb.recordset")
IRS.open strSQL,DB,1
if Not(IRS.Eof or IRS.Bof) Then
For i = 1 To IRS.Recordcount
FileName = IRS("B_File")
%>
[<%=FileName%>]%>_image/<%=FileName%>)
<%
IRS.MoveNext
Next
End If
IRS.Close
Set RS = Nothing
If ip <> "" Then
ip_ = Split(ip,".")
ip = ip_(0)&"."&ip_(1)&".xxx."&ip_(3)
Else
ip = ""
End If
response.write ""& ip &""
%>
|
|
<% If board_admin = "1" Then '1일경우 관리자 입력 Then %>
| 리스트
<% If Request.cookies("board_id") = "board_admin" Then %>
수정
<% End if %>
|
<% Else %>
| 리스트 수정 답변 |
<% End if %>
|
|
<% if board_Use_comment="1" then '1일때 리플달기%>
<% If c_idx = "" Then %>
<% Else %>
<% End If %>
<% end if%>
<%
End If
'내용보기 끝
'내용보기 끝
%>
 |
<% if strText <> "" Then %>
목록보기
<% else %>
목록보기
<% End if %>
<% If Request.cookies("board_id") <> "board_admin" Then %>
로그인
<% Else %>
로그아웃
<% end If %> 접속로그
|
|
<%
If board_type = "0" Then '게시판형식
%>
| NO |
SUBJECT |
NAME |
DATE |
HIT |
|
<% End If
'정규식 설정을 한단
Set regEx = New RegExp ' 정규식을 작성합니다.
regEx.IgnoreCase = True ' 대/소문자 구분 안함을 설정합니다.
regEx.Global = True ' 전역을 설정합니다.
'LIST 뿌리기....
'LIST 뿌리기....
for j = 1 to LRS.Recordcount
if Not(LRS.Eof or LRs.Bof) Then
sid = LRS("sid")
subject = LRS("subject")
name = LRS("name")
notice = LRS("notice")
contents = LRS("contents")
password = LRS("password")
visited = LRS("visited")
contents = replace(contents,chr(13) & chr(10),"")
writeday = LRS("writeday")
ref=LRS("ref")
step_=LRS("step")
step_order=LRS("step_order")
End If
strSQL = "select top 1 * from board_img where B_Code="& sid &" and B_Name='"& strCode &"' order by idx"
Set IRS = Server.CreateObject("Adodb.recordset")
IRS.open strSQL,DB,1
if Not(IRS.Eof or IRS.Bof) Then
FileName = IRS("B_File")
Else
FileName = ""
End If
IRS.Close
Set IRS = Nothing
'############# 확장자에 따른 이미지 선택 ###########
if FileName<>"" Then
pos = instrrev(FileName, ".")+1
check_fileexe = mid(FileName, pos)
Select Case Ucase(check_fileexe)
Case "HWP", "COM", "EXE","TXT", "WAV", "XLS", "DOC", "RAR", "ACE", "GIF", "BMP", "MP3", "PDF", "HLP", "CHM"
fileicon=check_fileexe & ".gif"
Case "ZIP", "Z", "GZ", "TAR"
fileicon= "zip.gif"
Case "RA", "RAM"
fileicon = "ra.gif"
Case "HTM", "HTML"
fileicon= "htm.gif"
Case "JPG", "JPEG"
fileicon="jpg.gif"
Case "MPG", "MPEG", "AVI", "ASF"
fileicon="mpg.gif"
Case else
fileicon="etc.gif"
End Select
'파일아이콘 이미지를 불러온다
fileicon_img = " "
If board_type = "1" Then '여행후기 리스트에 이미지 뿌려주기
url_img = ""&strCode_Img(0)&"_image"
If Ucase(check_fileexe)="JPG" Or Ucase(check_fileexe)="GIF" Or Ucase(check_fileexe)="BMP" Then
FileName_ = Replace(FileName,".","_.") '작은이미지를 불러온다
If FSO.FileExists(server.mappath(url_img) & "\" & FileName_) = "True" Then
Set objPic = Server.CreateObject("pakImage.ImageSize")
objPic.ImageSIze server.mappath(url_img) & "\" & FileName_
img_width = objPic.Width
img_height = objPic.Height
x1 = img_width 'DB에 저장된 가로크기
y1 = img_height 'DB에 저장된 세로크기
x2 = 80 '보여지는 페이지의 사진 부분에 할당된 크기
y2 = 80 '보여지는 페이지의 사진 부분에 할당된 크기
IF x1 > x2 Then '원본사진의 가로가 페이지의 크기보다 크다면
x2 = 80
y2 = Cint((y1*x2)/x1)
Else
x2 = Img_Width
y2 = Img_Height
End IF
SET objPic = Nothing
FileName_ = Replace(FileName_," ","%20")
list_img = " "
Else
list_img = ""
End If
End If
End If
Else
fileicon_img = ""
end If
if FileName="" Then
list_img =""
Else
list_img = list_img
End If
'리플수
Set Crs=Server.CreateObject("ADODB.RecordSet")
Csql="SELECT count(*) FROM comment WHERE sort='"&strCode&"' and sort_idx="&sid
Crs.Open Csql,db,1
count=Crs(0)
if count=0 then
count=""
else
count="["&count&"]"
end if
Crs.Close
Set Crs = Nothing
'LIST 뿌리기....
'LIST 뿌리기....
If board_type = "0" Then '게시판형식
%>
| <%=vnum%> |
<%
if step_ > 0 then '글에 해당하는 답변이 존재한다면
response.write " "
response.write " "
intSubjectBound = intSubjectBound - (step_*3)
end If
if datediff("d",writeday,now())=<1 then
response.write " "
end if
%>
<%=subject%><%=count%> <%=fileicon_img%> |
<%=name%> |
<%=left(writeday,10)%> |
<%=visited%> |
|
<% If notice = "1" Then %>
|
|
<% End If %>
<%
Else
contents = replace(contents," ","")
contents = replace(contents,"","")
contents = replace(contents," ","")
' regEx.Pattern = " ]*>" ' 패턴을 설정합니다. 이미지 태그 축출
regEx.Pattern = "<[^>]+>" ' 패턴을 설정합니다. < > 테그안에 있는 내용모두 축출
Set Matches = regEx.Execute(contents) ' 찾기를 실행합니다.
For Each Match in Matches ' Matches 컬렉션을 반복합니다.
RetStr = Match.Value
contents = Replace(contents,Trim(RetStr),"")
Next
If step_ > 0 then '글에 해당하는 답변이 존재한다면
In_ = Split(contents,".xxx.")
In_Count = Ubound(In_)
For i = 0 To In_Count
If i = In_Count Then
contents = Mid(In_(i),2,160)
End If
Next
End If
%>
<%
if step_ > 0 then '글에 해당하는 답변이 존재한다면
response.write " "
response.write " "
intSubjectBound = intSubjectBound - (step_*3)
end If
%>
<%=subject%><%=count%> <%=fileicon_img%> |
<%=name%> |
<%=left(writeday,10)%> |
<%=visited%> |
|
|
|
|
|
<% If notice = "1" Then %>
|
|
<% End If %>
|
<%
End If
vnum= vnum-1
LRS.MoveNext
Next
%>
| <%=Paging("list")%> |
<% If board_admin = "1" Then '1일경우 관리자 입력 Then %>
<% If Request.cookies("board_id") = "board_admin" Then %>
글쓰기
<% End if %>
<% else %>
글쓰기
<% End If %>
|
|
|
|