<% if request("page") = "" then page = 1 else page = int(request("page")) end if category = int(request("category")) if category = "" or NOT ctype(category) = 4 then errorbox("카테고리가 잘못되었습니다") end if word = request("word") sc = int(request("sc")) '1:제목,2:내용,3:작성자 Set rs1 = Server.CreateObject ("ADODB.recordset") sql = "select * from board where category = "&category if word <> "" then if sc = 1 then sql = sql&" and title like '%"&word&"%'" elseif sc = 2 then sql = sql&" and content like '%"&word&"%'" elseif sc = 3 then sql = sql&" and name like '%"&word&"%'" end if end if sql = sql&" order by bgroup DESC, bstep ASC" rs1.PageSize = 10 rs1.Open sql, Conn, 3, 3 if not rs1.EOF or not rs1.BOF then totalart=rs1.RecordCount totalpage=rs1.pagecount rs1.AbsolutePage = page bunchnum=((page-1)-((page-1) MOD 10))/10 '페이지 묶음에 따른 묶음 번호. else totalart = 0 totalpage = 0 end if %>
<% if Not rs1.EOF then i = 1 Do Until rs1.EOF or i>rs1.PageSize %> <% rs1.MoveNext i=i+1 Loop else %> <%end if%>
<%=totalart%> articles / <%=totalpage%> pages <%if islogin(session("id"),session("level"),1) then%> <%else%> <%end if%>
번호 제목 작성자 작성일 조회
<%=totalart-(page*rs1.pagesize-(rs1.pagesize+1))-i%> <%if Not rs1("bstep") = 0 then for j=1 to rs1("blevel")-1%>  <%next%>   <%end if%> &page=<%=page%>" onFocus="blur()"><%=rs1("title")%> <%if rs1("comment") > 0 then%>(<%=rs1("comment")%>)<%end if%> <%if mid(now(),1,10) = Left(rs1("wdate"), 10) then%><%end if%> <%=rs1("name")%> <%=formatDateTime(rs1("wdate"),2)%> <%=rs1("hit")%>
<%if word <> "" then%>검색 된 결과가 없습니다.<%else%>작성된 글이 없습니다.<%end if%>
첫페이지 <%if totalpage > 10 and page > 10 then%> prev <%end if%> <% for j=bunchnum*10 + 1 to (bunchnum+1)*10 step 1 if j < totalpage+1 then %> <%if cint(page) = j then%> [<%=j%>] <%else%> [<%=j%>] <%end if%> <% end if next %> <%if totalpage > 10 and totalpage-(bunchnum*10)>10 then %> next <%end if%>
Search  
<% Set rs1 = nothing%>