Cls_Template.asp
上传用户:jiajie98
上传日期:2020-04-24
资源大小:1206k
文件大小:44k
源码类别:

网格计算

开发平台:

PHP

  1. <%
  2. '==========================================
  3. '文 件 名:Cls_Template.asp
  4. '文件用途:模板引擎函数类
  5. '版权所有:方卡在线
  6. '==========================================
  7. Class Cls_Template
  8. Private TemplateTag,TemplatePar,TemplateBCode
  9. Private If1,If2
  10. '==============================
  11. '函 数 名:SiteChange
  12. '作    用:替换站点参数
  13. '参    数:
  14. '==============================
  15. Public Function SiteChange(TemplateCode)
  16. TemplateCode=Replace(TemplateCode,"{$SiteName$}",SiteName)
  17. TemplateCode=Replace(TemplateCode,"{$SiteUrl$}",SiteUrl)
  18. TemplateCode=Replace(TemplateCode,"{$SiteKeyword$}",SiteKeyword)
  19. TemplateCode=Replace(TemplateCode,"{$SiteDescription$}",SiteDescription)
  20. TemplateCode=Replace(TemplateCode,"{$SiteSkin$}",SiteDir&"Skin/"&SiteTemplate&"/")
  21. TemplateCode=Replace(TemplateCode,"{$SiteDir$}",SiteDir)
  22. TemplateCode=Replace(TemplateCode,"{$SystemName$}",FkSystemNameEn)
  23. TemplateCode=Replace(TemplateCode,"{$SystemVersion$}",FkSystemVersion)
  24. SiteChange=TemplateCode
  25. End Function
  26. '==============================
  27. '函 数 名:PageChange
  28. '作    用:替换信息页参数
  29. '参    数:
  30. '==============================
  31. Public Function PageChange(TemplateCode)
  32. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=0 And Fk_Module_Id=" & Id
  33. Rs.Open Sqlstr,Conn,1,3
  34. If Not Rs.Eof Then
  35. TemplateCode=Replace(TemplateCode,"{$PageTitle$}",Rs("Fk_Module_Name"))
  36. TemplateCode=Replace(TemplateCode,"{$PageKeyword$}",Rs("Fk_Module_Keyword"))
  37. TemplateCode=Replace(TemplateCode,"{$PageDescription$}",Rs("Fk_Module_Description"))
  38. End If
  39. Rs.Close
  40. PageChange=TemplateCode
  41. End Function
  42. '==============================
  43. '函 数 名:JobChange
  44. '作    用:替换招聘页参数
  45. '参    数:
  46. '==============================
  47. Public Function JobChange(TemplateCode)
  48. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=6 And Fk_Module_Id=" & Id
  49. Rs.Open Sqlstr,Conn,1,3
  50. If Not Rs.Eof Then
  51. TemplateCode=Replace(TemplateCode,"{$JobTitle$}",Rs("Fk_Module_Name"))
  52. End If
  53. Rs.Close
  54. JobChange=TemplateCode
  55. End Function
  56. '==============================
  57. '函 数 名:PageNows
  58. '作    用:当前位置
  59. '参    数:
  60. '==============================
  61. Public Function PageNows(ModuleId)
  62. PageNows=""
  63. While ModuleId>0
  64. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Id=" & ModuleId
  65. Rs.Open Sqlstr,Conn,1,3
  66. If Not Rs.Eof Then
  67. ModuleId=Rs("Fk_Module_Level")
  68. PageNows="&nbsp;&nbsp;&raquo;&nbsp;&nbsp;"&"<a href="""&GetGoUrl(Rs("Fk_Module_Type"),Rs("Fk_Module_Id"),Rs("Fk_Module_Dir"),Rs("Fk_Module_FileName"))&""" title="""&Rs("Fk_Module_Name")&""">"&Rs("Fk_Module_Name")&"</a>"&PageNows
  69. Else
  70. ModuleId=0
  71. End If
  72. Rs.Close
  73. Wend
  74. PageNows="<a href="""&SiteDir&""" title=""首页"">首页</a>"&PageNows
  75. End Function
  76. '==============================
  77. '函 数 名:InfoChange
  78. '作    用:替换信息页参数
  79. '参    数:
  80. '==============================
  81. Public Function InfoChange(TemplateCode)
  82. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=3 And Fk_Module_Id=" & Id
  83. Rs.Open Sqlstr,Conn,1,3
  84. If Not Rs.Eof Then
  85. TemplateCode=Replace(TemplateCode,"{$InfoTitle$}",Rs("Fk_Module_Name"))
  86. TemplateCode=Replace(TemplateCode,"{$InfoKeyword$}",Rs("Fk_Module_Keyword"))
  87. TemplateCode=Replace(TemplateCode,"{$InfoDescription$}",Rs("Fk_Module_Description"))
  88. Temp=Rs("Fk_Module_Content")
  89. Rs.Close
  90. Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
  91. Rs.Open Sqlstr,Conn,1,3
  92. While Not Rs.Eof
  93. Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
  94. Rs.MoveNext
  95. Wend
  96. TemplateCode=Replace(TemplateCode,"{$InfoContent$}",Temp)
  97. End If
  98. Rs.Close
  99. InfoChange=TemplateCode
  100. End Function
  101. '==============================
  102. '函 数 名:ArticleListChange
  103. '作    用:替换文章列表页参数
  104. '参    数:
  105. '==============================
  106. Public Function ArticleListChange(TemplateCode)
  107. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=1 And Fk_Module_Id=" & Id
  108. Rs.Open Sqlstr,Conn,1,3
  109. If Not Rs.Eof Then
  110. TemplateCode=Replace(TemplateCode,"{$ArticleCategoryName$}",Rs("Fk_Module_Name"))
  111. TemplateCode=Replace(TemplateCode,"{$ArticleCategoryId$}",Id)
  112. TemplateCode=Replace(TemplateCode,"{$ArticleCategoryKeyword$}",Rs("Fk_Module_Keyword"))
  113. TemplateCode=Replace(TemplateCode,"{$ArticleCategoryDescription$}",Rs("Fk_Module_Description"))
  114. End If
  115. Rs.Close
  116. ArticleListChange=TemplateCode
  117. End Function
  118. '==============================
  119. '函 数 名:ProductListChange
  120. '作    用:替换产品列表页参数
  121. '参    数:
  122. '==============================
  123. Public Function ProductListChange(TemplateCode)
  124. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=2 And Fk_Module_Id=" & Id
  125. Rs.Open Sqlstr,Conn,1,3
  126. If Not Rs.Eof Then
  127. TemplateCode=Replace(TemplateCode,"{$ProductCategoryName$}",Rs("Fk_Module_Name"))
  128. TemplateCode=Replace(TemplateCode,"{$ProductCategoryId$}",Id)
  129. TemplateCode=Replace(TemplateCode,"{$ProductCategoryKeyword$}",Rs("Fk_Module_Keyword"))
  130. TemplateCode=Replace(TemplateCode,"{$ProductCategoryDescription$}",Rs("Fk_Module_Description"))
  131. End If
  132. Rs.Close
  133. ProductListChange=TemplateCode
  134. End Function
  135. '==============================
  136. '函 数 名:DownListChange
  137. '作    用:替换下载列表页参数
  138. '参    数:
  139. '==============================
  140. Public Function DownListChange(TemplateCode)
  141. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=7 And Fk_Module_Id=" & Id
  142. Rs.Open Sqlstr,Conn,1,3
  143. If Not Rs.Eof Then
  144. TemplateCode=Replace(TemplateCode,"{$DownCategoryName$}",Rs("Fk_Module_Name"))
  145. TemplateCode=Replace(TemplateCode,"{$DownCategoryId$}",Id)
  146. TemplateCode=Replace(TemplateCode,"{$DownCategoryKeyword$}",Rs("Fk_Module_Keyword"))
  147. TemplateCode=Replace(TemplateCode,"{$DownCategoryDescription$}",Rs("Fk_Module_Description"))
  148. End If
  149. Rs.Close
  150. DownListChange=TemplateCode
  151. End Function
  152. '==============================
  153. '函 数 名:ArticleChange
  154. '作    用:替换文章页参数
  155. '参    数:
  156. '==============================
  157. Public Function ArticleChange(TemplateCode)
  158. Sqlstr="Select * From [Fk_ArticleList] Where Fk_Article_Show=1 And Fk_Article_Id=" & Id
  159. Rs.Open Sqlstr,Conn,1,3
  160. If Not Rs.Eof Then
  161. TemplateCode=Replace(TemplateCode,"{$ArticleId$}",Id)
  162. TemplateCode=Replace(TemplateCode,"{$ArticleTitle$}",Rs("Fk_Article_Title"))
  163. TemplateCode=Replace(TemplateCode,"{$ArticleFrom$}",Rs("Fk_Article_From"))
  164. TemplateCode=Replace(TemplateCode,"{$ArticleModuleName$}",Rs("Fk_Module_Name"))
  165. TemplateCode=Replace(TemplateCode,"{$ArticleModuleId$}",Rs("Fk_Module_Id"))
  166. TemplateCode=Replace(TemplateCode,"{$ArticleTime$}",Rs("Fk_Article_Time"))
  167. TemplateCode=Replace(TemplateCode,"{$ArticleKeyword$}",Rs("Fk_Article_Keyword"))
  168. TemplateCode=Replace(TemplateCode,"{$ArticleDescription$}",Rs("Fk_Article_Description"))
  169. TemplateCode=Replace(TemplateCode,"{$ArticleClick$}","<span id=""Click""></span>")
  170. Temp=Rs("Fk_Article_Content")
  171. Rs.Close
  172. Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
  173. Rs.Open Sqlstr,Conn,1,3
  174. While Not Rs.Eof
  175. Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
  176. Rs.MoveNext
  177. Wend
  178. TemplateCode=Replace(TemplateCode,"{$ArticleContent$}",Temp)
  179. End If
  180. Rs.Close
  181. ArticleChange=TemplateCode
  182. End Function
  183. '==============================
  184. '函 数 名:ProductChange
  185. '作    用:替换产品页参数
  186. '参    数:
  187. '==============================
  188. Public Function ProductChange(TemplateCode)
  189. Sqlstr="Select * From [Fk_ProductList] Where Fk_Product_Show=1 And Fk_Product_Id=" & Id
  190. Rs.Open Sqlstr,Conn,1,3
  191. If Not Rs.Eof Then
  192. TemplateCode=Replace(TemplateCode,"{$ProductId$}",Id)
  193. TemplateCode=Replace(TemplateCode,"{$ProductTitle$}",Rs("Fk_Product_Title"))
  194. TemplateCode=Replace(TemplateCode,"{$ProductTime$}",Rs("Fk_Product_Time"))
  195. TemplateCode=Replace(TemplateCode,"{$ProductDate$}",FormatDateTime(Rs("Fk_Product_Time"),2))
  196. TemplateCode=Replace(TemplateCode,"{$ProductPic$}",Rs("Fk_Product_Pic"))
  197. TemplateCode=Replace(TemplateCode,"{$ProductModuleName$}",Rs("Fk_Module_Name"))
  198. TemplateCode=Replace(TemplateCode,"{$ProductModuleId$}",Rs("Fk_Module_Id"))
  199. TemplateCode=Replace(TemplateCode,"{$ProductKeyword$}",Rs("Fk_Product_Keyword"))
  200. TemplateCode=Replace(TemplateCode,"{$ProductDescription$}",Rs("Fk_Product_Description"))
  201. TemplateCode=Replace(TemplateCode,"{$ProductClick$}","<span id=""Click""></span>")
  202. Temp=Rs("Fk_Product_Content")
  203. Rs.Close
  204. Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
  205. Rs.Open Sqlstr,Conn,1,3
  206. While Not Rs.Eof
  207. Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
  208. Rs.MoveNext
  209. Wend
  210. TemplateCode=Replace(TemplateCode,"{$ProductContent$}",Temp)
  211. End If
  212. Rs.Close
  213. ProductChange=TemplateCode
  214. End Function
  215. '==============================
  216. '函 数 名:DownChange
  217. '作    用:替换下载页参数
  218. '参    数:
  219. '==============================
  220. Public Function DownChange(TemplateCode)
  221. Sqlstr="Select * From [Fk_DownList] Where Fk_Down_Show=1 And Fk_Down_Id=" & Id
  222. Rs.Open Sqlstr,Conn,1,3
  223. If Not Rs.Eof Then
  224. TemplateCode=Replace(TemplateCode,"{$DownId$}",Id)
  225. TemplateCode=Replace(TemplateCode,"{$DownTitle$}",Rs("Fk_Down_Title"))
  226. TemplateCode=Replace(TemplateCode,"{$DownLanguage$}",Rs("Fk_Down_Language"))
  227. TemplateCode=Replace(TemplateCode,"{$DownSystem$}",Rs("Fk_Down_System"))
  228. TemplateCode=Replace(TemplateCode,"{$DownFile$}",Rs("Fk_Down_File"))
  229. TemplateCode=Replace(TemplateCode,"{$DownTime$}",Rs("Fk_Down_Time"))
  230. TemplateCode=Replace(TemplateCode,"{$DownDate$}",FormatDateTime(Rs("Fk_Down_Time"),2))
  231. TemplateCode=Replace(TemplateCode,"{$DownPic$}",Rs("Fk_Down_Pic"))
  232. TemplateCode=Replace(TemplateCode,"{$DownModuleName$}",Rs("Fk_Module_Name"))
  233. TemplateCode=Replace(TemplateCode,"{$DownModuleId$}",Rs("Fk_Module_Id"))
  234. TemplateCode=Replace(TemplateCode,"{$DownKeyword$}",Rs("Fk_Down_Keyword"))
  235. TemplateCode=Replace(TemplateCode,"{$DownDescription$}",Rs("Fk_Down_Description"))
  236. TemplateCode=Replace(TemplateCode,"{$DownClick$}","<span id=""Click""></span>")
  237. Temp=Rs("Fk_Down_Content")
  238. Rs.Close
  239. Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
  240. Rs.Open Sqlstr,Conn,1,3
  241. While Not Rs.Eof
  242. Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
  243. Rs.MoveNext
  244. Wend
  245. TemplateCode=Replace(TemplateCode,"{$DownContent$}",Temp)
  246. End If
  247. Rs.Close
  248. DownChange=TemplateCode
  249. End Function
  250. '==============================
  251. '函 数 名:GBookChange
  252. '作    用:替换留言页参数
  253. '参    数:
  254. '==============================
  255. Public Function GBookChange(TemplateCode)
  256. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=4 And Fk_Module_Id=" & Id
  257. Rs.Open Sqlstr,Conn,1,3
  258. If Not Rs.Eof Then
  259. TemplateCode=Replace(TemplateCode,"{$GBookTitle$}",Rs("Fk_Module_Name"))
  260. TemplateCode=Replace(TemplateCode,"{$GBookId$}",Id)
  261. TemplateCode=Replace(TemplateCode,"{$GBookKeyword$}",Rs("Fk_Module_Keyword"))
  262. TemplateCode=Replace(TemplateCode,"{$GBookDescription$}",Rs("Fk_Module_Description"))
  263. End If
  264. Rs.Close
  265. GBookChange=TemplateCode
  266. End Function
  267. '==============================
  268. '函 数 名:SubjectChange
  269. '作    用:专题页参数
  270. '参    数:
  271. '==============================
  272. Public Function SubjectChange(TemplateCode)
  273. TemplateCode=Replace(TemplateCode,"{$SubjectName$}",Fk_Subject_Name)
  274. SubjectChange=TemplateCode
  275. End Function
  276. '==============================
  277. '函 数 名:FileChange
  278. '作    用:替换模板模块参数
  279. '参    数:
  280. '==============================
  281. Public Function FileChange(TemplateCode)
  282. While Instr(TemplateCode,"{$File(")
  283. Temp=Split(Split(TemplateCode,"{$File(")(1),")$}")(0)
  284. Sqlstr="Select * From [Fk_Template] Where Fk_Template_Name='"&Temp&"'"
  285. Rs.Open Sqlstr,Conn,1,3
  286. If Not Rs.Eof Then
  287. TemplateCode=Replace(TemplateCode,"{$File("&Temp&")$}",Rs("Fk_Template_Content"))
  288. Else
  289. TemplateCode=Replace(TemplateCode,"{$File("&Temp&")$}","")
  290. End If
  291. Rs.Close
  292. Wend
  293. FileChange=TemplateCode
  294. End Function
  295. '========================标签处理区===========================
  296. '==============================
  297. '函 数 名:FkNav
  298. '作    用:菜单标签操作
  299. '参    数:
  300. '==============================
  301. Private Function FkNav(BCode,BPar)
  302. Dim NavUrl
  303. TempArr=Split(BPar,"/")
  304. While TempArr(3)<0 And TempArr(1)>0
  305. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Id="&TempArr(1)&""
  306. Rs.Open Sqlstr,Conn,1,3
  307. If Not Rs.Eof Then
  308. TempArr(1)=Rs("Fk_Module_Level")
  309. TempArr(3)=TempArr(3)+1
  310. Else
  311. TempArr(1)=0
  312. End If
  313. Rs.Close
  314. Wend
  315. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Show=1 And Fk_Module_Menu="&TempArr(0)&" And Fk_Module_Level="&TempArr(1)&" Order By Fk_Module_Order Asc,Fk_Module_Id Asc"
  316. Rs.Open Sqlstr,Conn,1,3
  317. While Not Rs.Eof
  318. If Rs("Fk_Module_Type")=5 Then
  319. NavUrl=Rs("Fk_Module_Url")
  320. Else
  321. NavUrl=GetGoUrl(Rs("Fk_Module_Type"),Rs("Fk_Module_Id"),Rs("Fk_Module_Dir"),Rs("Fk_Module_FileName"))
  322. End If
  323. FkNav=FkNav&BCode
  324. FkNav=Replace(FkNav,"{$NavId$}",Rs("Fk_Module_Id"))
  325. FkNav=Replace(FkNav,"{$NavName$}",Rs("Fk_Module_Name"))
  326. FkNav=Replace(FkNav,"{$NavUr$}",NavUrl)
  327. FkNav=Replace(FkNav,"{$NavId$}",Rs("Fk_Module_Id"))
  328. If TempArr(2)>1 Then
  329. FkNav=Replace(FkNav,"{$NavSub$}",FkNavs(Rs("Fk_Module_Id"),Clng(TempArr(2))-1))
  330. End If
  331. Rs.MoveNext
  332. Wend
  333. Rs.Close
  334. End Function
  335. '==============================
  336. '函 数 名:FkNavs
  337. '作    用:读取多级菜单操作
  338. '参    数:当前父ID GetId,还要读取级数GetCount
  339. '==============================
  340. Private Function FkNavs(GetId,GetCount)
  341. Dim NavUrl,Rs2
  342. Set Rs2=Server.Createobject("Adodb.RecordSet")
  343. Sqlstr="Select * From [Fk_Module] Where Fk_Module_Show=1 And Fk_Module_Level="&GetId&" Order By Fk_Module_Order Desc,Fk_Module_Id Asc"
  344. Rs2.Open Sqlstr,Conn,1,3
  345. If Not Rs2.Eof Then
  346. FkNavs="<ul>" & vbCrLf
  347. While Not Rs2.Eof
  348. If Rs2("Fk_Module_Type")=5 Then
  349. NavUrl=Rs2("Fk_Module_Url")
  350. Else
  351. NavUrl=GetGoUrl(Rs2("Fk_Module_Type"),Rs2("Fk_Module_Id"),Rs2("Fk_Module_Dir"),Rs2("Fk_Module_FileName"))
  352. End If
  353. FkNavs=FkNavs&"<li><a href="""&NavUrl&""">"&Rs2("Fk_Module_Name")&"</a>"
  354. If GetCount>1 Then
  355. FkNavs=FkNavs&FkNavs(Rs2("Fk_Module_Id"),GetCount-1)
  356. End If
  357. FkNavs=FkNavs&"</li>" & vbCrLf
  358. Rs2.MoveNext
  359. Wend
  360. FkNavs=FkNavs&"</ul>" & vbCrLf
  361. End If
  362. Rs2.Close
  363. Set Rs2=Nothing
  364. End Function
  365. '==============================
  366. '函 数 名:FkArticleList
  367. '作    用:文章列表标签操作
  368. '参    数:
  369. '==============================
  370. Private Function FkArticleList(BCode,BPar)
  371. Dim ArticleUrl,ArticleTitle
  372. TempArr=Split(BPar,"/")
  373. Sqlstr="Select"
  374. If TempArr(3)>0 And TempArr(4)=0 Then
  375. Sqlstr=Sqlstr&" Top "&TempArr(3)&""
  376. End If
  377. Sqlstr=Sqlstr&" * From [Fk_ArticleList] Where Fk_Article_Show=1 And Fk_Module_Menu=" & TempArr(0)
  378. If TempArr(1)>0 Then
  379. Sqlstr=Sqlstr&" And (Fk_Article_Module="&TempArr(1)&" Or Fk_Module_LevelList Like '%%,"&TempArr(1)&",%%')"
  380. End If
  381. If TempArr(5)>0 Then
  382. Sqlstr=Sqlstr&" And Fk_Article_Recommend Like '%%,"&TempArr(5)&",%%'"
  383. End If
  384. If TempArr(6)>0 Then
  385. Sqlstr=Sqlstr&" And Fk_Article_Subject Like '%%,"&TempArr(6)&",%%'"
  386. End If
  387. If TempArr(4)=1 And SearchStr<>"" Then
  388. Sqlstr=Sqlstr&" And Fk_Article_Title Like '%%"&SearchStr&"%%'"
  389. End If
  390. Select Case TempArr(2)
  391. Case 0
  392. Sqlstr=Sqlstr&" Order By Fk_Article_Id Desc"
  393. Case 1
  394. Sqlstr=Sqlstr&" Order By Fk_Article_Time Desc,Fk_Article_Id Desc"
  395. Case 2
  396. Sqlstr=Sqlstr&" Order By Fk_Article_Click Desc,Fk_Article_Id Desc"
  397. End Select
  398. Rs.Open Sqlstr,Conn,1,3
  399. If Not Rs.Eof Then
  400. If TempArr(4)=0 Then
  401. While Not Rs.Eof
  402. If Rs("Fk_Module_Dir")<>"" Then
  403. ArticleUrl=Rs("Fk_Module_Dir")&"/"
  404. Else
  405. ArticleUrl="Article"&Rs("Fk_Module_Id")&"/"
  406. End If
  407. If Rs("Fk_Article_FileName")<>"" Then
  408. ArticleUrl=ArticleUrl&Rs("Fk_Article_FileName")&".html"
  409. Else
  410. ArticleUrl=ArticleUrl&Rs("Fk_Article_Id")&".html"
  411. End If
  412. If SiteHtml=1 Then
  413. ArticleUrl=SiteDir&ArticleUrl
  414. Else
  415. ArticleUrl=SiteDir&"?"&ArticleUrl
  416. End If
  417. ArticleTitle=Rs("Fk_Article_Title")
  418. If Len(ArticleTitle)>TempArr(7) And TempArr(7)>0 Then
  419. ArticleTitle=Left(ArticleTitle,TempArr(7))&"..."
  420. End If
  421. FkArticleList=FkArticleList&BCode
  422. If Rs("Fk_Article_Color")<>"" Then
  423. FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}","<span style='color:"&Rs("Fk_Article_Color")&"'>"&ArticleTitle&"</span>")
  424. Else
  425. FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}",ArticleTitle)
  426. End If
  427. FkArticleList=Replace(FkArticleList,"{$ArticleListUrl$}",ArticleUrl)
  428. FkArticleList=Replace(FkArticleList,"{$ArticleListTime$}",Rs("Fk_Article_Time"))
  429. FkArticleList=Replace(FkArticleList,"{$ArticleListDate$}",FormatDateTime(Rs("Fk_Article_Time"),2))
  430. FkArticleList=Replace(FkArticleList,"{$ArticleListYear$}",Year(Rs("Fk_Article_Time")))
  431. FkArticleList=Replace(FkArticleList,"{$ArticleListMonth$}",Month(Rs("Fk_Article_Time")))
  432. FkArticleList=Replace(FkArticleList,"{$ArticleListDay$}",Day(Rs("Fk_Article_Time")))
  433. FkArticleList=Replace(FkArticleList,"{$ArticleListPic$}",Rs("Fk_Article_Pic"))
  434. FkArticleList=Replace(FkArticleList,"{$ArticleListNew$}",DateDiff("d",Rs("Fk_Article_Time"),Now()))
  435. FkArticleList=Replace(FkArticleList,"{$ArticleListClick$}",Rs("Fk_Article_Click"))
  436. Rs.MoveNext
  437. Wend
  438. Else
  439. Rs.PageSize=PageSizes
  440. If PageNow>Rs.PageCount Or PageNow<=0 Then
  441. PageNow=1
  442. End If
  443. PageCounts=Rs.PageCount
  444. Rs.AbsolutePage=PageNow
  445. PageAll=Rs.RecordCount
  446. i=1
  447. While (Not Rs.Eof) And i<PageSizes+1
  448. If Rs("Fk_Module_Dir")<>"" Then
  449. ArticleUrl=Rs("Fk_Module_Dir")&"/"
  450. Else
  451. ArticleUrl="Article"&Rs("Fk_Module_Id")&"/"
  452. End If
  453. If Rs("Fk_Article_FileName")<>"" Then
  454. ArticleUrl=ArticleUrl&Rs("Fk_Article_FileName")&".html"
  455. Else
  456. ArticleUrl=ArticleUrl&Rs("Fk_Article_Id")&".html"
  457. End If
  458. If SiteHtml=1 Then
  459. ArticleUrl=SiteDir&ArticleUrl
  460. Else
  461. ArticleUrl=SiteDir&"?"&ArticleUrl
  462. End If
  463. ArticleTitle=Rs("Fk_Article_Title")
  464. If Len(ArticleTitle)>TempArr(7) And TempArr(7)>0 Then
  465. ArticleTitle=Left(ArticleTitle,TempArr(7))&"..."
  466. End If
  467. FkArticleList=FkArticleList&BCode
  468. If Rs("Fk_Article_Color")<>"" Then
  469. FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}","<span style='color:"&Rs("Fk_Article_Color")&"'>"&ArticleTitle&"</span>")
  470. Else
  471. FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}",ArticleTitle)
  472. End If
  473. FkArticleList=Replace(FkArticleList,"{$ArticleListTime$}",Rs("Fk_Article_Time"))
  474. FkArticleList=Replace(FkArticleList,"{$ArticleListDate$}",FormatDateTime(Rs("Fk_Article_Time"),2))
  475. FkArticleList=Replace(FkArticleList,"{$ArticleListUrl$}",ArticleUrl)
  476. FkArticleList=Replace(FkArticleList,"{$ArticleListPic$}",Rs("Fk_Article_Pic"))
  477. FkArticleList=Replace(FkArticleList,"{$ArticleListYear$}",Year(Rs("Fk_Article_Time")))
  478. FkArticleList=Replace(FkArticleList,"{$ArticleListMonth$}",Month(Rs("Fk_Article_Time")))
  479. FkArticleList=Replace(FkArticleList,"{$ArticleListDay$}",Day(Rs("Fk_Article_Time")))
  480. FkArticleList=Replace(FkArticleList,"{$ArticleListNew$}",DateDiff("d",Rs("Fk_Article_Time"),Now()))
  481. FkArticleList=Replace(FkArticleList,"{$ArticleListClick$}",Rs("Fk_Article_Click"))
  482. Rs.MoveNext
  483. i=i+1
  484. Wend
  485. End If
  486. End If
  487. Rs.Close
  488. End Function
  489. '==============================
  490. '函 数 名:FkProductList
  491. '作    用:产品列表标签操作
  492. '参    数:
  493. '==============================
  494. Private Function FkProductList(BCode,BPar)
  495. Dim ProductUrl,ProductTitle
  496. TempArr=Split(BPar,"/")
  497. Sqlstr="Select"
  498. If TempArr(3)>0 And TempArr(4)=0 Then
  499. Sqlstr=Sqlstr&" Top "&TempArr(3)&""
  500. End If
  501. Sqlstr=Sqlstr&" * From [Fk_ProductList] Where Fk_Product_Show=1 And Fk_Module_Menu=" & TempArr(0)
  502. If TempArr(1)>0 Then
  503. Sqlstr=Sqlstr&" And (Fk_Product_Module="&TempArr(1)&" Or Fk_Module_LevelList Like '%%,"&TempArr(1)&",%%')"
  504. End If
  505. If TempArr(5)>0 Then
  506. Sqlstr=Sqlstr&" And Fk_Product_Recommend Like '%%,"&TempArr(5)&",%%'"
  507. End If
  508. If TempArr(6)>0 Then
  509. Sqlstr=Sqlstr&" And Fk_Product_Subject Like '%%,"&TempArr(6)&",%%'"
  510. End If
  511. If TempArr(4)=1 And SearchStr<>"" Then
  512. Sqlstr=Sqlstr&" And Fk_Product_Title Like '%%"&SearchStr&"%%'"
  513. End If
  514. Select Case TempArr(2)
  515. Case 0
  516. Sqlstr=Sqlstr&" Order By Fk_Product_Id Desc"
  517. Case 1
  518. Sqlstr=Sqlstr&" Order By Fk_Product_Time Desc,Fk_Product_Id Desc"
  519. Case 2
  520. Sqlstr=Sqlstr&" Order By Fk_Product_Click Desc,Fk_Product_Id Desc"
  521. End Select
  522. Rs.Open Sqlstr,Conn,1,3
  523. If Not Rs.Eof Then
  524. If TempArr(4)=0 Then
  525. While Not Rs.Eof
  526. If Rs("Fk_Module_Dir")<>"" Then
  527. ProductUrl=Rs("Fk_Module_Dir")&"/"
  528. Else
  529. ProductUrl="Product"&Rs("Fk_Module_Id")&"/"
  530. End If
  531. If Rs("Fk_Product_FileName")<>"" Then
  532. ProductUrl=ProductUrl&Rs("Fk_Product_FileName")&".html"
  533. Else
  534. ProductUrl=ProductUrl&Rs("Fk_Product_Id")&".html"
  535. End If
  536. If SiteHtml=1 Then
  537. ProductUrl=SiteDir&ProductUrl
  538. Else
  539. ProductUrl=SiteDir&"?"&ProductUrl
  540. End If
  541. ProductTitle=Rs("Fk_Product_Title")
  542. If Len(ProductTitle)>TempArr(7) And TempArr(7)>0 Then
  543. ProductTitle=Left(ProductTitle,TempArr(7))&"..."
  544. End If
  545. FkProductList=FkProductList&BCode
  546. If Rs("Fk_Product_Color")<>"" Then
  547. FkProductList=Replace(FkProductList,"{$ProductListTitle$}","<span style='color:"&Rs("Fk_Product_Color")&"'>"&ProductTitle&"</span>")
  548. Else
  549. FkProductList=Replace(FkProductList,"{$ProductListTitle$}",ProductTitle)
  550. End If
  551. FkProductList=Replace(FkProductList,"{$ProductListUrl$}",ProductUrl)
  552. FkProductList=Replace(FkProductList,"{$ProductListClick$}",Rs("Fk_Product_Click"))
  553. FkProductList=Replace(FkProductList,"{$ProductListTime$}",Rs("Fk_Product_Time"))
  554. FkProductList=Replace(FkProductList,"{$ProductListDate$}",FormatDateTime(Rs("Fk_Product_Time"),2))
  555. FkProductList=Replace(FkProductList,"{$ProductListYear$}",Year(Rs("Fk_Product_Time")))
  556. FkProductList=Replace(FkProductList,"{$ProductListMonth$}",Month(Rs("Fk_Product_Time")))
  557. FkProductList=Replace(FkProductList,"{$ProductListDay$}",Day(Rs("Fk_Product_Time")))
  558. FkProductList=Replace(FkProductList,"{$ProductListNew$}",DateDiff("d",Rs("Fk_Product_Time"),Now()))
  559. FkProductList=Replace(FkProductList,"{$ProductListPic$}",Rs("Fk_Product_Pic"))
  560. Rs.MoveNext
  561. Wend
  562. Else
  563. Rs.PageSize=PageSizes
  564. If PageNow>Rs.PageCount Or PageNow<=0 Then
  565. PageNow=1
  566. End If
  567. PageCounts=Rs.PageCount
  568. Rs.AbsolutePage=PageNow
  569. PageAll=Rs.RecordCount
  570. i=1
  571. While (Not Rs.Eof) And i<PageSizes+1
  572. If Rs("Fk_Module_Dir")<>"" Then
  573. ProductUrl=Rs("Fk_Module_Dir")&"/"
  574. Else
  575. ProductUrl="Product"&Rs("Fk_Module_Id")&"/"
  576. End If
  577. If Rs("Fk_Product_FileName")<>"" Then
  578. ProductUrl=ProductUrl&Rs("Fk_Product_FileName")&".html"
  579. Else
  580. ProductUrl=ProductUrl&Rs("Fk_Product_Id")&".html"
  581. End If
  582. If SiteHtml=1 Then
  583. ProductUrl=SiteDir&ProductUrl
  584. Else
  585. ProductUrl=SiteDir&"?"&ProductUrl
  586. End If
  587. ProductTitle=Rs("Fk_Product_Title")
  588. If Len(ProductTitle)>TempArr(7) And TempArr(7)>0 Then
  589. ProductTitle=Left(ProductTitle,TempArr(7))&"..."
  590. End If
  591. FkProductList=FkProductList&BCode
  592. If Rs("Fk_Product_Color")<>"" Then
  593. FkProductList=Replace(FkProductList,"{$ProductListTitle$}","<span style='color:"&Rs("Fk_Product_Color")&"'>"&ProductTitle&"</span>")
  594. Else
  595. FkProductList=Replace(FkProductList,"{$ProductListTitle$}",ProductTitle)
  596. End If
  597. FkProductList=Replace(FkProductList,"{$ProductListUrl$}",ProductUrl)
  598. FkProductList=Replace(FkProductList,"{$ProductListClick$}",Rs("Fk_Product_Click"))
  599. FkProductList=Replace(FkProductList,"{$ProductListTime$}",Rs("Fk_Product_Time"))
  600. FkProductList=Replace(FkProductList,"{$ProductListDate$}",FormatDateTime(Rs("Fk_Product_Time"),2))
  601. FkProductList=Replace(FkProductList,"{$ProductListYear$}",Year(Rs("Fk_Product_Time")))
  602. FkProductList=Replace(FkProductList,"{$ProductListMonth$}",Month(Rs("Fk_Product_Time")))
  603. FkProductList=Replace(FkProductList,"{$ProductListDay$}",Day(Rs("Fk_Product_Time")))
  604. FkProductList=Replace(FkProductList,"{$ProductListNew$}",DateDiff("d",Rs("Fk_Product_Time"),Now()))
  605. FkProductList=Replace(FkProductList,"{$ProductListPic$}",Rs("Fk_Product_Pic"))
  606. Rs.MoveNext
  607. i=i+1
  608. Wend
  609. End If
  610. End If
  611. Rs.Close
  612. End Function
  613. '==============================
  614. '函 数 名:FkDownList
  615. '作    用:下载列表标签操作
  616. '参    数:
  617. '==============================
  618. Private Function FkDownList(BCode,BPar)
  619. Dim DownUrl,DownTitle
  620. TempArr=Split(BPar,"/")
  621. Sqlstr="Select"
  622. If TempArr(3)>0 And TempArr(4)=0 Then
  623. Sqlstr=Sqlstr&" Top "&TempArr(3)&""
  624. End If
  625. Sqlstr=Sqlstr&" * From [Fk_DownList] Where Fk_Down_Show=1 And Fk_Module_Menu=" & TempArr(0)
  626. If TempArr(1)>0 Then
  627. Sqlstr=Sqlstr&" And (Fk_Down_Module="&TempArr(1)&" Or Fk_Module_LevelList Like '%%,"&TempArr(1)&",%%')"
  628. End If
  629. If TempArr(5)>0 Then
  630. Sqlstr=Sqlstr&" And Fk_Down_Recommend Like '%%,"&TempArr(5)&",%%'"
  631. End If
  632. If TempArr(6)>0 Then
  633. Sqlstr=Sqlstr&" And Fk_Down_Subject Like '%%,"&TempArr(6)&",%%'"
  634. End If
  635. If TempArr(4)=1 And SearchStr<>"" Then
  636. Sqlstr=Sqlstr&" And Fk_Down_Title Like '%%"&SearchStr&"%%'"
  637. End If
  638. Select Case TempArr(2)
  639. Case 0
  640. Sqlstr=Sqlstr&" Order By Fk_Down_Id Desc"
  641. Case 1
  642. Sqlstr=Sqlstr&" Order By Fk_Down_Time Desc,Fk_Down_Id Desc"
  643. Case 2
  644. Sqlstr=Sqlstr&" Order By Fk_Down_Click Desc,Fk_Down_Id Desc"
  645. End Select
  646. Rs.Open Sqlstr,Conn,1,3
  647. If Not Rs.Eof Then
  648. If TempArr(4)=0 Then
  649. While Not Rs.Eof
  650. If Rs("Fk_Module_Dir")<>"" Then
  651. DownUrl=Rs("Fk_Module_Dir")&"/"
  652. Else
  653. DownUrl="Down"&Rs("Fk_Module_Id")&"/"
  654. End If
  655. If Rs("Fk_Down_FileName")<>"" Then
  656. DownUrl=DownUrl&Rs("Fk_Down_FileName")&".html"
  657. Else
  658. DownUrl=DownUrl&Rs("Fk_Down_Id")&".html"
  659. End If
  660. If SiteHtml=1 Then
  661. DownUrl=SiteDir&DownUrl
  662. Else
  663. DownUrl=SiteDir&"?"&DownUrl
  664. End If
  665. DownTitle=Rs("Fk_Down_Title")
  666. If Len(DownTitle)>TempArr(7) And TempArr(7)>0 Then
  667. DownTitle=Left(DownTitle,TempArr(7))&"..."
  668. End If
  669. FkDownList=FkDownList&BCode
  670. If Rs("Fk_Down_Color")<>"" Then
  671. FkDownList=Replace(FkDownList,"{$DownListTitle$}","<span style='color:"&Rs("Fk_Down_Color")&"'>"&DownTitle&"</span>")
  672. Else
  673. FkDownList=Replace(FkDownList,"{$DownListTitle$}",DownTitle)
  674. End If
  675. FkDownList=Replace(FkDownList,"{$DownListUrl$}",DownUrl)
  676. FkDownList=Replace(FkDownList,"{$DownListClick$}",Rs("Fk_Down_Click"))
  677. FkDownList=Replace(FkDownList,"{$DownListTime$}",Rs("Fk_Down_Time"))
  678. FkDownList=Replace(FkDownList,"{$DownListSystem$}",Rs("Fk_Down_System"))
  679. FkDownList=Replace(FkDownList,"{$DownListLanguage$}",Rs("Fk_Down_Language"))
  680. FkDownList=Replace(FkDownList,"{$DownListFile$}",Rs("Fk_Down_File"))
  681. FkDownList=Replace(FkDownList,"{$DownListDate$}",FormatDateTime(Rs("Fk_Down_Time"),2))
  682. FkDownList=Replace(FkDownList,"{$DownListYear$}",Year(Rs("Fk_Down_Time")))
  683. FkDownList=Replace(FkDownList,"{$DownListMonth$}",Month(Rs("Fk_Down_Time")))
  684. FkDownList=Replace(FkDownList,"{$DownListDay$}",Day(Rs("Fk_Down_Time")))
  685. FkDownList=Replace(FkDownList,"{$DownListNew$}",DateDiff("d",Rs("Fk_Down_Time"),Now()))
  686. FkDownList=Replace(FkDownList,"{$DownListPic$}",Rs("Fk_Down_Pic"))
  687. Rs.MoveNext
  688. Wend
  689. Else
  690. Rs.PageSize=PageSizes
  691. If PageNow>Rs.PageCount Or PageNow<=0 Then
  692. PageNow=1
  693. End If
  694. PageCounts=Rs.PageCount
  695. Rs.AbsolutePage=PageNow
  696. PageAll=Rs.RecordCount
  697. i=1
  698. While (Not Rs.Eof) And i<PageSizes+1
  699. If Rs("Fk_Module_Dir")<>"" Then
  700. DownUrl=Rs("Fk_Module_Dir")&"/"
  701. Else
  702. DownUrl="Down"&Rs("Fk_Module_Id")&"/"
  703. End If
  704. If Rs("Fk_Down_FileName")<>"" Then
  705. DownUrl=DownUrl&Rs("Fk_Down_FileName")&".html"
  706. Else
  707. DownUrl=DownUrl&Rs("Fk_Down_Id")&".html"
  708. End If
  709. If SiteHtml=1 Then
  710. DownUrl=SiteDir&DownUrl
  711. Else
  712. DownUrl=SiteDir&"?"&DownUrl
  713. End If
  714. DownTitle=Rs("Fk_Down_Title")
  715. If Len(DownTitle)>TempArr(7) And TempArr(7)>0 Then
  716. DownTitle=Left(DownTitle,TempArr(7))&"..."
  717. End If
  718. FkDownList=FkDownList&BCode
  719. If Rs("Fk_Down_Color")<>"" Then
  720. FkDownList=Replace(FkDownList,"{$DownListTitle$}","<span style='color:"&Rs("Fk_Down_Color")&"'>"&DownTitle&"</span>")
  721. Else
  722. FkDownList=Replace(FkDownList,"{$DownListTitle$}",DownTitle)
  723. End If
  724. FkDownList=Replace(FkDownList,"{$DownListUrl$}",DownUrl)
  725. FkDownList=Replace(FkDownList,"{$DownListClick$}",Rs("Fk_Down_Click"))
  726. FkDownList=Replace(FkDownList,"{$DownListTime$}",Rs("Fk_Down_Time"))
  727. FkDownList=Replace(FkDownList,"{$DownListSystem$}",Rs("Fk_Down_System"))
  728. FkDownList=Replace(FkDownList,"{$DownListLanguage$}",Rs("Fk_Down_Language"))
  729. FkDownList=Replace(FkDownList,"{$DownListFile$}",Rs("Fk_Down_File"))
  730. FkDownList=Replace(FkDownList,"{$DownListDate$}",FormatDateTime(Rs("Fk_Down_Time"),2))
  731. FkDownList=Replace(FkDownList,"{$DownListYear$}",Year(Rs("Fk_Down_Time")))
  732. FkDownList=Replace(FkDownList,"{$DownListMonth$}",Month(Rs("Fk_Down_Time")))
  733. FkDownList=Replace(FkDownList,"{$DownListDay$}",Day(Rs("Fk_Down_Time")))
  734. FkDownList=Replace(FkDownList,"{$DownListNew$}",DateDiff("d",Rs("Fk_Down_Time"),Now()))
  735. FkDownList=Replace(FkDownList,"{$DownListPic$}",Rs("Fk_Down_Pic"))
  736. Rs.MoveNext
  737. i=i+1
  738. Wend
  739. End If
  740. End If
  741. Rs.Close
  742. End Function
  743. '==============================
  744. '函 数 名:FkFriendsList
  745. '作    用:友情链接列表标签操作
  746. '参    数:
  747. '==============================
  748. Private Function FkFriendsList(BCode,BPar)
  749. TempArr=Split(BPar,"/")
  750. Sqlstr="Select"
  751. If TempArr(2)>0 Then
  752. Sqlstr=Sqlstr&" Top "&TempArr(2)&""
  753. End If
  754. Sqlstr=Sqlstr&" * From [Fk_Friends] Where 1=1"
  755. If TempArr(0)>0 Then
  756. Sqlstr=Sqlstr&" And Fk_Friends_FriendsType="&TempArr(0)&""
  757. End If
  758. If TempArr(1)=1 Then
  759. Sqlstr=Sqlstr&" And Fk_Friends_ShowType=1"
  760. Else
  761. Sqlstr=Sqlstr&" And Fk_Friends_ShowType=2"
  762. End If
  763. Sqlstr=Sqlstr&" Order By Fk_Friends_Id Asc"
  764. Rs.Open Sqlstr,Conn,1,3
  765. If Not Rs.Eof Then
  766. While Not Rs.Eof
  767. FkFriendsList=FkFriendsList&BCode
  768. FkFriendsList=Replace(FkFriendsList,"{$FriendsName$}",Rs("Fk_Friends_Name"))
  769. FkFriendsList=Replace(FkFriendsList,"{$FriendsUrl$}",Rs("Fk_Friends_Url"))
  770. FkFriendsList=Replace(FkFriendsList,"{$FriendsAbout$}",Rs("Fk_Friends_About"))
  771. If Rs("Fk_Friends_Logo")<>"" Then
  772. FkFriendsList=Replace(FkFriendsList,"{$FriendsLogo$}",Rs("Fk_Friends_Logo"))
  773. End If
  774. Rs.MoveNext
  775. Wend
  776. End If
  777. Rs.Close
  778. End Function
  779. '==============================
  780. '函 数 名:FkJobList
  781. '作    用:招聘列表标签操作
  782. '参    数:
  783. '==============================
  784. Private Function FkJobList(BCode,BPar)
  785. TempArr=Split(BPar,"/")
  786. Sqlstr="Select"
  787. If TempArr(0)>0 Then
  788. Sqlstr=Sqlstr&" Top "&TempArr(0)&""
  789. End If
  790. Sqlstr=Sqlstr&" * From [Fk_Job] Where 1=1"
  791. If TempArr(1)=1 Then
  792. Sqlstr=Sqlstr&" And DateAdd('d',Fk_Job_Date,Fk_Job_Time)<=#"&Now()&"#"
  793. End If
  794. If TempArr(1)=2 Then
  795. Sqlstr=Sqlstr&" And DateAdd('d',Fk_Job_Date,Fk_Job_Time)>#"&Now()&"#"
  796. End If
  797. Sqlstr=Sqlstr&" Order By Fk_Job_Id Desc"
  798. Rs.Open Sqlstr,Conn,1,3
  799. If Not Rs.Eof Then
  800. While Not Rs.Eof
  801. FkJobList=FkJobList&BCode
  802. FkJobList=Replace(FkJobList,"{$JobName$}",Rs("Fk_Job_Name"))
  803. FkJobList=Replace(FkJobList,"{$JobCount$}",Rs("Fk_Job_Count"))
  804. FkJobList=Replace(FkJobList,"{$JobAbout$}",Rs("Fk_Job_About"))
  805. FkJobList=Replace(FkJobList,"{$JobArea$}",Rs("Fk_Job_Area"))
  806. If Rs("Fk_Job_Date")=0 Then
  807. FkJobList=Replace(FkJobList,"{$JobDate$}","长期有效")
  808. Else
  809. FkJobList=Replace(FkJobList,"{$JobDate$}",Rs("Fk_Job_Date")&"天")
  810. End If
  811. FkJobList=Replace(FkJobList,"{$JobTime$}",Rs("Fk_Job_Time"))
  812. Rs.MoveNext
  813. Wend
  814. End If
  815. Rs.Close
  816. End Function
  817. '==============================
  818. '函 数 名:FkSubjectList
  819. '作    用:专题列表标签操作
  820. '参    数:
  821. '==============================
  822. Private Function FkSubjectList(BCode,BPar)
  823. Dim SubjectUrl
  824. TempArr=Split(BPar,"/")
  825. Sqlstr="Select"
  826. If TempArr(0)>0 Then
  827. Sqlstr=Sqlstr&" Top "&TempArr(0)&""
  828. End If
  829. Sqlstr=Sqlstr&" * From [Fk_Subject] Where 1=1"
  830. Sqlstr=Sqlstr&" Order By Fk_Subject_Id Desc"
  831. Rs.Open Sqlstr,Conn,1,3
  832. If Not Rs.Eof Then
  833. While Not Rs.Eof
  834. SubjectUrl="Subject.asp?Id=" & Rs("Fk_Subject_Id")
  835. FkSubjectList=FkSubjectList&BCode
  836. FkSubjectList=Replace(FkSubjectList,"{$SubjectListName$}",Rs("Fk_Subject_Name"))
  837. FkSubjectList=Replace(FkSubjectList,"{$SubjectListPic$}",Rs("Fk_Subject_Pic"))
  838. FkSubjectList=Replace(FkSubjectList,"{$SubjectListUrl$}",SubjectUrl)
  839. Rs.MoveNext
  840. Wend
  841. End If
  842. Rs.Close
  843. End Function
  844. '==============================
  845. '函 数 名:GetGoUrl
  846. '作    用:获取内容操作链接
  847. '参    数:模块类型ModuleType,模块ID ModuleId
  848. '==============================
  849. Public Function GetGoUrl(ModuleType,ModuleId,ModuleDir,ModuleFileName)
  850. If SiteHtml=0 Then
  851. Select Case ModuleType
  852. ' Case 0
  853. ' GetGoUrl="Page.asp?Id=" & ModuleId
  854. ' Case 1
  855. ' GetGoUrl="ArticleList.asp?Id=" & ModuleId
  856. ' Case 2
  857. ' GetGoUrl="ProductList.asp?Id=" & ModuleId
  858. ' Case 3
  859. ' GetGoUrl="Info.asp?Id=" & ModuleId
  860. ' Case 4
  861. ' GetGoUrl="GBook.asp?Id=" & ModuleId
  862. ' Case 6
  863. ' GetGoUrl="Job.asp"
  864. ' Case 7
  865. ' GetGoUrl="DownList.asp?Id=" & ModuleId
  866. Case 0
  867. GetGoUrl=SiteDir&"?Page"&ModuleId&".html"
  868. Case 1
  869. GetGoUrl=SiteDir&"?Article"&ModuleId&"/Index.html"
  870. Case 2
  871. GetGoUrl=SiteDir&"?Product"&ModuleId&"/Index.html"
  872. Case 3
  873. GetGoUrl=SiteDir&"?Info"&ModuleId&".html"
  874. Case 4
  875. GetGoUrl=SiteDir&"?GBook"&ModuleId&".html"
  876. Case 6
  877. GetGoUrl=SiteDir&"?Job"&ModuleId&".html"
  878. Case 7
  879. GetGoUrl=SiteDir&"?Down"&ModuleId&"/Index.html"
  880. Case Else
  881. GetGoUrl="#"
  882. End Select
  883. If (ModuleType=1 Or ModuleType=2 Or ModuleType=7) And ModuleDir<>"" Then
  884. GetGoUrl=SiteDir&"?"&ModuleDir&"/Index.html"
  885. End If
  886. If (ModuleType=0 Or ModuleType=3 Or ModuleType=4) And ModuleFileName<>"" Then
  887. GetGoUrl=SiteDir&"?"&ModuleFileName&".html"
  888. End If
  889. ElseIf SiteHtml=1 Then
  890. Select Case ModuleType
  891. Case 0
  892. GetGoUrl=SiteDir&"Page"&ModuleId&".html"
  893. Case 1
  894. GetGoUrl=SiteDir&"Article"&ModuleId&"/Index.html"
  895. Case 2
  896. GetGoUrl=SiteDir&"Product"&ModuleId&"/Index.html"
  897. Case 3
  898. GetGoUrl=SiteDir&"Info"&ModuleId&".html"
  899. Case 4
  900. GetGoUrl=SiteDir&"GBook"&ModuleId&".html"
  901. Case 6
  902. GetGoUrl=SiteDir&"Job"&ModuleId&".html"
  903. Case 7
  904. GetGoUrl=SiteDir&"Down"&ModuleId&"/Index.html"
  905. Case Else
  906. GetGoUrl="#"
  907. End Select
  908. If (ModuleType=1 Or ModuleType=2 Or ModuleType=7) And ModuleDir<>"" Then
  909. GetGoUrl=SiteDir&ModuleDir&"/Index.html"
  910. End If
  911. If (ModuleType=0 Or ModuleType=3 Or ModuleType=4) And ModuleFileName<>"" Then
  912. GetGoUrl=SiteDir&ModuleFileName&".html"
  913. End If
  914. End If
  915. End Function
  916. '==============================
  917. '函 数 名:ShowPageCode
  918. '作    用:显示页码
  919. '参    数:链接PageUrl,当前页Nows,记录数AllCount,每页数量Sizes,总页数AllPage
  920. '==============================
  921. Public Function ShowPageCode(PageUrl,Nows,AllCount,Sizes,AllPage)
  922. If Nows>1 Then
  923. ShowPageCode="<a href="""&Replace(PageUrl,"{Pages}",1)&""">第一页</a>"
  924. ShowPageCode=ShowPageCode&"&nbsp;"
  925. ShowPageCode=ShowPageCode&"<a href="""&Replace(PageUrl,"{Pages}",Nows-1)&""">上一页</a>"
  926. If SiteHtml=1 And SearchStr="" Then
  927. ShowPageCode=Replace(ShowPageCode,"_1.",".")
  928. End If
  929. Else
  930. ShowPageCode=ShowPageCode&"第一页"
  931. ShowPageCode=ShowPageCode&"&nbsp;"
  932. ShowPageCode=ShowPageCode&"上一页"
  933. End If
  934. ShowPageCode=ShowPageCode&"&nbsp;"
  935. If AllPage>Nows Then
  936. ShowPageCode=ShowPageCode&"<a href="""&Replace(PageUrl,"{Pages}",Nows+1)&""">下一页</a>"
  937. ShowPageCode=ShowPageCode&"&nbsp;"
  938. ShowPageCode=ShowPageCode&"<a href="""&Replace(PageUrl,"{Pages}",AllPage)&""">尾页</a>"
  939. Else
  940. ShowPageCode=ShowPageCode&"下一页"
  941. ShowPageCode=ShowPageCode&"&nbsp;"
  942. ShowPageCode=ShowPageCode&"尾页"
  943. End If
  944. TempArr=Split(PageUrl,"{Pages}")
  945. ShowPageCode=ShowPageCode&"&nbsp;"&Sizes&"条/页&nbsp;共"&AllPage&"页/"&AllCount&"条&nbsp;当前第"&Nows&"页&nbsp;"
  946. ShowPageCode=ShowPageCode&"<select name=""Change_Page"" id=""Change_Page"" onChange=""window.location.href=this.options[this.selectedIndex].value"">"
  947. For i=1 To AllPage
  948. If SiteHtml=1 And SearchStr="" Then
  949. If i=1 Then
  950. If i=Nows Then
  951. ShowPageCode=ShowPageCode&"<option value=""Index.html"" selected=""selected"">第"&i&"页</option>"
  952. Else
  953. ShowPageCode=ShowPageCode&"<option value=""Index.html"">第"&i&"页</option>"
  954. End If
  955. Else
  956. If i=Nows Then
  957. ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""" selected=""selected"">第"&i&"页</option>"
  958. Else
  959. ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""">第"&i&"页</option>"
  960. End If
  961. End If
  962. Else
  963. If i=Nows Then
  964. ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""" selected=""selected"">第"&i&"页</option>"
  965. Else
  966. ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""">第"&i&"页</option>"
  967. End If
  968. End If
  969. Next
  970.        ShowPageCode=ShowPageCode&"</select>"
  971. End Function
  972. '========================模板引擎区===========================
  973. '==============================
  974. '函 数 名:TemplateDo
  975. '作    用:获取优先处理函数
  976. '参    数:
  977. '==============================
  978. Public Function TemplateDo(TemplateCode)
  979. Dim ForI,IfI
  980. ForI=Instr(TemplateCode,"{$For")
  981. IfI=Instr(TemplateCode,"{$If")
  982. If ForI=0 And IfI=0 Then
  983. TemplateDo=TemplateCode
  984. Exit Function
  985. End If
  986. If ForI>0 And IfI>0 Then
  987. If ForI<IfI Then
  988. TemplateCode=TemplateFor(TemplateCode)
  989. Else
  990. TemplateCode=TemplateIf(TemplateCode)
  991. End If
  992. ElseIf ForI>0 Then
  993. TemplateCode=TemplateFor(TemplateCode)
  994. ElseIf IfI>0 Then
  995. TemplateCode=TemplateIf(TemplateCode)
  996. ELse
  997. TemplateDo=TemplateCode
  998. Exit Function
  999. End If
  1000. Call TemplateDo(TemplateCode)
  1001. TemplateDo=TemplateCode
  1002. End Function
  1003. '==============================
  1004. '函 数 名:TemplateFor
  1005. '作    用:处理For
  1006. '参    数:
  1007. '==============================
  1008. Private Function TemplateFor(TemplateCode)
  1009. Temp=GetFor(TemplateCode)
  1010. TemplateTag=Split(Split(Temp,"{$For(")(1),",")(0)
  1011. TemplatePar=Split(Split(Temp,",")(1),")")(0)
  1012. TemplateBCode=Right(Temp,Len(Temp)-Len("{$For("&TemplateTag&","&TemplatePar&")$}"))
  1013. TemplateBCode=Left(TemplateBCode,Len(TemplateBCode)-8)
  1014. Select Case TemplateTag
  1015. Case "Nav"
  1016. TemplateFor=Replace(TemplateCode,Temp,FkNav(TemplateBCode,TemplatePar))
  1017. Case "ArticleList"
  1018. TemplateFor=Replace(TemplateCode,Temp,FkArticleList(TemplateBCode,TemplatePar))
  1019. Case "ProductList"
  1020. TemplateFor=Replace(TemplateCode,Temp,FkProductList(TemplateBCode,TemplatePar))
  1021. Case "DownList"
  1022. TemplateFor=Replace(TemplateCode,Temp,FkDownList(TemplateBCode,TemplatePar))
  1023. Case "FriendsList"
  1024. TemplateFor=Replace(TemplateCode,Temp,FkFriendsList(TemplateBCode,TemplatePar))
  1025. Case "JobList"
  1026. TemplateFor=Replace(TemplateCode,Temp,FkJobList(TemplateBCode,TemplatePar))
  1027. Case "SubjectList"
  1028. TemplateFor=Replace(TemplateCode,Temp,FkSubjectList(TemplateBCode,TemplatePar))
  1029. Case Else
  1030. TemplateFor=Replace(TemplateCode,Temp,"")
  1031. End Select
  1032. End Function
  1033. '==============================
  1034. '函 数 名:TemplateIf
  1035. '作    用:处理If
  1036. '参    数:
  1037. '==============================
  1038. Private Function TemplateIf(TemplateCode)
  1039. Temp=GetIf(TemplateCode)
  1040. TemplatePar=Split(Split(Temp,"{$If(")(1),")")(0)
  1041. If1=GetIfOne(Temp,"{$If("&TemplatePar&")$}")
  1042. If2=Replace(Temp,If1,"")
  1043. If2=Replace(If2,"{$If("&TemplatePar&")$}","")
  1044. If2=Left(If2,Len(If2)-10)
  1045. If2=Right(If2,Len(If2)-8)
  1046. If If2="{$Null$}" Then
  1047. If2=""
  1048. End If
  1049. TempArr=Split(TemplatePar,",")
  1050. Select Case TempArr(2)
  1051. Case ">"
  1052. If TempArr(0)>TempArr(1) Then
  1053. TemplateIf=Replace(TemplateCode,Temp,If1)
  1054. Else
  1055. TemplateIf=Replace(TemplateCode,Temp,If2)
  1056. End If
  1057. Case "<"
  1058. If TempArr(0)<TempArr(1) Then
  1059. TemplateIf=Replace(TemplateCode,Temp,If1)
  1060. Else
  1061. TemplateIf=Replace(TemplateCode,Temp,If2)
  1062. End If
  1063. Case "="
  1064. If TempArr(0)=TempArr(1) Then
  1065. TemplateIf=Replace(TemplateCode,Temp,If1)
  1066. Else
  1067. TemplateIf=Replace(TemplateCode,Temp,If2)
  1068. End If
  1069. Case "<>"
  1070. If TempArr(0)<>TempArr(1) Then
  1071. TemplateIf=Replace(TemplateCode,Temp,If1)
  1072. Else
  1073. TemplateIf=Replace(TemplateCode,Temp,If2)
  1074. End If
  1075. Case "<="
  1076. If TempArr(0)<=TempArr(1) Then
  1077. TemplateIf=Replace(TemplateCode,Temp,If1)
  1078. Else
  1079. TemplateIf=Replace(TemplateCode,Temp,If2)
  1080. End If
  1081. Case ">="
  1082. If TempArr(0)>=TempArr(1) Then
  1083. TemplateIf=Replace(TemplateCode,Temp,If1)
  1084. Else
  1085. TemplateIf=Replace(TemplateCode,Temp,If2)
  1086. End If
  1087. Case Else
  1088. TemplateIf=Replace(TemplateCode,Temp,"")
  1089. End Select
  1090. End Function
  1091. '==============================
  1092. '函 数 名:GetFor
  1093. '作    用:获取For字符串
  1094. '参    数:
  1095. '==============================
  1096. Private Function GetFor(TemplateCode)
  1097. Temp=Split(TemplateCode,"{$For")(0)
  1098. Temp=Replace(TemplateCode,Temp,"")
  1099. TempArr=Split(Temp,"{$Next$}")
  1100. GetFor=TempArr(0)&"{$Next$}"
  1101. i=1
  1102. While GetCount(GetFor,"{$For")<>GetCount(GetFor,"{$Next$}")
  1103. GetFor=GetFor&TempArr(i)&"{$Next$}"
  1104. i=i+1
  1105. Wend
  1106. End Function
  1107. '==============================
  1108. '函 数 名:GetIf
  1109. '作    用:获取If字符串
  1110. '参    数:
  1111. '==============================
  1112. Private Function GetIf(TemplateCode)
  1113. Temp=Split(TemplateCode,"{$If")(0)
  1114. Temp=Replace(TemplateCode,Temp,"")
  1115. TempArr=Split(Temp,"{$End If$}")
  1116. GetIf=TempArr(0)&"{$End If$}"
  1117. i=1
  1118. While GetCount(GetIf,"{$If")<>GetCount(GetIf,"{$End If$}")
  1119. GetIf=GetIf&TempArr(i)&"{$End If$}"
  1120. i=i+1
  1121. Wend
  1122. End Function
  1123. '==============================
  1124. '函 数 名:GetIfOne
  1125. '作    用:获取If字符串Else前
  1126. '参    数:
  1127. '==============================
  1128. Private Function GetIfOne(TemplateCode,IfCode)
  1129. TempArr=Split(TemplateCode,"{$Else$}")
  1130. GetIfOne=Replace(TempArr(0),IfCode,"")
  1131. i=1
  1132. While GetCount(GetIfOne,"{$If")<>GetCount(GetIfOne,"{$End If$}")
  1133. GetIfOne=GetIfOne&TempArr(i)
  1134. i=i+1
  1135. Wend
  1136. End Function
  1137. '==============================
  1138. '函 数 名:GetCount
  1139. '作    用:判断字符串中相同字符的个数
  1140. '参    数:
  1141. '==============================
  1142. Private Function GetCount(Strs,Word)
  1143. Dim N1,N2,N3
  1144. N1=Len(Strs)
  1145. N2=Len(Replace(Strs,Word,""))
  1146. N3=Len(Word)
  1147. GetCount=Clng(((N1-N2)/N3))
  1148. End Function 
  1149. End Class
  1150. %>