<!--#include file="../../conn.asp"-->
<%
'=====================================================================
'安全校验码
dim vercode

vercode=""   '此处取值请自行修改，必须与发布规则的检查网址中vercode参数一致

if vercode<>trim(request("vercode")) then
	response.Write("[err]invalid vercode[/err]")
	response.End()
end if

'=====================================================================
%>
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/const.asp"-->
<%

Dim InstallDir_ChannelDir,Channel_Setting
If ChannelID=0 Then
	ChannelID=1
Else
	InstallDir_ChannelDir = Trim(NewAsp.InstallDir & NewAsp.ChannelDir)
	Channel_Setting = Split(NewAsp.Channel_Setting & "|||||||||||||||", "|||")
End If

'替换article const.asp 结束

'Admin_header
Dim maxperpage,totalrec,Pcount,pagelinks,pagenow
Dim classid,SQLQuery,SQLField,searchTopic,searchmode,searchfield,fieldName
Dim ChildData,ischild,childstr,Keyword,searchMaxResult,ArryWords()
Keyword = NewAsp.CheckStr(Trim(Request("title")))
searchfield = 0

If Len(Keyword)>1 Then
	Call showmain()
else
	response.Write("[err]no title[/err]")
End If
'Admin_footer
NewAsp.PageEnd

Sub showmain()
	classid=NewAsp.ChkNumeric(Request("classid"))

	If classid>0 Then
		ChildData=NewAsp.GetChildData(ChannelID,classid,0)
		childstr=ChildData(0)
		ischild=CLng(ChildData(2))
	End If
	if searchTopicList>0 then
		response.Write("[yes]")
	else
		response.Write("[no]")	
	end if
	searchTopic=Null
End Sub

function searchTopicList()
	Dim Rs,SQL,i,iCount,ArryKeyword
	totalrec=0
	Select Case searchfield
		Case 0:fieldName="A.Title"
		Case 1:fieldName="A.username"
		Case 2:fieldName="A.Author"
		Case 3:fieldName="A.ComeFrom"
		Case 9:fieldName="A.Taglist"
		Case Else
			fieldName="A.Title"
	End Select
'	If Len(Keyword)>1 Then
		SQLQuery = ""&fieldName&" = '"&Keyword&"'"

		If Len(SQLQuery) >10 Then SQLQuery=" And ("&SQLQuery&")" Else SQLQuery=""
		If classid>0 Then
			If ischild>0 Then
				SQLQuery=" And A.isAccept=1 And A.classid in (" & childstr & ") "&SQLQuery
			Else
				SQLQuery=" And A.isAccept=1 And A.classid="&classid&" "&SQLQuery
			End If
		Else
			SQLQuery=" And A.isAccept=1 "&SQLQuery
		End If

		If Not IsObject(Conn) Then ConnectionDatabase
		Set Rs=NewAsp.CreateAXObject("ADODB.Recordset")
		SQL="SELECT count(*) as Rcount FROM [NC_Article] A  WHERE A.ChannelID=" &ChannelID& " "&SQLQuery
		'response.Write(SQL)
		Rs.Open SQL,Conn,1,1
		searchTopicList=Rs("Rcount")
		Rs.close()
		Set Rs=Nothing
'	End If

End function



%>