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

中间件编程

开发平台:

HTML/CSS

  1. <%@ CODEPAGE=65001 %>
  2. <%
  3. '///////////////////////////////////////////////////////////////////////////////
  4. '// 插件应用:    Z-Blog 1.7
  5. '// 插件制作:    
  6. '// 备    注:    
  7. '// 最后修改:   
  8. '// 最后版本:    
  9. '///////////////////////////////////////////////////////////////////////////////
  10. %>
  11. <% Option Explicit %>
  12. <% On Error Resume Next %>
  13. <% Response.Charset="UTF-8" %>
  14. <% Response.Buffer=True %>
  15. <!-- #include file="../../c_option.asp" -->
  16. <!-- #include file="../../function/c_function.asp" -->
  17. <!-- #include file="../../function/c_function_md5.asp" -->
  18. <!-- #include file="../../function/c_system_lib.asp" -->
  19. <!-- #include file="../../function/c_system_base.asp" -->
  20. <!-- #include file="../../function/c_system_event.asp" -->
  21. <!-- #include file="../../function/c_system_plugin.asp" -->
  22. <!-- #include file="../../plugin/p_config.asp" -->
  23. <%
  24. Call System_Initialize()
  25. '检查非法链接
  26. Call CheckReference("")
  27. '检查权限
  28. If BlogUser.Level>1 Then Call ShowError(6) 
  29. If CheckPluginState("Totoro")=False Then Call ShowError(48)
  30. %>
  31. <%
  32. Dim act,delid
  33. act=Request.Form("act")
  34. delid=Request.Form("id")
  35. 'act=Request.QueryString("act")
  36. 'delid=Request.QueryString("id")
  37. Dim strContent
  38. Dim strZC_TOTORO_BADWORD_LIST,StrTMP,NEW_BADWORD,bolTOTORO_DEL_DIRECTLY
  39. strContent=LoadFromFile(BlogPath & "/PLUGIN/totoro/include.asp","utf-8")
  40. Call LoadValueForSetting(strContent,True,"String","TOTORO_BADWORD_LIST",strZC_TOTORO_BADWORD_LIST)
  41. Call LoadValueForSetting(strContent,True,"Boolean","TOTORO_DEL_DIRECTLY",bolTOTORO_DEL_DIRECTLY)
  42. If act="delcm" then
  43. Dim objComment
  44. Set objComment=New TComment
  45. If objComment.LoadInfobyID(delid) Then
  46. StrTMP=TOTORO_checkStr(objComment.HomePage & "|" & objComment.Content,strZC_TOTORO_BADWORD_LIST)
  47. strZC_TOTORO_BADWORD_LIST=strZC_TOTORO_BADWORD_LIST & StrTMP
  48. NEW_BADWORD=StrTMP
  49. Response.Write Totoro_dealIt(objComment,bolTOTORO_DEL_DIRECTLY)
  50. End If
  51. Elseif act="deltb" then
  52. Dim objTrackBack
  53. Set objTrackBack=New TTrackBack
  54. If objTrackBack.LoadInfobyID(delid) Then
  55. StrTMP=TOTORO_checkStr(objTrackBack.URL & "|" & objTrackBack.Excerpt,strZC_TOTORO_BADWORD_LIST)
  56. strZC_TOTORO_BADWORD_LIST=strZC_TOTORO_BADWORD_LIST & StrTMP
  57. NEW_BADWORD=StrTMP
  58. Response.Write Totoro_dealIt(objTrackBack,bolTOTORO_DEL_DIRECTLY)
  59. End If
  60. End If
  61. If left(strZC_TOTORO_BADWORD_LIST,1)="|" then strZC_TOTORO_BADWORD_LIST=Right(strZC_TOTORO_BADWORD_LIST, Len(strZC_TOTORO_BADWORD_LIST) - 1)
  62. Call SaveValueForSetting(strContent,True,"String","TOTORO_BADWORD_LIST",strZC_TOTORO_BADWORD_LIST)
  63. Call SaveToFile(BlogPath & "/PLUGIN/totoro/include.asp",strContent,"utf-8",False)
  64. 'If NEW_BADWORD<>"" Then Response.write ",TotoroⅡ新增下列黑词: " & Right(NEW_BADWORD, Len(NEW_BADWORD) - 1)
  65. %>
  66. <%
  67. Function TOTORO_checkStr(strToCheck,BADWORD_LIST)
  68. Dim objReg,objMatches,Match
  69. Set objReg = New RegExp
  70. objReg.IgnoreCase = True
  71. objReg.Global = True
  72. objReg.Pattern = "http://([w-]+.)+[w-]+"
  73. Set objMatches = objReg.Execute(strToCheck)
  74. For Each Match In objMatches
  75. If Totoro_checkNewBadWord(Match.Value,BADWORD_LIST & TOTORO_checkStr) then
  76. TOTORO_checkStr=TOTORO_checkStr & "|" & Right(Match.Value, Len(Match.Value) - 7)
  77. End if
  78. Next
  79. Set objReg = Nothing
  80. Set objMatches = Nothing
  81. Set Match = Nothing
  82. End Function
  83. Function Totoro_checkNewBadWord(content,BADWORD_LIST)
  84. Totoro_checkNewBadWord=True
  85. Dim i,j
  86. j=0
  87.     Dim strFilter
  88.     strFilter = Split(BADWORD_LIST, "|")
  89. For i = 0 To UBound(strFilter)
  90. If strFilter(i)<>"" Then
  91. If InStr (LCase(content), LCase(strFilter(i))) > 0 Then
  92. Totoro_checkNewBadWord=False
  93. Exit For
  94. End If
  95. End If
  96.     Next
  97. End Function
  98. Function Totoro_dealIt(objToDeal,bolDel)
  99. Dim logId
  100. logId=objToDeal.log_ID
  101. If bolDel Then
  102. If objToDeal.Del() Then Totoro_dealIt = "删除成功"
  103. Else
  104. objToDeal.log_ID=-1-objToDeal.log_ID
  105. If objToDeal.Post Then Totoro_dealIt = "已加入审核"
  106. End If
  107. Call BuildArticle(logId,False,False)
  108. Call SetBlogHint(Null,True,Null)
  109. Set objToDeal = Nothing
  110. End Function
  111. %>