
|
 |
 |
 |
no
|
Subject
|
writer
|
data
|
hit
|
|
|
|
|
|
<%
Dim List_scale, Page_scale, Search_key, Search_name, Start_page, Page_count
Dim Count_query, Count_result, Query_result, Query_list, Total_count
List_scale = list_num
Page_scale = page_num
Start_page = INT(Request("Start_page"))
Search_key = Trim(Request("Search_key"))
Search_key = ReplaceApoToNull(Search_key)
Search_name = Trim(Request("Search_name"))
If Request.QueryString("action") = "delok" Then
Dim del_result, del_query ,dellater_query, dellater_result, dellater_count
del_query = "delete from "&free_board & " where uid="&Request.QueryString("uid")
Set del_Result=objConn.Execute(del_query)
If Search_key <> "" Then
dellater_query = "SELECT count(uid) as num FROM "
dellater_query = dellist_query & free_board & " WHERE " & Search_name & " like '%"&Search_key&"%'"
dellater_query = dellater_query & " AND country_code='"&country_code &"'"
Else
dellater_query = "SELECT count(uid) as num FROM "
dellater_query = dellater_query & free_board
dellater_query = dellater_query & " where country_code='"&country_code &"'"
End If
Set dellater_result = objConn.Execute(dellater_query)
dellater_count = dellater_result(0)
If dellater_count <= ((Start_page - 1) * List_scale) Then
Start_page = Start_page - 1
End If
End IF
If (Start_page = "" OR isnull(Start_page) OR Start_page = 0) Then
Start_page = 1
End If
If Search_key <> "" Then
Count_query = "SELECT count(uid) as num FROM "
Count_query = Count_query & free_board & " WHERE " & Search_name & " like '%"&Search_key&"%'"
Count_query = Count_query & " AND country_code='"&country_code &"'"
Query_list = "SELECT TOP " & List_scale
Query_list = Query_list & " uid, fid, parent, thread, user_name, user_email, user_home, subject, view_num, write_date FROM "
Query_list = Query_list & free_board & " WHERE " & Search_name & " like '%"&Search_key&"%'"
Query_list = Query_list & " AND country_code='"&country_code &"'"
If start_page > 1 Then
Query_list = Query_list & " AND uid not in (SELECT TOP " & ((Start_page - 1) * List_scale) & " uid FROM "
Query_list = Query_list & free_board & " WHERE " & Search_name & " like '%" & Search_key & "'"
Query_list = Query_list & " AND country_code='"&country_code &"'"
Query_list = Query_list & " order by fid desc,thread asc,parent asc) "
End If
Query_list = Query_list & " order by fid desc,thread asc,parent asc "
Else
Count_query = "SELECT count(uid) as num FROM "
Count_query = Count_query & free_board
Count_query = Count_query & " where country_code='"&country_code &"'"
Query_list = "SELECT TOP " & List_scale
Query_list = Query_list & " uid, fid, parent, thread, user_name, user_email, user_home, subject, view_num, write_date FROM "
Query_list = Query_list & free_board
Query_list = Query_list & " where country_code='"&country_code &"'"
If start_page > 1 Then
Query_list = Query_list & " AND uid not in (SELECT TOP " & ((Start_page - 1) * List_scale) & " uid FROM "
Query_list = Query_list & free_board
Query_list = Query_list & " where country_code='"&country_code &"'"
Query_list = Query_list & " order by fid desc,thread asc,parent asc) "
End If
Query_list = Query_list & " order by fid desc,thread asc,parent asc "
End If
Set Count_result = objConn.Execute(Count_query)
Total_count = Count_result("num")
Page_count = int((Total_count - 1)/Page_scale) + 1
Set Query_result = objConn.Execute(Query_list)
If (Query_result.BOF= True and Query_result.EOF = True) Then
%>
List is not exit!
|
 |
<%
Else
Dim uid, fid, parent, thread, user_name, user_email, user_home, subject, view_num, write_date
Dim New_list, yy, mm, dd, h, mi, intk , cnbsp, list_number, intj
intj = 0
Do until Query_result.EOF
uid = Query_result("uid")
fid = Query_result("fid")
parent = Query_result("parent")
thread = Query_result("thread")
cnbsp = ""
If thread > 1 Then
for intk = 1 to parent
cnbsp = cnbsp & " "
Next
cnbsp = cnbsp
End If
user_name = Query_result("user_name")
user_email = Query_result("user_email")
user_home = Query_result("user_home")
user_name = ReplaceTag2Text(user_name)
subject = Query_result("subject")
subject = subject_check(subject,25)
subject = ReplaceTag2Text(subject)
write_date = Query_result("write_date")
yy= year(write_date)
mm = right("0" & month(write_date),2)
dd = right("0" & day(write_date),2)
'h = right("0" & hour(write_date),2)
'mi = right("0" & minute(write_date),2)
write_date = yy & ":" & mm & ":" & dd
view_num = Query_result("view_num")
list_number = Total_count - ((Start_page - 1) * 10) - intj
intj = intj + 1
%>
<%=list_number%>
|
<%=cnbsp%><%=subject%>
|
<%=user_name%>
|
<%=write_date%>
|
<%=view_num%>
|
 |
<%
Query_result.Movenext
Loop
End If
%>
|
<%
Dim Page_ten_count, Pre_page, Next_page, intm, intn
Page_ten_count = int(Start_page/Page_scale)
If Start_page > Page_scale Then
Pre_page =( (Page_ten_count - 1) * Page_scale) + 1
Response.Write(" ")
End If
Response.Write(" [ ")
intn = 0
intm = Page_ten_count * Page_scale + 1
If Page_count > 1 Then
For intn = intm to Page_count
If intn >= intm + 10 Then
Exit For
End If
If Start_page = intn Then
Response.Write(""&intn&" ")
Else
Response.Write(""&intn&" ")
End If
Next
Else
Response.Write(""&intm&" ]")
End If
Next_page = (Page_ten_count + 1) * Page_scale + 1
If Page_count >= Next_page Then
Response.Write(" ")
End If
Response.Write(" ")
%>
|
|