<% Response.Expires = -1 Response.Expiresabsolute = Now() - 1 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "no-cache" '스펨방지 값------------------------------------------ If Request.cookies("SpPass") = "" Then response.cookies("SpPass") = ")(*&^%$#@!" End If '스펨방지 값------------------------------------------ Page=ReplaceString(Request("Page")) clumn_name = ReplaceString(Request("sKey")) strText = ReplaceString(Request("sText")) strCode = ReplaceString(Request("Code")) c_idx= ReplaceString(Request("c_idx"))'댓글 수정시 댓글 idx값을 받는다 strCode_Img = Split(strCode,"_") '게시판별 이미지 경로#7F7F7F Page_Color = "" Font_Color = "#FFFFFF" If Page="" Then Page=1 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''총페이지수 IF strText <> "" then strSQL = "SELECT COUNT(sid) FROM "& strCode &" WHERE "& clumn_name &" like '%"& strText &"%'" ELSE strSQL = "SELECT COUNT(sid) FROM "& strCode END IF Set Rs=DB.Execute(strSQL) RecordCount = Rs(0) If board_type = "0" Then '리스트 형식 PageSize=10 Else ' pageSize=5 End If TotalPage = ((RecordCount-1)/PageSize) +1 '총페이지수 Vnum = Recordcount-(Page-1)*PageSize '페이지의 게시물 수2 Rs.Close:Set Rs=Nothing ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''총페이지수 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''총페이지수 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''총페이지수 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''총페이지수 strSQL = "SELECT TOP "& PageSize &" * FROM "& strCode &" WHERE sid NOT IN (SELECT TOP "& (Page-1)*PageSize &" sid FROM "& strCode &"" IF strText <> "" then strSQL=strSQL &" WHERE "& clumn_name &" like '%"& strText &"%' ORDER BY notice DESC, ref DESC,step_order ASC) AND "& clumn_name &" like '%"& strText &"%' ORDER BY notice DESC, ref DESC,step_order ASC" ELSE strSQL=strSQL &" ORDER BY notice DESC, ref DESC,step_order ASC) ORDER BY notice DESC, ref DESC,step_order ASC" END IF Set LRS = Server.CreateObject("Adodb.recordset") LRS.open strSQL,DB,1 %> Untitled Document
<% '내용보기 시작 '내용보기 시작 '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%>]
<% 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 %> <% Else %> <% End if %>
리스트 <% If Request.cookies("board_id") = "board_admin" Then %>   수정     <% 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 '게시판형식 %> <% 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 '게시판형식 %> <% 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 notice = "1" Then %> <% End If %> <% End If vnum= vnum-1 LRS.MoveNext Next %>
NO SUBJECT NAME DATE HIT
<%=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 step_ > 0 then '글에 해당하는 답변이 존재한다면 response.write "" response.write " " intSubjectBound = intSubjectBound - (step_*3) end If %> <%=subject%><%=count%> <%=fileicon_img%> <%=name%> <%=left(writeday,10)%> <%=visited%>
<% If list_img <> "" Then %> <% Else %> <% End If %>
<%=list_img%> <%=Left(contents,160)%>...
<%=Paging("list")%> <% If board_admin = "1" Then '1일경우 관리자 입력 Then %> <% If Request.cookies("board_id") = "board_admin" Then %> 글쓰기 <% End if %> <% else %> 글쓰기 <% End If %>

 

<% DB.Close Set DB = Nothing %>