%
str1=request("str1")
str2=request("str2")
page=request("page")
if page="" then page=1
if page<1 then page=1
page_start=0
start_more=""
page_end=0
end_more=""
view_start=0
view_end=0
total_record_count=0
total_page_count=0
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
sql="select * from " & table & " where m_gongji > 0"
if str1="1" then sql=sql & " and m_title like '%" & str2 & "%'"
if str1="2" then sql=sql & " and m_content like '%" & str2 & "%'"
if str1="3" then sql=sql & " and m_title like '%" & str2 & "%' or m_content like '%" & str2 & "%'"
if str1="4" then sql=sql & " and m_name like '%" & str2 & "%'"
sql=sql & " order by m_ref desc, m_step"
conn.open dns, uid, pwd
rs.open sql, conn, 1, 1
if (rs.BOF=TRUE and rs.EOF=TRUE) then
result=1
page=0
else
Rs.PageSize=view_count
page=request("page")
if page<>"" then
if page<1 then
page=1
end if
else
page=1
end if
Rs.AbsolutePage=page
end if
total_record_count=rs.recordcount
total_page_count=int(total_record_count/view_count)
if (total_record_count mod view_count)>0 then total_page_count=total_page_count+1
if int(page)>total_page_count then page=total_page_count
page_start=page-right(page,1)
if page_start="0" then
page_start=1
end if
if page_start>1 then
start_more="..."
end if
page_end=(page-right(page,1))+9
if page_end+1>total_page_count then
page_end=total_page_count
else
end_more="..."
end if
%>
<% if article_search="Y" then %>
<% end if %>
<% if recommend_count="Y" then %>
<% end if %>
"" then response.write "align='" & table_align & "'"%> <% if table_width<>"" then response.write " width='" & table_width & "'"%>>
<%if int(page) > 1 then %>
<%else%>
<%end if%>
<%if session("master")<>"" or table="board" or table="notice" or table="freeboard" then%>
<%End if%>
<% if int(total_page_count) > int(page) then%>
<%else%>
<%end if%>
<% if list_form="guestbook" then %>
<% elseif list_form="board" then %>
<% elseif list_form="album" then %>
<% end if %>
<% if article_search="Y" then %>
<% end if %>
<% if result<>"1" then %>
<% if start_more="..." then %>
[1]
...
<% else %>
<% end if%>
<%
for i=page_start to page_end
if not int(page)=i then
%>
[<%=i%>]
<% else %>
<%=i%>
<%
end if
next
if end_more="..." then
%>
... [<%=total_page_count%>]
<% else %>
<% end if %>
<% end if %>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>