Search.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:31k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <% Option Explicit %>
  3. <%session.CodePage="936"%>
  4. <!--#include file="FS_Inc/Const.asp" -->
  5. <!--#include file="FS_InterFace/MF_Function.asp" -->
  6. <!--#include file="FS_Inc/Function.asp" -->
  7. <!--#include file="FS_Inc/Func_Page.asp" -->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by awen
  9. Server.ScriptTimeOut=999
  10. Response.Buffer = True
  11. Response.Expires = -1
  12. Response.ExpiresAbsolute = Now() - 1
  13. Response.CacheControl = "no-cache"
  14. response.Charset = "gb2312"
  15. Dim starttime,endtime
  16. starttime=timer()
  17. function morestr(str,length)
  18. if len(str)>length then 
  19. morestr = left(str,length)&"<strong>...</strong>"
  20. else
  21. morestr = str       
  22. end if   
  23. end function
  24. Dim Conn,Old_News_Conn,Search_Sql,Search_RS,strShowErr,Cookie_Domain,Cookie_Copyright,Cookie_eMail,Cookie_Site_Name
  25. Dim Server_Name,Server_V1,Server_V2
  26. Dim TmpStr,TmpArr,SqlDateType,FileSize,FileEditDate,TmpStr1,TmpStr2
  27. Dim Keyword,s_type,SubSys,ClassId,s_date,e_date  ,GetType
  28. Dim ChildDomain,ClassPath
  29. Dim LocalUrl
  30. GetType = NoSqlHack(request.QueryString("GetType")) ''内部
  31. if GetType = "" then response.Write("请指定必要的参数.") : response.End()
  32. ''日期
  33. If G_IS_SQL_DB = 1 Then  
  34. SqlDateType = "'"
  35. else
  36. SqlDateType = "#"
  37. end if
  38. Function Get_MF_Config()
  39. if request.Cookies("FoosunSearchCookie")("Cookie_Domain") = Get_MF_Domain() then exit Function
  40. set Search_RS=Conn.execute("select top 1 MF_Domain,MF_Site_Name,MF_eMail,MF_Copyright_Info  from FS_MF_Config")
  41. Response.Cookies("FoosunSearchCookie")("Cookie_Domain")=Search_RS("MF_Domain") 
  42. Response.Cookies("FoosunSearchCookie")("Cookie_Copyright")=Search_RS("MF_Copyright_Info") 
  43. Response.Cookies("FoosunSearchCookie")("Cookie_eMail")=Search_RS("MF_eMail") 
  44. Response.Cookies("FoosunSearchCookie")("Cookie_Site_Name")=Search_RS("MF_Site_Name") 
  45. Response.Cookies("FoosunSearchCookie").Expires=Date()+1
  46. Search_RS.close
  47. End Function
  48. '得到新闻单个地址____________________________________________________________
  49. Function get_NewsLink(f_id)
  50. get_NewsLink = ""
  51. dim rs,config_rs,config_mf_rs,class_rs
  52. dim SaveNewsPath,FileName,FileExtName,ClassId,LinkType,MF_Domain,Url_Domain,ClassEName,c_Domain,c_SavePath,IsDomain
  53. set rs = Conn.execute("select ID,IsURL,URLAddress,ClassId,NewsId,SaveNewsPath,FileName,FileExtName From FS_NS_News where NewsId='"&f_id&"'")
  54. SaveNewsPath = rs("SaveNewsPath")
  55. FileName = rs("FileName")
  56. FileExtName = rs("FileExtName")
  57. ClassId = rs("ClassId")
  58. LinkType = Conn.execute("select top 1 LinkType from FS_NS_SysParam")(0)
  59. IsDomain = Conn.execute("select top 1 IsDomain from FS_NS_SysParam")(0)
  60. MF_Domain = Cookie_Domain
  61. set class_rs = Conn.execute("select ClassEName,IsURL,URLAddress,[Domain],SavePath From FS_NS_NewsClass where ClassId='"&ClassId&"'")
  62. if not class_rs.eof then
  63. ClassEName = class_rs("ClassEName")
  64. c_Domain = class_rs("Domain")
  65. c_SavePath = class_rs("SavePath")
  66. class_rs.close:set class_rs=nothing
  67. else
  68. ClassEName = ""
  69. class_rs.close:set class_rs=nothing
  70. end if
  71. if not rs.eof then
  72. if rs("IsURL")=0 then
  73. if LinkType = 1 then
  74. if trim(c_Domain)<>"" then
  75. Url_Domain = "http://"&c_Domain
  76. else
  77. if trim(IsDomain)<>"" then
  78. Url_Domain = "http://"&IsDomain
  79. else
  80. Url_Domain = MF_Domain
  81. end if
  82. end if
  83. else
  84. if trim(c_Domain)<>"" then
  85. Url_Domain = "http://"&c_Domain
  86. else
  87. if trim(IsDomain)<>"" then
  88. Url_Domain = "http://"&IsDomain
  89. else
  90. Url_Domain = ""
  91. end if
  92. end if
  93. end if
  94. if trim(c_Domain)<>"" then
  95. get_NewsLink = Url_Domain & SaveNewsPath &"/"&FileName&"."&FileExtName
  96. LocalUrl = SaveNewsPath &"/"&FileName&"."&FileExtName
  97. else
  98. get_NewsLink = Url_Domain & c_SavePath& "/" & ClassEName &SaveNewsPath &"/"&FileName&"."&FileExtName
  99. LocalUrl = c_SavePath& "/" & ClassEName &SaveNewsPath &"/"&FileName&"."&FileExtName
  100. end if
  101. else
  102. get_NewsLink = rs("URLAddress")
  103. end if
  104. rs.close:set rs=nothing
  105.   else
  106. get_NewsLink = ""
  107. rs.close:set rs=nothing
  108.   end if
  109.   get_NewsLink = get_NewsLink
  110. End Function
  111. ''++++++++++++++++++++++++++++++++++++
  112. '检查本地文件 返回大小和修改日期
  113. Function CheckFile(PhFileName)
  114. dim fsv1,fsv2
  115. fsv1="":fsv2=""
  116. On Error Resume Next
  117. if isnull(PhFileName) or PhFileName="" then CheckFile="|":exit Function
  118. Dim Fso,MyFile
  119. Set Fso = CreateObject(G_FS_FSO)
  120. If Fso.FileExists(server.MapPath(PhFileName)) Then
  121. set MyFile = Fso.GetFile(server.MapPath(PhFileName))
  122. fsv1 = formatnumber(MyFile.Size/1024,2,-1)&"K"
  123. fsv2 = MyFile.DateLastModified
  124. set MyFile = nothing 
  125. End if
  126. if Err<>0 then CheckFile="|":exit Function
  127. Set Fso = Nothing
  128. CheckFile = fsv1&"|"&fsv2
  129. End Function
  130. MF_Default_Conn
  131. MF_Old_News_Conn
  132. Get_MF_Config
  133. Cookie_Domain = request.Cookies("FoosunSearchCookie")("Cookie_Domain")
  134. Cookie_Copyright = request.Cookies("FoosunSearchCookie")("Cookie_Copyright")
  135. Cookie_eMail = request.Cookies("FoosunSearchCookie")("Cookie_eMail")
  136. Cookie_Site_Name = request.Cookies("FoosunSearchCookie")("Cookie_Site_Name")
  137. if Cookie_Domain="" then 
  138. Cookie_Domain = "http://localhost"
  139. else
  140. if left(lcase(Cookie_Domain),len("http://"))<>"http://" then Cookie_Domain = "http://"&Cookie_Domain
  141. if right(Cookie_Domain,1)="/" then Cookie_Domain = mid(Cookie_Domain,1,len(Cookie_Domain) - 1)
  142. end if
  143. ''防盗连
  144. Server_Name = Len(Request.ServerVariables("SERVER_NAME"))
  145. Server_V1 = Left(Replace(Cstr(Request.ServerVariables("HTTP_REFERER")),"http://",""),Server_Name)
  146. Server_V2 = Left(Cstr(Request.ServerVariables("SERVER_NAME")),Server_Name)
  147. if Server_V1 <> Server_V2 and Server_V1 <> "" and Server_V2 <> "" then
  148. response.Write("没有权限,请访问<a href="""&Cookie_Domain&""">"&Cookie_Domain&"</a>.")
  149. response.End()
  150. end if
  151. ''+++++++++++++++++++++++++++++++++++++++++++
  152. select case GetType
  153. case "LoginHtml"
  154. %>
  155. <FONT size=-1><A href="<%=Cookie_Domain&"/User/Login.asp"%>" target="_blank">登录</A></FONT>
  156. <%case "FootHTML"%>
  157. &nbsp;<BR>
  158.         <BR>
  159.         <FONT 
  160.       size=-1><%=Cookie_Copyright%></FONT><BR><BR>
  161.   
  162. <%case "CopyrightHTML"
  163. TmpStr = "<TABLE cellSpacing=0 cellPadding=2 width=""100%"" border=0>"&vbNewLine _ 
  164. &"<TR>"&vbNewLine _ 
  165. &"<TD align=right height=25><font size=-1>"&vbNewLine _
  166. &"<a class=fl href=""javascript:window.external.AddFavorite('"&Cookie_Domain&"', '"&Cookie_Site_Name&"')"">加入收藏</a>"&vbNewLine _
  167. &" - <a class=fl href=""#"" onClick=""this.style.behavior='url(#default#homepage)';this.setHomePage('"&Cookie_Domain&"')"">设为主页</a>"&vbNewLine _
  168. &" - <A class=fl href=""#"">Top</A>"&vbNewLine _
  169. &"</font></TD>"&vbNewLine _
  170. &"</TR>"&vbNewLine _
  171. &"</TABLE>"&vbNewLine _ 
  172. &"</CENTER>"&vbNewLine
  173. response.Write(TmpStr)  
  174. case "MainInfo"
  175. SubSys = Ucase(NoHtmlHackInput(NoSqlHack(request.QueryString("SubSys"))))
  176. Keyword = NoHtmlHackInput(NoSqlHack(request.QueryString("Keyword")))
  177. s_type = NoHtmlHackInput(NoSqlHack(request.QueryString("s_type")))
  178. ClassId = NoHtmlHackInput(NoSqlHack(request.QueryString("ClassId")))
  179. s_date = trim(request.QueryString("s_date"))
  180. e_date = trim(request.QueryString("e_date"))
  181. if Keyword = "" then strShowErr=strShowErr&"<li>关键字不能为空</li>"&vbnewLine
  182. if s_date<>"" then if not isdate(s_date) then strShowErr=strShowErr&"<li>开始日期"&s_date&"非法</li>"&vbnewLine
  183. if e_date<>"" then if not isdate(e_date) then strShowErr=strShowErr&"<li>结束日期"&e_date&"非法</li>"&vbnewLine
  184. if strShowErr<>"" then strShowErr=strShowErr&"<li><a href="""&Cookie_Domain&""">"&Cookie_Domain&"</a>.</li>": response.Write(strShowErr):response.End()
  185. if SubSys="" then SubSys = "NS"
  186. '===========================================
  187. ''sql的处理
  188. select case SubSys
  189. case "NS"
  190. TmpStr = "新闻"
  191. select case s_type
  192. case "title"
  193. s_type="NewsTitle"   
  194. case "stitle"
  195. s_type = "CurtTitle"
  196. case "content"
  197. s_type = "Content"
  198. case "NaviContent"
  199. s_type ="NewsNaviContent"
  200. case "author","source"
  201. s_type = s_type
  202. case "keyword"
  203. s_type = "Keywords"
  204. case else
  205. s_type = "NewsTitle,CurtTitle,NewsNaviContent,Content,author,source,Keywords"
  206. end select
  207. Search_Sql = "select NewsID,NewsTitle,CurtTitle,NewsNaviContent,Content,A.addtime,PopId,ClassName,A.IsURL,isPicNews,NewsSmallPicFile,NewsPicFile," _
  208. &"Source,Author,Hits,TodayNewsPic,ClassEName,SaveNewsPath,FileName,A.FileExtName from FS_NS_News A,FS_NS_NewsClass B where A.ClassID=B.ClassID" _
  209. &" and isLock=0 and isRecyle=0 and isdraft=0 "
  210. if Keyword<>"" then 
  211. if instr(s_type,",")=0 then 
  212. Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"") 
  213. else
  214. TmpArr = split(s_type,",")
  215. TmpStr2 = ""
  216. for each TmpStr1 in  TmpArr
  217. TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&"" 
  218. next
  219. if left(TmpStr2,len(" or "))=" or " then 
  220. TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
  221. end if
  222. end if
  223. end if
  224. if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","") 
  225. if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime>="&SqlDateType&s_date&SqlDateType
  226. if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime<="&SqlDateType&e_date&SqlDateType
  227. case "WS"
  228. TmpStr = "留言本"
  229. select case s_type
  230. case "title"
  231. s_type="Topic"   
  232. case "content"
  233. s_type = "Body"
  234. case "author"
  235. s_type = "User"
  236. case else
  237. s_type = "Topic,Body,User"
  238. end select
  239. Search_Sql = "select A.ID,ClassName,ParentID,User,Topic,Body,A.AddDate,IsTop,State,Style,IsAdmin,Answer,Hit,LastUpdateDate,LastUpdateUser," _
  240. &"Face,IP,Isonline,Vistor,isUpoad " _
  241. &" from FS_WS_BBS A,FS_WS_Class B where A.ClassID=B.ClassID "
  242. if Keyword<>"" then 
  243. if instr(s_type,",")=0 then 
  244. Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"") 
  245. else
  246. TmpArr = split(s_type,",")
  247. TmpStr2 = ""
  248. for each TmpStr1 in  TmpArr
  249. TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&"" 
  250. next
  251. if left(TmpStr2,len(" or "))=" or " then 
  252. TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
  253. end if
  254. end if
  255. end if
  256. if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","") 
  257. if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.AddDate>="&SqlDateType&s_date&SqlDateType
  258. if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.AddDate<="&SqlDateType&e_date&SqlDateType
  259. case "DS"
  260. TmpStr = "下载"
  261. select case s_type
  262. case "title"
  263. s_type="Name"
  264. case "content"
  265. s_type = "Description"
  266. case else
  267. s_type = "Name,Description"
  268. end select
  269. Search_Sql = "select ClassName,Name,Description,A.AddTime,ClickNum,ClassEName,A.SavePath,A.FileExtName,A.FileName," _
  270. &"FileSize,RecTF,Types,Hits,ConsumeNum,A.Pic from FS_DS_List A,FS_DS_Class B where A.ClassID=B.ClassID" _
  271. &" and AuditTF=1 and (OverDue=0 or (OverDue>0 and datediff('d',A.AddTime,'"&date()&"') <= OverDue)) "
  272. if Keyword<>"" then 
  273. if instr(s_type,",")=0 then 
  274. Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"") 
  275. else
  276. TmpArr = split(s_type,",")
  277. TmpStr2 = ""
  278. for each TmpStr1 in  TmpArr
  279. TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&"" 
  280. next
  281. if left(TmpStr2,len(" or "))=" or " then 
  282. TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
  283. end if
  284. end if
  285. end if
  286. if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","") 
  287. if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime>="&SqlDateType&s_date&SqlDateType
  288. if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime<="&SqlDateType&e_date&SqlDateType
  289. case "MS"
  290. TmpStr = "商城"
  291. select case s_type
  292. case "title"
  293. s_type="ProductTitle"
  294. case "content"
  295. s_type = "ProductContent"
  296. case "keyword"
  297. s_type = "Keywords"
  298. case else
  299. s_type = "ProductTitle,ProductContent,Keywords"
  300. end select
  301. Search_Sql = "select ProductTitle,ClassCName,Stockpile,StockpileWarn,OldPrice,NewPrice,IsWholesale,ProductContent,MakeFactory," _
  302. &"ProductsAddress,Click,smallPic,BigPic,StyleFlagBit,SaleStyle,A.AddTime,Discount,DiscountStartDate,DiscountEndDate," _
  303. &" ClassEName,A.SavePath,A.FileExtName,A.FileName from FS_MS_Products A,FS_MS_ProductsClass B where A.ClassID=B.ClassID "
  304. if Keyword<>"" then 
  305. if instr(s_type,",")=0 then 
  306. Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"") 
  307. else
  308. TmpArr = split(s_type,",")
  309. TmpStr2 = ""
  310. for each TmpStr1 in  TmpArr
  311. TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&"" 
  312. next
  313. if left(TmpStr2,len(" or "))=" or " then 
  314. TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
  315. end if
  316. end if
  317. end if
  318. if ClassID<>"" then Search_Sql = and_where(Search_Sql) & Search_TextArr(ClassId,"A.ClassID","") 
  319. if s_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime>="&SqlDateType&s_date&SqlDateType
  320. if e_date<>"" then Search_Sql = and_where(Search_Sql) & " A.addtime<="&SqlDateType&e_date&SqlDateType
  321. case "RD"
  322. TmpStr = "总站归档搜索"
  323. select case s_type
  324. case "title"
  325. s_type="NewsTitle"
  326. case "stitle"
  327. s_type = "CurtTitle"
  328. case "content"
  329. s_type = "Content"
  330. case "NaviContent"
  331. s_type ="NewsNaviContent"
  332. case "author","source"
  333. s_type = s_type
  334. case "keyword"
  335. s_type = "Keywords"
  336. case else
  337. s_type = "NewsTitle,CurtTitle,NewsNaviContent,Content,author,source,Keywords"
  338. end select
  339. Search_Sql = "select ID,NewsID,NewsTitle,CurtTitle,NewsNaviContent,Content,addtime,PopId,IsURL,isPicNews,NewsSmallPicFile,NewsPicFile," _
  340. &"Source,Author,Hits,TodayNewsPic,SaveNewsPath,FileName,FileExtName,FileTime from FS_Old_News " _
  341. &" where isLock=0 and isRecyle=0 and isdraft=0 "
  342. if Keyword<>"" then 
  343. if instr(s_type,",")=0 then 
  344. Search_Sql = and_where(Search_Sql) & Search_TextArr(Keyword,s_type,"") 
  345. else
  346. TmpArr = split(s_type,",")
  347. TmpStr2 = ""
  348. for each TmpStr1 in  TmpArr
  349. TmpStr2 = TmpStr2 & " or " & Search_TextArr(Keyword,TmpStr1,"")&"" 
  350. next
  351. if left(TmpStr2,len(" or "))=" or " then 
  352. TmpStr2 = mid(TmpStr2,len(" or ")+1) : TmpStr2 = " ("&TmpStr2&") " :Search_Sql = and_where(Search_Sql) & TmpStr2
  353. end if
  354. end if
  355. end if
  356. if s_date<>"" then Search_Sql = and_where(Search_Sql) & " addtime>="&SqlDateType&s_date&SqlDateType
  357. if e_date<>"" then Search_Sql = and_where(Search_Sql) & " addtime<="&SqlDateType&e_date&SqlDateType
  358. case else
  359. strShowErr="<li>错误的参数传递.SubSys</li><li><a href="""&Cookie_Domain&""">"&Cookie_Domain&"</a>.</li>": response.Write(strShowErr):response.End()
  360. end select
  361. On Error Resume Next
  362. 'response.Write("["&Search_Sql&"]") '测试用
  363. 'Response.end
  364. Set Search_RS = CreateObject(G_FS_RS)
  365. if SubSys="RD" then 
  366. Search_RS.Open Search_Sql,Old_News_Conn,1,1
  367. Else
  368. Search_RS.Open Search_Sql,Conn,1,1
  369. end if
  370. if Err<>0 then 
  371. response.Write("<li>查询条件不匹配.无法继续.<br />"&Err.Number&":"&Err.description&"</li>")
  372. response.End()
  373. end if
  374. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  375. int_RPP=10 '设置每页显示数目
  376. int_showNumberLink_=10 '数字导航显示数目
  377. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  378. str_nonLinkColor_="#999999" '非热链接颜色
  379. toF_="<font face=webdings>9</font>"    '首页 
  380. toP10_=" <font face=webdings>7</font>" '上十 
  381. toP1_=" <font face=webdings>3</font>" '上一
  382. toN1_=" <font face=webdings>4</font>" '下一
  383. toN10_=" <font face=webdings>8</font>" '下十
  384. toL_="<font face=webdings>:</font>" '尾页
  385. IF Search_RS.eof THEN%>
  386. <TABLE class="t bt" cellSpacing=0 cellPadding=0 width="100%" border=0>
  387.   <TBODY>
  388.   <TR>
  389.     <TD noWrap><FONT size=+1>&nbsp;<B><FONT size=+1>&nbsp;<B><%=TmpStr%></B></FONT>&nbsp;</B></FONT>&nbsp;</TD>
  390.     <TD noWrap align=right>
  391. <FONT size=-1>共有<B>0</B>项符合<B><%=Keyword%></B>的查询结果
  392. (搜索用时 <B><%=FormatNumber((timer()-starttime),2,-1)%></B>毫秒)&nbsp;</FONT>
  393. </TD>
  394.    </TR>
  395.   </TBODY>
  396. </TABLE>
  397. <p><font size=-1 color=#666666>未查询到符合条件的记录。</font></p>
  398. <%else
  399. Dim UrlAndTitle,SaveNewsPath,Content,NewsSmallPicFile,NewsPicFile,addtime,NaviContent ,SysRs_Tmp,ChildPath,picShuXing,picShuXingB
  400. Search_RS.PageSize=int_RPP
  401. cPageNo=Request.QueryString("Page")
  402. If cPageNo="" or not isnumeric(cPageNo) Then cPageNo = 1
  403. cPageNo = Clng(cPageNo)
  404. If cPageNo<1 Then cPageNo=1
  405. If cPageNo>Search_RS.PageCount Then cPageNo=Search_RS.PageCount 
  406. Search_RS.AbsolutePage=cPageNo
  407.   FOR int_Start=1 TO int_RPP 
  408.  
  409. select case  SubSys
  410. case "NS"
  411. SaveNewsPath = get_NewsLink(Search_RS("NewsID"))
  412. UrlAndTitle = "<A class=l href="""&SaveNewsPath&""" target=_blank>"&Search_RS("NewsTitle")&"</A>"
  413. addtime = Search_RS("addtime")
  414. if isnull(addtime) then addtime=""
  415. if isdate(addtime) then addtime = FormatDateTime(addtime,0)
  416. NewsSmallPicFile = Search_RS("NewsSmallPicFile")
  417. NewsPicFile = Search_RS("NewsPicFile")
  418. if NewsSmallPicFile = "" then 
  419. NewsSmallPicFile = "sys_images/NoPic.jpg"
  420. end if
  421. NaviContent = Search_RS("Content")
  422. if isnull(NaviContent) or NaviContent="" then 
  423. NaviContent = "暂无"
  424. else
  425. NaviContent = morestr(Lose_Html(NaviContent),255)
  426. NaviContent = Search_TextArr(Keyword,"Content",NaviContent)
  427. end if
  428. FileSize = split(CheckFile(LocalUrl),"|")(0)
  429. FileEditDate = split(CheckFile(LocalUrl),"|")(1)
  430. case "RD"
  431. SaveNewsPath = ""&Cookie_Domain&"/historynews.asp?id="&Search_RS("ID")&""
  432. UrlAndTitle = "<A class=l href="""&SaveNewsPath&""" target=_blank>"&Search_RS("NewsTitle")&"</A>"
  433. addtime = Search_RS("addtime")
  434. if isnull(addtime) then addtime=""
  435. if isdate(addtime) then addtime = FormatDateTime(addtime,0)
  436. NewsSmallPicFile = Search_RS("NewsSmallPicFile")
  437. NewsPicFile = Search_RS("NewsPicFile")
  438. if NewsSmallPicFile = "" then 
  439. NewsSmallPicFile = "sys_images/NoPic.jpg"
  440. end if
  441. NaviContent = Search_RS("Content")
  442. if isnull(NaviContent) or NaviContent="" then 
  443. NaviContent = "暂无"
  444. else
  445. NaviContent = morestr(Lose_Html(NaviContent),255)
  446. NaviContent = Search_TextArr(Keyword,"Content",NaviContent)
  447. end if
  448. FileSize = ""
  449. FileEditDate = addtime
  450. case "WS"
  451. SaveNewsPath = ""&Cookie_Domain&"/historynews.asp?id="&Search_RS("ID")&""
  452. UrlAndTitle = "<A class=l href="""&SaveNewsPath&""" target=_blank>"&Search_RS("Topic")&"</A>"
  453. addtime = Search_RS("AddDate")
  454. if isnull(addtime) then addtime=""
  455. if isdate(addtime) then addtime = FormatDateTime(addtime,0)
  456. NewsSmallPicFile = Search_RS("Face")
  457. NewsPicFile = Search_RS("Face")
  458. if NewsSmallPicFile = "" then 
  459. NewsSmallPicFile = "sys_images/NoPic.jpg"
  460. else
  461. NewsSmallPicFile = Cookie_Domain&"/sys_images/emot/face"&NewsSmallPicFile&".gif"
  462. end if
  463. NaviContent = Search_RS("Body")
  464. if isnull(NaviContent) or NaviContent="" then 
  465. NaviContent = "暂无"
  466. else
  467. NaviContent = morestr(Lose_Html(NaviContent),255)
  468. NaviContent = Search_TextArr(Keyword,"Body",NaviContent)
  469. end if
  470. FileSize = ""
  471. FileEditDate = addtime
  472. case "DS"
  473. set SysRs_Tmp = Conn.execute("select DownDir,IsDomain From FS_DS_SysPara")
  474. if not SysRs_Tmp.eof then 
  475. if not isnull(SysRs_Tmp("IsDomain")) and SysRs_Tmp("IsDomain") <> "" then 
  476. ChildDomain  =  SysRs_Tmp("IsDomain")
  477. else
  478. ChildDomain =Cookie_Domain&"/"&SysRs_Tmp("DownDir")
  479. end if
  480. LocalUrl = "/"&SysRs_Tmp("DownDir")
  481. end If
  482. SysRs_Tmp.close
  483. if isnull(ChildDomain) then ChildDomain = ""
  484. ClassPath = Search_RS("ClassEName")
  485. if isnull(ClassPath) then ClassPath = ""
  486. if right(ChildDomain,1)="/" then ChildDomain = mid(ChildDomain,1,len(ChildDomain) - 1)
  487. if ChildDomain<>"" then 
  488. if left(lcase(ChildDomain),len("http://"))<>"http://" then ChildDomain = "http://"&ChildDomain
  489. else
  490. ChildDomain = Cookie_Domain
  491. end if
  492. if ClassPath<>"" then ClassPath = replace(ClassPath,"/","")   
  493. if len(ChildDomain&"/"&ClassPath)>1 then ChildPath = ChildDomain&"/"&ClassPath
  494. SaveNewsPath = ChildPath & Search_RS("SavePath")
  495. if right(SaveNewsPath,1)<>"/" then SaveNewsPath = SaveNewsPath&"/"
  496. SaveNewsPath = SaveNewsPath & Search_RS("FileName") &"."& Search_RS("FileExtName")
  497. UrlAndTitle = "<A class=l href="""&SaveNewsPath&""" target=_blank>"&Search_RS("Name")&"</A>"
  498. addtime = Search_RS("addtime")
  499. if isnull(addtime) then addtime=""
  500. if isdate(addtime) then addtime = FormatDateTime(addtime,0)
  501. NewsSmallPicFile = Search_RS("Pic")
  502. NewsPicFile = Search_RS("Pic")
  503. if NewsSmallPicFile = "" then 
  504. NewsSmallPicFile = "sys_images/NoPic.jpg"
  505. end if
  506. NaviContent = Search_RS("Description")
  507. if isnull(NaviContent) or NaviContent="" then 
  508. NaviContent = "暂无"
  509. else
  510. NaviContent = morestr(Lose_Html(NaviContent),255)
  511. NaviContent = Search_TextArr(Keyword,"Description",NaviContent)
  512. end if
  513. LocalUrl = LocalUrl&"/"&ClassPath&Search_RS("SavePath")&"/"&Search_RS("FileName") &"."& Search_RS("FileExtName")
  514. FileSize = split(CheckFile(LocalUrl),"|")(0)
  515. FileEditDate = split(CheckFile(LocalUrl),"|")(1)
  516. case "MS"
  517. set SysRs_Tmp = Conn.execute("select SavePath,IsDomain From FS_MS_SysPara")
  518. if not SysRs_Tmp.eof then 
  519. if not isnull(SysRs_Tmp("IsDomain")) and SysRs_Tmp("IsDomain") <> "" then 
  520. ChildDomain  =  SysRs_Tmp("IsDomain")
  521. else
  522. ChildDomain = SysRs_Tmp("SavePath")
  523. end if
  524. LocalUrl = "/"&SysRs_Tmp("SavePath")
  525. end if
  526. SysRs_Tmp.close
  527. if isnull(ChildDomain) then ChildDomain = ""
  528. ClassPath = Search_RS("ClassEName")
  529. if isnull(ClassPath) then ClassPath = ""
  530. if right(ChildDomain,1)="/" then ChildDomain = mid(ChildDomain,1,len(ChildDomain) - 1)
  531. if ChildDomain<>"" then 
  532. if left(lcase(ChildDomain),len("http://"))<>"http://" then ChildDomain = "http://"&ChildDomain
  533. else
  534. ChildDomain =Cookie_Domain&"/"&SysRs_Tmp("NewsDir")     
  535. end if
  536. if ClassPath<>"" then ClassPath = replace(ClassPath,"/","")
  537. if len(ChildDomain&"/"&ClassPath)>1 then ChildPath = ChildDomain&"/"&ClassPath
  538. SaveNewsPath = ChildPath & Search_RS("SavePath")
  539. if right(SaveNewsPath,1)<>"/" then SaveNewsPath = SaveNewsPath&"/"
  540. SaveNewsPath = SaveNewsPath & Search_RS("FileName") &"."& Search_RS("FileExtName")
  541. UrlAndTitle = "<A class=l href="""&SaveNewsPath&""" target=_blank>"&Search_RS("ProductTitle")&"</A>"
  542. addtime = Search_RS("addtime")
  543. if isnull(addtime) then addtime=""
  544. if isdate(addtime) then addtime = FormatDateTime(addtime,0)
  545. NewsSmallPicFile = Search_RS("smallPic")
  546. NewsPicFile = Search_RS("BigPic")
  547. if NewsSmallPicFile = "" then 
  548. NewsSmallPicFile = "sys_images/NoPic.jpg"
  549. end if
  550. NaviContent = Search_RS("ProductContent")
  551. if isnull(NaviContent) or NaviContent="" then 
  552. NaviContent = "暂无"
  553. else
  554. NaviContent = morestr(Lose_Html(NaviContent),255)
  555. NaviContent = Search_TextArr(Keyword,"ProductContent",NaviContent)
  556. end if
  557. LocalUrl = LocalUrl&"/"&ClassPath&Search_RS("SavePath")&"/"&Search_RS("FileName") &"."& Search_RS("FileExtName")
  558. FileSize = split(CheckFile(LocalUrl),"|")(0)
  559. FileEditDate = split(CheckFile(LocalUrl),"|")(1)
  560. end select
  561. Content="<TABLE cellSpacing=1 cellPadding=1 border=0 width=""80%"">"&vbNewLine _
  562. &"<TBODY>"&vbNewLine _
  563.   &"<TR>"&vbNewLine _  
  564. &"<TD class=pic rowspan=2 align=center>"&vbNewLine 
  565. if NewsPicFile<>"" then 
  566. picShuXingB = CheckFile(NewsPicFile)
  567. if len(picShuXingB)>5 then picShuXingB = "["&picShuXingB&"]" else picShuXingB="" end if 
  568. Content=Content&"<a href="""&NewsPicFile&""" target=""_blank""><img border=0 src="""&NewsSmallPicFile&""" alt=""点击看大图"&picShuXingB&""" onload=""if(this.offsetWidth>120)this.width=120;""></a></TD>"&vbNewLine
  569. else
  570. Content=Content&"<img border=0 src=""sys_images/NoPic.jpg"" onload=""if(this.offsetWidth>120)this.width=120;""></TD>"&vbNewLine
  571. end if
  572. picShuXing="":picShuXingB=""
  573. Content=Content &"<TD class=content valign=top>"&vbNewLine _
  574. &"<font size=-1>"&NaviContent&"</font>"&vbNewLine _
  575. &"</TD>"&vbNewLine _
  576.   &"</TR>"&vbNewLine _
  577.   &"<TR>"&vbNewLine _ 
  578. &"<TD height=21><font size=-1>"&vbNewLine _
  579. &"<font color=#008000>"&SaveNewsPath&" - "&FileSize&" "&FileEditDate&" </font>" _
  580. &"<a class=fl href=""javascript:window.external.AddFavorite('"&SaveNewsPath&"', '"&Cookie_Site_Name&"')"">加入收藏</a>"&vbNewLine _
  581. &" - <a class=fl href=""#"" onClick=""this.style.behavior='url(#default#homepage)';this.setHomePage('"&SaveNewsPath&"')"">设为主页</a>"&vbNewLine
  582. 'Content=Content &" - <a class=fl href=""#"" onClick=""window.open('http://www.ueuo.cn/?URL="&server.URLEncode(SaveNewsPath)&"&KeyWord="&server.URLEncode(Keyword)&"');"">加入网络收藏夹</a>"&vbNewLine 
  583. Content=Content &"</font></TD>"&vbNewLine _
  584.   &"</TR>"&vbNewLine _
  585. &"</TBODY>"&vbNewLine _
  586.    &"</TABLE>"&vbNewLine
  587. if int_Start = 1 then%>      
  588. <TABLE class="t bt" cellSpacing=0 cellPadding=0 width="100%" border=0>
  589.   <TBODY>
  590.   <TR>
  591.     <TD noWrap><FONT size=+1>&nbsp;<B><FONT size=+1>&nbsp;<B><%=TmpStr%></B></FONT>&nbsp;</B></FONT>&nbsp;</TD>
  592.     <TD noWrap align=right>
  593. <FONT size=-1>共有<B><%=Search_RS.recordcount%></B>项符合 <B><%=morestr(Keyword,30)%></B> 的查询结果,
  594. 以下是第 <B>1</B> - <B>10</B> 项。(搜索用时 <B><%=FormatNumber((timer()-starttime),2,-1)%></B> 秒)&nbsp;</FONT>
  595. </TD></TR></TBODY></TABLE>
  596. <%end if%>
  597. <DIV>
  598. <div>
  599.   <P class=g>
  600.   <%
  601.   ''标题
  602.   response.Write(UrlAndTitle)
  603.   response.Write("<font size=-2 color=#666666>")
  604. select case  SubSys
  605. case "NS","RD"
  606.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&addtime&vbNewLine)
  607.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
  608.   if SubSys="NS" then response.Write("<img border=0 src=""sys_images/alert.gif"">"&Replacestr(Search_Rs("ClassName"),":,else:"&Search_Rs("ClassName")))
  609.   response.Write(Replacestr(Search_Rs("PopId"),"5:总置顶,4:栏目置顶,3:总推荐文章,else:普通")&vbNewLine)
  610.   response.Write(Replacestr(Search_Rs("IsURL"),"0:,else: | 标题新闻"))
  611.   response.Write(Replacestr(Search_Rs("isPicNews"),"0:,else: | <img border=0 title=""图"" src=""sys_images/img.jpg"">"))
  612.   response.Write(Replacestr(Search_Rs("TodayNewsPic"),":,else: | 图片头条"))
  613.   response.Write(Replacestr(Search_Rs("Source"),":,else: | "&Search_Rs("Source")))
  614.   response.Write(Replacestr(Search_Rs("Author"),":,else: | "&Search_Rs("Author")))
  615.   response.Write(Replacestr(Search_Rs("Hits"),":,else: | ["&Search_Rs("Hits")&"]"))
  616. case "DS" 
  617.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&addtime&vbNewLine)
  618.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&Replacestr(Search_Rs("ClassName"),":,else:"&Search_Rs("ClassName")))
  619.   response.Write(Replacestr(Search_Rs("RecTF"),"1: | 推荐,else:"))
  620.   response.Write(Replacestr(Search_Rs("Types"),"1: | 图片,2: | 文件,3: | 程序,4: | Flash,5: | 音乐,6: | 影视,7: | 其它"))
  621.   response.Write(Replacestr(Search_Rs("ClickNum"),":,else: | 热度["&Search_Rs("ClickNum")))
  622.   response.Write(Replacestr(Search_Rs("Hits"),":,else: | "&Search_Rs("Hits")&"]"))
  623.   response.Write(Replacestr(Search_Rs("ConsumeNum"),"0:,else: | 需要点数["&Search_Rs("ConsumeNum")&"]"))
  624. case "WS" 
  625.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&addtime&vbNewLine)
  626.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&Replacestr(Search_Rs("ClassName"),":,else:"&Search_Rs("ClassName")))
  627.   response.Write(Replacestr(Search_Rs("ParentID"),"0: | <strong>话题</strong>,else:回复"))
  628.   response.Write(Replacestr(Search_Rs("User"),":未知用户,else:"&Search_Rs("User")))
  629.   response.Write(Replacestr(Search_Rs("IsTop"),"1: | 推荐,else:"))
  630.   response.Write(Replacestr(Search_Rs("Answer"),":,else: | 回复["&Search_Rs("Answer")&"]"))
  631.   response.Write(Replacestr(Search_Rs("Hit"),":,else: | Hit["&Search_Rs("Hit")&"]"))
  632.   response.Write(Replacestr(Search_Rs("LastUpdateDate"),":,else: | LastTime["&Search_Rs("LastUpdateDate")&""))
  633.   response.Write(Replacestr(Search_Rs("LastUpdateUser"),":,else: | "&Search_Rs("LastUpdateUser")&"]"))
  634.   response.Write(Replacestr(Search_Rs("IP"),":,else:"&Search_Rs("IP")))
  635.   response.Write(Replacestr(Search_Rs("Vistor"),"0: | 游客可访,else:"))
  636. case "MS"
  637.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&addtime&vbNewLine)
  638.   response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&Replacestr(Search_Rs("ClassCName"),":,else:"&Search_Rs("ClassCName")))
  639.   response.Write(Replacestr(Search_Rs("StyleFlagBit"),":,else:"&Replacestr(split(Search_Rs("StyleFlagBit"),",")(0),"1: | 推荐,else:")))
  640.   response.Write(Replacestr(Search_Rs("StyleFlagBit"),":,else:"&Replacestr(split(Search_Rs("StyleFlagBit"),",")(1),"1: | 热点,else:")))
  641.   response.Write(Replacestr(Search_Rs("StyleFlagBit"),":,else:"&Replacestr(split(Search_Rs("StyleFlagBit"),",")(2),"1: | 置顶,else:")))
  642.   response.Write(Replacestr(Search_Rs("StyleFlagBit"),":,else:"&Replacestr(split(Search_Rs("StyleFlagBit"),",")(3),"1: | 特价,else:")))
  643.   response.Write(Replacestr(Search_Rs("StyleFlagBit"),":,else:"&Replacestr(split(Search_Rs("StyleFlagBit"),",")(4),"1: | 锁定,else:")))
  644.   response.Write(Replacestr(Search_Rs("StyleFlagBit"),":,else:"&Replacestr(split(Search_Rs("StyleFlagBit"),",")(5),"1: | 促销,else:")))
  645.   response.Write(Replacestr(Search_Rs("Click"),":,else: | ["&Search_Rs("Click")&"]"))
  646.   response.Write(Replacestr(Search_Rs("Stockpile"),":,else: | 库存"&Search_Rs("Stockpile")))
  647.   response.Write(Replacestr(Search_Rs("StockpileWarn"),"1:[<font color=red>库存不够</font>],else:"))
  648.   response.Write(Replacestr(Search_Rs("OldPrice"),"0:,else: | [市场价"&Search_Rs("OldPrice")))
  649.   response.Write(Replacestr(Search_Rs("NewPrice"),"0:0],else: | 商城价"&Search_Rs("NewPrice")&"]"))
  650.   response.Write(Replacestr(left(Search_Rs("IsWholesale"),1),"1: | 可批发,else:"))
  651.   response.Write(Replacestr(Search_Rs("MakeFactory"),":,else: | "&Search_Rs("MakeFactory")))
  652.   response.Write(Replacestr(Search_Rs("ProductsAddress"),":,else: | "&replace(Search_Rs("ProductsAddress"),","," ")))
  653.   response.Write(" | "&Replacestr(Search_Rs("SaleStyle"),"0:正常,1:竞拍,2:一口价,3:特价,4:降价"))
  654.   response.Write(Replacestr(Search_Rs("Discount"),":,else: | 折率["&Search_Rs("Discount")&"]"))
  655.   response.Write(Replacestr(Search_Rs("DiscountStartDate"),":,else:["&Search_Rs("DiscountStartDate")&"-"))
  656.   response.Write(Replacestr(Search_Rs("DiscountEndDate"),":,else:"&Search_Rs("DiscountEndDate")&"]"))
  657. end select
  658.   response.Write("</font>")
  659.   response.Write(Content)
  660. %>
  661. </div>
  662. <%
  663. ''+++++++++++++++++++++++++++++++++++++++
  664. Search_RS.MoveNext
  665. if Search_RS.eof or Search_RS.bof then exit for
  666.   NEXT
  667. %>
  668. <BR clear=all>
  669. <DIV class=n id=navbar> 
  670.   <TABLE cellSpacing=0 cellPadding=0 width="1%" align=center border=0>
  671.     <TBODY>
  672.       <TR style="TEXT-ALIGN: center" vAlign=top align=middle> 
  673.         <TD vAlign=bottom noWrap class=i><FONT size=-1>结果页码:&nbsp;</FONT> 
  674.         <TD noWrap class="i"><font size=-1>&nbsp; 
  675. <%response.Write( fPageCount(Search_RS,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)  & vbcrlf )%>
  676. </font></TR>
  677.     </TBODY>
  678.   </TABLE>
  679. </DIV> 
  680. <%
  681. END IF
  682. RsClose
  683. end select
  684. Sub RsClose()
  685. Search_RS.Close
  686. Set Search_RS = Nothing
  687. end Sub
  688. Set Old_News_Conn = Nothing
  689. Set Conn = Nothing
  690. response.End()
  691. %>