%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% Option Explicit %>
<%session.CodePage="936"%>
<%'Copyright (c) 2006 Foosun Inc. Code by awen
Server.ScriptTimeOut=999
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.CacheControl = "no-cache"
response.Charset = "gb2312"
Dim starttime,endtime
starttime=timer()
function morestr(str,length)
if len(str)>length then
morestr = left(str,length)&"..."
else
morestr = str
end if
end function
Dim Conn,Old_News_Conn,User_Conn,Search_Sql,Search_RS,strShowErr,Cookie_Domain,Cookie_Copyright,Cookie_eMail,Cookie_Site_Name
Dim Server_Name,Server_V1,Server_V2
Dim TmpStr,TmpArr,SqlDateType,FileSize,FileEditDate,TmpStr1,TmpStr2
Dim Keyword,s_type,SubSys,ClassId,s_date,e_date ,GetType,AreaID,PubType
Dim ChildDomain,ClassPath
Dim LocalUrl,RDSqlDateType
Dim MsMinPric,MsMaxPric
Dim StringType
IF G_IS_SQL_DB = 1 Then
StringType = "SubString"
Else
StringType = "Mid"
End If
GetType = NoSqlHack(request.QueryString("GetType")) ''内部
if GetType = "" then response.Write("请指定必要的参数.") : response.End()
''日期
If G_IS_SQL_DB = 1 Then
SqlDateType = "'"
else
SqlDateType = "#"
end If
Function Get_MF_Config()
if request.Cookies("FoosunSearchCookie")("Cookie_Domain") = Get_MF_Domain() then exit Function
set Search_RS=Conn.execute("select top 1 MF_Domain,MF_Site_Name,MF_eMail,MF_Copyright_Info from FS_MF_Config")
Response.Cookies("FoosunSearchCookie")("Cookie_Domain")=Search_RS("MF_Domain")
Response.Cookies("FoosunSearchCookie")("Cookie_Copyright")=Search_RS("MF_Copyright_Info")
Response.Cookies("FoosunSearchCookie")("Cookie_eMail")=Search_RS("MF_eMail")
Response.Cookies("FoosunSearchCookie")("Cookie_Site_Name")=Search_RS("MF_Site_Name")
Response.Cookies("FoosunSearchCookie").Expires=Date()+1
Search_RS.close
End Function
'得到信息链接地址
Function GetTheInfoLink(InfoID,InfoType)
Dim LinkObj
Select Case InfoType
Case "NS"
Set LinkObj = New cls_NS
GetTheInfoLink = LinkObj.get_NewsLink(InfoID)
Set LinkObj = Nothing
Case "DS"
Set LinkObj = New cls_DS
GetTheInfoLink = LinkObj.get_DownLink(InfoID)
Set LinkObj = Nothing
Case "MS"
Set LinkObj = New cls_MS
GetTheInfoLink = LinkObj.get_productsLink(InfoID)
Set LinkObj = Nothing
End Select
End Function
''得到相关表的值。
Function Get_OtherTable_Value(This_Fun_Sql)
Dim This_Fun_Rs
if instr(This_Fun_Sql," FS_ME_")>0 then
set This_Fun_Rs = User_Conn.execute(This_Fun_Sql)
else
set This_Fun_Rs = Conn.execute(This_Fun_Sql)
end if
if instr(lcase(This_Fun_Sql)," in ")>0 then
do while not This_Fun_Rs.eof
Get_OtherTable_Value = Get_OtherTable_Value & This_Fun_Rs(0) &" "
This_Fun_Rs.movenext
loop
else
if not This_Fun_Rs.eof then
Get_OtherTable_Value = This_Fun_Rs(0)
else
Get_OtherTable_Value = ""
end if
end if
set This_Fun_Rs=nothing
End Function
'得到新闻单个地址____________________________________________________________
Public Function get_NewsLink(f_id)
get_NewsLink = ""
dim rs,config_rs,config_mf_rs,class_rs
dim SaveNewsPath,FileName,FileExtName,ClassId,LinkType,MF_Domain,Url_Domain,ClassEName,c_Domain,c_SavePath,IsDomain
set rs = Conn.execute("select ID,IsURL,URLAddress,ClassId,NewsId,SaveNewsPath,FileName,FileExtName From FS_NS_News where NewsId='"&f_id&"'")
if not rs.eof then
SaveNewsPath = rs("SaveNewsPath")
FileName = rs("FileName")
FileExtName = rs("FileExtName")
ClassId = rs("ClassId")
LinkType = Conn.execute("select top 1 LinkType from FS_NS_SysParam")(0)
IsDomain = Conn.execute("select top 1 IsDomain from FS_NS_SysParam")(0)
MF_Domain = Cookie_Domain
set class_rs = Conn.execute("select ClassEName,IsURL,URLAddress,[Domain],SavePath From FS_NS_NewsClass where ClassId='"&ClassId&"'")
if not class_rs.eof then
ClassEName = class_rs("ClassEName")
c_Domain = class_rs("Domain")
c_SavePath = class_rs("SavePath")
class_rs.close:set class_rs=nothing
else
ClassEName = ""
class_rs.close:set class_rs=nothing
end if
if rs("IsURL")=0 then
if LinkType = 1 then
if trim(c_Domain)<>"" then
Url_Domain = "http://"&c_Domain
else
if trim(IsDomain)<>"" then
Url_Domain = "http://"&IsDomain
c_SavePath = ""
else
Url_Domain = MF_Domain
c_SavePath = c_SavePath
end if
end if
else
if trim(c_Domain)<>"" then
Url_Domain = "http://"&c_Domain
else
if trim(IsDomain)<>"" then
Url_Domain = "http://"&IsDomain
c_SavePath = ""
else
if G_VIRTUAL_ROOT_DIR<>"" then
Url_Domain = "/"& G_VIRTUAL_ROOT_DIR
else
Url_Domain = ""
end if
c_SavePath = c_SavePath
end if
end if
end if
if trim(c_Domain)<>"" then
get_NewsLink = Url_Domain & replace(SaveNewsPath &"/"&FileName&"."&FileExtName,"//","/")
else
get_NewsLink = Url_Domain & replace(c_SavePath& "/" & ClassEName &SaveNewsPath &"/"&FileName&"."&FileExtName,"//","/")
end if
else
get_NewsLink = rs("URLAddress")
end if
rs.close:set rs=nothing
else
get_NewsLink = ""
rs.close:set rs=nothing
end if
End Function
''++++++++++++++++++++++++++++++++++++
'检查本地文件 返回大小和修改日期
Function CheckFile(PhFileName)
dim fsv1,fsv2
fsv1="":fsv2=""
On Error Resume Next
if isnull(PhFileName) or PhFileName="" then CheckFile="|":exit Function
Dim Fso,MyFile
Set Fso = CreateObject(G_FS_FSO)
If Left(LCase(PhFileName),7) = "http://" Then
CheckFile="|":exit Function
Else
IF Left(PhFileName,1) <> "/" Then
CheckFile="|":exit Function
End If
End If
If Fso.FileExists(server.MapPath(PhFileName)) Then
set MyFile = Fso.GetFile(server.MapPath(PhFileName))
fsv1 = formatnumber(MyFile.Size/1024,2,-1)&"K"
fsv2 = MyFile.DateLastModified
set MyFile = nothing
End if
if Err<>0 then CheckFile="|":exit Function
Set Fso = Nothing
CheckFile = fsv1&"|"&fsv2
End Function
MF_Default_Conn
MF_User_Conn
MF_Old_News_Conn
Get_MF_Config
SubSys_Cookies:MFConfig_Cookies:NSConfig_Cookies:DSConfig_Cookies
Cookie_Domain = request.Cookies("FoosunSearchCookie")("Cookie_Domain")
Cookie_Copyright = request.Cookies("FoosunSearchCookie")("Cookie_Copyright")
Cookie_eMail = request.Cookies("FoosunSearchCookie")("Cookie_eMail")
Cookie_Site_Name = request.Cookies("FoosunSearchCookie")("Cookie_Site_Name")
if Cookie_Domain="" then
Cookie_Domain = "http://localhost"
else
if left(lcase(Cookie_Domain),len("http://"))<>"http://" then Cookie_Domain = "http://"&Cookie_Domain
if right(Cookie_Domain,1)="/" then Cookie_Domain = mid(Cookie_Domain,1,len(Cookie_Domain) - 1)
end if
''防盗连
Server_Name = Len(Request.ServerVariables("SERVER_NAME"))
Server_V1 = Left(Replace(Cstr(Request.ServerVariables("HTTP_REFERER")),"http://",""),Server_Name)
Server_V2 = Left(Cstr(Request.ServerVariables("SERVER_NAME")),Server_Name)
if Server_V1 <> Server_V2 and Server_V1 <> "" and Server_V2 <> "" then
response.Write("没有权限,请访问"&Cookie_Domain&".")
response.End()
end if
''+++++++++++++++++++++++++++++++++++++++++++
select case GetType
case "LoginHtml"
%>
<%case "FootHTML"%>
<%=Cookie_Copyright%>
<%case "CopyrightHTML"
TmpStr = "
"&vbNewLine _
&""&vbNewLine _
&" | "&vbNewLine _
&"
"&vbNewLine _
&"
"&vbNewLine _
&""&vbNewLine
response.Write(TmpStr)
case "MainInfo"
SubSys = Ucase(NoHtmlHackInput(NoSqlHack(request.QueryString("SubSys"))))
Keyword = NoHtmlHackInput(NoSqlHack(request.QueryString("Keyword")))
s_type = NoHtmlHackInput(NoSqlHack(request.QueryString("s_type")))
ClassId = NoHtmlHackInput(NoSqlHack(request.QueryString("ClassId")))
AreaID = NoHtmlHackInput(NoSqlHack(request.QueryString("s_area")))
PubType = NoHtmlHackInput(NoSqlHack(request.QueryString("PubType")))
s_date = trim(request.QueryString("s_date"))
e_date = trim(request.QueryString("e_date"))
If e_date <> "" And Len(e_date) <= 10 Then
e_date = e_date & " " & Hour(Now()) & ":" & Minute(Now()) & ":" & Second(Now())
End If
If SubSys <> "SD" And SubSys <> "HS" Then
If Keyword = "" then
strShowErr=strShowErr&"关键字不能为空"&vbnewLine
End If
End If
if s_date<>"" then if not isdate(s_date) then strShowErr=strShowErr&"开始日期"&s_date&"非法"&vbnewLine
if e_date<>"" then if not isdate(e_date) then strShowErr=strShowErr&"结束日期"&e_date&"非法"&vbnewLine
if strShowErr<>"" then strShowErr=strShowErr&""&Cookie_Domain&".": response.Write(strShowErr):response.End()
if SubSys="" then SubSys = "NS"
'===========================================
''sql的处理
select case SubSys
case "NS"
TmpStr = ""
select case s_type
case "title"
s_type="NewsTitle"
case "stitle"
s_type = "CurtTitle"
case "content"
s_type = "Content"
case "NaviContent"
s_type ="NewsNaviContent"
case "author","source"
s_type = s_type
case "keyword"
s_type = "Keywords"
case else
s_type = "NewsTitle,CurtTitle,NewsNaviContent,Content,author,source,Keywords"
end select
Search_Sql = "select NewsID,NewsTitle,CurtTitle,NewsNaviContent,Content,A.addtime,PopId,ClassName,A.IsURL,isPicNews,NewsSmallPicFile,NewsPicFile," _
&"Source,Author,Hits,TodayNewsPic,ClassEName,SaveNewsPath,FileName,A.FileExtName from FS_NS_News A,FS_NS_NewsClass B where A.ClassID=B.ClassID" _
&" and isLock=0 and isRecyle=0 and isdraft=0 "
if Keyword<>"" then
if instr(s_type,",")=0 then
Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"")
else
TmpArr = split(s_type,",")
TmpStr2 = ""
for each TmpStr1 in TmpArr
TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&""
next
if left(TmpStr2,len(" or "))=" or " then
TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
end if
end if
end if
if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","")
if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime>="&SqlDateType&s_date&SqlDateType
if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime<="&SqlDateType&e_date&SqlDateType
case "WS"
TmpStr = "留言本"
select case s_type
case "title"
s_type="Topic"
case "content"
s_type = "Body"
case "author"
s_type = "User"
case else
s_type = "Topic,Body,User"
end select
Search_Sql = "select A.ID,ClassName,ParentID,User,Topic,Body,A.AddDate,IsTop,State,Style,IsAdmin,Answer,Hit,LastUpdateDate,LastUpdateUser," _
&"Face,IP,Isonline,Vistor,isUpoad " _
&" from FS_WS_BBS A,FS_WS_Class B where A.ClassID=B.ClassID "
if Keyword<>"" then
if instr(s_type,",")=0 then
Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"")
else
TmpArr = split(s_type,",")
TmpStr2 = ""
for each TmpStr1 in TmpArr
TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&""
next
if left(TmpStr2,len(" or "))=" or " then
TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
end if
end if
end if
if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","")
if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.AddDate>="&SqlDateType&s_date&SqlDateType
if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.AddDate<="&SqlDateType&e_date&SqlDateType
case "DS"
TmpStr = "下载"
select case s_type
case "title"
s_type="Name"
case "content"
s_type = "Description"
case else
s_type = "Name,Description"
end select
Dim DataStr
IF G_IS_SQL_DB = 1 Then
DataStr = "datediff(d,A.AddTime,"&date()&")"
Else
DataStr = "datediff('d',A.AddTime,'"&date()&"')"
End If
Search_Sql = "select DownLoadID,ClassName,Name,Description,A.AddTime,ClickNum,ClassEName,A.SavePath,A.FileExtName,A.FileName," _
&"FileSize,RecTF,Types,Hits,ConsumeNum,A.Pic from FS_DS_List A,FS_DS_Class B where A.ClassID=B.ClassID" _
&" and AuditTF=1 and (OverDue=0 or (OverDue>0 and " & DataStr & " <= OverDue)) "
if Keyword<>"" then
if instr(s_type,",")=0 then
Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"")
else
TmpArr = split(s_type,",")
TmpStr2 = ""
for each TmpStr1 in TmpArr
TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&""
next
if left(TmpStr2,len(" or "))=" or " then
TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
end if
end if
end if
if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","")
if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime>="&SqlDateType&s_date&SqlDateType
if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime<="&SqlDateType&e_date&SqlDateType
case "MS"
TmpStr = "商城"
select case s_type
case "title"
s_type="ProductTitle"
case "content"
s_type = "ProductContent"
case "keyword"
s_type = "Keywords"
case else
s_type = "ProductTitle,ProductContent,Keywords"
end select
'-----
MsMinPric = Trim(NoHtmlHackInput(NoSqlHack(request.QueryString("MinPric"))))
MsMaxPric = Trim(NoHtmlHackInput(NoSqlHack(request.QueryString("MaxPric"))))
'------
Search_Sql = "select ID,ProductTitle,ClassCName,Stockpile,StockpileWarn,OldPrice,NewPrice,IsWholesale,ProductContent,MakeFactory," _
&"ProductsAddress,Click,smallPic,BigPic,StyleFlagBit,SaleStyle,A.AddTime,Discount,DiscountStartDate,DiscountEndDate," _
&" ClassEName,A.SavePath,A.FileExtName,A.FileName from FS_MS_Products A,FS_MS_ProductsClass B where A.ClassID=B.ClassID "
if Keyword<>"" then
if instr(s_type,",")=0 then
Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"")
else
TmpArr = split(s_type,",")
TmpStr2 = ""
for each TmpStr1 in TmpArr
TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&""
next
if left(TmpStr2,len(" or "))=" or " then
TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
end if
end if
end if
if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","")
if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime>="&SqlDateType&s_date&SqlDateType
if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime<="&SqlDateType&e_date&SqlDateType
If MsMinPric <> "" And IsNumeric(MsMinPric) Then Search_Sql = and_where(Search_Sql) & " A.NewPrice>="&MsMinPric
If MsMaxPric <> "" And IsNumeric(MsMaxPric) Then Search_Sql = and_where(Search_Sql) & " A.NewPrice<="&MsMaxPric
case "RD"
If G_IS_SQL_Old_News_DB = 1 Then
RDSqlDateType = "'"
else
RDSqlDateType = "#"
end if
TmpStr = "总站归档搜索"
select case s_type
case "title"
s_type="NewsTitle"
case "stitle"
s_type = "CurtTitle"
case "content"
s_type = "Content"
case "NaviContent"
s_type ="NewsNaviContent"
case "author","source"
s_type = s_type
case "keyword"
s_type = "Keywords"
case else
s_type = "NewsTitle,CurtTitle,NewsNaviContent,Content,author,source,Keywords"
end select
Search_Sql = "select ID,NewsID,NewsTitle,CurtTitle,NewsNaviContent,Content,addtime,PopId,IsURL,isPicNews,NewsSmallPicFile,NewsPicFile," _
&"Source,Author,Hits,TodayNewsPic,SaveNewsPath,FileName,FileExtName,FileTime from FS_Old_News " _
&" where isLock=0 and isRecyle=0 and isdraft=0 "
if Keyword<>"" then
if instr(s_type,",")=0 then
Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"")
else
TmpArr = split(s_type,",")
TmpStr2 = ""
for each TmpStr1 in TmpArr
TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&""
next
if left(TmpStr2,len(" or "))=" or " then
TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
end if
end if
end If
if s_date<>"" then Search_Sql = and_where(Search_Sql) & " addtime>="&RDSqlDateType&s_date&RDSqlDateType
if e_date<>"" then Search_Sql = and_where(Search_Sql) & " addtime<="&RDSqlDateType&e_date&RDSqlDateType
case "SD"
Dim ValidTime
TmpStr = "供求"
if G_IS_SQL_DB=1 then
ValidTime = " and dateadd(d,ValidTime,EditTime)>=getdate() "
else
ValidTime = " and dateadd('d',ValidTime,EditTime)>=date() "
end if
Search_Sql = "select A.ID,A.UserNumber,PubTitle,PubType,PubContent,Keyword,CompType,PubNumber,PubPrice,PubPack,Pubgui,PubPic_1,PubPic_2,PubPic_3," _
&"A.Addtime,EditTime,ValidTime,PubAddress,otherLink,hits,GQ_ClassName,C.ClassName,AreaID,A.ClassID from FS_SD_News A,FS_SD_Class B,FS_SD_Address C " _
&"where A.ClassID=B.ID and A.AreaID = C.ID and A.isLock=0 and A.HideTF=0 and isPass=1 "&ValidTime
'---ken
If Keyword <> "" Then Search_Sql = and_where(Search_Sql) & " A.PubTitle Like '%"&Keyword&"%' "
'---end
if ClassID<>"" then Search_Sql = and_where(Search_Sql) & " A.ClassID="&ClassId&" "
if AreaID<>"" then Search_Sql = and_where(Search_Sql) & " A.AreaID="&AreaID&" "
if PubType<>"" then if cint(PubType)>0 then Search_Sql = and_where(Search_Sql) & " A.PubType="&cint(PubType)-1&" "
Search_Sql = Search_Sql & " order by C.ClassLevel desc,B.ClassOrder desc,A.hits desc,A.ID desc"
'----------2007-01-18 Edit By Ken For Fs_House Search
Case "HS"
Dim HSType,QH_Type,THKWD_Type,THUse_Type,THInfo_Type,THHouse_Type,THZX_Type
Dim SHKey_Type,SHUse_Type,SHHouse_Type,SHZX_Type
Dim KWDsType,HSsql
HSType = NoHtmlHackInput(NoSqlHack(request.QueryString("HSType")))
'If HSType = "" Then : Response.Write "参数传递错误" : Response.End : End If
'---- 匹配信息发布时间范围
If s_date <> "" And e_date <> "" Then
If G_IS_SQL_DB = 1 Then
HSsql = HSsql & " And PubDate >= '" & s_date & "' And PubDate <= '" & e_date & "'"
Else
HSsql = HSsql & " And PubDate >= #" & s_date & "# And PubDate <= #" & e_date & "#"
End If
Else
HSsql = HSsql
End If
If HSType = "Quotation" Then
TmpStr = "楼盘信息搜索"
KWDsType = NoHtmlHackInput(NoSqlHack(request.QueryString("QHKey_Type")))
QH_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("QH_Type")))
Select Case KWDsType '匹配搜索关键字
Case "QHTitle"
If Keyword <> "" Then
HSsql = HSsql & " And HouseName Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "QHAddress"
If Keyword <> "" Then
HSsql = HSsql & " And Position Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "QHSell"
If Keyword <> "" Then
HSsql = HSsql & " And PreSaleRange Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "QHSellNum"
If Keyword <> "" Then
HSsql = HSsql & " And PreSaleNumber Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "QHInfo"
If Keyword <> "" Then
HSsql = HSsql & " And introduction Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "QHTelNum"
If Keyword <> "" Then
HSsql = HSsql & " And Tel Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case Else
HSsql = HSsql
End Select
'---- 匹配房屋状况
If QH_Type <> "" Then
QH_Type = Cint(QH_Type)
HSsql = HSsql & " And Status = " & QH_Type
Else
HSsql = HSsql
End If
'---匹配查询sql语句
Search_Sql = "Select ID,HouseName,Position,Direction,Class,OpenDate,PreSaleNumber,IssueDate,PreSaleRange,Status,Price,PubDate,Tel,Click,UserNumber,introduction From FS_HS_Quotation Where isRecyle = 0 And Audited = 1" & HSsql & " Order By ID Desc,PubDate Desc"
ElseIf HSType = "Tenancy" Then
TmpStr = "租赁信息搜索"
THKWD_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("THKey_Type")))
THUse_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("THUse_Type")))
THInfo_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("THInfo_Type")))
THHouse_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("THHouse_Type")))
THZX_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("THZX_Type")))
'-----匹配查询关键字
Select Case THKWD_Type
Case "THTitle"
If Keyword <> "" Then
HSsql = HSsql & " And Position Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "THAdd"
If Keyword <> "" Then
HSsql = HSsql & " And CityArea Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "THAouth"
If Keyword <> "" Then
HSsql = HSsql & " And LinkMan Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "THInfo"
If Keyword <> "" Then
HSsql = HSsql & " And Remark Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case Else
HSsql = HSsql
End Select
'---匹配房屋用途
If THUse_Type <> "" Then
THUse_Type = Cint(THUse_Type)
HSsql = HSsql & " And UseFor = " & THUse_Type
Else
HSsql = HSsql
End If
'---匹配信息类型
If THInfo_Type <> "" Then
THInfo_Type = Cint(THInfo_Type)
HSsql = HSsql & " And Class = " & THInfo_Type
Else
HSsql = HSsql
End If
'---匹配户型
If THHouse_Type <> "" Then
If THHouse_Type = "Other" Then
HSsql = HSsql & " And " & StringType & "(HouseStyle,1,1) > 3 And " & StringType & "(HouseStyle,3,1) > 2"
Else
HSsql = HSsql & " And " & StringType & "(HouseStyle,1,1) = '" & Split(THHouse_Type,",")(0) & "' And " & StringType & "(HouseStyle,3,1) = '" & Split(THHouse_Type,",")(1) & "'"
End If
Else
HSsql = HSsql
End If
'---匹配装修类型
If THZX_Type <> "" Then
THZX_Type = Cint(THZX_Type)
HSsql = HSsql & " And Decoration = " & THZX_Type
Else
HSsql = HSsql
End If
'---匹配查询sql语句
Search_Sql = "Select TID,UseFor,Class,Position,CityArea,Price,HouseStyle,Area,Floor,BuildDate,equip,Decoration,LinkMan,Contact,Period,Remark,PubDate From FS_HS_Tenancy Where Audited = 1 And isRecyle = 0" & HSsql & " Order By TID Desc,PubDate Desc"
Else
TmpStr = "二手房信息搜索"
SHKey_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("SHKey_Type")))
SHUse_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("SHUse_Type")))
SHHouse_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("SHHouse_Type")))
SHZX_Type = NoHtmlHackInput(NoSqlHack(request.QueryString("SHZX_Type")))
'---匹配搜索关键字
Select Case SHKey_Type
Case "SHNum"
If Keyword <> "" Then
HSsql = HSsql & " And Label = '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "SHAdd"
If Keyword <> "" Then
HSsql = HSsql & " And Address Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "SHCent"
If Keyword <> "" Then
HSsql = HSsql & " And CityArea Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "SHAouth"
If Keyword <> "" Then
HSsql = HSsql & " And LinkMan Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case "SHInfo"
If Keyword <> "" Then
HSsql = HSsql & " And Remark Like '%" & Keyword & "%'"
Else
HSsql = HSsql
End If
Case Else
HSsql = HSsql
End Select
'---匹配房屋用途
If SHUse_Type <> "" Then
SHUse_Type = Cint(SHUse_Type)
HSsql = HSsql & " And UseFor = " & SHUse_Type
Else
HSsql = HSsql
End If
'---匹配户型
If SHHouse_Type <> "" Then
If SHHouse_Type = "Other" Then
HSsql = HSsql & " And " & StringType & "(HouseStyle,1,1) > 3 And " & StringType & "(HouseStyle,3,1) > 2"
Else
HSsql = HSsql & " And " & StringType & "(HouseStyle,1,1) = '" & Split(SHHouse_Type,",")(0) & "' And " & StringType & "(HouseStyle,3,1) = '" & Split(SHHouse_Type,",")(1) & "'"
End If
Else
HSsql = HSsql
End If
'---匹配装修类型
If SHZX_Type <> "" Then
SHZX_Type = Cint(SHZX_Type)
HSsql = HSsql & " And Decoration = " & SHZX_Type
Else
HSsql = HSsql
End If
'---匹配搜索sql语句
Search_Sql = "Select SID,Class,UserNumber,Label,UseFor,FloorType,BelongType,HouseStyle,Structure,Area,BuildDate,Price,CityArea,Address,Floor,Position,Decoration,LinkMan,Contact,Contact,Remark,PubDate From FS_HS_Second Where Audited = 1 And isRecyle = 0" & HSsql & " Order By SID Desc,PubDate Desc"
End If
'------------------
case else
strShowErr="错误的参数传递.SubSys"&Cookie_Domain&".": response.Write(strShowErr):response.End()
end select
'On Error Resume Next
Set Search_RS = CreateObject(G_FS_RS)
if SubSys="RD" then
Search_RS.Open Search_Sql,Old_News_Conn,1,1
Else
Search_RS.Open Search_Sql,Conn,1,1
end if
if Err<>0 then
response.Write("查询条件不匹配.无法继续.
"&Err.Number&":"&Err.description&"")
response.End()
end if
Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
int_RPP=20 '设置每页显示数目
int_showNumberLink_=10 '数字导航显示数目
showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
str_nonLinkColor_="#999999" '非热链接颜色
toF_="9" '首页
toP10_=" 7" '上十
toP1_=" 3" '上一
toN1_=" 4" '下一
toN10_=" 8" '下十
toL_=":" '尾页
IF Search_RS.eof THEN%>
| <%=TmpStr%> |
共有0项符合<%=Keyword%>的查询结果
(搜索用时 <%=FormatNumber((timer()-starttime),2,-1)%>毫秒)
|
未查询到符合条件的记录。
<%else
Dim UrlAndTitle,SaveNewsPath,Content,NewsSmallPicFile,NewsPicFile,addtime,NaviContent ,SysRs_Tmp,ChildPath,picShuXing,picShuXingB
Dim rndpic,DBUserName,sdnextdoman
Search_RS.PageSize=int_RPP
cPageNo=Request.QueryString("Page")
If cPageNo="" or not isnumeric(cPageNo) Then cPageNo = 1
cPageNo = Clng(cPageNo)
If cPageNo<1 Then cPageNo=1
If cPageNo>Search_RS.PageCount Then cPageNo=Search_RS.PageCount
Search_RS.AbsolutePage=cPageNo
FOR int_Start=1 TO int_RPP
select case SubSys
case "NS"
SaveNewsPath = GetTheInfoLink(Search_RS("NewsID"),"NS")
UrlAndTitle = ""&Search_RS("NewsTitle")&""
addtime = Search_RS("addtime")
if isnull(addtime) then addtime=""
if isdate(addtime) then addtime = FormatDateTime(addtime,0)
NewsSmallPicFile = Search_RS("NewsSmallPicFile")
NewsPicFile = Search_RS("NewsPicFile")
if NewsSmallPicFile = "" then
NewsSmallPicFile = "images/sys/NoPic.jpg"
end if
NaviContent = Search_RS("Content")
if isnull(NaviContent) or NaviContent="" then
NaviContent = "暂无"
else
NaviContent = morestr(Lose_Html(NaviContent),255)
NaviContent = morestr(Lose_Html(NaviContent),255)
If NaviContent <> "" Then
NaviContent = Search_TextArr(Keyword,"Content",NaviContent)
Else
NaviContent = "详细内容请点击标题浏览"
End If
end if
FileSize = split(CheckFile(LocalUrl),"|")(0)
FileEditDate = split(CheckFile(LocalUrl),"|")(1)
case "RD"
SaveNewsPath = ""&Cookie_Domain&"/historynews.asp?id="&Search_RS("ID")&""
UrlAndTitle = ""&Search_RS("NewsTitle")&""
addtime = Search_RS("addtime")
if isnull(addtime) then addtime=""
if isdate(addtime) then addtime = FormatDateTime(addtime,0)
NewsSmallPicFile = Search_RS("NewsSmallPicFile")
NewsPicFile = Search_RS("NewsPicFile")
if NewsSmallPicFile = "" then
NewsSmallPicFile = "images/sys/NoPic.jpg"
end if
NaviContent = Search_RS("Content")
if isnull(NaviContent) or NaviContent="" then
NaviContent = "暂无"
else
NaviContent = morestr(Lose_Html(NaviContent),255)
If NaviContent <> "" Then
NaviContent = Search_TextArr(Keyword,"Content",NaviContent)
Else
NaviContent = "详细内容请点击标题浏览"
End If
end if
FileSize = ""
FileEditDate = addtime
case "WS"
SaveNewsPath = ""&Cookie_Domain&"/historynews.asp?id="&Search_RS("ID")&""
UrlAndTitle = ""&Search_RS("Topic")&""
addtime = Search_RS("AddDate")
if isnull(addtime) then addtime=""
if isdate(addtime) then addtime = FormatDateTime(addtime,0)
NewsSmallPicFile = Search_RS("Face")
NewsPicFile = Search_RS("Face")
if NewsSmallPicFile = "" then
NewsSmallPicFile = "images/sys/NoPic.jpg"
else
NewsSmallPicFile = Cookie_Domain&"/images/sys/emot/face"&NewsSmallPicFile&".gif"
end if
NaviContent = Search_RS("Body")
if isnull(NaviContent) or NaviContent="" then
NaviContent = "暂无"
else
NaviContent = morestr(Lose_Html(NaviContent),255)
NaviContent = Search_TextArr(Keyword,"Body",NaviContent)
end if
FileSize = ""
FileEditDate = addtime
case "DS"
set SysRs_Tmp = Conn.execute("select DownDir,IsDomain From FS_DS_SysPara")
if not SysRs_Tmp.eof then
if not isnull(SysRs_Tmp("IsDomain")) and SysRs_Tmp("IsDomain") <> "" then
ChildDomain = SysRs_Tmp("IsDomain")
else
ChildDomain =Cookie_Domain&"/"&SysRs_Tmp("DownDir")
end if
LocalUrl = "/"&SysRs_Tmp("DownDir")
end If
SysRs_Tmp.close
if isnull(ChildDomain) then ChildDomain = ""
ClassPath = Search_RS("ClassEName")
if isnull(ClassPath) then ClassPath = ""
if right(ChildDomain,1)="/" then ChildDomain = mid(ChildDomain,1,len(ChildDomain) - 1)
if ChildDomain<>"" then
if left(lcase(ChildDomain),len("http://"))<>"http://" then ChildDomain = "http://"&ChildDomain
else
ChildDomain = Cookie_Domain
end if
if ClassPath<>"" then ClassPath = replace(ClassPath,"/","")
if len(ChildDomain&"/"&ClassPath)>1 then ChildPath = ChildDomain&"/"&ClassPath
SaveNewsPath = ChildPath & Search_RS("SavePath")
if right(SaveNewsPath,1)<>"/" then SaveNewsPath = SaveNewsPath&"/"
SaveNewsPath = SaveNewsPath & Search_RS("FileName") &"."& Search_RS("FileExtName")
SaveNewsPath = GetTheInfoLink(Search_RS("DownLoadID"),"DS")
UrlAndTitle = ""&Search_RS("Name")&""
addtime = Search_RS("addtime")
if isnull(addtime) then addtime=""
if isdate(addtime) then addtime = FormatDateTime(addtime,0)
NewsSmallPicFile = Search_RS("Pic")
NewsPicFile = Search_RS("Pic")
if NewsSmallPicFile = "" then
NewsSmallPicFile = "images/sys/NoPic.jpg"
end if
NaviContent = Search_RS("Description")
if isnull(NaviContent) or NaviContent="" then
NaviContent = "暂无"
else
NaviContent = morestr(Lose_Html(NaviContent),255)
NaviContent = Search_TextArr(Keyword,"Description",NaviContent)
end if
LocalUrl = LocalUrl&"/"&ClassPath&Search_RS("SavePath")&"/"&Search_RS("FileName") &"."& Search_RS("FileExtName")
FileSize = split(CheckFile(LocalUrl),"|")(0)
FileEditDate = split(CheckFile(LocalUrl),"|")(1)
case "MS"
set SysRs_Tmp = Conn.execute("select SavePath,IsDomain From FS_MS_SysPara")
if not SysRs_Tmp.eof then
if not isnull(SysRs_Tmp("IsDomain")) and SysRs_Tmp("IsDomain") <> "" then
ChildDomain = SysRs_Tmp("IsDomain")
else
ChildDomain = Cookie_Domain & "/" & SysRs_Tmp("SavePath")
end if
LocalUrl = "/"&SysRs_Tmp("SavePath")
end if
SysRs_Tmp.close
if isnull(ChildDomain) then ChildDomain = ""
ClassPath = Search_RS("ClassEName")
if isnull(ClassPath) then ClassPath = ""
if right(ChildDomain,1)="/" then ChildDomain = mid(ChildDomain,1,len(ChildDomain) - 1)
if ChildDomain<>"" then
if left(lcase(ChildDomain),len("http://"))<>"http://" then ChildDomain = "http://"&ChildDomain
else
ChildDomain =Cookie_Domain&"/"&SysRs_Tmp("NewsDir")
end if
if ClassPath<>"" then ClassPath = replace(ClassPath,"/","")
if len(ChildDomain&"/"&ClassPath)>1 then ChildPath = ChildDomain&"/"&ClassPath
SaveNewsPath = ChildPath & Search_RS("SavePath")
if right(SaveNewsPath,1)<>"/" then SaveNewsPath = SaveNewsPath&"/"
SaveNewsPath = SaveNewsPath & Search_RS("FileName") &"."& Search_RS("FileExtName")
SaveNewsPath = GetTheInfoLink(Search_RS("ID"),"MS")
UrlAndTitle = ""&Search_RS("ProductTitle")&""
addtime = Search_RS("addtime")
if isnull(addtime) then addtime=""
if isdate(addtime) then addtime = FormatDateTime(addtime,0)
NewsSmallPicFile = Search_RS("smallPic")
NewsPicFile = Search_RS("BigPic")
if NewsSmallPicFile = "" then
NewsSmallPicFile = "images/sys/NoPic.jpg"
end if
NaviContent = Search_RS("ProductContent")
if isnull(NaviContent) or NaviContent="" then
NaviContent = "暂无"
else
NaviContent = morestr(Lose_Html(NaviContent),255)
NaviContent = Search_TextArr(Keyword,"ProductContent",NaviContent)
end if
LocalUrl = LocalUrl&"/"&ClassPath&Search_RS("SavePath")&"/"&Search_RS("FileName") &"."& Search_RS("FileExtName")
FileSize = split(CheckFile(LocalUrl),"|")(0)
FileEditDate = split(CheckFile(LocalUrl),"|")(1)
case "SD"
sdnextdoman = Get_OtherTable_Value("select top 1 [Domain] from FS_SD_Config")
if sdnextdoman<>"" then
SaveNewsPath = "http://"&sdnextdoman&"/Supply.asp?id="&Search_RS("ID")
else
SaveNewsPath = ""&Cookie_Domain&"/Supply/Supply.asp?id="&Search_RS("ID")
end if
UrlAndTitle = "["&Replacestr(Search_RS("PubType"),"0:供应,1:求购,2:合作,3:代理,4:其它")&"] " _
&""&Search_RS("PubTitle")&""
addtime = Search_RS("Addtime")
if isnull(addtime) then addtime=""
if isdate(addtime) then addtime = FormatDateTime(addtime,0)
randomize
rndpic = Int(3 * Rnd + 1)
NewsSmallPicFile = Search_RS("PubPic_"&rndpic)
NewsPicFile = NewsSmallPicFile
if NewsSmallPicFile = "" then NewsSmallPicFile = "images/sys/NoPic.jpg"
NaviContent = Search_RS("PubContent")
if isnull(NaviContent) or NaviContent="" then
NaviContent = "暂无"
else
NaviContent = morestr(Lose_Html(NaviContent),255)
NaviContent = Search_TextArr(Keyword,"PubContent",NaviContent)
end if
FileSize = ""
FileEditDate = Search_RS("EditTime")
Case "HS"
Dim HsPicSql,HsPicRs
sdnextdoman = Get_OtherTable_Value("select top 1 isDomain from FS_HS_SysPara")
If LCase(HSType) = "quotation" Then
if sdnextdoman<>"" then
SaveNewsPath = "http://"&sdnextdoman&"/BuildingRead.asp?id="&Search_RS("ID")
else
SaveNewsPath = ""&Cookie_Domain&"/House/BuildingRead.asp?id="&Search_RS("ID")
end if
UrlAndTitle = ""&Search_RS("HouseName")&""
HsPicSql = "Select * From FS_HS_Picture Where HS_Type = 1 And ID = " & Search_RS("ID")
ElseIf LCase(HSType) = "second" Then
if sdnextdoman<>"" then
SaveNewsPath = "http://"&sdnextdoman&"/SecondRead.asp?id="&Search_RS("SID")
else
SaveNewsPath = ""&Cookie_Domain&"/House/SecondRead.asp?id="&Search_RS("SID")
end if
UrlAndTitle = ""&Search_RS("Address")&""
HsPicSql = "Select * From FS_HS_Picture Where HS_Type = 3 And ID = "&Search_RS("SID")
Else
if sdnextdoman<>"" then
SaveNewsPath = "http://"&sdnextdoman&"/HouseRead.asp?id="&Search_RS("TID")
else
SaveNewsPath = ""&Cookie_Domain&"/House/HouseRead.asp?id="&Search_RS("TID")
end if
UrlAndTitle = ""&Search_RS("Position")&""
HsPicSql = "Select * From FS_HS_Picture Where HS_Type = 2 And ID = "&Search_RS("TID")
End If
Set HsPicRs = Conn.ExeCute(HsPicSql)
If HsPicRs.Eof Then
NewsSmallPicFile = ""
Else
NewsSmallPicFile = HsPicRs("Pic")
End If
HsPicRs.Close : Set HsPicRs = Nothing
NewsPicFile = NewsSmallPicFile
if NewsSmallPicFile = "" then NewsSmallPicFile = "images/sys/NoPic.jpg"
addtime = Search_RS("PubDate")
if isnull(addtime) then addtime=""
if isdate(addtime) then addtime = FormatDateTime(addtime,0)
If LCase(HSType) = "quotation" Then
NaviContent = Search_RS("introduction")
Else
NaviContent = Search_RS("Remark")
End if
if isnull(NaviContent) or NaviContent="" then
NaviContent = "暂无"
else
NaviContent = morestr(Lose_Html(NaviContent),255)
NaviContent = Search_TextArr(Keyword,"Remark",NaviContent)
end if
FileSize = ""
FileEditDate = Search_RS("PubDate")
end select
if int_Start = 1 then%>
| <%=TmpStr%> |
共有<%=Search_RS.recordcount%>项符合 <%=morestr(Keyword,30)%> 的查询结果,
以下是第 1 - 10 项。(搜索用时 <%=FormatNumber((timer()-starttime),2,-1)%> 秒)
|
<%end if%>
<%
''+++++++++++++++++++++++++++++++++++++++
Search_RS.MoveNext
if Search_RS.eof or Search_RS.bof then exit for
NEXT
%>
| 结果页码:
|
<%response.Write( fPageCount(Search_RS,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo) & vbcrlf )%>
|
<%
END IF
RsClose
end select
Sub RsClose()
Search_RS.Close
Set Search_RS = Nothing
end Sub
Set Old_News_Conn = Nothing
Set User_Conn = Nothing
Set Conn = Nothing
response.End()
%>