c_system_lib.asp
上传用户:saigedz
上传日期:2019-10-14
资源大小:997k
文件大小:127k
源码类别:

中间件编程

开发平台:

HTML/CSS

  1. <%
  2. '///////////////////////////////////////////////////////////////////////////////
  3. '//              Z-Blog
  4. '// 作    者:    朱煊(zx.asd)
  5. '// 版权所有:    RainbowSoft Studio
  6. '// 技术支持:    rainbowsoft@163.com
  7. '// 程序名称:    
  8. '// 程序版本:    
  9. '// 单元名称:    c_system_lib.asp
  10. '// 开始时间:    2004.07.25
  11. '// 最后修改:    2007-1-4
  12. '// 备    注:    库模块
  13. '///////////////////////////////////////////////////////////////////////////////
  14. '*********************************************************
  15. ' 目的:    定义TCategory类
  16. ' 输入:    无
  17. ' 返回:    无
  18. '*********************************************************
  19. Class TCategory
  20. Public ID
  21. Public Name
  22. Public Intro
  23. Public Order
  24. Public Count
  25. Public Alias
  26. Public Property Get Url
  27. If ZC_MOONSOFT_PLUGIN_ENABLE=True Then
  28. Url = ZC_BLOG_HOST & Directory & FileName
  29. If ZC_MOONSOFT_PLUGIN_ENABLE And ZC_MOONSOFT_PLUGIN_ANONYMOUS Then
  30. Url = ZC_BLOG_HOST & Directory
  31. End If
  32. Else
  33. Url = ZC_BLOG_HOST & "catalog.asp?"& "cate=" & ID
  34. End If
  35. End Property
  36. Public Property Get RssUrl
  37. RssUrl = ZC_BLOG_HOST & "feed.asp?cate=" & ID
  38. End Property
  39. Public Property Get HtmlName
  40. HtmlName=TransferHTML(Name,"[html-format]")
  41. End Property
  42. Public Property Get HtmlUrl
  43. HtmlUrl=TransferHTML(Url,"[html-format]")
  44. End Property
  45. Private FDirectory
  46. Public Property Let Directory(strDirectory)
  47. FDirectory=strDirectory
  48. End Property
  49. Public Property Get Directory
  50. If IsEmpty(FDirectory)=True Then
  51. If ZC_MOONSOFT_PLUGIN_ENABLE=True Then
  52. Directory=ParseCustomDirectory(ZC_MOONSOFT_PLUGIN_REGEX,ZC_STATIC_DIRECTORY,StaticName,"","","","","","")
  53. Else
  54. Directory=ZC_STATIC_DIRECTORY
  55. End If
  56. Else
  57. Directory = FDirectory
  58. End If
  59. Directory=Replace(Directory,"","/")
  60. If Right(ZC_BLOG_HOST & Directory,1)<>"/" Then
  61. Directory=Directory & "/"
  62. End If
  63. End Property
  64. Public Property Get StaticName
  65. If IsNull(Alias) Or IsEmpty(Alias) Or Alias="" Then
  66. StaticName = "cat_" & ID
  67. Else
  68. StaticName = Alias
  69. End If
  70. End Property
  71. Public Property Get FileName
  72. FileName = StaticName
  73. If ZC_MOONSOFT_PLUGIN_ENABLE And ZC_MOONSOFT_PLUGIN_ANONYMOUS Then
  74. FileName = "default"
  75. End If
  76. FileName = FileName & "." & ZC_STATIC_TYPE
  77. End Property
  78. Public Function Post()
  79. Call Filter_Plugin_TCategory_Post(ID,Name,Alias,Order,Count)
  80. Call CheckParameter(ID,"int",0)
  81. Call CheckParameter(Order,"int",0)
  82. 'ID可以为0
  83. Name=FilterSQL(Name)
  84. Alias=TransferHTML(Alias,"[filename]")
  85. Alias=FilterSQL(Alias)
  86. If Len(Name)=0 Then Post=False:Exit Function
  87. If ID=0 Then
  88. objConn.Execute("INSERT INTO [blog_Category]([cate_Name],[cate_Order],[cate_Intro]) VALUES ('"&Name&"',"&Order&",'"&Alias&"')")
  89. Dim objRS
  90. Set objRS=objConn.Execute("SELECT MAX([cate_ID]) FROM [blog_Category]")
  91. If (Not objRS.bof) And (Not objRS.eof) Then
  92. ID=objRS(0)
  93. End If
  94. Set objRS=Nothing
  95. Else
  96. objConn.Execute("UPDATE [blog_Category] set [cate_Name]='"&Name&"',[cate_Order]="&Order&",[cate_Intro]='"&Alias&"' WHERE [cate_ID] =" & ID)
  97. End If
  98. Post=True
  99. End Function
  100. Public Function LoadInfoByID(cate_ID)
  101. Call CheckParameter(cate_ID,"int",0)
  102. Dim objRS
  103. Set objRS=objConn.Execute("SELECT [cate_ID],[cate_Name],[cate_Intro],[cate_Order],[cate_Count] FROM [blog_Category] WHERE [cate_ID]=" & cate_ID)
  104. If (Not objRS.bof) And (Not objRS.eof) Then
  105. ID=objRS("cate_ID")
  106. Name=objRS("cate_Name")
  107. Alias=objRS("cate_Intro")
  108. Order=objRS("cate_Order")
  109. Count=objRS("cate_Count")
  110. LoadInfoByID=True
  111. End If
  112. objRS.Close
  113. Set objRS=Nothing
  114. Call Filter_Plugin_TCategory_LoadInfoByID(ID,Name,Alias,Order,Count)
  115. End Function
  116. Public Function LoadInfoByArray(aryCateInfo)
  117. If IsArray(aryCateInfo)=True Then
  118. ID=aryCateInfo(0)
  119. Name=aryCateInfo(1)
  120. Alias=aryCateInfo(2)
  121. Order=aryCateInfo(3)
  122. Count=aryCateInfo(4)
  123. End If
  124. LoadInfoByArray=True
  125. Call Filter_Plugin_TCategory_LoadInfoByArray(ID,Name,Alias,Order,Count)
  126. End Function
  127. Public Function Del()
  128. Call Filter_Plugin_TCategory_Del(ID,Name,Alias,Order,Count)
  129. Call CheckParameter(ID,"int",0)
  130. If (ID=0) Then Del=False:Exit Function
  131. Dim objRS
  132. Set objRS=objConn.Execute("SELECT [log_ID] FROM [blog_Article] WHERE [log_CateID]=" & ID)
  133. If (Not objRS.bof) And (Not objRS.eof) Then  ShowError(13)
  134. objConn.Execute("DELETE FROM [blog_Category] WHERE [cate_ID] =" & ID)
  135. Call DelFile()
  136. Del=True
  137. End Function
  138. Public Function DelFile()
  139. On Error Resume Next
  140. Dim fso, TxtFile
  141. Set fso = CreateObject("Scripting.FileSystemObject")
  142. If fso.FileExists(BlogPath & Directory & FileName) Then
  143. Set TxtFile = fso.GetFile(BlogPath & Directory & FileName)
  144. TxtFile.Delete
  145. End If
  146. Set fso=Nothing
  147. DelFile=True
  148. Err.Clear
  149. End Function
  150. Private Sub Class_Initialize()
  151. ID=0
  152. End Sub
  153. End Class
  154. '*********************************************************
  155. '*********************************************************
  156. ' 目的:    定义TArticle类
  157. ' 输入:    无
  158. ' 返回:    无
  159. '*********************************************************
  160. Class TArticle
  161. Public ID
  162. Public CateID
  163. Public AuthorID
  164. Public Level
  165. Public Title
  166. Public Intro
  167. Public Content
  168. Public PostTime
  169. Public Tag
  170. Public Alias
  171. Public CommNums
  172. Public ViewNums
  173. Public TrackBackNums
  174. Private IP
  175. Public Istop
  176. Public Template_Article_Trackback
  177. Public Template_Article_Comment
  178. Public Template_Article_Commentpost
  179. Public Template_Article_Tag
  180. Public Template_Article_Navbar_L
  181. Public Template_Article_Navbar_R
  182. Public Template_Article_Commentpost_Verify
  183. Public Template_Article_Mutuality
  184. Public Template_Article_Single
  185. Public Template_Article_Multi
  186. Public Template_Article_Istop
  187. Public Template_Article_Search
  188. Public html
  189. Public htmlWAP
  190. Public Template_Article_Multi_WAP
  191. Public Template_Article_Single_WAP
  192. Private Ftemplate_Wap
  193. Private Ftemplate
  194. Public Property Let template(strFileName)
  195. Ftemplate=GetTemplate("TEMPLATE_" & strFileName)
  196. End Property
  197. Public Property Get template
  198. template = Ftemplate
  199. End Property
  200. Public Property Let template_Wap(strFileName)
  201. Ftemplate=GetTemplate("TEMPLATE_" & strFileName)
  202. End Property
  203. Public Property Get template_Wap
  204. template_Wap = Ftemplate_Wap
  205. End Property
  206. Private FDirectory
  207. Public Property Let Directory(strDirectory)
  208. FDirectory=strDirectory
  209. End Property
  210. Public Property Get Directory
  211. If IsEmpty(FDirectory)=True Then
  212. If ZC_CUSTOM_DIRECTORY_ENABLE=True Then
  213. Directory=ParseCustomDirectory(ZC_CUSTOM_DIRECTORY_REGEX,ZC_STATIC_DIRECTORY,Categorys(CateID).StaticName,Users(AuthorID).StaticName,Year(PostTime),Month(PostTime),Day(PostTime),ID,StaticName)
  214. Else
  215. Directory=ZC_STATIC_DIRECTORY
  216. End If
  217. Else
  218. Directory = FDirectory
  219. End If
  220. Directory=Replace(Directory,"","/")
  221. If Right(ZC_BLOG_HOST & Directory,1)<>"/" Then
  222. Directory=Directory & "/"
  223. End If
  224. End Property
  225. Public Property Get Url
  226. If Level<=2 Then
  227. Url = ZC_BLOG_HOST & "view.asp?id=" & ID
  228. Else
  229. Url = ZC_BLOG_HOST & Directory & FileName
  230. If ZC_CUSTOM_DIRECTORY_ENABLE And ZC_CUSTOM_DIRECTORY_ANONYMOUS Then
  231. Url = ZC_BLOG_HOST & Directory
  232. End If
  233. End If
  234. End Property
  235. Public Property Get StaticName
  236. If IsNull(Alias) Or IsEmpty(Alias) Or Alias="" Then
  237. StaticName = ID
  238. Else
  239. StaticName = Alias
  240. End If
  241. End Property
  242. Public Property Get FileName
  243. FileName = StaticName
  244. If ZC_CUSTOM_DIRECTORY_ENABLE And ZC_CUSTOM_DIRECTORY_ANONYMOUS Then
  245. FileName = "default"
  246. End If
  247. FileName = FileName & "." & ZC_STATIC_TYPE
  248. End Property
  249. Private FTrackBackKey
  250. Public Property Get TrackBackKey
  251. If IsNull(FTrackBackKey) Or IsEmpty(FTrackBackKey) Or FTrackBackKey="" Then
  252. FTrackBackKey=Left(MD5(ZC_BLOG_HOST & ZC_BLOG_CLSID & CStr(ID) & CStr(TrackBackNums)),8)
  253. End If
  254. TrackBackKey=FTrackBackKey
  255. End Property
  256. Private FCommentKey
  257. Public Property Get CommentKey
  258. If IsNull(FCommentKey) Or IsEmpty(FCommentKey) Or FCommentKey="" Then
  259. FCommentKey=Left(MD5(ZC_BLOG_HOST & ZC_BLOG_CLSID & CStr(ID)),8)
  260. End If
  261. CommentKey=FCommentKey
  262. End Property
  263. Public Property Get TrackBack
  264. TrackBack = ZC_BLOG_HOST & "cmd.asp?act=tb&id="& ID &"&key=" & TrackBackKey
  265. End Property
  266. Public Property Get PreTrackBack
  267. PreTrackBack = ZC_BLOG_HOST & "cmd.asp?act=gettburl&id=" & ID
  268. End Property
  269. Public Property Get TrackBackUrl
  270. TrackBackUrl = TrackBack
  271. End Property
  272. Public Property Get CommentUrl
  273. CommentUrl = Url & "#comment"
  274. End Property
  275. Public Property Get WfwComment
  276. WfwComment = ZC_BLOG_HOST
  277. End Property
  278. Public Property Get WfwCommentRss
  279. WfwCommentRss = ZC_BLOG_HOST & "feed.asp?cmt=" & ID
  280. End Property
  281. Public Property Get WAPUrl
  282. WAPUrl = ZC_BLOG_HOST & "wap.asp?act=View&id=" & ID
  283. End Property
  284. Public Property Get HtmlWAPUrl
  285. HtmlWAPUrl=TransferHTML(WAPUrl,"[html-format]")
  286. End Property
  287. Public Property Get CommentPostUrl
  288. CommentPostUrl = ZC_BLOG_HOST & "cmd.asp?act=cmt&key=" & CommentKey
  289. End Property
  290. Public Property Get HtmlContent
  291. HtmlContent=TransferHTML(UBBCode(Content,"[face][link][email][autolink][font][code][image][typeset][media][flash][key]"),"[html-japan][vbCrlf][upload]")
  292. End Property
  293. Public Property Get HtmlTitle
  294. HtmlTitle=TransferHTML(Title,"[html-japan][html-format]")
  295. End Property
  296. Public Property Get HtmlIntro
  297. HtmlIntro=TransferHTML(UBBCode(Intro,"[face][link][email][autolink][font][code][image][typeset][media][flash][key]"),"[html-japan][vbCrlf][upload]")
  298. End Property
  299. Public Property Get HtmlUrl
  300. HtmlUrl=TransferHTML(Url,"[html-format]")
  301. End Property
  302. Public Property Get TagToName
  303. Dim t,i,s
  304. If Tag<>"" Then
  305. s=Tag
  306. s=Replace(s,"}","")
  307. t=Split(s,"{")
  308. For i=LBound(t) To UBound(t)
  309. If t(i)<>"" Then
  310. If IsEmpty(FirstTagIntro) Then FirstTagIntro=Tags(t(i)).Intro
  311. t(i)=Tags(t(i)).Name
  312. End If
  313. Next
  314. s=Join(t,",")
  315. s=Right(s,Len(s)-1)
  316. TagToName=s
  317. End If
  318. End Property
  319. Public FirstTagIntro
  320. Public Function LoadInfobyID(log_ID)
  321. Call CheckParameter(log_ID,"int",0)
  322. Dim objRS
  323. Set objRS=objConn.Execute("SELECT [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Content],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url],[log_Istop] FROM [blog_Article] WHERE [log_ID]=" & log_ID)
  324. If (Not objRS.bof) And (Not objRS.eof) Then
  325. ID=objRS("log_ID")
  326. Tag=objRS("log_Tag")
  327. CateID=objRS("log_CateID")
  328. Title=objRS("log_Title")
  329. Intro=objRS("log_Intro")
  330. Content=objRS("log_Content")
  331. Level=objRS("log_Level")
  332. AuthorID=objRS("log_AuthorID")
  333. PostTime=objRS("log_PostTime")
  334. CommNums=objRS("log_CommNums")
  335. ViewNums=objRS("log_ViewNums")
  336. TrackBackNums=objRS("log_TrackBackNums")
  337. Alias=objRS("log_Url")
  338. Istop=objRS("log_Istop")
  339. Content=TransferHTML(Content,"[upload][zc_blog_host]")
  340. Intro=TransferHTML(Intro,"[upload][zc_blog_host]")
  341. PostTime = Year(PostTime) & "-" & Month(PostTime) & "-" & Day(PostTime) & " " & Hour(PostTime) & ":" & Minute(PostTime) & ":" & Second(PostTime)
  342. Else
  343. Exit Function
  344. End If
  345. objRS.Close
  346. Set objRS=Nothing
  347. LoadInfobyID=True
  348. Call Filter_Plugin_TArticle_LoadInfobyID(ID,Tag,CateID,Title,Intro,Content,Level,AuthorID,PostTime,CommNums,ViewNums,TrackBackNums,Alias,Istop)
  349. End Function
  350. Public Function LoadInfoByArray(aryArticleInfo)
  351. '[log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Content],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url]
  352. 'Array(objRS("log_ID"),objRS("log_Tag"),objRS("log_CateID"),objRS("log_Title"),objRS("log_Intro"),objRS("log_Content"),objRS("log_Level"),objRS("log_AuthorID"),objRS("log_PostTime"),objRS("log_CommNums"),objRS("log_ViewNums"),objRS("log_TrackBackNums"),objRS("log_Url"))
  353. If IsArray(aryArticleInfo)=True Then
  354. ID=aryArticleInfo(0)
  355. Tag=aryArticleInfo(1)
  356. CateID=aryArticleInfo(2)
  357. Title=aryArticleInfo(3)
  358. Intro=aryArticleInfo(4)
  359. Content=aryArticleInfo(5)
  360. Level=aryArticleInfo(6)
  361. AuthorID=aryArticleInfo(7)
  362. PostTime=aryArticleInfo(8)
  363. CommNums=aryArticleInfo(9)
  364. ViewNums=aryArticleInfo(10)
  365. TrackBackNums=aryArticleInfo(11)
  366. Alias=aryArticleInfo(12)
  367. Istop=aryArticleInfo(13)
  368. Content=TransferHTML(Content,"[upload][zc_blog_host]")
  369. Intro=TransferHTML(Intro,"[upload][zc_blog_host]")
  370. PostTime = Year(PostTime) & "-" & Month(PostTime) & "-" & Day(PostTime) & " " & Hour(PostTime) & ":" & Minute(PostTime) & ":" & Second(PostTime)
  371. End If
  372. LoadInfoByArray=True
  373. Call Filter_Plugin_TArticle_LoadInfoByArray(ID,Tag,CateID,Title,Intro,Content,Level,AuthorID,PostTime,CommNums,ViewNums,TrackBackNums,Alias,Istop)
  374. End Function
  375. Public Function Export(intType)
  376. 'plugin node
  377. bAction_Plugin_TArticle_Export_Begin=False
  378. For Each sAction_Plugin_TArticle_Export_Begin in Action_Plugin_TArticle_Export_Begin
  379. If Not IsEmpty(sAction_Plugin_TArticle_Export_Begin) Then Call Execute(sAction_Plugin_TArticle_Export_Begin)
  380. If bAction_Plugin_TArticle_Export_Begin=True Then Exit Function
  381. Next
  382. 'Call Export_CMTandTB
  383. 'Call Export_Mutuality
  384. 'Call Export_NavBar
  385. 'Call Export_CommentPost
  386. 'Call Export_Tag
  387. Call Export_Tag
  388. Call Export_CMTandTB
  389. Call Export_CommentPost
  390. Call Export_Mutuality
  391. Call Export_NavBar
  392. Template_Article_Single=GetTemplate("TEMPLATE_B_ARTICLE-SINGLE")
  393. Template_Article_Multi=GetTemplate("TEMPLATE_B_ARTICLE-MULTI")
  394. Template_Article_Istop=GetTemplate("TEMPLATE_B_ARTICLE-ISTOP")
  395. Template_Article_Multi_WAP=GetTemplate("TEMPLATE_WAP_ARTICLE-MULTI")
  396. Template_Article_Single_WAP =GetTemplate("TEMPLATE_WAP_SINGLE")
  397. 'plugin node
  398. Call Filter_Plugin_TArticle_Export_Template(Ftemplate,Template_Article_Single,Template_Article_Multi,Template_Article_Istop,Template_Article_Multi_WAP,Template_Article_Single_WAP)
  399. 'plugin node
  400. Call Filter_Plugin_TArticle_Export_Template_Sub(Template_Article_Comment,Template_Article_Trackback,Template_Article_Tag,Template_Article_Commentpost,Template_Article_Navbar_L,Template_Article_Navbar_R,Template_Article_Mutuality)
  401. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_trackback#>",Template_Article_Trackback)
  402. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_comment#>",Template_Article_Comment)
  403. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_commentpost#>",Template_Article_Commentpost)
  404. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_tag#>",Template_Article_Tag)
  405. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_navbar_l#>",Template_Article_Navbar_L)
  406. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_navbar_r#>",Template_Article_Navbar_R)
  407. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_mutuality#>",Template_Article_Mutuality)
  408. Template_Article_Multi=Replace(Template_Article_Multi,"<#template:article_tag#>",Template_Article_Tag)
  409. Template_Article_Istop=Replace(Template_Article_Istop,"<#template:article_tag#>",Template_Article_Tag)
  410. Ftemplate=Replace(Ftemplate,"<#template:article_trackback#>",Template_Article_Trackback)
  411. Ftemplate=Replace(Ftemplate,"<#template:article_comment#>",Template_Article_Comment)
  412. Ftemplate=Replace(Ftemplate,"<#template:article_commentpost#>",Template_Article_Commentpost)
  413. Ftemplate=Replace(Ftemplate,"<#template:article_tag#>",Template_Article_Tag)
  414. Ftemplate=Replace(Ftemplate,"<#template:article_navbar_l#>",Template_Article_Navbar_L)
  415. Ftemplate=Replace(Ftemplate,"<#template:article_navbar_r#>",Template_Article_Navbar_R)
  416. Ftemplate=Replace(Ftemplate,"<#template:article_mutuality#>",Template_Article_Mutuality)
  417. Dim aryTemplateTagsName()
  418. Dim aryTemplateTagsValue()
  419. Dim i,j
  420. ReDim aryTemplateTagsName(49)
  421. ReDim aryTemplateTagsValue(49)
  422. aryTemplateTagsName(1)="article/id"
  423. aryTemplateTagsValue(1)=ID
  424. aryTemplateTagsName(2)="article/level"
  425. aryTemplateTagsValue(2)=Level
  426. aryTemplateTagsName(3)="article/title"
  427. If intType=ZC_DISPLAY_MODE_SEARCH Then
  428. aryTemplateTagsValue(3)=Search(Title,Request.QueryString("q"))
  429. Else
  430. aryTemplateTagsValue(3)=HtmlTitle
  431. End If
  432. aryTemplateTagsName(4)="article/intro"
  433. If intType=ZC_DISPLAY_MODE_SEARCH Then
  434. 'aryTemplateTagsValue(4)=Search(TransferHTML(Intro & Content,"[html-format]"),Request.QueryString("q"))
  435. aryTemplateTagsValue(4)=Search(TransferHTML(Intro & Content,"[nohtml]"),Request.QueryString("q"))  
  436. Else
  437. If Level=2 Then
  438. aryTemplateTagsValue(4)=ZC_MSG043
  439. Else
  440. aryTemplateTagsValue(4)=HtmlIntro
  441. End If
  442. End If
  443. aryTemplateTagsName(5)="article/content"
  444. aryTemplateTagsValue(5)=HtmlContent
  445. If intType=ZC_DISPLAY_MODE_SEARCH Then
  446. aryTemplateTagsValue(5)=aryTemplateTagsValue(4)
  447. End If
  448. aryTemplateTagsName(6)="article/posttime"
  449. aryTemplateTagsValue(6)=PostTime
  450. aryTemplateTagsName(7)="article/commnums"
  451. aryTemplateTagsValue(7)=Commnums
  452. aryTemplateTagsName(8)="article/viewnums"
  453. aryTemplateTagsValue(8)=Viewnums
  454. aryTemplateTagsName(9)="article/trackbacknums"
  455. aryTemplateTagsValue(9)=Trackbacknums
  456. aryTemplateTagsName(10)="article/trackback_url"
  457. aryTemplateTagsValue(10)=TrackBack
  458. aryTemplateTagsName(11)="article/url"
  459. aryTemplateTagsValue(11)=HtmlUrl
  460. aryTemplateTagsName(12)="article/category/id"
  461. aryTemplateTagsValue(12)=Categorys(CateID).ID
  462. aryTemplateTagsName(13)="article/category/name"
  463. aryTemplateTagsValue(13)=Categorys(CateID).HtmlName
  464. aryTemplateTagsName(15)="article/category/order"
  465. aryTemplateTagsValue(15)=Categorys(CateID).Order
  466. aryTemplateTagsName(16)="article/category/count"
  467. aryTemplateTagsValue(16)=Categorys(CateID).Count
  468. aryTemplateTagsName(17)="article/category/url"
  469. aryTemplateTagsValue(17)=Categorys(CateID).HtmlUrl
  470. aryTemplateTagsName(18)="article/author/id"
  471. aryTemplateTagsValue(18)=Users(AuthorID).ID
  472. aryTemplateTagsName(19)="article/author/name"
  473. aryTemplateTagsValue(19)=Users(AuthorID).Name
  474. aryTemplateTagsName(20)="article/author/level"
  475. aryTemplateTagsValue(20)=ZVA_User_Level_Name(Users(AuthorID).Level)
  476. aryTemplateTagsName(21)="article/author/email"
  477. aryTemplateTagsValue(21)=Users(AuthorID).Email
  478. aryTemplateTagsName(22)="article/author/homepage"
  479. aryTemplateTagsValue(22)=Users(AuthorID).HomePage
  480. aryTemplateTagsName(23)="article/author/count"
  481. aryTemplateTagsValue(23)=Users(AuthorID).Count
  482. aryTemplateTagsName(24)="article/author/url"
  483. aryTemplateTagsValue(24)=Users(AuthorID).HtmlUrl
  484. aryTemplateTagsName(25)="article/posttime/longdate"
  485. aryTemplateTagsValue(25)=FormatDateTime(PostTime,vbLongDate)
  486. aryTemplateTagsName(26)="article/posttime/shortdate"
  487. aryTemplateTagsValue(26)=FormatDateTime(PostTime,vbShortDate)
  488. aryTemplateTagsName(27)="article/posttime/longtime"
  489. aryTemplateTagsValue(27)=FormatDateTime(PostTime,vbLongTime)
  490. aryTemplateTagsName(28)="article/posttime/shorttime"
  491. aryTemplateTagsValue(28)=FormatDateTime(PostTime,vbShortTime)
  492. aryTemplateTagsName(29)="article/posttime/year"
  493. aryTemplateTagsValue(29)=Year(PostTime)
  494. aryTemplateTagsName(30)="article/posttime/month"
  495. aryTemplateTagsValue(30)=Month(PostTime)
  496. aryTemplateTagsName(31)="article/posttime/monthname"
  497. aryTemplateTagsValue(31)=ZVA_Month(Month(PostTime))
  498. aryTemplateTagsName(32)="article/posttime/day"
  499. aryTemplateTagsValue(32)=Day(PostTime)
  500. aryTemplateTagsName(33)="article/posttime/weekday"
  501. aryTemplateTagsValue(33)=Weekday(PostTime)
  502. aryTemplateTagsName(34)="article/posttime/weekdayname"
  503. aryTemplateTagsValue(34)=ZVA_Week(Weekday(PostTime))
  504. aryTemplateTagsName(35)="article/posttime/hour"
  505. aryTemplateTagsValue(35)=Hour(PostTime)
  506. aryTemplateTagsName(36)="article/posttime/minute"
  507. aryTemplateTagsValue(36)=Minute(PostTime)
  508. aryTemplateTagsName(37)="article/posttime/second"
  509. aryTemplateTagsValue(37)=Second(PostTime)
  510. aryTemplateTagsName(38)="article/commentrss"
  511. aryTemplateTagsValue(38)=WfwCommentRss
  512. aryTemplateTagsName(39)="article/commentposturl"
  513. aryTemplateTagsValue(39)=TransferHTML(CommentPostUrl,"[html-format]")
  514. aryTemplateTagsName(40)="article/pretrackback_url"
  515. aryTemplateTagsValue(40)=TransferHTML(PreTrackBack,"[html-format]")
  516. aryTemplateTagsName(41)="article/trackbackkey"
  517. aryTemplateTagsValue(41)=TrackBackKey
  518. aryTemplateTagsName(42)="article/commentkey"
  519. aryTemplateTagsValue(42)=CommentKey
  520. aryTemplateTagsName(43)="article/staticname"
  521. aryTemplateTagsValue(43)=StaticName
  522. aryTemplateTagsName(44)="article/category/staticname"
  523. aryTemplateTagsValue(44)=Categorys(CateID).StaticName
  524. aryTemplateTagsName(45)="article/author/staticname"
  525. aryTemplateTagsValue(45)=Users(AuthorID).StaticName
  526. aryTemplateTagsName(46)="article/tagtoname"
  527. aryTemplateTagsValue(46)=TagToName
  528. aryTemplateTagsName(47)="article/firsttagintro"
  529. aryTemplateTagsValue(47)=FirstTagIntro
  530. aryTemplateTagsName(48)="article/posttime/monthnameabbr"
  531. aryTemplateTagsValue(48)=ZVA_Month_Abbr(Month(PostTime))
  532. aryTemplateTagsName(49)="article/posttime/weekdaynameabbr"
  533. aryTemplateTagsValue(49)=ZVA_Week_Abbr(Weekday(PostTime))
  534. Call Filter_Plugin_TArticle_Export_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  535. j=UBound(aryTemplateTagsName)
  536. For i=1 to j
  537. Template_Article_Istop=Replace(Template_Article_Istop,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  538. Template_Article_Multi=Replace(Template_Article_Multi,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  539. Template_Article_Single=Replace(Template_Article_Single,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  540. Template_Article_Multi_WAP = Replace(Template_Article_Multi_WAP,"<#" & aryTemplateTagsName(i) & "#>", aryTemplateTagsValue(i))
  541. Template_Article_Single_WAP = Replace(Template_Article_Single_WAP,"<#" & aryTemplateTagsName(i) & "#>", aryTemplateTagsValue(i))
  542. Ftemplate = Replace(Ftemplate,"<#" & aryTemplateTagsName(i) & "#>", aryTemplateTagsValue(i))
  543. Next
  544. If intType=ZC_DISPLAY_MODE_SEARCH Then
  545. Template_Article_Search=Template_Article_Multi
  546. End If
  547. Export=True
  548. 'plugin node
  549. bAction_Plugin_TArticle_Export_End=False
  550. For Each sAction_Plugin_TArticle_Export_End in Action_Plugin_TArticle_Export_End
  551. If Not IsEmpty(sAction_Plugin_TArticle_Export_End) Then Call Execute(sAction_Plugin_TArticle_Export_End)
  552. If bAction_Plugin_TArticle_Export_End=True Then Exit Function
  553. Next
  554. End Function
  555. Public Function Export_Tag
  556. 'plugin node
  557. bAction_Plugin_TArticle_Export_Tag_Begin=False
  558. For Each sAction_Plugin_TArticle_Export_Tag_Begin in Action_Plugin_TArticle_Export_Tag_Begin
  559. If Not IsEmpty(sAction_Plugin_TArticle_Export_Tag_Begin) Then Call Execute(sAction_Plugin_TArticle_Export_Tag_Begin)
  560. If bAction_Plugin_TArticle_Export_Tag_Begin=True Then Exit Function
  561. Next
  562. 'Tag
  563. Dim t,i,s,j
  564. If Tag<>"" Then
  565. Tag=Replace(Tag,"}","")
  566. t=Split(Tag,"{")
  567. For i=LBound(t) To UBound(t)
  568. If t(i)<>"" Then
  569. s=GetTemplate("TEMPLATE_B_ARTICLE_TAG")
  570. Template_Article_Tag=Template_Article_Tag & Tags(t(i)).MakeTemplate(s)
  571. End If
  572. Next
  573. End If
  574. Export_Tag=True
  575. End Function
  576. Function Export_CMTandTB()
  577. 'plugin node
  578. bAction_Plugin_TArticle_Export_CMTandTB_Begin=False
  579. For Each sAction_Plugin_TArticle_Export_CMTandTB_Begin in Action_Plugin_TArticle_Export_CMTandTB_Begin
  580. If Not IsEmpty(sAction_Plugin_TArticle_Export_CMTandTB_Begin) Then Call Execute(sAction_Plugin_TArticle_Export_CMTandTB_Begin)
  581. If bAction_Plugin_TArticle_Export_CMTandTB_Begin=True Then Exit Function
  582. Next
  583. If CommNums + TrackBackNums > 0 Then
  584. Dim strC_Count,strC,strT_Count,strT
  585. Dim objComment
  586. Dim objTrackBack
  587. Dim i
  588. Dim objRS
  589. Set objRS=Server.CreateObject("ADODB.Recordset")
  590. objRS.CursorType = adOpenKeyset
  591. objRS.LockType = adLockReadOnly
  592. objRS.ActiveConnection=objConn
  593. objRS.Source="SELECT [comm_ID],[log_ID],[comm_AuthorID],[comm_Author],[comm_Content],[comm_Email],[comm_HomePage],[comm_PostTime],[comm_IP],[comm_Agent] FROM [blog_Comment] WHERE [blog_Comment].[log_ID]=" & ID &" UNION ALL SELECT [tb_ID],[log_ID],'',[tb_Title],[tb_Excerpt],[tb_Blog],[tb_URL],[tb_PostTime],[tb_IP],[tb_Agent] from [blog_TrackBack] WHERE [blog_TrackBack].[log_ID]="& ID & " ORDER BY [comm_ID],[comm_PostTime]"
  594. objRS.Open()
  595. If (not objRS.bof) And (not objRS.eof) Then
  596. ReDim aryArticleExportMsgTB(objRS.RecordCount)
  597. For i=1 To objRS.RecordCount
  598. If IsNumeric(objRS("comm_AuthorID")) Then
  599. Set objComment=New TComment
  600. objComment.LoadInfoByArray(Array(objRS("comm_ID"),objRS("log_ID"),objRS("comm_AuthorID"),objRS("comm_Author"),objRS("comm_Content"),objRS("comm_Email"),objRS("comm_HomePage"),objRS("comm_PostTime"),"",""))
  601. strC_Count=strC_Count+1
  602. strC=GetTemplate("TEMPLATE_B_ARTICLE_COMMENT")
  603. objComment.Count=strC_Count
  604. strC=objComment.MakeTemplate(strC)
  605. If ZC_COMMENT_REVERSE_ORDER_EXPORT=True Then
  606. Template_Article_Comment=strC & Template_Article_Comment
  607. Else
  608. Template_Article_Comment=Template_Article_Comment & strC
  609. End If
  610. Set objComment=Nothing
  611. Else
  612. Set objTrackBack=New TTrackBack
  613. objTrackBack.LoadInfoByArray(Array(objRS("comm_ID"),objRS("log_ID"),objRS("comm_HomePage"),objRS("comm_Author"),objRS("comm_Email"),objRS("comm_Content"),objRS("comm_PostTime"),"",""))
  614. strT_Count=strT_Count+1
  615. strT=GetTemplate("TEMPLATE_B_ARTICLE_TRACKBACK")
  616. objTrackBack.Count=strT_Count
  617. strT=objTrackBack.MakeTemplate(strT)
  618. If ZC_COMMENT_REVERSE_ORDER_EXPORT=True Then
  619. Template_Article_Trackback=strT & Template_Article_Trackback
  620. Else
  621. Template_Article_Trackback=Template_Article_Trackback & strT
  622. End If
  623. Set objTrackBack=Nothing
  624. End If
  625. objRS.MoveNext
  626. If objRS.eof Then Exit For
  627. Next
  628. End if
  629. objRS.Close()
  630. Set objRS=Nothing
  631. End If
  632. Template_Article_Comment=Template_Article_Comment & "<div style=""display:none;"" id=""divAjaxComment""></div>"
  633. Export_CMTandTB=True
  634. End Function
  635. Function Export_NavBar()
  636. 'plugin node
  637. bAction_Plugin_TArticle_Export_NavBar_Begin=False
  638. For Each sAction_Plugin_TArticle_Export_NavBar_Begin in Action_Plugin_TArticle_Export_NavBar_Begin
  639. If Not IsEmpty(sAction_Plugin_TArticle_Export_NavBar_Begin) Then Call Execute(sAction_Plugin_TArticle_Export_NavBar_Begin)
  640. If bAction_Plugin_TArticle_Export_NavBar_Begin=True Then Exit Function
  641. Next
  642. If ZC_USE_NAVIGATE_ARTICLE=False Then 
  643. Template_Article_Navbar_L=""
  644. Template_Article_Navbar_R=""
  645. Export_NavBar=True
  646. Exit Function
  647. End If
  648. Dim s,t
  649. Dim strName
  650. Dim strUrl
  651. Dim objNavArticle
  652. Dim objRS
  653. Set objRS=objConn.Execute("SELECT TOP 1 [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Content],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url],[log_Istop] FROM [blog_Article] WHERE ([log_Level]>2) AND ([log_PostTime]<#" & PostTime & "#) ORDER BY [log_PostTime] DESC")
  654. If (Not objRS.bof) And (Not objRS.eof) Then
  655. Set objNavArticle=New TArticle
  656. If objNavArticle.LoadInfoByArray(Array(objRS(0),objRS(1),objRS(2),objRS(3),objRS(4),objRS(5),objRS(6),objRS(7),objRS(8),objRS(9),objRS(10),objRS(11),objRS(12),objRS(13))) Then
  657. strName=objNavArticle.Title
  658. strUrl=objNavArticle.Url
  659. End If
  660. Set objNavArticle=Nothing
  661. s=GetTemplate("TEMPLATE_B_ARTICLE_NVABAR_L")
  662. s=Replace(s,"<#article/nav_l/url#>",strUrl)
  663. s=Replace(s,"<#article/nav_l/name#>",strName)
  664. Template_Article_Navbar_L=s
  665. End If
  666. Set objRS=Nothing
  667. Set objRS=objConn.Execute("SELECT TOP 1 [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Content],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url],[log_Istop] FROM [blog_Article] WHERE ([log_Level]>2) AND ([log_PostTime]>#" & PostTime & "#) ORDER BY [log_PostTime] ASC")
  668. If (Not objRS.bof) And (Not objRS.eof) Then
  669. Set objNavArticle=New TArticle
  670. If objNavArticle.LoadInfoByArray(Array(objRS(0),objRS(1),objRS(2),objRS(3),objRS(4),objRS(5),objRS(6),objRS(7),objRS(8),objRS(9),objRS(10),objRS(11),objRS(12),objRS(13))) Then
  671. strName=objNavArticle.Title
  672. strUrl=objNavArticle.Url
  673. End If
  674. Set objNavArticle=Nothing
  675. t=GetTemplate("TEMPLATE_B_ARTICLE_NVABAR_R")
  676. t=Replace(t,"<#article/nav_r/url#>",strUrl)
  677. t=Replace(t,"<#article/nav_r/name#>",strName)
  678. Template_Article_Navbar_R=t
  679. End If
  680. Set objRS=Nothing
  681. Export_NavBar=True
  682. End Function
  683. Function Export_CommentPost()
  684. 'plugin node
  685. bAction_Plugin_TArticle_Export_CommentPost_Begin=False
  686. For Each sAction_Plugin_TArticle_Export_CommentPost_Begin in Action_Plugin_TArticle_Export_CommentPost_Begin
  687. If Not IsEmpty(sAction_Plugin_TArticle_Export_CommentPost_Begin) Then Call Execute(sAction_Plugin_TArticle_Export_CommentPost_Begin)
  688. If bAction_Plugin_TArticle_Export_CommentPost_Begin=True Then Exit Function
  689. Next
  690. If Level<4 Then Exit Function
  691. Template_Article_Commentpost=GetTemplate("TEMPLATE_B_ARTICLE_COMMENTPOST")
  692. If ZC_COMMENT_VERIFY_ENABLE=True Then
  693. Template_Article_Commentpost_Verify=GetTemplate("TEMPLATE_B_ARTICLE_COMMENTPOST-VERIFY")
  694. End If
  695. Template_Article_Commentpost=Replace(Template_Article_Commentpost,"<#template:article_commentpost-verify#>",Template_Article_Commentpost_Verify)
  696. End Function
  697. '相关文章的生成
  698. Function Export_Mutuality()
  699. 'plugin node
  700. bAction_Plugin_TArticle_Export_Mutuality_Begin=False
  701. For Each sAction_Plugin_TArticle_Export_Mutuality_Begin in Action_Plugin_TArticle_Export_Mutuality_Begin
  702. If Not IsEmpty(sAction_Plugin_TArticle_Export_Mutuality_Begin) Then Call Execute(sAction_Plugin_TArticle_Export_Mutuality_Begin)
  703. If bAction_Plugin_TArticle_Export_Mutuality_Begin=True Then Exit Function
  704. Next
  705. If Tag<>"" Then
  706. Dim strCC_Count,strCC_ID,strCC_Name,strCC_Url,strCC_PostTime,strCC_Title
  707. Dim strCC
  708. Dim i
  709. Dim j
  710. Dim objRS
  711. Dim strSQL
  712. Set objRS=Server.CreateObject("ADODB.Recordset")
  713. strSQL="SELECT TOP "& ZC_MUTUALITY_COUNT &" [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url],[log_Istop] FROM [blog_Article] WHERE ([log_Level]>2) AND [log_ID]<"& ID
  714. strSQL = strSQL & " AND ("
  715. Dim aryTAGs
  716. Tag=Replace(Tag,"}","")
  717. aryTAGs=Split(Tag,"{")
  718. For j = LBound(aryTAGs) To UBound(aryTAGs)
  719. If aryTAGs(j)<>"" Then
  720. strSQL = strSQL & "([log_Tag] Like '%{"&FilterSQL(aryTAGs(j))&"}%')"
  721. If j=UBound(aryTAGs) Then Exit For
  722. If aryTAGs(j)<>"" Then strSQL = strSQL & " OR "
  723. End If
  724. Next
  725. strSQL = strSQL & ")"
  726. strSQL = strSQL + " ORDER BY [log_PostTime] DESC " 
  727. Set objRS=Server.CreateObject("ADODB.Recordset")
  728. objRS.CursorType = adOpenKeyset
  729. objRS.LockType = adLockReadOnly
  730. objRS.ActiveConnection=objConn
  731. objRS.Source=strSQL
  732. objRS.Open()
  733. If (Not objRS.bof) And (Not objRS.eof) Then
  734. Dim objArticle
  735. For i=1 To ZC_MUTUALITY_COUNT '相关文章数目,可自行设定
  736. Set objArticle=New TArticle
  737. If objArticle.LoadInfoByArray(Array(objRS("log_ID"),objRS("log_Tag"),objRS("log_CateID"),objRS("log_Title"),"","",objRS("log_Level"),objRS("log_AuthorID"),objRS("log_PostTime"),objRS("log_CommNums"),objRS("log_ViewNums"),objRS("log_TrackBackNums"),objRS("log_Url"),objRS("log_Istop"))) Then
  738. strCC_Count=strCC_Count+1
  739. strCC_ID=objArticle.ID
  740. strCC_Url=objArticle.Url
  741. strCC_PostTime=objArticle.PostTime
  742. strCC_Title=objArticle.Title
  743. strCC=GetTemplate("TEMPLATE_B_ARTICLE_Mutuality")
  744. strCC=Replace(strCC,"<#article/mutuality/id#>",strCC_ID)
  745. strCC=Replace(strCC,"<#article/mutuality/url#>",strCC_Url)
  746. strCC=Replace(strCC,"<#article/mutuality/posttime#>",strCC_PostTime)
  747. strCC=Replace(strCC,"<#article/mutuality/name#>",strCC_Title)
  748. Template_Article_Mutuality=Template_Article_Mutuality & strCC
  749. End If
  750. objRS.MoveNext
  751. If objRS.eof Then Exit For
  752. Set objArticle=Nothing
  753. Next
  754. End if
  755. objRS.Close()
  756. Set objRS=Nothing
  757. End If
  758. Export_Mutuality=True
  759. End Function
  760. Public Function Post()
  761. Call Filter_Plugin_TArticle_Post(ID,Tag,CateID,Title,Intro,Content,Level,AuthorID,PostTime,CommNums,ViewNums,TrackBackNums,Alias,Istop)
  762. Call CheckParameter(ID,"int",0)
  763. Call CheckParameter(CateID,"int",0)
  764. Call CheckParameter(AuthorID,"int",0)
  765. Call CheckParameter(Level,"int",0)
  766. Call CheckParameter(PostTime,"dtm",Empty)
  767. Call CheckParameter(Istop,"bool",False)
  768. 'ID可以为0
  769. If (CateID=0) Then Post=False:Exit Function
  770. If (AuthorID=0) Then Post=False:Exit Function
  771. If IsEmpty(PostTime) Then Post=False:Exit Function
  772. Title=FilterSQL(Title)
  773. Intro=FilterSQL(Intro)
  774. Content=FilterSQL(Content)
  775. Tag=FilterSQL(Tag)
  776. IP=FilterSQL(IP)
  777. Title=TransferHTML(Title,"[japan-html]")
  778. Intro=TransferHTML(Intro,"[japan-html]")
  779. Content=TransferHTML(Content,"[japan-html]")
  780. Intro=TransferHTML(Intro,"[anti-upload]")
  781. Content=TransferHTML(Content,"[anti-upload]")
  782. '先进行"[anti-upload]",再替换<#ZC_BLOG_HOST#>
  783. Intro=TransferHTML(Intro,"[anti-zc_blog_host]")
  784. Content=TransferHTML(Content,"[anti-zc_blog_host]")
  785. Alias=TransferHTML(Alias,"[filename]")
  786. Alias=FilterSQL(Alias)
  787. '检查“别名”是否有重名
  788. If Alias<>"" Then
  789. Dim objRSsub
  790. Set objRSsub=objConn.Execute("SELECT [log_ID] FROM [blog_Article] WHERE [log_ID]<>"& ID &" AND [log_Url]='"& Alias &"'" )
  791. If (Not objRSsub.bof) And (Not objRSsub.eof) Then
  792. Randomize
  793. Alias=Alias & "_" & CStr(Int((9 * Rnd) + 1)) & CStr(Int((9 * Rnd) + 1)) & CStr(Int((9 * Rnd) + 1)) & CStr(Int((9 * Rnd) + 1))
  794. End If
  795. Set objRSsub=Nothing
  796. End If
  797. If Len(Title)=0 Then Post=False:Exit Function
  798. If Len(Content)=0 Then Post=False:Exit Function
  799. If Len(Intro)=0 Then Intro=Left(Content,ZC_TB_EXCERPT_MAX) & "..."
  800. If ID=0 Then
  801. objConn.Execute("INSERT INTO [blog_Article]([log_CateID],[log_AuthorID],[log_Level],[log_Title],[log_Intro],[log_Content],[log_PostTime],[log_IP],[log_Tag],[log_Url],[log_Istop]) VALUES ("&CateID&","&AuthorID&","&Level&",'"&Title&"','"&Intro&"','"&Content&"','"&PostTime&"','"&IP&"','"&Tag&"','"&Alias&"',"&Istop&")")
  802. Dim objRS
  803. Set objRS=objConn.Execute("SELECT MAX([log_ID]) FROM [blog_Article]")
  804. If (Not objRS.bof) And (Not objRS.eof) Then
  805. ID=objRS(0)
  806. End If
  807. Set objRS=Nothing
  808. Else
  809. objConn.Execute("UPDATE [blog_Article] SET [log_CateID]="&CateID&",[log_AuthorID]="&AuthorID&",[log_Level]="&Level&",[log_Title]='"&Title&"',[log_Intro]='"&Intro&"',[log_Content]='"&Content&"',[log_PostTime]='"&PostTime&"',[log_IP]='"&IP&"',[log_Tag]='"&Tag&"',[log_Url]='"&Alias&"',[log_Istop]="&Istop&" WHERE [log_ID] =" & ID)
  810. End If
  811. Post=True
  812. End Function
  813. Public Function DelFile()
  814. On Error Resume Next
  815. Dim fso, TxtFile
  816. Set fso = CreateObject("Scripting.FileSystemObject")
  817. If fso.FileExists(BlogPath & Directory & FileName) Then
  818. Set TxtFile = fso.GetFile(BlogPath & Directory & FileName)
  819. TxtFile.Delete
  820. End If
  821. Set fso=Nothing
  822. Set fso = CreateObject("Scripting.FileSystemObject")
  823. If fso.FileExists(BlogPath & "/cache/" & ID & ".html") Then
  824. Set TxtFile = fso.GetFile(BlogPath & "/cache/" & ID & ".html")
  825. TxtFile.Delete
  826. End If
  827. Set fso=Nothing
  828. DelFile=True
  829. Err.Clear
  830. End Function
  831. Public Function Del()
  832. Call Filter_Plugin_TArticle_Del(ID,Tag,CateID,Title,Intro,Content,Level,AuthorID,PostTime,CommNums,ViewNums,TrackBackNums,Alias,Istop)
  833. Call DelFile()
  834. Call CheckParameter(ID,"int",0)
  835. If (ID=0) Then Del=False:Exit Function
  836. objConn.Execute("DELETE FROM [blog_Article] WHERE [log_ID] =" & ID)
  837. objConn.Execute("DELETE FROM [blog_Comment] WHERE [log_ID] =" & ID)
  838. objConn.Execute("DELETE FROM [blog_TrackBack] WHERE [log_ID] =" & ID)
  839. Del=True
  840. End Function
  841. Public Function Statistic()
  842. Dim objRS
  843. Set objRS=objConn.Execute("SELECT COUNT([log_ID]) FROM [blog_Comment] WHERE [log_ID] =" & ID)
  844. If (Not objRS.bof) And (Not objRS.eof) Then
  845. CommNums=objRS(0)
  846. End If
  847. objConn.Execute("UPDATE [blog_Article] SET [log_CommNums]="& CommNums &" WHERE [log_ID] =" & ID)
  848. Set objRS=Nothing
  849. Set objRS=objConn.Execute("SELECT COUNT([log_ID]) FROM [blog_TrackBack] WHERE [log_ID] =" & ID)
  850. If (Not objRS.bof) And (Not objRS.eof) Then
  851. TrackBackNums=objRS(0)
  852. End If
  853. objConn.Execute("UPDATE [blog_Article] SET [log_TrackBackNums]="& TrackBackNums &" WHERE [log_ID] =" & ID)
  854. Set objRS=Nothing
  855. Statistic=True
  856. End Function
  857. Function Build()
  858. Dim aryTemplateTagsName
  859. Dim aryTemplateTagsValue
  860. Dim i,j
  861. htmlWAP = Template_Article_Single_WAP
  862. If IsEmpty(html) Then html=template
  863. Call Filter_Plugin_TArticle_Build_Template(html,htmlWAP)
  864. Call Filter_Plugin_TArticle_Build_Template_Sub(Template_Article_Single)
  865. html=Replace(html,"<#template:article-single#>",Template_Article_Single)
  866. aryTemplateTagsName=TemplateTagsName
  867. aryTemplateTagsValue=TemplateTagsValue
  868. aryTemplateTagsName(0)="BlogTitle"
  869. aryTemplateTagsValue(0)=HtmlTitle
  870. Call Filter_Plugin_TArticle_Build_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  871. j=UBound(aryTemplateTagsName)
  872. For i=1 to j
  873. If (InStr(aryTemplateTagsName(i),"CACHE_INCLUDE_")>0) And (Right(aryTemplateTagsName(i),5)<>"_HTML") And (Right(aryTemplateTagsName(i),3)<>"_JS") Then
  874. Dim modname
  875. modname=LCase(Replace(aryTemplateTagsName(i),"CACHE_INCLUDE_",""))
  876. If aryTemplateTagsName(i)<>"CACHE_INCLUDE_NAVBAR" Then
  877. If aryTemplateTagsName(i)="CACHE_INCLUDE_CALENDAR" Then
  878. aryTemplateTagsValue(i)="<div id=""mod_"+modname+"""><script type=""text/javascript"">strBatchInculde+=""mod_"+modname+"="+modname+",""</script></div>"
  879. Else
  880. aryTemplateTagsValue(i)="<li id=""mod_"+modname+""" style=""display:none;""><script type=""text/javascript"">strBatchInculde+=""mod_"+modname+"="+modname+",""</script></li>"
  881. End If
  882. End If
  883. End If
  884. Next
  885. j=UBound(aryTemplateTagsName)
  886. For i=1 to j
  887. html=Replace(html,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  888. htmlWAP = Replace(htmlWAP, "<#" & aryTemplateTagsName(i) & "#>", aryTemplateTagsValue(i))
  889. Next
  890. html=Replace(html,"<#" & aryTemplateTagsName(0) & "#>",aryTemplateTagsValue(0))
  891. htmlWAP = Replace(htmlWAP, "<#" & aryTemplateTagsName(0) & "#>", aryTemplateTagsValue(0))
  892. Build=True
  893. End Function
  894. Function SetVar(TemplateTag,TemplateValue)
  895. If IsEmpty(html) Then html=template
  896. html=Replace(html,"<#" & TemplateTag & "#>",TemplateValue)
  897. End Function
  898. Function Save()
  899. If Not(Level>2) Then Save=True:Exit Function
  900. Dim objStream
  901. html=TransferHTML(html,"[no-asp]")
  902. If ZC_STATIC_TYPE="asp" Then
  903. html="<"&"%@ CODEPAGE=65001 %"&">" & html
  904. End If
  905. If ZC_CUSTOM_DIRECTORY_ENABLE=True Then
  906. Call CreatDirectoryByCustomDirectory(Directory)
  907. End If
  908. Call SaveToFile(BlogPath & Directory & FileName,html,"utf-8",False)
  909. Save=True
  910. End Function
  911. Function SaveCache()
  912. If Not(Level>1) Then SaveCache=True:Exit Function
  913. Dim strList
  914. If Istop Then
  915. strList=Template_Article_Istop
  916. Else
  917. strList=Template_Article_Multi
  918. End If
  919. strList=TransferHTML(strList,"[no-asp]")
  920. Call SaveToFile(BlogPath & "/cache/" & ID & ".html",strList,"utf-8",False)
  921. SaveCache=True
  922. End Function
  923. Function LoadCache()
  924. Dim objStream
  925. Template_Article_Multi=LoadFromFile(BlogPath & "/CACHE/" & ID & ".html","utf-8")
  926. LoadCache=True
  927. End Function
  928. Private Sub Class_Initialize()
  929. PostTime=GetTime(Now())
  930. ID=0
  931. CateID=0
  932. AuthorID=0
  933. Level=4'默认为普通
  934. Title=ZC_MSG099
  935. IP=Request.Servervariables("REMOTE_ADDR")
  936. Ftemplate_Wap=Empty
  937. Ftemplate=Empty
  938. End Sub
  939. End Class
  940. '*********************************************************
  941. '*********************************************************
  942. ' 目的:    定义TArticleList类
  943. ' 输入:    无
  944. ' 返回:    无
  945. '*********************************************************
  946. Class TArticleList
  947. Public Title
  948. Public FileName
  949. Public AllList
  950. Public AuthList
  951. Public CateList
  952. Public TagsList
  953. Public aryArticle
  954. Public aryArticleList()
  955. Public Template_PageBar
  956. Public Template_Article_Multi
  957. Public Template_PageBar_Next
  958. Public Template_PageBar_Previous
  959. Public Template_Calendar
  960. Public TemplateTags_ArticleList_Author_ID
  961. Public TemplateTags_ArticleList_Tags_ID
  962. Public TemplateTags_ArticleList_Category_ID
  963. Public TemplateTags_ArticleList_Date_ShortDate
  964. Public TemplateTags_ArticleList_Date_Year
  965. Public TemplateTags_ArticleList_Date_Month
  966. Public TemplateTags_ArticleList_Date_Day
  967. Public TemplateTags_ArticleList_Page_Now
  968. Public TemplateTags_ArticleList_Page_All
  969. Public html
  970. Private Ftemplate
  971. Public Property Let template(strFileName)
  972. Ftemplate=GetTemplate("TEMPLATE_" & strFileName)
  973. End Property
  974. Public Property Get template
  975. template = Ftemplate
  976. End Property
  977. Private FDirectory
  978. Public Property Let Directory(strDirectory)
  979. FDirectory=strDirectory
  980. End Property
  981. Public Property Get Directory
  982. If IsEmpty(FDirectory)=True Then
  983. Directory=ZC_STATIC_DIRECTORY
  984. Else
  985. Directory = FDirectory
  986. End If
  987. Directory=Replace(Directory,"","/")
  988. If Right(ZC_BLOG_HOST & Directory,1)<>"/" Then
  989. Directory=Directory & "/"
  990. End If
  991. End Property
  992. Public Function Export(intPage,intCateId,intAuthorId,dtmYearMonth,strTagsName,intType)
  993. 'plugin node
  994. bAction_Plugin_TArticleList_Export_Begin=False
  995. For Each sAction_Plugin_TArticleList_Export_Begin in Action_Plugin_TArticleList_Export_Begin
  996. If Not IsEmpty(sAction_Plugin_TArticleList_Export_Begin) Then Call Execute(sAction_Plugin_TArticleList_Export_Begin)
  997. If bAction_Plugin_TArticleList_Export_Begin=True Then Exit Function
  998. Next
  999. 'plugin node
  1000. Call Filter_Plugin_TArticleList_Export(intPage,intCateId,intAuthorId,dtmYearMonth,strTagsName,intType)
  1001. Dim i,j,k,l
  1002. Dim objRS
  1003. Dim intPageCount
  1004. Dim objArticle
  1005. Call CheckParameter(intPage,"int",1)
  1006. Call CheckParameter(intCateId,"int",Empty)
  1007. Call CheckParameter(intAuthorId,"int",Empty)
  1008. Call CheckParameter(dtmYearMonth,"dtm",Empty)
  1009. Title=ZC_BLOG_SUBTITLE
  1010. Set objRS=Server.CreateObject("ADODB.Recordset")
  1011. objRS.CursorType = adOpenKeyset
  1012. objRS.LockType = adLockReadOnly
  1013. objRS.ActiveConnection=objConn
  1014. '//////////////////////////
  1015. 'ontop
  1016. objRS.Source="SELECT [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Content],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url],[log_Istop] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Istop]=True) AND ([log_Level]>1)"
  1017. objRS.Source=objRS.Source & "ORDER BY [log_PostTime] DESC,[log_ID] DESC"
  1018. objRS.Open()
  1019. If (Not objRS.bof) And (Not objRS.eof) Then
  1020. objRS.PageSize = ZC_DISPLAY_COUNT
  1021. intPageCount=objRS.PageCount
  1022. objRS.AbsolutePage = 1
  1023. For i = 1 To objRS.PageSize
  1024. ReDim Preserve aryArticleList(i)
  1025. Set objArticle=New TArticle
  1026. If objArticle.LoadInfoByArray(Array(objRS(0),objRS(1),objRS(2),objRS(3),objRS(4),objRS(5),objRS(6),objRS(7),objRS(8),objRS(9),objRS(10),objRS(11),objRS(12),objRS(13))) Then
  1027. If objArticle.Export(intType)= True Then
  1028. aryArticleList(i)=objArticle.Template_Article_Istop
  1029. End If
  1030. End If
  1031. Set objArticle=Nothing
  1032. objRS.MoveNext
  1033. If objRS.EOF Then Exit For
  1034. Next
  1035. End If
  1036. objRS.Close()
  1037. k=Join(aryArticleList)
  1038. Erase aryArticleList
  1039. '//////////////////////////
  1040. objRS.Source="SELECT [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Content],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url],[log_Istop] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Istop]=False) AND ([log_Level]>1)"
  1041. If Not IsEmpty(intCateId) Then
  1042. objRS.Source=objRS.Source & "AND([log_CateID]="&intCateId&")"
  1043. On Error Resume Next
  1044. Title=Server.HTMLEncode(Categorys(intCateId).Name)
  1045. TemplateTags_ArticleList_Category_ID=Categorys(intCateId).ID
  1046. Err.Clear
  1047. End if
  1048. If Not IsEmpty(intAuthorId) Then
  1049. objRS.Source=objRS.Source & "AND([log_AuthorID]="&intAuthorId&")"
  1050. On Error Resume Next
  1051. Title=Server.HTMLEncode(Users(intAuthorId).Name)
  1052. TemplateTags_ArticleList_Author_ID=Users(intAuthorId).ID
  1053. Err.Clear
  1054. End if
  1055. If IsDate(dtmYearMonth) Then
  1056. Dim y
  1057. Dim m
  1058. Dim d
  1059. Dim ny
  1060. Dim nm
  1061. If IsDate(dtmYearMonth) Then
  1062. 'dtmYearMonth=CDate(dtmYearMonth)
  1063. Else
  1064. Call showError(3)
  1065. End If
  1066. y=Year(dtmYearMonth)
  1067. m=Month(dtmYearMonth)
  1068. d=Day(dtmYearMonth)
  1069. TemplateTags_ArticleList_Date_ShortDate=dtmYearMonth
  1070. TemplateTags_ArticleList_Date_Year=y
  1071. TemplateTags_ArticleList_Date_Month=m
  1072. TemplateTags_ArticleList_Date_Day=d
  1073. ny=y
  1074. nm=m+1
  1075. If m=12 Then ny=ny+1:nm=1
  1076. If InstrRev(CStr(dtmYearMonth),"-")>=7 Then
  1077. objRS.Source=objRS.Source & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&") AND(Day([log_PostTime])="&d&")"
  1078. Else
  1079. objRS.Source=objRS.Source & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&")"
  1080. End If
  1081. Template_Calendar="<script language=""JavaScript"" src="""&ZC_BLOG_HOST&"function/c_html_js.asp?date="&dtmYearMonth&""" type=""text/javascript""></script>"
  1082. Title=Year(dtmYearMonth) & " " & ZVA_Month(Month(dtmYearMonth))
  1083. End If
  1084. If Not IsEmpty(strTagsName) Then
  1085. On Error Resume Next
  1086. Dim Tag
  1087. For Each Tag in Tags
  1088. If IsObject(Tag) Then
  1089. If UCase(Tag.Name)=UCase(strTagsName) Then
  1090. objRS.Source=objRS.Source & "AND([log_Tag] LIKE '%{" & Tag.ID & "}%')"
  1091. TemplateTags_ArticleList_Tags_ID=Tag.ID
  1092. 'Title=strTagsName
  1093. Title=Server.HTMLEncode(strTagsName)
  1094. End If
  1095. End If
  1096. Next
  1097. Err.Clear
  1098. End If
  1099. objRS.Source=objRS.Source & "ORDER BY [log_PostTime] DESC,[log_ID] DESC"
  1100. objRS.Open()
  1101. If (Not objRS.bof) And (Not objRS.eof) Then
  1102. objRS.PageSize = ZC_DISPLAY_COUNT
  1103. intPageCount=objRS.PageCount
  1104. objRS.AbsolutePage = intPage
  1105. For i = 1 To objRS.PageSize
  1106. ReDim Preserve aryArticleList(i)
  1107. Set objArticle=New TArticle
  1108. If objArticle.LoadInfoByArray(Array(objRS(0),objRS(1),objRS(2),objRS(3),objRS(4),objRS(5),objRS(6),objRS(7),objRS(8),objRS(9),objRS(10),objRS(11),objRS(12),objRS(13))) Then
  1109. If objArticle.Export(intType)= True Then
  1110. aryArticleList(i)=objArticle.Template_Article_Multi
  1111. End If
  1112. End If
  1113. Set objArticle=Nothing
  1114. objRS.MoveNext
  1115. If objRS.EOF Then Exit For
  1116. Next
  1117. End If
  1118. objRS.Close()
  1119. Set objRS=Nothing
  1120. Template_Article_Multi=k & Join(aryArticleList)
  1121. TemplateTags_ArticleList_Page_Now=intPage
  1122. TemplateTags_ArticleList_Page_All=intPageCount
  1123. Call ExportBar(intPage,intPageCount,intCateId,intAuthorId,dtmYearMonth,strTagsName)
  1124. Export=True
  1125. 'plugin node
  1126. bAction_Plugin_TArticleList_Export_End=False
  1127. For Each sAction_Plugin_TArticleList_Export_End in Action_Plugin_TArticleList_Export_End
  1128. If Not IsEmpty(sAction_Plugin_TArticleList_Export_End) Then Call Execute(sAction_Plugin_TArticleList_Export_End)
  1129. If bAction_Plugin_TArticleList_Export_End=True Then Exit Function
  1130. Next
  1131. End Function
  1132. Public Function ExportByCache(intPage,intCateId,intAuthorId,dtmYearMonth,strTagsName,intType)
  1133. 'plugin node
  1134. bAction_Plugin_TArticleList_ExportByCache_Begin=False
  1135. For Each sAction_Plugin_TArticleList_ExportByCache_Begin in Action_Plugin_TArticleList_ExportByCache_Begin
  1136. If Not IsEmpty(sAction_Plugin_TArticleList_ExportByCache_Begin) Then Call Execute(sAction_Plugin_TArticleList_ExportByCache_Begin)
  1137. If bAction_Plugin_TArticleList_ExportByCache_Begin=True Then Exit Function
  1138. Next
  1139. 'plugin node
  1140. Call Filter_Plugin_TArticleList_ExportByCache(intPage,intCateId,intAuthorId,dtmYearMonth,strTagsName,intType)
  1141. Dim strType
  1142. Dim i,j,s,t,k,l
  1143. Dim intAllPage
  1144. Dim intTagsID
  1145. Dim objArticle
  1146. Call CheckParameter(intPage,"int",1)
  1147. Call CheckParameter(intCateId,"int",Empty)
  1148. Call CheckParameter(intAuthorId,"int",Empty)
  1149. Call CheckParameter(dtmYearMonth,"dtm",Empty)
  1150. i=InStr(1,TagsList,vbTab & strTagsName & vbVerticalTab,vbBinaryCompare)
  1151. If i>0 Then
  1152. j=Left(TagsList,i-1)
  1153. i=InStrRev(j,vbTab)
  1154. intTagsID=Right(j,Len(j)-i)
  1155. Call CheckParameter(intTagsID,"int",Empty)
  1156. End If
  1157. '//////////////////////////
  1158. 'ontop
  1159. If True Then 
  1160. strType="Istop" & "Page1" & "["
  1161. s="Istop" & "Page"
  1162. i=InStrRev(AllList,s)
  1163. If i>0 Then
  1164. j=InStr(i,AllList,"[",vbBinaryCompare)
  1165. s=Mid(AllList,i+Len(s),j-i-Len(s))
  1166. intAllPage=CInt(s)
  1167. End If
  1168. i=InStr(1,AllList,strType,vbBinaryCompare)
  1169. If i>0 Then
  1170. i=Len(strType)+i
  1171. j=InStr(i,AllList,"]",vbBinaryCompare)
  1172. s=Mid(AllList,i,j-i)
  1173. aryArticle=Split(s,";")
  1174. End If
  1175. If IsArray(aryArticle) Then
  1176. Redim aryArticleList(UBound(aryArticle))
  1177. For i=LBound(aryArticle) To UBound(aryArticle)-1
  1178. Set objArticle = New TArticle
  1179. objArticle.ID=aryArticle(i)
  1180. If objArticle.LoadCache Then
  1181. aryArticleList(i)=objArticle.Template_Article_Multi
  1182. End if
  1183. Set objArticle = Nothing
  1184. Next
  1185. k=Join(aryArticleList)
  1186. Erase aryArticleList
  1187. ReDim aryArticle(0)
  1188. End If
  1189. End If
  1190. '////////////////////////////
  1191. strType="All" & "Page" & CStr(intPage) & "["
  1192. s="All" & "Page"
  1193. Title=ZC_BLOG_SUBTITLE
  1194. i=InStrRev(AllList,s)
  1195. If i>0 Then
  1196. j=InStr(i,AllList,"[",vbBinaryCompare)
  1197. s=Mid(AllList,i+Len(s),j-i-Len(s))
  1198. intAllPage=CInt(s)
  1199. End If
  1200. i=InStr(1,AllList,strType,vbBinaryCompare)
  1201. If i>0 Then
  1202. i=Len(strType)+i
  1203. j=InStr(i,AllList,"]",vbBinaryCompare)
  1204. s=Mid(AllList,i,j-i)
  1205. aryArticle=Split(s,";")
  1206. End If
  1207. If IsArray(aryArticle) Then
  1208. Redim aryArticleList(UBound(aryArticle))
  1209. For i=LBound(aryArticle) To UBound(aryArticle)-1
  1210. Set objArticle = New TArticle
  1211. objArticle.ID=aryArticle(i)
  1212. If objArticle.LoadCache Then
  1213. aryArticleList(i)=objArticle.Template_Article_Multi
  1214. End if
  1215. Set objArticle = Nothing
  1216. Next
  1217. Template_Article_Multi=k & Join(aryArticleList)
  1218. End If
  1219. TemplateTags_ArticleList_Page_Now=intPage
  1220. TemplateTags_ArticleList_Page_All=intAllPage
  1221. Call ExportBar(intPage,intAllPage,intCateId,intAuthorId,dtmYearMonth,strTagsName)
  1222. ExportByCache=True
  1223. 'plugin node
  1224. bAction_Plugin_TArticleList_ExportByCache_End=False
  1225. For Each sAction_Plugin_TArticleList_ExportByCache_End in Action_Plugin_TArticleList_ExportByCache_End
  1226. If Not IsEmpty(sAction_Plugin_TArticleList_ExportByCache_End) Then Call Execute(sAction_Plugin_TArticleList_ExportByCache_End)
  1227. If bAction_Plugin_TArticleList_ExportByCache_End=True Then Exit Function
  1228. Next
  1229. End Function
  1230. Public Function ExportByMixed(intPage,intCateId,intAuthorId,dtmYearMonth,strTagsName,intType)
  1231. 'plugin node
  1232. bAction_Plugin_TArticleList_ExportByMixed_Begin=False
  1233. For Each sAction_Plugin_TArticleList_ExportByMixed_Begin in Action_Plugin_TArticleList_ExportByMixed_Begin
  1234. If Not IsEmpty(sAction_Plugin_TArticleList_ExportByMixed_Begin) Then Call Execute(sAction_Plugin_TArticleList_ExportByMixed_Begin)
  1235. If bAction_Plugin_TArticleList_ExportByMixed_Begin=True Then Exit Function
  1236. Next
  1237. 'plugin node
  1238. Call Filter_Plugin_TArticleList_ExportByMixed(intPage,intCateId,intAuthorId,dtmYearMonth,strTagsName,intType)
  1239. Dim strType
  1240. Dim i,j,k,l,s
  1241. Dim objRS
  1242. Dim intPageCount
  1243. Dim objArticle
  1244. Dim intAllPage
  1245. Call CheckParameter(intPage,"int",1)
  1246. Call CheckParameter(intCateId,"int",Empty)
  1247. Call CheckParameter(intAuthorId,"int",Empty)
  1248. Call CheckParameter(dtmYearMonth,"dtm",Empty)
  1249. Title=ZC_BLOG_SUBTITLE
  1250. Set objRS=Server.CreateObject("ADODB.Recordset")
  1251. objRS.CursorType = adOpenKeyset
  1252. objRS.LockType = adLockReadOnly
  1253. objRS.ActiveConnection=objConn
  1254. '//////////////////////////
  1255. 'ontop
  1256. If True Then 
  1257. strType="Istop" & "Page1" & "["
  1258. s="Istop" & "Page"
  1259. i=InStrRev(AllList,s)
  1260. If i>0 Then
  1261. j=InStr(i,AllList,"[",vbBinaryCompare)
  1262. s=Mid(AllList,i+Len(s),j-i-Len(s))
  1263. intAllPage=CInt(s)
  1264. End If
  1265. i=InStr(1,AllList,strType,vbBinaryCompare)
  1266. If i>0 Then
  1267. i=Len(strType)+i
  1268. j=InStr(i,AllList,"]",vbBinaryCompare)
  1269. s=Mid(AllList,i,j-i)
  1270. aryArticle=Split(s,";")
  1271. End If
  1272. If IsArray(aryArticle) Then
  1273. Redim aryArticleList(UBound(aryArticle))
  1274. For i=LBound(aryArticle) To UBound(aryArticle)-1
  1275. Set objArticle = New TArticle
  1276. objArticle.ID=aryArticle(i)
  1277. If objArticle.LoadCache Then
  1278. aryArticleList(i)=objArticle.Template_Article_Multi
  1279. End if
  1280. Set objArticle = Nothing
  1281. Next
  1282. k=Join(aryArticleList)
  1283. Erase aryArticleList
  1284. ReDim aryArticle(0)
  1285. End If
  1286. End If
  1287. '////////////////////////////
  1288. objRS.Source="SELECT [log_ID] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Istop]=False) AND ([log_Level]>1)"
  1289. If Not IsEmpty(intCateId) Then
  1290. objRS.Source=objRS.Source & "AND([log_CateID]="&intCateId&")"
  1291. On Error Resume Next
  1292. Title=Server.HTMLEncode(Categorys(intCateId).Name)
  1293. TemplateTags_ArticleList_Category_ID=Categorys(intCateId).ID
  1294. Err.Clear
  1295. End if
  1296. If Not IsEmpty(intAuthorId) Then
  1297. objRS.Source=objRS.Source & "AND([log_AuthorID]="&intAuthorId&")"
  1298. On Error Resume Next
  1299. Title=Server.HTMLEncode(Users(intAuthorId).Name)
  1300. TemplateTags_ArticleList_Author_ID=Users(intAuthorId).ID
  1301. Err.Clear
  1302. End If
  1303. If IsDate(dtmYearMonth) Then
  1304. Dim y
  1305. Dim m
  1306. Dim d
  1307. Dim ny
  1308. Dim nm
  1309. If IsDate(dtmYearMonth) Then
  1310. ' dtmYearMonth=CDate(dtmYearMonth)
  1311. Else
  1312. Call showError(3)
  1313. End If
  1314. y=Year(dtmYearMonth)
  1315. m=Month(dtmYearMonth)
  1316. d=Day(dtmYearMonth)
  1317. TemplateTags_ArticleList_Date_ShortDate=dtmYearMonth
  1318. TemplateTags_ArticleList_Date_Year=y
  1319. TemplateTags_ArticleList_Date_Month=m
  1320. TemplateTags_ArticleList_Date_Day=d
  1321. ny=y
  1322. nm=m+1
  1323. If m=12 Then ny=ny+1:nm=1
  1324. If InstrRev(CStr(dtmYearMonth),"-")>=7 Then
  1325. objRS.Source=objRS.Source & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&") AND(Day([log_PostTime])="&d&")"
  1326. Else
  1327. objRS.Source=objRS.Source & "AND(Year([log_PostTime])="&y&") AND(Month([log_PostTime])="&m&")"
  1328. End If
  1329. Template_Calendar="<script language=""JavaScript"" src="""&ZC_BLOG_HOST&"function/c_html_js.asp?date="&dtmYearMonth&""" type=""text/javascript""></script>"
  1330. Title=Year(dtmYearMonth) & " " & ZVA_Month(Month(dtmYearMonth))
  1331. End If
  1332.                 If Not IsEmpty(strTagsName) Then
  1333.                         On Error Resume Next
  1334.                         Dim Tag
  1335.                         For Each Tag in Tags
  1336.                                 If IsObject(Tag) Then
  1337.                                         Dim arrTagsName, Tag_i
  1338.                                         arrTagsName = split(strTagsName, ",")
  1339.                                         For Tag_i = 0 To UBound(arrTagsName)
  1340.                                         strTagsName = arrTagsName(Tag_i)
  1341.                                         If UCase(Tag.Name)=UCase(strTagsName) Then
  1342.                                                 objRS.Source=objRS.Source & "AND([log_Tag] LIKE '%{" & Tag.ID & "}%')"
  1343.                                                 TemplateTags_ArticleList_Tags_ID=Tag.ID
  1344.                                         End If
  1345.                                         Next'Tag_i
  1346.                                 End If
  1347.                         Next
  1348.                         Err.Clear
  1349.                         Title=Server.HTMLEncode(strTagsName)
  1350.                 End If
  1351. objRS.Source=objRS.Source & "ORDER BY [log_PostTime] DESC,[log_ID] DESC"
  1352. objRS.Open()
  1353. If (Not objRS.bof) And (Not objRS.eof) Then
  1354. objRS.PageSize = ZC_DISPLAY_COUNT
  1355. intPageCount=objRS.PageCount
  1356. objRS.AbsolutePage = intPage
  1357. For i = 1 To objRS.PageSize
  1358. ReDim Preserve aryArticleList(i)
  1359. Set objArticle = New TArticle
  1360. objArticle.ID=objRS(0)
  1361. If objArticle.LoadCache Then
  1362. aryArticleList(i)=objArticle.Template_Article_Multi
  1363. End if
  1364. Set objArticle = Nothing
  1365. objRS.MoveNext
  1366. If objRS.EOF Then Exit For
  1367. Next
  1368. End If
  1369. objRS.Close()
  1370. Set objRS=Nothing
  1371. Template_Article_Multi=k & Join(aryArticleList)
  1372. TemplateTags_ArticleList_Page_Now=intPage
  1373. TemplateTags_ArticleList_Page_All=intPageCount
  1374. Call ExportBar(intPage,intPageCount,intCateId,intAuthorId,dtmYearMonth,strTagsName)
  1375. ExportByMixed=True
  1376. 'plugin node
  1377. bAction_Plugin_TArticleList_ExportByMixed_End=False
  1378. For Each sAction_Plugin_TArticleList_ExportByMixed_End in Action_Plugin_TArticleList_ExportByMixed_End
  1379. If Not IsEmpty(sAction_Plugin_TArticleList_ExportByMixed_End) Then Call Execute(sAction_Plugin_TArticleList_ExportByMixed_End)
  1380. If bAction_Plugin_TArticleList_ExportByMixed_End=True Then Exit Function
  1381. Next
  1382. End Function
  1383. Public Function Build()
  1384. Dim aryTemplateTagsName
  1385. Dim aryTemplateTagsValue
  1386. Dim aryTemplateSubName()
  1387. Dim aryTemplateSubValue()
  1388. Dim i,j
  1389. If IsEmpty(html) Then html=template
  1390. 'plugin node
  1391. Call Filter_Plugin_TArticleList_Build_Template(html)
  1392. ReDim aryTemplateSubName(14)
  1393. ReDim aryTemplateSubValue(14)
  1394. aryTemplateSubName(  1)="template:article-multi"
  1395. aryTemplateSubValue( 1)=Template_Article_Multi
  1396. aryTemplateSubName(  2)="template:pagebar"
  1397. aryTemplateSubValue( 2)=Template_PageBar
  1398. aryTemplateSubName(  3)="template:pagebar_next"
  1399. aryTemplateSubValue( 3)=Template_PageBar_Next
  1400. aryTemplateSubName(  4)="template:pagebar_previous"
  1401. aryTemplateSubValue( 4)=Template_PageBar_Previous
  1402. aryTemplateSubName(  5)="articlelist/author/id"
  1403. aryTemplateSubValue( 5)=TemplateTags_ArticleList_Author_ID
  1404. aryTemplateSubName(  6)="articlelist/tags/id"
  1405. aryTemplateSubValue( 6)=TemplateTags_ArticleList_Tags_ID
  1406. aryTemplateSubName(  7)="articlelist/category/id"
  1407. aryTemplateSubValue( 7)=TemplateTags_ArticleList_Category_ID
  1408. aryTemplateSubName(  8)="articlelist/date/year"
  1409. aryTemplateSubValue( 8)=TemplateTags_ArticleList_Date_Year
  1410. aryTemplateSubName(  9)="articlelist/date/month"
  1411. aryTemplateSubValue( 9)=TemplateTags_ArticleList_Date_Month
  1412. aryTemplateSubName( 10)="articlelist/date/day"
  1413. aryTemplateSubValue(10)=TemplateTags_ArticleList_Date_Day
  1414. aryTemplateSubName( 11)="articlelist/date/shortdate"
  1415. aryTemplateSubValue(11)=TemplateTags_ArticleList_Date_ShortDate
  1416. aryTemplateSubName( 12)="articlelist/page/now"
  1417. aryTemplateSubValue(12)=TemplateTags_ArticleList_Page_Now
  1418. aryTemplateSubName( 13)="articlelist/page/all"
  1419. aryTemplateSubValue(13)=TemplateTags_ArticleList_Page_All
  1420. aryTemplateSubName( 14)="articlelist/page/count"
  1421. aryTemplateSubValue(14)=ZC_DISPLAY_COUNT
  1422. 'plugin node
  1423. Call Filter_Plugin_TArticleList_Build_TemplateSub(aryTemplateSubName,aryTemplateSubValue)
  1424. j=UBound(aryTemplateSubName)
  1425. For i=0 to j
  1426. html=Replace(html,"<#" & aryTemplateSubName(i) & "#>",aryTemplateSubValue(i))
  1427. Next
  1428. aryTemplateTagsName=TemplateTagsName
  1429. aryTemplateTagsValue=TemplateTagsValue
  1430. aryTemplateTagsName(0)="BlogTitle"
  1431. aryTemplateTagsValue(0)=Title
  1432. Call Filter_Plugin_TArticleList_Build_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  1433. j=UBound(aryTemplateTagsName)
  1434. For i=1 to j
  1435. html=Replace(html,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  1436. Next
  1437. html=Replace(html,"<#" & aryTemplateTagsName(0) & "#>",aryTemplateTagsValue(0))
  1438. If IsEmpty(Template_Calendar) Or Len(Template_Calendar)=0 Then
  1439. For i=1 to j
  1440. If aryTemplateTagsName(i)="CACHE_INCLUDE_CALENDAR" Then
  1441. Template_Calendar=aryTemplateTagsValue(i)
  1442. End If
  1443. Next
  1444. End If
  1445. html=Replace(html,"<#CACHE_INCLUDE_CALENDAR_NOW#>",Template_Calendar)
  1446. Build=True
  1447. End Function
  1448. Function Save()
  1449. html=TransferHTML(html,"[no-asp]")
  1450. If ZC_STATIC_TYPE="asp" Then
  1451. html="<"&"%@ CODEPAGE=65001 %"&">" & html
  1452. End If
  1453. If ZC_MOONSOFT_PLUGIN_ENABLE=True Then
  1454. Call CreatDirectoryByCustomDirectory(Directory)
  1455. End If
  1456. Call SaveToFile(BlogPath & Directory & FileName,html,"utf-8",False)
  1457. Save=True
  1458. End Function
  1459. Function SetVar(TemplateTag,TemplateValue)
  1460. If IsEmpty(html) Then html=template
  1461. html=Replace(html,"<#" & TemplateTag & "#>",TemplateValue)
  1462. End Function
  1463. Public Function Search(strQuestion)
  1464. 'plugin node
  1465. bAction_Plugin_TArticleList_Search_Begin=False
  1466. For Each sAction_Plugin_TArticleList_Search_Begin in Action_Plugin_TArticleList_Search_Begin
  1467. If Not IsEmpty(sAction_Plugin_TArticleList_Search_Begin) Then Call Execute(sAction_Plugin_TArticleList_Search_Begin)
  1468. If bAction_Plugin_TArticleList_Search_Begin=True Then Exit Function
  1469. Next
  1470. Dim i
  1471. Dim j
  1472. Dim s
  1473. Dim objRS
  1474. Dim intPageCount
  1475. Dim objArticle
  1476. strQuestion=Trim(strQuestion)
  1477. If Len(strQuestion)=0 Then Search=True:Exit Function
  1478. 'If CheckRegExp(strQuestion,"[nojapan]") Then Exit Function
  1479. strQuestion=FilterSQL(strQuestion)
  1480. Set objRS=Server.CreateObject("ADODB.Recordset")
  1481. objRS.CursorType = adOpenKeyset
  1482. objRS.LockType = adLockReadOnly
  1483. objRS.ActiveConnection=objConn
  1484. objRS.Source="SELECT [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Content],[log_Level],[log_AuthorID],[log_PostTime],[log_CommNums],[log_ViewNums],[log_TrackBackNums],[log_Url],[log_Istop] FROM [blog_Article] WHERE ([log_ID]>0) AND ([log_Level]>2)"
  1485. objRS.Source=objRS.Source & "AND( (InStr(1,LCase([log_Title]),LCase('"&strQuestion&"'),0)<>0) OR (InStr(1,LCase([log_Intro]),LCase('"&strQuestion&"'),0)<>0) OR (InStr(1,LCase([log_Content]),LCase('"&strQuestion&"'),0)<>0) )"
  1486. objRS.Source=objRS.Source & "ORDER BY [log_PostTime] DESC,[log_ID] DESC"
  1487. objRS.Open()
  1488. 's=Replace(Replace(ZC_MSG086,"%s","<strong>" & TransferHTML(Replace(strQuestion,Chr(39)&Chr(39),Chr(39)),"[html-format]") & "</strong>",vbTextCompare,1),"%s","<strong>" & objRS.RecordCount & "</strong>")
  1489. s=Replace(Replace(ZC_MSG086,"%s","<strong>" & TransferHTML(Replace(strQuestion,Chr(39)&Chr(39),Chr(39),1,-1,0),"[html-format]") & "</strong>",vbTextCompare,1),"%s","<strong>" & objRS.RecordCount & "</strong>",1,-1,0)
  1490. If (Not objRS.bof) And (Not objRS.eof) Then
  1491. objRS.PageSize = ZC_SEARCH_COUNT
  1492. intPageCount=objRS.PageCount
  1493. objRS.AbsolutePage = 1
  1494. For i = 1 To objRS.PageSize
  1495. ReDim Preserve aryArticleList(i)
  1496. Set objArticle=New TArticle
  1497. If objArticle.LoadInfoByArray(Array(objRS(0),objRS(1),objRS(2),objRS(3),objRS(4),objRS(5),objRS(6),objRS(7),objRS(8),objRS(9),objRS(10),objRS(11),objRS(12),objRS(13))) Then
  1498. If objArticle.Export(ZC_DISPLAY_MODE_SEARCH)= True Then
  1499. aryArticleList(i)=objArticle.Template_Article_Search
  1500. End If
  1501. End If
  1502. Set objArticle=Nothing
  1503. objRS.MoveNext
  1504. If objRS.EOF Then Exit For
  1505. Next
  1506. End If
  1507. objRS.Close()
  1508. Set objRS=Nothing
  1509. Template_Article_Multi=Join(aryArticleList)
  1510. Title=TransferHTML(strQuestion,"[html-format]")
  1511. Search=True
  1512. 'plugin node
  1513. bAction_Plugin_TArticleList_Search_End=False
  1514. For Each sAction_Plugin_TArticleList_Search_End in Action_Plugin_TArticleList_Search_End
  1515. If Not IsEmpty(sAction_Plugin_TArticleList_Search_End) Then Call Execute(sAction_Plugin_TArticleList_Search_End)
  1516. If bAction_Plugin_TArticleList_Search_End=True Then Exit Function
  1517. Next
  1518. End Function
  1519. Public Function ExportBar(intNowPage,intAllPage,intCateId,intAuthorId,dtmYearMonth,strTagsName)
  1520. 'plugin node
  1521. bAction_Plugin_TArticleList_ExportBar_Begin=False
  1522. For Each sAction_Plugin_TArticleList_ExportBar_Begin in Action_Plugin_TArticleList_ExportBar_Begin
  1523. If Not IsEmpty(sAction_Plugin_TArticleList_ExportBar_Begin) Then Call Execute(sAction_Plugin_TArticleList_ExportBar_Begin)
  1524. If bAction_Plugin_TArticleList_ExportBar_Begin=True Then Exit Function
  1525. Next
  1526. Dim i
  1527. Dim s
  1528. Dim t
  1529. Dim strPageBar
  1530. If Not IsEmpty(intCateId) Then t=t & "cate=" & intCateId & "&amp;"
  1531. If Not IsEmpty(dtmYearMonth) Then
  1532. t=t & "date=" & Year(dtmYearMonth) & "-" & Month(dtmYearMonth)
  1533. If InstrRev(CStr(dtmYearMonth),"-")>=7 Then
  1534. t=t & "-" &  Day(dtmYearMonth)
  1535. End If
  1536. t=t & "&amp;"
  1537. End If
  1538. If Not IsEmpty(intAuthorId) Then t=t & "auth=" & intAuthorId & "&amp;"
  1539. If Not (strTagsName="") Then t=t & "tags=" & Server.URLEncode(strTagsName) & "&amp;"
  1540. If intAllPage>0 Then
  1541. Dim a,b
  1542. s=ZC_BLOG_HOST & "catalog.asp?"& t &"page=1"
  1543. strPageBar=GetTemplate("TEMPLATE_B_PAGEBAR")
  1544. strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s)
  1545. strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",ZC_MSG285)
  1546. Template_PageBar=Template_PageBar & strPageBar
  1547. If intAllPage>ZC_PAGEBAR_COUNT Then
  1548. a=intNowPage
  1549. b=intNowPage+ZC_PAGEBAR_COUNT
  1550. If a>ZC_PAGEBAR_COUNT Then a=a-1:b=b-1
  1551. If b>intAllPage Then b=intAllPage:a=intAllPage-ZC_PAGEBAR_COUNT
  1552. Else
  1553. a=1:b=intAllPage
  1554. End If
  1555. For i=a to b
  1556. s=ZC_BLOG_HOST & "catalog.asp?"& t &"page="& i
  1557. strPageBar=GetTemplate("TEMPLATE_B_PAGEBAR")
  1558. If i=intNowPage then
  1559. Template_PageBar=Template_PageBar & "<span class=""now-page"">" & i & "</span>"
  1560. Else
  1561. strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s)
  1562. strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",i)
  1563. Template_PageBar=Template_PageBar & strPageBar
  1564. End If
  1565. Next
  1566. s=ZC_BLOG_HOST & "catalog.asp?"& t &"page="& intAllPage
  1567. strPageBar=GetTemplate("TEMPLATE_B_PAGEBAR")
  1568. strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s)
  1569. strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",ZC_MSG286)
  1570. Template_PageBar=Template_PageBar & strPageBar
  1571. If intNowPage=1 Then
  1572. Template_PageBar_Previous=""
  1573. Else
  1574. Template_PageBar_Previous="<span class=""pagebar-previous""><a href="""& ZC_BLOG_HOST &"catalog.asp?"& t &"page="& intNowPage-1 &"""><span>"&ZC_MSG156&"</span></a></span>"
  1575. End If
  1576. If intNowPage=intAllPage Then
  1577. Template_PageBar_Next=""
  1578. Else
  1579. Template_PageBar_Next="<span class=""pagebar-next""><a href="""& ZC_BLOG_HOST &"catalog.asp?"& t &"page="& intNowPage+1 &"""><span>"&ZC_MSG155&"</span></a></span>"
  1580. End If
  1581. End If
  1582. ExportBar=True
  1583. 'plugin node
  1584. bAction_Plugin_TArticleList_ExportBar_End=False
  1585. For Each sAction_Plugin_TArticleList_ExportBar_End in Action_Plugin_TArticleList_ExportBar_End
  1586. If Not IsEmpty(sAction_Plugin_TArticleList_ExportBar_End) Then Call Execute(sAction_Plugin_TArticleList_ExportBar_End)
  1587. If bAction_Plugin_TArticleList_ExportBar_End=True Then Exit Function
  1588. Next
  1589. End Function
  1590. Public Function LoadCache()
  1591. Dim strContent
  1592. strContent=""
  1593. strContent=LoadFromFile(BlogPath & "/CACHE/cache_list_"&ZC_BLOG_CLSID&".html","utf-8")
  1594. AllList=strContent
  1595. LoadCache=True
  1596. End Function
  1597. Private Sub Class_Initialize()
  1598. Redim Article(ZC_DISPLAY_COUNT)
  1599. End Sub
  1600. End Class
  1601. '*********************************************************
  1602. '*********************************************************
  1603. ' 目的:    定义TUser类
  1604. ' 输入:    无
  1605. ' 返回:    无
  1606. '*********************************************************
  1607. Class TUser
  1608. Public ID
  1609. Public Level
  1610. Public Name
  1611. Public Password
  1612. Public Alias
  1613. Public Sex
  1614. Public Email
  1615. Public MSN
  1616. Public QQ
  1617. Public HomePage
  1618. Public Intro
  1619. Public Count
  1620. Public LastVisitTime
  1621. Public LastVisitIP
  1622. Public Property Get Url
  1623. Url = ZC_BLOG_HOST & "catalog.asp?"& "auth=" & ID
  1624. End Property
  1625. Public Property Get HtmlUrl
  1626. HtmlUrl=TransferHTML(Url,"[html-format]")
  1627. End Property
  1628. Public Property Get RssUrl
  1629. RssUrl = ZC_BLOG_HOST & "sydication.asp?user=" & ID
  1630. End Property
  1631. Private FLoginType
  1632. Public Property Let LoginType(strLoginType)
  1633. If (strLoginType="Form") Or (strLoginType="QueryString") Or (strLoginType="Self") Then
  1634. FLoginType=strLoginType
  1635. Else
  1636. FLoginType="Cookies"
  1637. End If
  1638. End Property
  1639. Public Property Get LoginType
  1640. If IsEmpty(FLoginType)=True Then
  1641. LoginType="Cookies"
  1642. Else
  1643. LoginType = FLoginType
  1644. End If
  1645. End Property
  1646. Public Property Get StaticName
  1647. If IsNull(Alias) Or IsEmpty(Alias) Or Alias="" Then
  1648. StaticName = "user_" & ID
  1649. Else
  1650. StaticName = Alias
  1651. End If
  1652. End Property
  1653. Public Function Verify()
  1654. Dim strUserName
  1655. Dim  strPassWord
  1656. If LoginType="Cookies" Then
  1657. strPassWord=Request.Cookies("password")
  1658. If (strPassWord="") Then Exit Function
  1659. strUserName=vbsunescape(Request.Cookies("username"))
  1660. If (strUserName="") Then Exit Function
  1661. ElseIf LoginType="Form" Then
  1662. strPassWord=Request.Form("password")
  1663. If (strPassWord="") Then Exit Function
  1664. strUserName=Request.Form("username")
  1665. If (strUserName="") Then Exit Function
  1666. ElseIf LoginType="QueryString" Then
  1667. strPassWord=Request.QueryString("password")
  1668. If (strPassWord="") Then Exit Function
  1669. strUserName=Request.QueryString("username")
  1670. If (strUserName="") Then Exit Function
  1671. ElseIf LoginType="Self" Then
  1672. strPassWord=Password
  1673. If (strPassWord="") Then Exit Function
  1674. strUserName=Name
  1675. If (strUserName="") Then Exit Function
  1676. Else
  1677. Exit Function
  1678. End If
  1679. strUserName=FilterSQL(strUserName)
  1680. strPassWord=FilterSQL(strPassWord)
  1681. '校检
  1682. If Len(strUserName) >ZC_USERNAME_MAX Then Call ShowError(7)
  1683. If Len(strPassWord)<>ZC_PASSWORD_MAX Then Call ShowError(7)
  1684. If Not CheckRegExp(strUserName,"[username]") Then Call ShowError(7)
  1685. If Not CheckRegExp(strPassWord,"[password]") Then Call ShowError(7)
  1686. Dim objRS
  1687. Set objRS=objConn.Execute("SELECT [mem_ID],[mem_Level],[mem_Password] FROM [blog_Member] WHERE [mem_Name]='"&strUserName & "'" )
  1688. If (Not objRS.Bof) And (Not objRS.Eof) Then
  1689. If StrComp(strPassWord,objRS("mem_Password"))=0 Then
  1690. ID=objRS("mem_ID")
  1691. LoadInfobyID(ID)
  1692. Verify=True
  1693. Else
  1694. 'If LoginType="Cookies" Then Response.Cookies("password")=""
  1695. End If
  1696. Else
  1697. 'If LoginType="Cookies" Then Response.Cookies("password")=""
  1698. End If
  1699. objRS.Close
  1700. Set objRS=Nothing
  1701. End Function
  1702. Function LoadInfobyID(user_ID)
  1703. Call CheckParameter(user_ID,"int",0)
  1704. Dim objRS
  1705. Set objRS=objConn.Execute("SELECT [mem_ID],[mem_Name],[mem_Level],[mem_Password],[mem_Email],[mem_HomePage],[mem_PostLogs],[mem_Intro] FROM [blog_Member] WHERE [mem_ID]=" & user_ID)
  1706. If (Not objRS.bof) And (Not objRS.eof) Then
  1707. ID=objRS("mem_ID")
  1708. Name=objRS("mem_Name")
  1709. Level=objRS("mem_Level")
  1710. Password=objRS("mem_Password")
  1711. Email=objRS("mem_Email")
  1712. HomePage=objRS("mem_HomePage")
  1713. Count=objRS("mem_PostLogs")
  1714. Alias=objRS("mem_Intro")
  1715. If IsNull(Email) Or IsEmpty(Email) Or Len(Email)=0 Then Email="a@b.com"
  1716. If IsNull(HomePage) Then HomePage=""
  1717. If IsNull(Alias) Then Alias=""
  1718. LoadInfobyID=True
  1719. End If
  1720. objRS.Close
  1721. Set objRS=Nothing
  1722. Call Filter_Plugin_TUser_LoadInfobyID(ID,Name,Level,Password,Email,HomePage,Count,Alias)
  1723. End Function
  1724. Public Function LoadInfoByArray(aryUserInfo)
  1725. If IsArray(aryUserInfo)=True Then
  1726. ID=aryUserInfo(0)
  1727. Name=aryUserInfo(1)
  1728. Level=aryUserInfo(2)
  1729. Password=aryUserInfo(3)
  1730. Email=aryUserInfo(4)
  1731. HomePage=aryUserInfo(5)
  1732. Count=aryUserInfo(6)
  1733. Alias=aryUserInfo(7)
  1734. End If
  1735. If IsNull(Email) Or IsEmpty(Email) Or Len(Email)=0 Then Email="a@b.com"
  1736. If IsNull(HomePage) Then HomePage=""
  1737. If IsNull(Alias) Then Alias=""
  1738. LoadInfoByArray=True
  1739. Call Filter_Plugin_TUser_LoadInfoByArray(ID,Name,Level,Password,Email,HomePage,Count,Alias)
  1740. End Function
  1741. Function Edit(currentUser)
  1742. Call Filter_Plugin_TUser_Edit(ID,Name,Level,Password,Email,HomePage,Count,Alias,currentUser)
  1743. Call CheckParameter(ID,"int",0)
  1744. Call CheckParameter(Level,"int",0)
  1745. If ((Level<1) Or (Level>5)) Then Call ShowError(16)
  1746. If (Name="") Then Call ShowError(7)
  1747. If Len(Name) >ZC_USERNAME_MAX Then Call ShowError(7)
  1748. If Not CheckRegExp(Name,"[username]") Then Call ShowError(7)
  1749. Email=FilterSQL(Email)
  1750. HomePage=FilterSQL(HomePage)
  1751. Email=TransferHTML(Email,"[html-format]")
  1752. HomePage=TransferHTML(HomePage,"[html-format]")
  1753. Alias=TransferHTML(Alias,"[filename]")
  1754. Alias=FilterSQL(Alias)
  1755. If Len(Email)=0 Then Call ShowError(29)
  1756. If Len(Email)>ZC_EMAIL_MAX Then Call ShowError(29)
  1757. If Len(HomePage)>ZC_HOMEPAGE_MAX Then Call ShowError(29)
  1758. If Not CheckRegExp(Email,"[email]") Then Call ShowError(29)
  1759. IF Len(HomePage)>0 Then
  1760. If Not CheckRegExp(HomePage,"[homepage]") Then Call ShowError(30)
  1761. End If
  1762. If ID=0 Then
  1763. If Level <= currentUser.Level Then ShowError(6)
  1764. If Len(PassWord)<>ZC_PASSWORD_MAX Then Call ShowError(7)
  1765. If Not CheckRegExp(PassWord,"[password]") Then Call ShowError(7)
  1766. objConn.Execute("INSERT INTO [blog_Member]([mem_Level],[mem_Name],[mem_PassWord],[mem_Email],[mem_HomePage],[mem_Intro]) VALUES ("&Level&",'"&Name&"','"&PassWord&"','"&Email&"','"&HomePage&"','"&Alias&"')")
  1767. Edit=True
  1768. Else
  1769. If (ID=currentUser.ID) And (Level <> currentUser.Level) Then ShowError(6)
  1770. If (ID<>currentUser.ID) And (Level <= currentUser.Level) Then ShowError(6)
  1771. Dim targetUser
  1772. Set targetUser=New TUser
  1773. If targetUser.LoadInfobyID(ID) Then
  1774. If Len(PassWord)=0 Then PassWord=targetUser.PassWord
  1775. If Len(PassWord)<>ZC_PASSWORD_MAX Then Call ShowError(6)
  1776. If Not CheckRegExp(PassWord,"[password]") Then Call ShowError(7)
  1777. Else
  1778. Exit Function
  1779. End If
  1780. objConn.Execute("UPDATE [blog_Member] SET [mem_Level]="&Level&",[mem_Name]='"&Name&"',[mem_PassWord]='"&PassWord&"',[mem_Email]='"&Email&"',[mem_HomePage]='"&HomePage&"',[mem_Intro]='"&Alias&"' WHERE [mem_ID]="&ID)
  1781. If Name <> targetUser.Name Then
  1782. objConn.Execute("UPDATE [blog_Comment] SET [comm_Author]='"&Name&"' WHERE [comm_AuthorID]="&ID)
  1783. End If
  1784. If Email <> targetUser.Email Then
  1785. objConn.Execute("UPDATE [blog_Comment] SET [comm_Email]='"&Email&"' WHERE [comm_AuthorID]="&ID)
  1786. End If
  1787. Edit=True
  1788. If (ID=currentUser.ID) Then
  1789. Response.Cookies("username")=Name
  1790. Response.Cookies("password")=PassWord
  1791. Response.Write "<script language=""JavaScript"" src=""script/common.js"" type=""text/javascript""></script>"
  1792. Response.Write "<script language=""JavaScript"" type=""text/javascript"">"
  1793. Response.Write "SetCookie(""username"","""&Name&""","""");"
  1794. Response.Write "SetCookie(""password"","""&PassWord&""","""");"
  1795. Response.Write "window.location=""" & ZC_BLOG_HOST & "cmd.asp?act=UserMng"";"
  1796. Response.Write "</script>"
  1797. Response.End
  1798. End If
  1799. End If
  1800. End Function
  1801. Function Register(currentUser)
  1802. Call Filter_Plugin_TUser_Register(ID,Name,Level,Password,Email,HomePage,Count,Alias,currentUser)
  1803. Call CheckParameter(ID,"int",0)
  1804. Call CheckParameter(Level,"int",0)
  1805. If (Level<>4) Then Call ShowError(16)
  1806. If (Name="") Then Call ShowError(7)
  1807. If Len(Name) >ZC_USERNAME_MAX Then Call ShowError(7)
  1808. If Not CheckRegExp(Name,"[username]") Then Call ShowError(7)
  1809. Email=FilterSQL(Email)
  1810. HomePage=FilterSQL(HomePage)
  1811. Email=TransferHTML(Email,"[html-format]")
  1812. HomePage=TransferHTML(HomePage,"[html-format]")
  1813. Alias=TransferHTML(Alias,"[filename]")
  1814. Alias=FilterSQL(Alias)
  1815. If Len(Email)=0 Then Call ShowError(29)
  1816. If Len(Email)>ZC_EMAIL_MAX Then Call ShowError(29)
  1817. If Len(HomePage)>ZC_HOMEPAGE_MAX Then Call ShowError(29)
  1818. If Not CheckRegExp(Email,"[email]") Then Call ShowError(30)
  1819. IF Len(HomePage)>0 Then
  1820. If Not CheckRegExp(HomePage,"[homepage]") Then Call ShowError(30)
  1821. End If
  1822. If ID=0 Then
  1823. If Level <= 1 Then ShowError(6)
  1824. If Len(PassWord)<>ZC_PASSWORD_MAX Then Call ShowError(7)
  1825. If Not CheckRegExp(PassWord,"[password]") Then Call ShowError(7)
  1826. objConn.Execute("INSERT INTO [blog_Member]([mem_Level],[mem_Name],[mem_PassWord],[mem_Email],[mem_HomePage],[mem_Intro]) VALUES ("&Level&",'"&Name&"','"&PassWord&"','"&Email&"','"&HomePage&"','"&Alias&"')")
  1827. Register=True
  1828. End If
  1829. End Function
  1830. Function Del(currentUser)
  1831. Call Filter_Plugin_TUser_Del(ID,Name,Level,Password,Email,HomePage,Count,Alias,currentUser)
  1832. Dim objRS
  1833. Dim objUpLoadFile
  1834. Call CheckParameter(ID,"int",0)
  1835. Call CheckParameter(Level,"int",0)
  1836. Dim targetUser
  1837. Set targetUser=New TUser
  1838. If targetUser.LoadInfobyID(ID) Then
  1839. If targetUser.Level<= currentUser.Level Then ShowError(6)
  1840. If currentUser.ID = targetUser.ID Then ShowError(17)
  1841. Else
  1842. Exit Function
  1843. End If
  1844. objConn.Execute("DELETE FROM [blog_Article] WHERE [log_AuthorID] =" & ID)
  1845. objConn.Execute("DELETE FROM [blog_Comment] WHERE [comm_AuthorID] =" & ID)
  1846. objConn.Execute("DELETE FROM [blog_Member] WHERE [mem_ID] =" & ID)
  1847. Set objRS=objConn.Execute("SELECT * FROM [blog_UpLoad] WHERE [ul_AuthorID] =" & ID)
  1848. If (Not objRS.bof) And (Not objRS.eof) Then
  1849. Do While Not objRS.eof
  1850. Set objUpLoadFile=New TUpLoadFile
  1851. If objUpLoadFile.LoadInfoByID(objRS("ul_ID")) Then objUpLoadFile.Del
  1852. Set objUpLoadFile=Nothing
  1853. objRS.MoveNext
  1854. Loop
  1855. End If
  1856. objRS.Close
  1857. Set objRS=Nothing
  1858. objConn.Execute("DELETE FROM [blog_UpLoad] WHERE [ul_AuthorID] =" & ID)
  1859. Del=True
  1860. End Function
  1861. Private Sub Class_Initialize()
  1862. Level=5
  1863. ID=0
  1864. Name=ZC_MSG018
  1865. Sex=0
  1866. Email=""
  1867. MSN=""
  1868. QQ=""
  1869. HomePage=""
  1870. Intro=""
  1871. End Sub
  1872. End Class
  1873. '*********************************************************
  1874. '*********************************************************
  1875. ' 目的:    定义TComment类
  1876. ' 输入:    无
  1877. ' 返回:    无
  1878. '*********************************************************
  1879. Class TComment
  1880. Public ID
  1881. Public log_ID
  1882. Public AuthorID
  1883. Public Author
  1884. Public Content
  1885. Public Email
  1886. Public HomePage
  1887. Public PostTime
  1888. Public IP
  1889. Public Agent
  1890. Public Count
  1891. Public Property Get HomePageForAntiSpam
  1892. HomePageForAntiSpam=URLEncodeForAntiSpam(HomePage)
  1893. End Property
  1894. Public Property Get SafeEmail
  1895. If (Email="") Or IsEmpty(Email) Or IsNull(Email) Then Email="null@null.com"
  1896. SafeEmail=Replace(Email,"@","[AT]")
  1897. End Property
  1898. Public Property Get EmailMD5
  1899. If AuthorID>0 Then
  1900. EmailMD5=MD5(Users(AuthorID).Email)
  1901. Else
  1902. If (Email="") Or IsEmpty(Email) Or IsNull(Email) Then
  1903. EmailMD5=""
  1904. Else
  1905. EmailMD5=MD5(Email)
  1906. End If
  1907. End If
  1908. End Property
  1909. Public Property Get FirstContact
  1910. If Len(HomePage)>0 Then
  1911. FirstContact=HomePageForAntiSpam
  1912. Else
  1913. If (Email="") Or IsEmpty(Email) Or IsNull(Email) Then
  1914. FirstContact=""
  1915. Else
  1916. FirstContact="mailto:" & SafeEmail
  1917. End If
  1918. End If
  1919. End Property
  1920. Public Property Get HtmlContent
  1921. 'HtmlContent=TransferHTML(UBBCode(Content,"[font][face]"),"[enter][nofollow]")
  1922. HtmlContent=TransferHTML(UBBCode(Content,"[link][link-antispam][font][face]"),"[enter][nofollow]")
  1923. End Property
  1924. Public Function Post()
  1925. Call Filter_Plugin_TComment_Post(ID,log_ID,AuthorID,Author,Content,Email,HomePage,PostTime,IP,Agent)
  1926. IP=Request.ServerVariables("REMOTE_ADDR")
  1927. Agent=Request.ServerVariables("HTTP_USER_AGENT")
  1928. If Len(HomePage)>0 Then
  1929. If InStr(HomePage,"http://")=0 Then HomePage="http://" & HomePage
  1930. End If
  1931. '检查参数
  1932. Call CheckParameter(log_ID,"int",0)
  1933. Call CheckParameter(AuthorID,"int",0)
  1934. Call CheckParameter(PostTime,"dtm",GetTime(Now()))
  1935. Author=FilterSQL(Author)
  1936. Content=FilterSQL(Content)
  1937. Email=FilterSQL(Email)
  1938. HomePage=FilterSQL(HomePage)
  1939. PostTime=FilterSQL(PostTime)
  1940. IP=FilterSQL(IP)
  1941. Agent=FilterSQL(Agent)
  1942. '作者不能为空
  1943. If Len(Author)=0 Then Call  ShowError(15)
  1944. 'If Len(Content)=0 Then Call  ShowError(46)
  1945. 'If Len(Content)>ZC_CONTENT_MAX Then Call  ShowError(46)
  1946. Author=TransferHTML(Author,"[html-format]")
  1947. Email=TransferHTML(Email,"[html-format]")
  1948. HomePage=TransferHTML(HomePage,"[html-format]")
  1949. Content=TransferHTML(Content,"[html-format]")
  1950. If Len(Author)>ZC_USERNAME_MAX Then Call  ShowError(15)
  1951. If Len(Email)>ZC_EMAIL_MAX Then Call  ShowError(29)
  1952. If Len(HomePage)>ZC_HOMEPAGE_MAX Then Call  ShowError(30)
  1953. If Not CheckRegExp(Author,"[username]") Then Call  ShowError(15)
  1954. IF Len(Email)>0 Then
  1955. If Not CheckRegExp(Email,"[email]") Then Call  ShowError(29)
  1956. End If
  1957. IF Len(HomePage)>0 Then
  1958. If Not CheckRegExp(HomePage,"[homepage]") Then Call  ShowError(30)
  1959. End If
  1960. Dim objRS
  1961. Dim strSpamIP
  1962. Dim strSpamContent
  1963. Set objRS=objConn.Execute("SELECT [comm_IP],[comm_Content] FROM [blog_Comment] WHERE [comm_ID]= ( SELECT MAX(comm_ID) FROM [blog_Comment] )")
  1964. If (Not objRS.bof) And (Not objRS.eof) Then
  1965. strSpamIP=objRS("comm_IP")
  1966. strSpamContent=objRS("comm_Content")
  1967. End If
  1968. objRS.Close
  1969. Set objRS=Nothing
  1970. If (ID=0) And (strSpamIP=IP) And (strSpamContent=Content) Then
  1971. Call ShowError(39)
  1972. End If
  1973. If ID=0 Then
  1974. objConn.Execute("INSERT INTO [blog_Comment]([log_ID],[comm_AuthorID],[comm_Author],[comm_Content],[comm_Email],[comm_HomePage],[comm_IP],[comm_PostTime],[comm_Agent]) VALUES ("&log_ID&","&AuthorID&",'"&Author&"','"&Content&"','"&Email&"','"&HomePage&"','"&IP&"','"&PostTime&"','"&Agent&"')")
  1975. Set objRS=objConn.Execute("SELECT MAX([comm_ID]) FROM [blog_Comment]")
  1976. If (Not objRS.bof) And (Not objRS.eof) Then
  1977. ID=objRS(0)
  1978. End If
  1979. Set objRS=Nothing
  1980. Else
  1981. objConn.Execute("UPDATE [blog_Comment] SET [log_ID]="&log_ID&", [comm_AuthorID]="&AuthorID&",[comm_Author]='"&Author&"',[comm_Content]='"&Content&"',[comm_Email]='"&Email&"',[comm_HomePage]='"&HomePage&"',[comm_IP]='"&IP&"',[comm_PostTime]='"&PostTime&"',[comm_Agent]='"&Agent&"' WHERE [comm_ID] =" & ID)
  1982. End If
  1983. Post=True
  1984. End Function
  1985. Public Function Del()
  1986. Call Filter_Plugin_TComment_Del(ID,log_ID,AuthorID,Author,Content,Email,HomePage,PostTime,IP,Agent)
  1987. Call CheckParameter(ID,"int",0)
  1988. If (ID=0) Then Del=False:Exit Function
  1989. objConn.Execute("DELETE FROM [blog_Comment] WHERE [comm_ID] =" & ID)
  1990. Del=True
  1991. End Function
  1992. Public Function LoadInfoByID(comm_ID)
  1993. Call CheckParameter(comm_ID,"int",0)
  1994. Dim objRS
  1995. Set objRS=objConn.Execute("SELECT [comm_ID],[log_ID],[comm_AuthorID],[comm_Author],[comm_Content],[comm_Email],[comm_HomePage],[comm_PostTime],[comm_IP],[comm_Agent] FROM [blog_Comment] WHERE [comm_ID]=" & comm_ID)
  1996. If (Not objRS.bof) And (Not objRS.eof) Then
  1997. ID=objRS("comm_ID")
  1998. log_ID=objRS("log_ID")
  1999. AuthorID=objRS("comm_AuthorID")
  2000. Author=objRS("comm_Author")
  2001. Content=objRS("comm_Content")
  2002. Email=objRS("comm_Email")
  2003. HomePage=objRS("comm_HomePage")
  2004. PostTime=objRS("comm_PostTime")
  2005. IP=objRS("comm_IP")
  2006. Agent=objRS("comm_Agent")
  2007. LoadInfoByID=True
  2008. End If
  2009. objRS.Close
  2010. Set objRS=Nothing
  2011. If IsNull(HomePage) Then HomePage=""
  2012. Call Filter_Plugin_TComment_LoadInfoByID(ID,log_ID,AuthorID,Author,Content,Email,HomePage,PostTime,IP,Agent)
  2013. End Function
  2014. Public Function LoadInfoByArray(aryCommInfo)
  2015. If IsArray(aryCommInfo)=True Then
  2016. ID=aryCommInfo(0)
  2017. log_ID=aryCommInfo(1)
  2018. AuthorID=aryCommInfo(2)
  2019. Author=aryCommInfo(3)
  2020. Content=aryCommInfo(4)
  2021. Email=aryCommInfo(5)
  2022. HomePage=aryCommInfo(6)
  2023. PostTime=aryCommInfo(7)
  2024. IP=aryCommInfo(8)
  2025. Agent=aryCommInfo(9)
  2026. End If
  2027. If IsNull(HomePage) Then HomePage=""
  2028. LoadInfoByArray=True
  2029. Call Filter_Plugin_TComment_LoadInfoByArray(ID,log_ID,AuthorID,Author,Content,Email,HomePage,PostTime,IP,Agent)
  2030. End Function
  2031. Public Function MakeTemplate(strC)
  2032. Dim html,i,j
  2033. html=strC
  2034. 'plugin node
  2035. Call Filter_Plugin_TComment_MakeTemplate_Template(html)
  2036. Dim aryTemplateTagsName()
  2037. Dim aryTemplateTagsValue()
  2038. ReDim aryTemplateTagsName(11)
  2039. ReDim aryTemplateTagsValue(11)
  2040. aryTemplateTagsName(  1)="article/comment/id"
  2041. aryTemplateTagsValue( 1)=ID
  2042. aryTemplateTagsName(  2)="article/comment/name"
  2043. aryTemplateTagsValue( 2)=Author
  2044. aryTemplateTagsName(  3)="article/comment/url"
  2045. aryTemplateTagsValue( 3)=HomePage
  2046. aryTemplateTagsName(  4)="article/comment/urlencoder"
  2047. aryTemplateTagsValue( 4)=HomePageForAntiSpam
  2048. aryTemplateTagsName(  5)="article/comment/email"
  2049. aryTemplateTagsValue( 5)=SafeEmail
  2050. aryTemplateTagsName(  6)="article/comment/posttime"
  2051. aryTemplateTagsValue( 6)=PostTime
  2052. aryTemplateTagsName(  7)="article/comment/content"
  2053. aryTemplateTagsValue( 7)=HtmlContent
  2054. aryTemplateTagsName(  8)="article/comment/count"
  2055. aryTemplateTagsValue( 8)=Count
  2056. aryTemplateTagsName(  9)="article/comment/authorid"
  2057. aryTemplateTagsValue( 9)=AuthorID
  2058. aryTemplateTagsName( 10)="article/comment/firstcontact"
  2059. aryTemplateTagsValue(10)=FirstContact
  2060. aryTemplateTagsName( 11)="article/comment/emailmd5"
  2061. aryTemplateTagsValue(11)=EmailMD5
  2062. 'plugin node
  2063. Call Filter_Plugin_TComment_MakeTemplate_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  2064. j=UBound(aryTemplateTagsName)
  2065. For i=1 to j
  2066. html=Replace(html,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  2067. Next
  2068. MakeTemplate=html
  2069. End Function
  2070. End Class
  2071. '*********************************************************
  2072. '*********************************************************
  2073. ' 目的:    定义TTrackBack类
  2074. ' 输入:    无
  2075. ' 返回:    无
  2076. '*********************************************************
  2077. Class TTrackBack
  2078. Public ID
  2079. Public log_ID
  2080. Public URL
  2081. Public Title
  2082. Public Blog
  2083. Public Excerpt
  2084. Public PostTime
  2085. Public IP
  2086. Public Agent
  2087. Public Count
  2088. Public Property Get UrlForAntiSpam
  2089. UrlForAntiSpam=URLEncodeForAntiSpam(Url)
  2090. End Property
  2091. Public Property Get HtmlExcerpt
  2092. HtmlExcerpt=TransferHTML(Excerpt,"[enter]")
  2093. End Property
  2094. Public TbXML
  2095. Private Function ReturnTbXML(strMsg)
  2096. Dim strXML
  2097. strXML="<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><response><error>%e</error><message>%m</message></response>"
  2098. If strMsg="undiscovered" Then'未发现相应ID
  2099. strXML=Replace(strXML,"%e","1")
  2100. strXML=Replace(strXML,"%m",strMsg)
  2101. ElseIf strMsg="repetition" Then'重复PING
  2102. strXML=Replace(strXML,"%e","1")
  2103. strXML=Replace(strXML,"%m",strMsg)
  2104. Elseif strMsg="invalid parameter" Then'非法参数
  2105. strXML=Replace(strXML,"%e","1")
  2106. strXML=Replace(strXML,"%m",strMsg)
  2107. Elseif strMsg="none data" Then'无数据
  2108. strXML=Replace(strXML,"%e","1")
  2109. strXML=Replace(strXML,"%m",strMsg)
  2110. Else'PING 成功
  2111. strXML=Replace(strXML,"%e","0")
  2112. strXML=Replace(strXML,"%m",strMsg)
  2113. End If
  2114. TbXML=strXML
  2115. 'Response.ContentType = "text/html"
  2116. End Function
  2117. Public Function Post()
  2118. Call Filter_Plugin_TTrackBack_Post(ID,log_ID,URL,Title,Blog,Excerpt,PostTime,IP,Agent)
  2119. Dim objRS
  2120. 'Call ReturnTbXML("undiscovered"):Exit Function
  2121. Call CheckParameter(log_ID,"int",0)
  2122. If IsDate(PostTime)=False Then PostTime=GetTime(Now())
  2123. IP=Request.ServerVariables("REMOTE_ADDR")
  2124. Agent=Request.ServerVariables("HTTP_USER_AGENT")
  2125. IP=FilterSQL(IP)
  2126. Agent=FilterSQL(Agent)
  2127. URL=FilterSQL(URL)
  2128. Title=FilterSQL(Title)
  2129. Blog=FilterSQL(Blog)
  2130. Excerpt=FilterSQL(Excerpt)
  2131. Blog=TransferHTML(Blog,"[html-format]")
  2132. Title=TransferHTML(Title,"[html-format]")
  2133. Excerpt=TransferHTML(Excerpt,"[html-format][nohtml]")
  2134. URL=TransferHTML(URL,"[html-format]")
  2135. 'log_ID不能为0
  2136. If (log_ID=0) Then Call ReturnTbXML("invalid parameter"):Post=False:Exit Function
  2137. If Len(URL)=0 Then Call ReturnTbXML("none data"):Post=False:Exit Function
  2138. If Len(URL)>ZC_HOMEPAGE_MAX Then Call ReturnTbXML("url is long"):Post=False:Exit Function
  2139. If Len(Blog)>ZC_EMAIL_MAX Then Call ReturnTbXML("name is long"):Post=False:Exit Function
  2140. If Len(Blog)=0 Then Blog="Unknow"
  2141. If Len(Excerpt)=0 Then Excerpt=""
  2142. If Len(Excerpt)>ZC_TB_EXCERPT_MAX Then Excerpt=Left(Excerpt,ZC_TB_EXCERPT_MAX)&"..."
  2143. If Len(Title)>ZC_HOMEPAGE_MAX Then Call ReturnTbXML("title is long"):Post=False:Exit Function
  2144. If Len(Title)=0 Then Title=URL
  2145. '检查ID是否存在
  2146. 'Set objRS=objConn.Execute("SELECT * FROM [blog_Article] WHERE [log_ID]=" & log_ID)
  2147. 'If (Not objRS.bof) And (Not objRS.eof) Then
  2148. 'Else
  2149. ' objRS.close
  2150. ' Call returnTbXML("undiscovered")
  2151. ' Exit Function
  2152. 'End If
  2153. 'objRS.Close
  2154. 'Set objRS=Nothing
  2155. '检查是否已TB过
  2156. Set objRS=objConn.Execute("SELECT * FROM [blog_TrackBack] WHERE [log_ID]=" & log_ID & " and [tb_url]='" & URL & "'")
  2157. If (Not objRS.bof) And (Not objRS.eof) Then
  2158. objRS.close
  2159. Call returnTbXML("repetition")
  2160. Exit Function
  2161. End If
  2162. objRS.Close
  2163. Set objRS=Nothing
  2164. '接收TB
  2165. If ID=0 Then
  2166. objConn.Execute("INSERT INTO [blog_TrackBack]([log_ID],[tb_URL],[tb_Title],[tb_Blog],[tb_Excerpt],[tb_PostTime],[tb_IP],[tb_Agent]) VALUES ("&log_ID&",'"&URL&"','"&Title&"','"&Blog&"','"&Excerpt&"','"&PostTime&"','"&IP&"','"&Agent&"')")
  2167. Else
  2168. objConn.Execute("UPDATE [blog_TrackBack] SET [log_ID]="&log_ID&", [tb_URL]='"&URL&"',[tb_Excerpt]='"&Excerpt&"',[tb_Title]='"&Title&"',[tb_Blog]='"&Blog&"',[tb_IP]='"&IP&"',[tb_PostTime]='"&PostTime&"',[tb_Agent]='"&Agent&"' WHERE [tb_ID] =" & ID)
  2169. End If
  2170. Call returnTbXML("succeed")
  2171. Post=True
  2172. End Function
  2173. Public Function Del()
  2174. Call Filter_Plugin_TTrackBack_Del(ID,log_ID,URL,Title,Blog,Excerpt,PostTime,IP,Agent)
  2175. Call CheckParameter(ID,"int",0)
  2176. If (ID=0) Then Del=False:Exit Function
  2177. objConn.Execute("DELETE FROM [blog_TrackBack] WHERE [tb_ID] =" & ID)
  2178. Del=True
  2179. End Function
  2180. Function Send(strAddress)
  2181. Dim strSendTB
  2182. strSendTB = "title=" & Server.URLEncode(Title) & "&url=" & Server.URLEncode(URL) & "&excerpt=" & Server.URLEncode(Excerpt) & "&blog_name=" & Server.URLEncode(Blog)
  2183. Dim objPing
  2184. Set objPing = Server.CreateObject("MSXML2.ServerXMLHTTP")
  2185. objPing.SetTimeOuts 10000, 10000, 10000, 10000 
  2186. objPing.open "POST",strAddress,False
  2187. objPing.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  2188. objPing.send strSendTB
  2189. 'Response.ContentType = "text/xml"
  2190. 'Response.Clear
  2191. 'Response.Write objPing.responseXML.xml
  2192. Set objPing = Nothing
  2193. Send=True
  2194. End Function
  2195. Public Function LoadInfoByID(tb_ID)
  2196. Call CheckParameter(tb_ID,"int",0)
  2197. Dim objRS
  2198. Set objRS=objConn.Execute("SELECT [tb_ID],[log_ID],[tb_URL],[tb_Title],[tb_Blog],[tb_Excerpt],[tb_PostTime],[tb_IP],[tb_Agent] FROM [blog_TrackBack] WHERE [tb_ID]=" & tb_ID)
  2199. If (Not objRS.bof) And (Not objRS.eof) Then
  2200. ID=objRS("tb_ID")
  2201. log_ID=objRS("log_ID")
  2202. URL=objRS("tb_URL")
  2203. Title=objRS("tb_Title")
  2204. Blog=objRS("tb_Blog")
  2205. Excerpt=objRS("tb_Excerpt")
  2206. PostTime=objRS("tb_PostTime")
  2207. IP=objRS("tb_IP")
  2208. Agent=objRS("tb_Agent")
  2209. LoadInfoByID=True
  2210. End If
  2211. objRS.Close
  2212. Set objRS=Nothing
  2213. If IsNull(Excerpt) Then Excerpt=""
  2214. Call Filter_Plugin_TTrackBack_LoadInfoByID(ID,log_ID,URL,Title,Blog,Excerpt,PostTime,IP,Agent)
  2215. End Function
  2216. Public Function LoadInfoByArray(aryTbInfo)
  2217. If IsArray(aryTbInfo)=True Then
  2218. ID=aryTbInfo(0)
  2219. log_ID=aryTbInfo(1)
  2220. URL=aryTbInfo(2)
  2221. Title=aryTbInfo(3)
  2222. Blog=aryTbInfo(4)
  2223. Excerpt=aryTbInfo(5)
  2224. PostTime=aryTbInfo(6)
  2225. IP=aryTbInfo(7)
  2226. Agent=aryTbInfo(8)
  2227. End If
  2228. If IsNull(Excerpt) Then Excerpt=""
  2229. LoadInfoByArray=True
  2230. Call Filter_Plugin_TTrackBack_LoadInfoByArray(ID,log_ID,URL,Title,Blog,Excerpt,PostTime,IP,Agent)
  2231. End Function
  2232. Public Function MakeTemplate(strT)
  2233. Dim html,i,j
  2234. html=strT
  2235. 'plugin node
  2236. Call Filter_Plugin_TTrackBack_MakeTemplate_Template(html)
  2237. Dim aryTemplateTagsName()
  2238. Dim aryTemplateTagsValue()
  2239. ReDim aryTemplateTagsName(7)
  2240. ReDim aryTemplateTagsValue(7)
  2241. aryTemplateTagsName(  1)="article/trackback/id"
  2242. aryTemplateTagsValue( 1)=ID
  2243. aryTemplateTagsName(  2)="article/trackback/name"
  2244. aryTemplateTagsValue( 2)=Blog
  2245. aryTemplateTagsName(  3)="article/trackback/url"
  2246. aryTemplateTagsValue( 3)=UrlForAntiSpam
  2247. aryTemplateTagsName(  4)="article/trackback/title"
  2248. aryTemplateTagsValue( 4)=Title
  2249. aryTemplateTagsName(  5)="article/trackback/posttime"
  2250. aryTemplateTagsValue( 5)=PostTime
  2251. aryTemplateTagsName(  6)="article/trackback/content"
  2252. aryTemplateTagsValue( 6)=HtmlExcerpt
  2253. aryTemplateTagsName(  7)="article/trackback/count"
  2254. aryTemplateTagsValue( 7)=Count
  2255. 'plugin node
  2256. Call Filter_Plugin_TTrackBack_MakeTemplate_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  2257. j=UBound(aryTemplateTagsName)
  2258. For i=1 to j
  2259. html=Replace(html,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  2260. Next
  2261. MakeTemplate=html
  2262. End Function
  2263. End Class
  2264. '*********************************************************
  2265. '*********************************************************
  2266. ' 目的:    定义TUpLoadFile类
  2267. ' 输入:    无
  2268. ' 返回:    无
  2269. '*********************************************************
  2270. Class TUpLoadFile
  2271. Public ID
  2272. Public AuthorID
  2273. Public FileSize
  2274. Public FileName
  2275. Public PostTime
  2276. Public Stream
  2277. Public DirByTime
  2278. Private FUploadType
  2279. Public Property Let UploadType(strUploadType)
  2280. If (strUploadType="Stream") Then
  2281. FUploadType=strUploadType
  2282. Else
  2283. FUploadType="Form"
  2284. End If
  2285. End Property
  2286. Public Property Get UploadType
  2287. If IsEmpty(FUploadType)=True Then
  2288. UploadType="Form"
  2289. Else
  2290. UploadType = FUploadType
  2291. End If
  2292. End Property
  2293. Public Function LoadInfoByID(ul_ID)
  2294. Call CheckParameter(ul_ID,"int",0)
  2295. Dim objRS
  2296. Set objRS=objConn.Execute("SELECT [ul_ID],[ul_AuthorID],[ul_FileSize],[ul_FileName],[ul_PostTime],[ul_Quote] FROM [blog_UpLoad] WHERE [ul_ID]=" & ul_ID)
  2297. If (Not objRS.bof) And (Not objRS.eof) Then
  2298. ID=objRS("ul_ID")
  2299. AuthorID=objRS("ul_AuthorID")
  2300. FileSize=objRS("ul_FileSize")
  2301. FileName=objRS("ul_FileName")
  2302. PostTime=objRS("ul_PostTime")
  2303. DirByTime=objRS("ul_Quote")
  2304. If IsNull(DirByTime) Or DirByTime="" Then DirByTime=False
  2305. LoadInfobyID=True
  2306. End If
  2307. objRS.Close
  2308. Set objRS=Nothing
  2309. Call Filter_Plugin_TUpLoadFile_LoadInfoByID(ID,AuthorID,FileSize,FileName,PostTime,DirByTime)
  2310. End Function
  2311. Public Function LoadInfoByArray(aryULInfo)
  2312. If IsArray(aryULInfo)=True Then
  2313. ID=aryULInfo(0)
  2314. AuthorID=aryULInfo(1)
  2315. FileSize=aryULInfo(2)
  2316. FileName=aryULInfo(3)
  2317. PostTime=aryULInfo(4)
  2318. DirByTime=aryULInfo(5)
  2319. If IsNull(DirByTime) Or DirByTime="" Then DirByTime=False
  2320. End If
  2321. LoadInfoByArray=True
  2322. Call Filter_Plugin_TUpLoadFile_LoadInfoByArray(ID,AuthorID,FileSize,FileName,PostTime,DirByTime)
  2323. End Function
  2324. Private Function UpLoad_Form()
  2325. Dim i,j
  2326. Dim x,y,z
  2327. Dim intFormSize
  2328. Dim binFormData
  2329. Dim strFileName
  2330. Dim s,t
  2331. intFormSize = Request.TotalBytes
  2332. binFormData = Request.BinaryRead(intFormSize)
  2333. i=0
  2334. i=InstrB(binFormData,ChrB(13)&ChrB(10)&ChrB(13)&ChrB(10))
  2335. If i>0 Then i=i+3
  2336. t=InstrB(binFormData,ChrB(13)&ChrB(10))
  2337. s=Midb(binFormData,1,t)
  2338. t=InstrB(binFormData,ChrB(13)&ChrB(10)&s)
  2339. j=t
  2340. If Len(Request.QueryString("filename"))>0 Then
  2341. strFileName=Request.QueryString("filename")
  2342. Else
  2343. x=InstrB(binFormData,ChrB(&H66)&ChrB(&H69)&ChrB(&H6C)&ChrB(&H65)&ChrB(&H6E)&ChrB(&H61)&ChrB(&H6D)&ChrB(&H65)&ChrB(&H3D)&ChrB(&H22))
  2344. y=InstrB(x+11,binFormData,ChrB(&H22))
  2345. For z=1 to y-x-10
  2346. strFileName=strFileName & Chr(AscB(MidB(binFormData,x+z+9,1)))
  2347. Next
  2348. End If
  2349. Dim objStreamUp
  2350. Set objStreamUp = Server.CreateObject("ADODB.Stream")
  2351. With objStreamUp
  2352. .Type = adTypeBinary
  2353. .Mode = adModeReadWrite
  2354. .Open
  2355. .Position = 0
  2356. .Write binFormData
  2357. .Position = i
  2358. Stream=.Read(j-i-1)
  2359. .Close
  2360. End With
  2361. FileName=strFileName
  2362. FileSize=LenB(Stream)
  2363. End Function
  2364. Private Function UpLoad_Stream()
  2365. FileSize=LenB(Stream)
  2366. End Function
  2367. Public Function UpLoad(bolAutoName)
  2368. Call Filter_Plugin_TUpLoadFile_UpLoad(ID,AuthorID,FileSize,FileName,PostTime,DirByTime)
  2369. DirByTime=ZC_UPLOAD_DIRBYMONTH
  2370. If UploadType="Form" Then
  2371. Call UpLoad_Form()
  2372. ElseIf UploadType="Stream" Then
  2373. Call UpLoad_Stream()
  2374. End If
  2375. If InStrRev(FileName,"")>0 Then
  2376. FileName=Mid(FileName,InStrRev(FileName,"")+1)
  2377. End If
  2378. If InStrRev(FileName,"/")>0 Then
  2379. FileName=Mid(FileName,InStrRev(FileName,"/")+1)
  2380. End If
  2381. FileName=TransferHTML(FileName,"[filename]")
  2382. '超出类型限制
  2383. If Not CheckRegExp(LCase(FileName),".("& ZC_UPLOAD_FILETYPE &")$") Then Call ShowError(26)
  2384. '超出大小限制
  2385. If FileSize>ZC_UPLOAD_FILESIZE Then Call ShowError(27)
  2386. FileName=FilterSQL(FileName)
  2387. If bolAutoName=True Then
  2388. Randomize
  2389. FileName=Year(GetTime(Now())) & Right("0"&Month(GetTime(Now())),2) & Right("0"&Day(GetTime(Now())),2) & Right("0"&Hour(GetTime(Now())),2) & Right("0"&Minute(GetTime(Now())),2) & Right("0"&Second(GetTime(Now())),2) & Int(9 * Rnd) & Int(9 * Rnd) & Int(9 * Rnd) & Int(9 * Rnd) & Right(FileName,Len(FileName)-InStrRev(FileName,".")+1)
  2390. End If
  2391. Dim objRS
  2392. Set objRS=objConn.Execute("SELECT * FROM [blog_UpLoad] WHERE [ul_FileName] = '" & FileName & "'")
  2393. If (Not objRS.bof) And (Not objRS.eof) Then
  2394. '不能重名
  2395.  Call ShowError(28)
  2396. Else
  2397. PostTime=GetTime(Now())
  2398. objConn.Execute("INSERT INTO [blog_UpLoad]([ul_AuthorID],[ul_FileSize],[ul_FileName],[ul_PostTime],[ul_Quote]) VALUES ("& AuthorID &","& FileSize &",'"& FileName &"','"& PostTime &"',"&DirByTime&")")
  2399. Dim strUPLOADDIR
  2400. If ZC_UPLOAD_DIRBYMONTH Then
  2401. CreatDirectoryByCustomDirectory(ZC_UPLOAD_DIRECTORY&"/"&Year(GetTime(Now()))&"/"&Month(GetTime(Now())))
  2402. strUPLOADDIR = ZC_UPLOAD_DIRECTORY&"/"&Year(GetTime(Now()))&"/"&Month(GetTime(Now()))
  2403. Else
  2404. strUPLOADDIR = ZC_UPLOAD_DIRECTORY
  2405. End If
  2406. Dim objStreamFile
  2407. Set objStreamFile = Server.CreateObject("ADODB.Stream")
  2408. objStreamFile.Type = adTypeBinary
  2409. objStreamFile.Mode = adModeReadWrite
  2410. objStreamFile.Open
  2411. objStreamFile.Write Stream
  2412. objStreamFile.SaveToFile BlogPath & "/"& strUPLOADDIR &"/" & FileName,adSaveCreateOverWrite
  2413. objStreamFile.Close
  2414. End If
  2415. UpLoad=True
  2416. End Function
  2417. Public Function Del()
  2418. Call Filter_Plugin_TUpLoadFile_Del(ID,AuthorID,FileSize,FileName,PostTime,DirByTime)
  2419. Call CheckParameter(ID,"int",0)
  2420. Dim objRS,strFilePath
  2421. Set objRS=objConn.Execute("SELECT * FROM [blog_UpLoad] WHERE [ul_ID] = " & ID)
  2422. If (Not objRS.bof) And (Not objRS.eof) Then
  2423. Dim fso
  2424. Set fso = CreateObject("Scripting.FileSystemObject")
  2425. strFilePath = BlogPath & "/"& ZC_UPLOAD_DIRECTORY &"/" & objRS("ul_FileName")
  2426. If fso.FileExists( strFilePath ) Then
  2427. fso.DeleteFile( strFilePath )
  2428. End If
  2429. strFilePath = BlogPath & "/"& ZC_UPLOAD_DIRECTORY & "/" & Year(objRS("ul_PostTime")) & "/" & Month(objRS("ul_PostTime")) &"/" & objRS("ul_FileName")
  2430. If fso.FileExists( strFilePath ) Then
  2431. fso.DeleteFile( strFilePath )
  2432. End If
  2433. objConn.Execute("DELETE FROM [blog_UpLoad] WHERE [ul_ID] =" & ID)
  2434. Else
  2435. Exit Function
  2436. End If
  2437. objRS.Close
  2438. Set objRS=Nothing
  2439. Del=True
  2440. End Function
  2441. Public Property Get FullUrlPathName
  2442. Dim strUPLOADDIR
  2443. If ZC_UPLOAD_DIRBYMONTH Then
  2444. strUPLOADDIR = ZC_UPLOAD_DIRECTORY&"/"&Year(GetTime(Now()))&"/"&Month(GetTime(Now()))
  2445. Else
  2446. strUPLOADDIR = ZC_UPLOAD_DIRECTORY
  2447. End If
  2448. FullUrlPathName=ZC_BLOG_HOST & strUPLOADDIR & "/" & FileName
  2449. End Property
  2450. End Class
  2451. '*********************************************************
  2452. '*********************************************************
  2453. ' 目的:    定义TTag类
  2454. ' 输入:    无
  2455. ' 返回:    无
  2456. '*********************************************************
  2457. Class TTag
  2458. Public ID
  2459. Public Name
  2460. Public Intro
  2461. Public Order
  2462. Public Count
  2463. Public Property Get EncodeName
  2464. EncodeName = Server.URLEncode(Name)
  2465. End Property
  2466. Public Property Get Url
  2467. Url = ZC_BLOG_HOST & "catalog.asp?"& "tags=" & Server.URLEncode(Name)
  2468. End Property
  2469. Public Property Get HtmlUrl
  2470. HtmlUrl=TransferHTML(Url,"[html-format]")
  2471. End Property
  2472. Public Property Get HtmlIntro
  2473. HtmlIntro=TransferHTML(Intro,"[html-format]")
  2474. End Property
  2475. Public Property Get HtmlName
  2476. HtmlName=TransferHTML(Name,"[html-format]")
  2477. End Property
  2478. Public Property Get RssUrl
  2479. RssUrl = ZC_BLOG_HOST & "sydication.asp?tags=" & ID
  2480. End Property
  2481. Public Function Post()
  2482. Call Filter_Plugin_TTag_Post(ID,Name,Intro,Order,Count)
  2483. Call CheckParameter(ID,"int",0)
  2484. Call CheckParameter(Order,"int",0)
  2485. Name=FilterSQL(Name)
  2486. Name=TransferHTML(Name,"[normalname]")
  2487. If Len(Name)=0 Then Post=False:Exit Function
  2488. Intro=FilterSQL(Intro)
  2489. 'Intro=TransferHTML(Intro,"[html-format]")
  2490. If ID=0 Then
  2491. objConn.Execute("INSERT INTO [blog_Tag]([tag_Name],[tag_Order],[tag_Intro]) VALUES ('"&Name&"',"&Order&",'"&Intro&"')")
  2492. Else
  2493. objConn.Execute("UPDATE [blog_Tag] SET [tag_Name]='"&Name&"',[tag_Order]="&Order&",[tag_Intro]='"&Intro&"' WHERE [tag_ID] =" & ID)
  2494. End If
  2495. Post=True
  2496. End Function
  2497. Public Function LoadInfoByID(tag_ID)
  2498. Call CheckParameter(tag_ID,"int",0)
  2499. Dim objRS
  2500. Set objRS=objConn.Execute("SELECT [tag_ID],[tag_Name],[tag_Intro],[tag_Order],[tag_Count] FROM [blog_Tag] WHERE [tag_ID]=" & tag_ID)
  2501. If (Not objRS.bof) And (Not objRS.eof) Then
  2502. ID=objRS("tag_ID")
  2503. Name=objRS("tag_Name")
  2504. Intro=objRS("tag_Intro")
  2505. Order=objRS("tag_Order")
  2506. Count=objRS("tag_Count")
  2507. LoadInfoByID=True
  2508. End If
  2509. objRS.Close
  2510. Set objRS=Nothing
  2511. If IsNull(Intro) Then Intro=""
  2512. Call Filter_Plugin_TTag_LoadInfoByID(ID,Name,Intro,Order,Count)
  2513. End Function
  2514. Public Function LoadInfoByArray(aryTagInfo)
  2515. If IsArray(aryTagInfo)=True Then
  2516. ID=aryTagInfo(0)
  2517. Name=aryTagInfo(1)
  2518. Intro=aryTagInfo(2)
  2519. Order=aryTagInfo(3)
  2520. Count=aryTagInfo(4)
  2521. End If
  2522. If IsNull(Intro) Then Intro=""
  2523. LoadInfoByArray=True
  2524. Call Filter_Plugin_TTag_LoadInfoByArray(ID,Name,Intro,Order,Count)
  2525. End Function
  2526. Public Function Del()
  2527. Call Filter_Plugin_TTag_Del(ID,Name,Intro,Order,Count)
  2528. Call CheckParameter(ID,"int",0)
  2529. If (ID=0) Then Del=False:Exit Function
  2530. Dim s
  2531. Dim i
  2532. Dim objRS
  2533. Set objRS=Server.CreateObject("ADODB.Recordset")
  2534. objRS.CursorType = adOpenKeyset
  2535. objRS.LockType = adLockReadOnly
  2536. objRS.ActiveConnection=objConn
  2537. objRS.Source=""
  2538. objRS.Open("SELECT [log_ID],[log_tag] FROM [blog_Article] WHERE [log_Tag] LIKE '%{" & ID & "}%'")
  2539. If (Not objRS.bof) And (Not objRS.eof) Then
  2540. Do While Not objRS.eof
  2541. i=objRS("log_ID")
  2542. s=objRS("log_tag")
  2543. s=Replace(s,"{"& ID &"}","")
  2544. objConn.Execute("UPDATE [blog_Article] SET [log_tag]='"& s &"' WHERE [log_ID] =" & i)
  2545. objRS.MoveNext
  2546. Loop
  2547. End If
  2548. objRS.Close
  2549. objConn.Execute("DELETE FROM [blog_Tag] WHERE [tag_ID] =" & ID)
  2550. Del=True
  2551. End Function
  2552. Public Function MakeTemplate(s)
  2553. Dim html,i,j
  2554. html=s
  2555. 'plugin node
  2556. Call Filter_Plugin_TTag_MakeTemplate_Template(html)
  2557. Dim aryTemplateTagsName()
  2558. Dim aryTemplateTagsValue()
  2559. ReDim aryTemplateTagsName(7)
  2560. ReDim aryTemplateTagsValue(7)
  2561. aryTemplateTagsName(  1)="article/tag/id"
  2562. aryTemplateTagsValue( 1)=ID
  2563. aryTemplateTagsName(  2)="article/tag/name"
  2564. aryTemplateTagsValue( 2)=HtmlName
  2565. aryTemplateTagsName(  3)="article/tag/intro"
  2566. aryTemplateTagsValue( 3)=HtmlIntro
  2567. aryTemplateTagsName(  4)="article/tag/count"
  2568. aryTemplateTagsValue( 4)=Count
  2569. aryTemplateTagsName(  5)="article/tag/url"
  2570. aryTemplateTagsValue( 5)=HtmlUrl
  2571. aryTemplateTagsName(  6)="article/tag/encodename"
  2572. aryTemplateTagsValue( 6)=EncodeName
  2573. 'plugin node
  2574. Call Filter_Plugin_TTag_MakeTemplate_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  2575. j=UBound(aryTemplateTagsName)
  2576. For i=1 to j
  2577. html=Replace(html,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  2578. Next
  2579. MakeTemplate=html
  2580. End Function
  2581. End Class
  2582. '*********************************************************
  2583. '*********************************************************
  2584. ' 目的:    定义TKeyWord类
  2585. ' 输入:    无
  2586. ' 返回:    无
  2587. '*********************************************************
  2588. Class TKeyWord
  2589. Public ID
  2590. Public Name
  2591. Public Intro
  2592. Public Url
  2593. Public Function Post()
  2594. Call CheckParameter(ID,"int",0)
  2595. Name=FilterSQL(Name)
  2596. Name=TransferHTML(Name,"[normalname]")
  2597. If Len(Name)=0 Then Post=False:Exit Function
  2598. Intro=FilterSQL(Intro)
  2599. Intro=TransferHTML(Intro,"[html-format]")
  2600. Url=FilterSQL(Url)
  2601. If Len(Url)=0 Then Post=False:Exit Function
  2602. If Not CheckRegExp(Url,"[homepage]") Then Call  ShowError(30)
  2603. If ID=0 Then
  2604. objConn.Execute("INSERT INTO [blog_Keyword]([key_Name],[key_URL],[key_Intro]) VALUES ('"&Name&"','"&Url&"','"&Intro&"')")
  2605. Else
  2606. objConn.Execute("UPDATE [blog_Keyword] SET [key_Name]='"&Name&"',[key_URL]='"&Url&"',[key_Intro]='"&Intro&"' WHERE [key_ID] =" & ID)
  2607. End If
  2608. Post=True
  2609. End Function
  2610. Public Function LoadInfoByID(key_ID)
  2611. Call CheckParameter(key_ID,"int",0)
  2612. Dim objRS
  2613. Set objRS=objConn.Execute("SELECT [key_ID],[key_Name],[key_Intro],[key_Url] FROM [blog_Keyword] WHERE [key_ID]=" & key_ID)
  2614. If (Not objRS.bof) And (Not objRS.eof) Then
  2615. ID=objRS("key_ID")
  2616. Name=objRS("key_Name")
  2617. Intro=objRS("key_Intro")
  2618. Url=objRS("key_Url")
  2619. LoadInfoByID=True
  2620. End If
  2621. objRS.Close
  2622. Set objRS=Nothing
  2623. If IsNull(Intro) Then Intro=""
  2624. End Function
  2625. Public Function LoadInfoByArray(aryKeyWordInfo)
  2626. If IsArray(aryKeywordInfo)=True Then
  2627. ID=aryKeyWordInfo(0)
  2628. Name=aryKeyWordInfo(1)
  2629. Intro=aryKeyWordInfo(2)
  2630. Url=aryKeyWordInfo(3)
  2631. End If
  2632. If IsNull(Intro) Then Intro=""
  2633. LoadInfoByArray=True
  2634. End Function
  2635. Public Function Del()
  2636. Call CheckParameter(ID,"int",0)
  2637. If (ID=0) Then Del=False:Exit Function
  2638. objConn.Execute("DELETE FROM [blog_Keyword] WHERE [key_ID] =" & ID)
  2639. Del=True
  2640. End Function
  2641. End Class
  2642. '*********************************************************
  2643. '*********************************************************
  2644. ' 目的:    定义TRss2Export类 New版
  2645. ' 输入:    无
  2646. ' 返回:    无
  2647. '*********************************************************
  2648. Class TNewRss2Export
  2649. Public TimeZone
  2650. Public Property Get xml
  2651. xml = objXMLdoc.xml
  2652. End Property
  2653. public FstrWebLink
  2654. public FstrAuthor
  2655. Public Property Get WebLink
  2656. WebLink = FstrWebLink
  2657. End Property
  2658. Public Property Let WebLink(strWebLink)
  2659. FstrWebLink = strWebLink
  2660. End Property
  2661. Public Property Get Author
  2662. Author = FstrAuthor
  2663. End Property
  2664. Public Property Let Author(strAuthor)
  2665. FstrAuthor = strAuthor
  2666. End Property
  2667. Private objXMLdoc
  2668. Private objXMLrss
  2669. Private objXMLchannel
  2670. Public Function AddChannelAttribute(title,value)
  2671. Dim objXMLitem
  2672. Set objXMLitem = objXMLdoc.createElement(title)
  2673. If title="pubDate" Then value=ParseDateForRFC822(value)
  2674. objXMLitem.text=value
  2675. objXMLchannel.AppendChild(objXMLitem)
  2676. AddChannelAttribute=True
  2677. End Function
  2678. Public Function AddItem(title,author,link,pubDate,guid,description,category,comments,wfw_comment,wfw_commentRss,trackback_ping)
  2679. Dim objXMLitem
  2680. Set objXMLitem = objXMLdoc.createElement("item")
  2681. Dim objXMLcdata
  2682. If(Len(title)>0) Then
  2683. objXMLitem.AppendChild(objXMLdoc.createElement("title"))
  2684. objXMLitem.selectSingleNode("title").text=title
  2685. End If
  2686. If(Len(author)>0) Then
  2687. objXMLitem.AppendChild(objXMLdoc.createElement("author"))
  2688. objXMLitem.selectSingleNode("author").text=author
  2689. End If
  2690. If(Len(link)>0) Then
  2691. objXMLitem.AppendChild(objXMLdoc.createElement("link"))
  2692. objXMLitem.selectSingleNode("link").text=link
  2693. End If
  2694. If(Len(pubDate)>0) Then
  2695. objXMLitem.AppendChild(objXMLdoc.createElement("pubDate"))
  2696. objXMLitem.selectSingleNode("pubDate").text=ParseDateForRFC822(pubDate)
  2697. End If
  2698. If(Len(guid)>0) Then
  2699. objXMLitem.AppendChild(objXMLdoc.createElement("guid"))
  2700. objXMLitem.selectSingleNode("guid").text=guid
  2701. End If
  2702. If(Len(description)>0) Then
  2703. objXMLitem.AppendChild(objXMLdoc.createElement("description"))
  2704. Set objXMLcdata = objXMLdoc.createNode("cdatasection", "","")
  2705. objXMLcdata.NodeValue=description
  2706. objXMLitem.selectSingleNode("description").AppendChild(objXMLcdata)
  2707. Set objXMLcdata = Nothing
  2708. End If
  2709. If(Len(category)>0) Then
  2710. objXMLitem.AppendChild(objXMLdoc.createElement("category"))
  2711. objXMLitem.selectSingleNode("category").text=category
  2712. End If
  2713. If(Len(comments)>0) Then
  2714. objXMLitem.AppendChild(objXMLdoc.createElement("comments"))
  2715. objXMLitem.selectSingleNode("comments").text=comments
  2716. End If
  2717. If(Len(wfw_comment)>0) Then
  2718. objXMLitem.AppendChild(objXMLdoc.createElement("wfw:comment"))
  2719. objXMLitem.selectSingleNode("wfw:comment").text=wfw_comment
  2720. End If
  2721. If(Len(wfw_commentRss)>0) Then
  2722. objXMLitem.AppendChild(objXMLdoc.createElement("wfw:commentRss"))
  2723. objXMLitem.selectSingleNode("wfw:commentRss").text=wfw_commentRss
  2724. End If
  2725. If(Len(trackback_ping)>0) Then
  2726. objXMLitem.AppendChild(objXMLdoc.createElement("trackback:ping"))
  2727. objXMLitem.selectSingleNode("trackback:ping").text=trackback_ping
  2728. End If
  2729. objXMLchannel.AppendChild(objXMLitem)
  2730. AddItem=True
  2731. End Function
  2732. Public Function Execute()
  2733. 'Response.ContentType = "text/html"
  2734. Response.ContentType = "text/xml"
  2735. Response.Clear
  2736. Response.Write xml
  2737. Execute=True
  2738. End Function
  2739. Public Function SaveToFile(strFileName)
  2740. objXMLdoc.save(strFileName)
  2741. SaveToFile=True
  2742. End Function
  2743. Function ParseDateForRFC822(dtmDate)
  2744. Dim dtmDay, dtmWeekDay, dtmMonth, dtmYear
  2745. Dim dtmHours, dtmMinutes, dtmSeconds
  2746. Select Case WeekDay(dtmDate)
  2747. Case 1:dtmWeekDay="Sun"
  2748. Case 2:dtmWeekDay="Mon"
  2749. Case 3:dtmWeekDay="Tue"
  2750. Case 4:dtmWeekDay="Wed"
  2751. Case 5:dtmWeekDay="Thu"
  2752. Case 6:dtmWeekDay="Fri"
  2753. Case 7:dtmWeekDay="Sat"
  2754. End Select
  2755. Select Case Month(dtmDate)
  2756. Case 1:dtmMonth="Jan"
  2757. Case 2:dtmMonth="Feb"
  2758. Case 3:dtmMonth="Mar"
  2759. Case 4:dtmMonth="Apr"
  2760. Case 5:dtmMonth="May"
  2761. Case 6:dtmMonth="Jun"
  2762. Case 7:dtmMonth="Jul"
  2763. Case 8:dtmMonth="Aug"
  2764. Case 9:dtmMonth="Sep"
  2765. Case 10:dtmMonth="Oct"
  2766. Case 11:dtmMonth="Nov"
  2767. Case 12:dtmMonth="Dec"
  2768. End Select
  2769. dtmYear = Year(dtmDate)
  2770. dtmDay = Right("00" & Day(dtmDate),2)
  2771. dtmHours = Right("00" & Hour(dtmDate),2)
  2772. dtmMinutes = Right("00" & Minute(dtmDate),2)
  2773. dtmSeconds = Right("00" & Second(dtmDate),2)
  2774. ParseDateForRFC822 = dtmWeekDay & ", " & dtmDay &" " & dtmMonth & " " & dtmYear & " " & dtmHours & ":" & dtmMinutes & ":" & dtmSeconds & " " & TimeZone
  2775. End Function 
  2776. ' 类初始化
  2777. Private Sub Class_Initialize()
  2778. On Error Resume Next
  2779. '对objXMLdoc进行初始化,如不能建对象则报错
  2780. Set objXMLdoc =Server.CreateObject("Microsoft.XMLDOM")
  2781. If Err.Number<>0 Then
  2782. End If
  2783. Dim objPI
  2784. 'Set objPI = objXMLdoc.createProcessingInstruction("xml-stylesheet","type=""text/css"" href=""css/rss.css""")
  2785. 'objXMLdoc.insertBefore objPI, objXMLdoc.childNodes(0)
  2786. 'Set objPI = Nothing
  2787. Set objPI = objXMLdoc.createProcessingInstruction("xml-stylesheet","type=""text/xsl"" href=""css/rss.xslt""")
  2788. objXMLdoc.insertBefore objPI, objXMLdoc.childNodes(0)
  2789. Set objPI = Nothing
  2790. Set objPI = objXMLdoc.createProcessingInstruction("xml","version=""1.0"" encoding=""UTF-8"" standalone=""yes""")
  2791. objXMLdoc.insertBefore objPI, objXMLdoc.childNodes(0)
  2792. Set objPI = Nothing
  2793. Set objXMLrss = objXMLdoc.createElement("rss")
  2794. Set objXMLchannel = objXMLdoc.createElement("channel")
  2795. objXMLrss.AppendChild(objXMLchannel)
  2796. objXMLdoc.AppendChild(objXMLrss)
  2797. objXMLrss.setAttribute "version","2.0"
  2798. objXMLrss.setAttribute "xmlns:dc","http://purl.org/dc/elements/1.1/"
  2799. objXMLrss.setAttribute "xmlns:trackback","http://madskills.com/public/xml/rss/module/trackback/"
  2800. objXMLrss.setAttribute "xmlns:wfw","http://wellformedweb.org/CommentAPI/"
  2801. objXMLrss.setAttribute "xmlns:slash","http://purl.org/rss/1.0/modules/slash/"
  2802. End Sub
  2803. ' 类释放
  2804. Private Sub Class_Terminate()
  2805. Set objXMLrss = Nothing
  2806. Set objXMLdoc  = Nothing
  2807. End Sub
  2808. End Class
  2809. '*********************************************************
  2810. '*********************************************************
  2811. ' 目的:    定义TGuestBook类
  2812. ' 输入:    无
  2813. ' 返回:    无
  2814. '*********************************************************
  2815. Class TGuestBook
  2816. Public Title
  2817. Public Template_Article_Single
  2818. Public Template_Article_Comment
  2819. Public Template_Article_Commentpost
  2820. Public Template_PageBar
  2821. Public Template_Article_Commentpost_Verify
  2822. Public Template_Article_Single_WAP
  2823. Public Template_Article_Multi
  2824. Public Template_PageBar_Next
  2825. Public Template_PageBar_Previous
  2826. Public Template_Calendar
  2827. Public TemplateTags_ArticleList_Author_ID
  2828. Public TemplateTags_ArticleList_Tags_ID
  2829. Public TemplateTags_ArticleList_Category_ID
  2830. Public TemplateTags_ArticleList_Date_ShortDate
  2831. Public TemplateTags_ArticleList_Date_Year
  2832. Public TemplateTags_ArticleList_Date_Month
  2833. Public TemplateTags_ArticleList_Date_Day
  2834. Public TemplateTags_ArticleList_Page_Now
  2835. Public TemplateTags_ArticleList_Page_All
  2836. Public html
  2837. Public htmlWAP
  2838. Private Ftemplate
  2839. Public Property Let template(strFileName)
  2840. Ftemplate=GetTemplate("TEMPLATE_" & strFileName)
  2841. End Property
  2842. Public Property Get template
  2843. template = Ftemplate
  2844. End Property
  2845. Public Function Export(intPage)
  2846. 'plugin node
  2847. bAction_Plugin_TGuestBook_Export_Begin=False
  2848. For Each sAction_Plugin_TGuestBook_Export_Begin in Action_Plugin_TGuestBook_Export_Begin
  2849. If Not IsEmpty(sAction_Plugin_TGuestBook_Export_Begin) Then Call Execute(sAction_Plugin_TGuestBook_Export_Begin)
  2850. If bAction_Plugin_TGuestBook_Export_Begin=True Then Exit Function
  2851. Next
  2852. Dim i,j,strC_Count,objComment,strC
  2853. Dim intPageCount
  2854. If IsNumeric(intPage)=False Then intPage=1
  2855. Call CheckParameter(intPage,"int",1)
  2856. Template_Article_Single=GetTemplate("TEMPLATE_B_ARTICLE-GUESTBOOK")
  2857. If (Template_Article_Single="") Then
  2858. Template_Article_Single=GetTemplate("TEMPLATE_B_ARTICLE-SINGLE")
  2859. End If
  2860. Template_Article_Commentpost=GetTemplate("TEMPLATE_B_ARTICLE_COMMENTPOST")
  2861. If ZC_COMMENT_VERIFY_ENABLE=True Then
  2862. Template_Article_Commentpost_Verify=GetTemplate("TEMPLATE_B_ARTICLE_COMMENTPOST-VERIFY")
  2863. End If
  2864. Dim objRS
  2865. Set objRS=Server.CreateObject("ADODB.Recordset")
  2866. objRS.CursorType = adOpenKeyset
  2867. objRS.LockType = adLockReadOnly
  2868. objRS.ActiveConnection=objConn
  2869. objRS.Source=""
  2870. objRS.Open("SELECT COUNT([comm_ID])AS allComment FROM [blog_Comment] WHERE [blog_Comment].[log_ID]=0")
  2871. If (Not objRS.bof) And (Not objRS.eof) Then
  2872. strC_Count=objRS("allComment")
  2873. End If
  2874. objRS.Close
  2875. Set objRS=Nothing
  2876. Set objRS=Server.CreateObject("ADODB.Recordset")
  2877. objRS.CursorType = adOpenKeyset
  2878. objRS.LockType = adLockReadOnly
  2879. objRS.ActiveConnection=objConn
  2880. objRS.Source="SELECT [comm_ID],[log_ID],[comm_AuthorID],[comm_Author],[comm_Content],[comm_Email],[comm_HomePage],[comm_PostTime],[comm_IP],[comm_Agent] FROM [blog_Comment] WHERE [blog_Comment].[log_ID]=0 ORDER BY [comm_PostTime] DESC"
  2881. objRS.Open()
  2882. objRS.PageSize=ZC_MSG_COUNT
  2883. If objRS.PageCount>0 Then objRS.AbsolutePage = intPage
  2884. intPageCount=objRS.PageCount
  2885. If (not objRS.bof) And (not objRS.eof) Then
  2886. For i=1 To objRS.PageSize
  2887. Set objComment=New TComment
  2888. objComment.LoadInfoByArray(Array(objRS("comm_ID"),objRS("log_ID"),objRS("comm_AuthorID"),objRS("comm_Author"),objRS("comm_Content"),objRS("comm_Email"),objRS("comm_HomePage"),objRS("comm_PostTime"),"",""))
  2889. strC=GetTemplate("TEMPLATE_B_ARTICLE_COMMENT")
  2890. objComment.Count=strC_Count-i-(ZC_MSG_COUNT * (intPage-1))+1
  2891. strC=objComment.MakeTemplate(strC)
  2892. If ZC_COMMENT_REVERSE_ORDER_EXPORT=True Then
  2893. Template_Article_Comment=Template_Article_Comment & strC
  2894. Else
  2895. Template_Article_Comment=strC & Template_Article_Comment
  2896. End If
  2897. Set objComment=Nothing
  2898. objRS.MoveNext
  2899. If objRS.eof Then Exit For
  2900. Next
  2901. End If
  2902. TemplateTags_ArticleList_Page_Now=intPage
  2903. TemplateTags_ArticleList_Page_All=intPageCount
  2904. j=objRS.PageCount
  2905. If j>0 Then
  2906. Dim a,b,s,t,intNowPage,strPageBar
  2907. s=ZC_BLOG_HOST & "guestbook.asp"
  2908. t=""
  2909. intNowPage=intPage
  2910. strPageBar=GetTemplate("TEMPLATE_B_PAGEBAR")
  2911. strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s)
  2912. strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",ZC_MSG285)
  2913. Template_PageBar=Template_PageBar & strPageBar
  2914. If j>ZC_PAGEBAR_COUNT Then
  2915. a=intNowPage
  2916. b=intNowPage+ZC_PAGEBAR_COUNT
  2917. If a>ZC_PAGEBAR_COUNT Then a=a-1:b=b-1
  2918. If b>j Then b=j:a=j-ZC_PAGEBAR_COUNT
  2919. Else
  2920. a=1:b=j
  2921. End If
  2922. For i=a to b
  2923. s=ZC_BLOG_HOST & "guestbook.asp?"& t &"page="& i
  2924. If i=1 Then
  2925. s=ZC_BLOG_HOST & "guestbook.asp"
  2926. End If
  2927. strPageBar=GetTemplate("TEMPLATE_B_PAGEBAR")
  2928. If i=intNowPage then
  2929. Template_PageBar=Template_PageBar & "<span class=""now-page"">" & i & "</span>"
  2930. Else
  2931. strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s)
  2932. strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",i)
  2933. Template_PageBar=Template_PageBar & strPageBar
  2934. End If
  2935. Next
  2936. s=ZC_BLOG_HOST & "guestbook.asp?"& t &"page="& j
  2937. If j=1 Then
  2938. s=ZC_BLOG_HOST & "guestbook.asp"
  2939. End If
  2940. strPageBar=GetTemplate("TEMPLATE_B_PAGEBAR")
  2941. strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s)
  2942. strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",ZC_MSG286)
  2943. Template_PageBar=Template_PageBar & strPageBar
  2944. If intNowPage=1 Then
  2945. Template_PageBar_Previous=""
  2946. Else
  2947. Template_PageBar_Previous="<span class=""pagebar-previous""><a href="""& ZC_BLOG_HOST &"guestbook.asp?"& t &"page="& intNowPage-1 &"""><span>"&ZC_MSG156&"</span></a></span>"
  2948. End If
  2949. If intNowPage=intPageCount Then
  2950. Template_PageBar_Next=""
  2951. Else
  2952. Template_PageBar_Next="<span class=""pagebar-next""><a href="""& ZC_BLOG_HOST &"guestbook.asp?"& t &"page="& intNowPage+1 &"""><span>"&ZC_MSG155&"</span></a></span>"
  2953. End If
  2954. End If
  2955. objRS.Close
  2956. Set objRS=Nothing
  2957. Template_Article_Comment=Template_Article_Comment & "<div style=""display:none;"" id=""divAjaxComment""></div>"
  2958. Template_Article_Commentpost=Replace(Template_Article_Commentpost,"<#template:article_commentpost-verify#>",Template_Article_Commentpost_Verify)
  2959. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_trackback#>","")
  2960. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_comment#>",Template_Article_Comment)
  2961. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_commentpost#>",Template_Article_Commentpost)
  2962. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_tag#>","")
  2963. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_navbar_l#>","")
  2964. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_navbar_r#>","")
  2965. Template_Article_Single=Replace(Template_Article_Single,"<#template:article_mutuality#>","")
  2966. Template_Article_Single=Replace(Template_Article_Single,"<#template:pagebar#>",Template_PageBar)
  2967. Ftemplate=Replace(Ftemplate,"<#template:article_trackback#>","")
  2968. Ftemplate=Replace(Ftemplate,"<#template:article_comment#>",Template_Article_Comment)
  2969. Ftemplate=Replace(Ftemplate,"<#template:article_commentpost#>",Template_Article_Commentpost)
  2970. Ftemplate=Replace(Ftemplate,"<#template:article_tag#>","")
  2971. Ftemplate=Replace(Ftemplate,"<#template:article_navbar_l#>","")
  2972. Ftemplate=Replace(Ftemplate,"<#template:article_navbar_r#>","")
  2973. Ftemplate=Replace(Ftemplate,"<#template:article_mutuality#>","")
  2974. Ftemplate=Replace(Ftemplate,"<#template:pagebar#>",Template_PageBar)
  2975. Ftemplate=Replace(Ftemplate,"<#template:article-multi#>","")
  2976. Ftemplate=Replace(Ftemplate,"<#template:pagebar_next#>",Template_PageBar_Next)
  2977. Ftemplate=Replace(Ftemplate,"<#template:pagebar_previous#>",Template_PageBar_Previous)
  2978. Ftemplate=Replace(Ftemplate,"<#articlelist/author/id#>","")
  2979. Ftemplate=Replace(Ftemplate,"<#articlelist/tags/id#>","")
  2980. Ftemplate=Replace(Ftemplate,"<#articlelist/category/id#>","")
  2981. Ftemplate=Replace(Ftemplate,"<#articlelist/date/year#>","")
  2982. Ftemplate=Replace(Ftemplate,"<#articlelist/date/month#>","")
  2983. Ftemplate=Replace(Ftemplate,"<#articlelist/date/day#>","")
  2984. Ftemplate=Replace(Ftemplate,"<#articlelist/date/shortdate#>","")
  2985. Ftemplate=Replace(Ftemplate,"<#articlelist/page/now#>",TemplateTags_ArticleList_Page_Now)
  2986. Ftemplate=Replace(Ftemplate,"<#articlelist/page/all#>",TemplateTags_ArticleList_Page_All)
  2987. Ftemplate=Replace(Ftemplate,"<#articlelist/page/count#>",ZC_DISPLAY_COUNT)
  2988. Dim aryTemplateTagsName(49)
  2989. Dim aryTemplateTagsValue(49)
  2990. j=49
  2991. Dim PostTime
  2992. PostTime=GetTime(Now())
  2993. aryTemplateTagsName(1)="article/id"
  2994. aryTemplateTagsValue(1)=0
  2995. aryTemplateTagsName(2)="article/level"
  2996. aryTemplateTagsValue(2)=4
  2997. aryTemplateTagsName(3)="article/title"
  2998. aryTemplateTagsValue(3)=ZC_MSG275
  2999. aryTemplateTagsName(4)="article/intro"
  3000. aryTemplateTagsValue(4)=ZC_GUESTBOOK_CONTENT
  3001. aryTemplateTagsName(5)="article/content"
  3002. aryTemplateTagsValue(5)=ZC_GUESTBOOK_CONTENT '& "<br/>" & "<br/><div class=""guestbook_pagebar"">" & ZC_MSG042 & ":" & Template_PageBar & "</div>"
  3003. aryTemplateTagsName(6)="article/posttime"
  3004. aryTemplateTagsValue(6)=PostTime
  3005. aryTemplateTagsName(7)="article/commnums"
  3006. aryTemplateTagsValue(7)=strC_Count
  3007. aryTemplateTagsName(8)="article/viewnums"
  3008. aryTemplateTagsValue(8)=0
  3009. aryTemplateTagsName(9)="article/trackbacknums"
  3010. aryTemplateTagsValue(9)=0
  3011. aryTemplateTagsName(10)="article/trackback_url"
  3012. aryTemplateTagsValue(10)=""
  3013. aryTemplateTagsName(11)="article/url"
  3014. aryTemplateTagsValue(11)=ZC_BLOG_HOST & "guestbook.asp"
  3015. aryTemplateTagsName(12)="article/category/id"
  3016. aryTemplateTagsValue(12)=0
  3017. aryTemplateTagsName(13)="article/category/name"
  3018. aryTemplateTagsValue(13)=ZC_BLOG_NAME
  3019. aryTemplateTagsName(15)="article/category/order"
  3020. aryTemplateTagsValue(15)=0
  3021. aryTemplateTagsName(16)="article/category/count"
  3022. aryTemplateTagsValue(16)=0
  3023. aryTemplateTagsName(17)="article/category/url"
  3024. aryTemplateTagsValue(17)=""
  3025. aryTemplateTagsName(18)="article/author/id"
  3026. aryTemplateTagsValue(18)=0
  3027. aryTemplateTagsName(19)="article/author/name"
  3028. aryTemplateTagsValue(19)=ZC_BLOG_MASTER
  3029. aryTemplateTagsName(20)="article/author/level"
  3030. aryTemplateTagsValue(20)=4
  3031. aryTemplateTagsName(21)="article/author/email"
  3032. aryTemplateTagsValue(21)=""
  3033. aryTemplateTagsName(22)="article/author/homepage"
  3034. aryTemplateTagsValue(22)=""
  3035. aryTemplateTagsName(23)="article/author/count"
  3036. aryTemplateTagsValue(23)=0
  3037. aryTemplateTagsName(24)="article/author/url"
  3038. aryTemplateTagsValue(24)=""
  3039. aryTemplateTagsName(25)="article/posttime/longdate"
  3040. aryTemplateTagsValue(25)=FormatDateTime(PostTime,vbLongDate)
  3041. aryTemplateTagsName(26)="article/posttime/shortdate"
  3042. aryTemplateTagsValue(26)=FormatDateTime(PostTime,vbShortDate)
  3043. aryTemplateTagsName(27)="article/posttime/longtime"
  3044. aryTemplateTagsValue(27)=FormatDateTime(PostTime,vbLongTime)
  3045. aryTemplateTagsName(28)="article/posttime/shorttime"
  3046. aryTemplateTagsValue(28)=FormatDateTime(PostTime,vbShortTime)
  3047. aryTemplateTagsName(29)="article/posttime/year"
  3048. aryTemplateTagsValue(29)=Year(PostTime)
  3049. aryTemplateTagsName(30)="article/posttime/month"
  3050. aryTemplateTagsValue(30)=Month(PostTime)
  3051. aryTemplateTagsName(31)="article/posttime/monthname"
  3052. aryTemplateTagsValue(31)=ZVA_Month(Month(PostTime))
  3053. aryTemplateTagsName(32)="article/posttime/day"
  3054. aryTemplateTagsValue(32)=Day(PostTime)
  3055. aryTemplateTagsName(33)="article/posttime/weekday"
  3056. aryTemplateTagsValue(33)=Weekday(PostTime)
  3057. aryTemplateTagsName(34)="article/posttime/weekdayname"
  3058. aryTemplateTagsValue(34)=ZVA_Week(Weekday(PostTime))
  3059. aryTemplateTagsName(35)="article/posttime/hour"
  3060. aryTemplateTagsValue(35)=Hour(PostTime)
  3061. aryTemplateTagsName(36)="article/posttime/minute"
  3062. aryTemplateTagsValue(36)=Minute(PostTime)
  3063. aryTemplateTagsName(37)="article/posttime/second"
  3064. aryTemplateTagsValue(37)=Second(PostTime)
  3065. aryTemplateTagsName(38)="article/commentrss"
  3066. aryTemplateTagsValue(38)=""
  3067. aryTemplateTagsName(39)="article/commentposturl"
  3068. aryTemplateTagsValue(39)=ZC_BLOG_HOST & "cmd.asp?act=cmt&amp;key=" & Left(MD5(ZC_BLOG_HOST & ZC_BLOG_CLSID & CStr(0) & CStr(Day(GetTime(Now())))),8)
  3069. aryTemplateTagsName(40)="article/pretrackback_url"
  3070. aryTemplateTagsValue(40)=""
  3071. aryTemplateTagsName(41)="article/trackbackkey"
  3072. aryTemplateTagsValue(41)="00000"
  3073. aryTemplateTagsName(42)="article/commentkey"
  3074. aryTemplateTagsValue(42)="00000"
  3075. aryTemplateTagsName(43)="article/staticname"
  3076. aryTemplateTagsValue(43)=""
  3077. aryTemplateTagsName(44)="article/category/staticname"
  3078. aryTemplateTagsValue(44)=""
  3079. aryTemplateTagsName(45)="article/author/staticname"
  3080. aryTemplateTagsValue(45)=""
  3081. aryTemplateTagsName(46)="article/tagtoname"
  3082. aryTemplateTagsValue(46)=""
  3083. aryTemplateTagsName(47)="article/firsttagintro"
  3084. aryTemplateTagsValue(47)=""
  3085. aryTemplateTagsName(48)="article/posttime/monthnameabbr"
  3086. aryTemplateTagsValue(48)=ZVA_Month_Abbr(Month(PostTime))
  3087. aryTemplateTagsName(49)="article/posttime/weekdaynameabbr"
  3088. aryTemplateTagsValue(49)=ZVA_Week_Abbr(Weekday(PostTime))
  3089. Call Filter_Plugin_TGuestBook_Export_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  3090. For i=1 to j
  3091. Template_Article_Single=Replace(Template_Article_Single,"<#"&aryTemplateTagsName(i)&"#>",aryTemplateTagsValue(i))
  3092. Ftemplate=Replace(Ftemplate,"<#"&aryTemplateTagsName(i)&"#>",aryTemplateTagsValue(i))
  3093. Next
  3094. html=Replace(template,"<#template:article-single#>",Template_Article_Single)
  3095. html=Replace(html,"<#template:article-guestbook#>",Template_Article_Single)
  3096. Title=TransferHTML(ZC_MSG275,"[html-format]")
  3097. Export=True
  3098. 'plugin node
  3099. bAction_Plugin_TGuestBook_Export_End=False
  3100. For Each sAction_Plugin_TGuestBook_Export_End in Action_Plugin_TGuestBook_Export_End
  3101. If Not IsEmpty(sAction_Plugin_TGuestBook_Export_End) Then Call Execute(sAction_Plugin_TGuestBook_Export_End)
  3102. If bAction_Plugin_TGuestBook_Export_End=True Then Exit Function
  3103. Next
  3104. End Function
  3105. Public Function Build()
  3106. Dim aryTemplateTagsName
  3107. Dim aryTemplateTagsValue
  3108. Dim i,j
  3109. htmlWAP = Template_Article_Single_WAP
  3110. If IsEmpty(html) Then html=template
  3111. Call Filter_Plugin_TGuestBook_Build_Template(html,htmlWAP)
  3112. Call Filter_Plugin_TGuestBook_Build_Template_Sub(Template_Article_Single)
  3113. html=Replace(html,"<#template:article-single#>",Template_Article_Single)
  3114. aryTemplateTagsName=TemplateTagsName
  3115. aryTemplateTagsValue=TemplateTagsValue
  3116. aryTemplateTagsName(0)="BlogTitle"
  3117. aryTemplateTagsValue(0)=Title
  3118. Call Filter_Plugin_TGuestBook_Build_TemplateTags(aryTemplateTagsName,aryTemplateTagsValue)
  3119. j=UBound(aryTemplateTagsName)
  3120. For i=1 to j
  3121. html=Replace(html,"<#" & aryTemplateTagsName(i) & "#>",aryTemplateTagsValue(i))
  3122. htmlWAP = Replace(htmlWAP, "<#" & aryTemplateTagsName(i) & "#>", aryTemplateTagsValue(i))
  3123. Next
  3124. html=Replace(html,"<#" & aryTemplateTagsName(0) & "#>",aryTemplateTagsValue(0))
  3125. htmlWAP = Replace(htmlWAP, "<#" & aryTemplateTagsName(0) & "#>", aryTemplateTagsValue(0))
  3126. Build=True
  3127. End Function
  3128. End Class
  3129. '*********************************************************
  3130. %>