<% If tb<>"" then page = request("page") block = request("block") if block="" then block=0 end if if page="" then page=1 end if If request("search") <> "" then st=request("st") sc=request("sc") sn=request("sn") search = trim(request("search")) search = replace(search,"'","''") if st="on" then SQL2="(title LIKE '%"& search &"%')" if sc="on" or sn="on" then SQL2=SQL2 & " or " end if else st="off" end if if sc="on" then if st="on" then SQL2=SQL2 & "(content LIKE '%"& search &"%')" else SQL2="(content LIKE '%"& search &"%')" end if if sn="on" then SQL2=SQL2 & " or " end if else sc="off" end if if sn="on" then if st="on" or sc="on" then SQL2=SQL2 & "(name LIKE '%"& search &"%')" else SQL2="(name LIKE '%"& search &"%')" end if else sn="off" end if SQL = "SELECT * FROM "&tb&" where " & SQL2 & " ORDER BY re desc, reid asc, num DESC" Set rs = Server.CreateObject("ADODB.Recordset") rs.PageSize = recordset-1 rs.Open SQL,db,1 else if request("mode")="new" then if left(now,2) = "20" then nowday = mid(now,3) else nowday = now end if nowday = left(nowday,8) Set rs = Server.CreateObject("ADODB.Recordset") SQL = "SELECT * FROM "&tb&" where writeday LIKE '%"& nowday &"%' order by re DESC, reid ASC, num DESC" rs.PageSize = recordset-1 rs.Open SQL,db,1 Else Set rs = Server.CreateObject("ADODB.Recordset") SQL = "SELECT * FROM "&tb&" order by re DESC, reid ASC, num DESC" rs.PageSize = recordset rs.Open SQL,db,1 end if end if %> <% topmenu %> <%'좌측서브메뉴%> <%'좌측서브메뉴%> <% contents %>
<% If rs.BOF or rs.EOF then '현재 저장된 글이 없다면.. if request("mode")="new" or request("search")<>"" then Response.Redirect "error.asp?no=5" else Response.Redirect "write.asp?tb="&tb end if Else '현재 저장된 글이 있다면.. rs.Move rs.PageSize * (page-1) record = rs.RecordCount totalpage = rs.pagecount rs.AbsolutePage = page %>
<%=record%>개의 게시물이 있습니다. ( <%=page%> / <%=totalpage%> )
<% If admin_notice<>"no" then ' 공지사항 Set notice_rs = Server.CreateObject("ADODB.Recordset") notice_SQL = "SELECT * FROM notice where tb='"&tb&"' order by num DESC" notice_rs.PageSize = notice_num notice_rs.Open notice_SQL,db,1 If not (notice_rs.BOF or notice_rs.EOF) then m=1 Do until notice_rs.EOF or m>notice_rs.pagesize id=notice_rs("id") name=notice_rs("name") email=notice_rs("email") url=notice_rs("url") title=notice_rs("title") tag=notice_rs("tag") write_diff=notice_rs("writeday") writeday=left(notice_rs("writeday"),8) visit=notice_rs("visit") content=notice_rs("content") num=notice_rs("num") filename=notice_rs("filename") If filename="none" then filename="" end if if email="none" then email="" end if if num=0 then num="" end if if left(now,2)="20" then nowday=mid(now,3) else nowday=now end if if tag="tag_ok" then title=CheckWord(title) if Len(title) > 38 then title=mid(title,1,39)&".." end if name=CheckWord(name) If Len(name) > 15 Then name = Mid(name,1,16) & ".." End If else if Len(title) > 20 then title=mid(title,1,21)&".." end if title=replace(title,""","'") If Len(name) > 4 Then name = Mid(name,1,5) & ".." End If name=replace(name,""","'") end if If name="관리자" Then name = admin_img End If if search<>"" then if st = "on" then title = replace(title,search,""&search&"") end if if sn = "on" then name = replace(name,search,""&search&"") end if end if %> <% notice_rs.movenext m=m+1 Loop notice_rs.Close set notice_rs=nothing end if End if '-------------------------------------------- 공지사항 끝부분 ------------------------------------------- %> <% i=1 Do until rs.EOF or i>rs.pagesize id=rs("id") name=rs("name") email=rs("email") url=rs("url") title=rs("title") tag=rs("tag") write_diff=rs("writeday") writeday=left(rs("writeday"),8) visit=rs("visit") num=rs("num") resame=rs("resame") filename=rs("filename") filesize=rs("filesize") blank=4*resame if filename="none" then filename="" filesize="" end if if num=0 then num="" end if if email="none" then email="" end if if url="none" then url="" end if if left(now,2)="20" then nowday=mid(now,3) else nowday=now end if if tag="tag_ok" then title=CheckWord(title) if Len(title) > 38 then title=mid(title,1,39)&".." end if name=CheckWord(name) If Len(name) > 15 Then name = Mid(name,1,16) & ".." End If else if Len(title) > 30 then title=mid(title,1,31)&".." end if title=replace(title,""","'") If Len(name) > 4 Then name = Mid(name,1,5) & ".." End If name=replace(name,""","'") end if If name="관리자" Then name = admin_img End If if search<>"" then if st = "on" then title = replace(title,search,""&search&"") end if if sn = "on" then name = replace(name,search,""&search&"") end if end if '---------- 게시물 리스트 --- Set com_rs = Server.CreateObject("ADODB.Recordset") com_SQL = "SELECT * FROM comment where tb='"&tb&"' and com_num="&id com_rs.Open com_SQL,db,1 if rs.BOF or rs.EOF then else com_record = com_rs.RecordCount end if '---------- 게시물 리스트 끝 --- %> <% rs.movenext i=i+1 Loop %>
번호 제목 작성자 작성일
공지 <% if filename="" then %><% if DateDiff("d",write_diff,nowday) < newimg then %><% else %><% end if %><% else %><% if DateDiff("d",write_diff,nowday) < newimg then %><% else %><% end if %><% end if %> <%=title%> <% if email<>"" then %><% if admin_smtp<>"yes" then %><% else %><% if request("mode")="new" then %>&mode=new<% end if %><% if search<>"" then %>&search=<%=search%>&st=<%=st%>&sc=<%=sc%>&sn=<%=sn%><% end if %>"><% end if %><%=name%><% else %><%=name%><% end if %> <%=writeday%>
<%=num%> <% if resame<>0 then %> <% end if %> &search=<%=search%>&st=<%=st%>&sc=<%=sc%>&sn=<%=sn%><% end if %>"><%=title%><% if admin_comment="yes" then %><% if com_record<>0 then %>   [<%=com_record%>]<% end if %><% end if %> <% if email<>"" then %> <% if admin_smtp<>"yes" then %> <%=name%> <% else %> <% if request("mode")="new" then %>&mode=new<% end if %><% if search<>"" then %>&search=<%=search%>&st=<%=st%>&sc=<%=sc%>&sn=<%=sn%><% end if %>"><%=name%> <% end if %> <% else %> <%=name%> <% end if %> <%=writeday%>
<% '페이지 번호 total_block = int(totalpage / pageset) if (totalpage mod pageset) > 0 then total_block = total_block + 1 end if total_block = total_block - 1 if totalpage > 0 then Response.Write "[" if block > 0 then %> &mode=new<% end if %><% if search<>"" then %>&search=<%=search%>&st=<%=st%>&sc=<%=sc%>&sn=<%=sn%><% end if %>"> <% end if%> 이전 <%=pageset%>개 <% if block >0 then %> <%end if%> ] <% if Cint(total_block) <> Cint(block) then %> [ <% for Gopage = 1 to pageset %> <% if int(block*pageset) + Gopage = Cint(page) then %> <%=(int(block*pageset) + Gopage)%> <%else%> &mode=new<% end if %><% if search<>"" then %>&search=<%=search%>&st=<%=st%>&sc=<%=sc%>&sn=<%=sn%><% end if %>"> <%=(int(block*pageset) + Gopage)%> <% end if%> <% next %> ] <% else %> <% if (totalpage mod pageset) = 0 then lastpage= pageset else lastpage = totalpage mod pageset end if %> [ <% for Gopage = 1 to lastpage %> <% if int(block*pageset) + Gopage = Cint(page) then %> <%=(int(block*pageset) + Gopage)%> <%else%> &mode=new<% end if %><% if search<>"" then %>&search=<%=search%>&st=<%=st%>&sc=<%=sc%>&sn=<%=sn%><% end if %>"> <%=(int(block*pageset) + Gopage)%> <% end if %> <% next %> ] <% end if %> [ <% if (Cint(total_block) > 0) and (Cint(block) < Cint(total_block)) then %> &mode=new<% end if %><% if search<>"" then %>&search=<%=search%>&st=<%=st%>&sc=<%=sc%>&sn=<%=sn%><% end if %>"> <%end if%> 다음 <%=pageset%> 개 <% if (Cint(total_block) > 0) and (Cint(block) < Cint(total_block)) then %> <%end if%> ] <% end if %> <% '페이지 번호 끝 %>

<% '검색폼 부분 테이블 시작 %>
on<%elseif st="" then%>on<%else%>off<% end if %>"> on<%elseif sc="" then%>on<%else%>off<% end if %>"> on<%else%>off<% end if %>"> on<%elseif st="" then%>on<%else%>off<% end if %>.gif" border="0" name="st" align="absmiddle"> on<%elseif sc="" then%>on<%else%>off<% end if %>.gif" border="0" name="sc" align="absmiddle"> on<%else%>off<% end if %>.gif" border="0" name="sn" align="absmiddle"> <% if request("mode")="new" or search<>"" then %><% else %><% end if %> <% if admin_auth<>"yes" or session("login")=admin_name then %><% end if %>
<% '검색폼 부분 테이블 끝 %> <% end if %>
<% copyright %> <% rs.Close db.Close Set rs = Nothing Set db = Nothing %> <% end if %>