common.asp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <!--#include file="inc/common.asp"-->
  2. <%
  3. Server.ScriptTimeOut = 9999999
  4. Dim NeedCheckComeUrl
  5. If NeedCheckComeUrl = True Then
  6. Call CheckComeUrl
  7. End If
  8. Dim ObjInstalled_FSO, fso
  9. ObjInstalled_FSO = IsObjInstalled("Scripting.FileSystemObject")
  10. If ObjInstalled_FSO = True Then
  11. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  12. Else
  13. Response.Write "<li>FSO组件不可用,各种与FSO相关的功能都将出错!请运行Install.asp或者到后台网站配置处设置好FSO组件名称。</li>"
  14. End If
  15. Function IsObjInstalled(strClassString)
  16. On Error Resume Next
  17. IsObjInstalled = False
  18. Err = 0
  19. Dim xTestObj
  20. Set xTestObj = CreateObject(strClassString)
  21. If Err.Number = 0 Then IsObjInstalled = True
  22. Set xTestObj = Nothing
  23. Err = 0
  24. End Function
  25. Sub CheckComeUrl()
  26. Dim ComeUrl, TrueSiteUrl, cUrl
  27. ComeUrl = Trim(Request.ServerVariables("HTTP_REFERER"))
  28. TrueSiteUrl = Trim(Request.ServerVariables("HTTP_HOST"))
  29. If ComeUrl = "" Then
  30. Response.Write "<br><p align=center><font color='red'>不允许直接输入地址访问此页面</font></p>"
  31. Response.End
  32. Else
  33. cUrl = Trim("http://" & TrueSiteUrl) & ScriptName
  34. If LCase(Left(ComeUrl, InStrRev(ComeUrl, "/"))) <> LCase(Left(cUrl, InStrRev(cUrl, "/"))) Then
  35. Response.Write "<br><p align=center><font color='red'>不允许从外部链接访问此页面</font></p>"
  36. Response.End
  37. End If
  38. End If
  39. End Sub
  40. '检查登录
  41. Dim AdminID, AdminName, AdminPassword, RndPassword, AdminLoginCode
  42. Dim rsGetAdmin, sqlGetAdmin
  43. AdminName = ReplaceBadChar(Trim(Request.Cookies("AdminName")))
  44. AdminPassword = ReplaceBadChar(Trim(Request.Cookies("AdminPassword")))
  45. 'RndPassword = ReplaceBadChar(Trim(Request.Cookies("RndPassword")))
  46. 'AdminLoginCode = ReplaceBadChar(Trim(Request.Cookies("AdminLoginCode")))
  47. If AdminName = "" Or AdminPassword = "" Then 'Or RndPassword = "" Or (AdminLoginCode <> SiteManageCode)
  48. Call CloseConn
  49. Response.redirect "login.asp"
  50. End If
  51. sqlGetAdmin = "select * from t_user_info where uid='" & AdminName & "' and pwd='" & AdminPassword & "'"
  52. Set rsGetAdmin = Server.CreateObject("adodb.recordset")
  53. rsGetAdmin.Open sqlGetAdmin, Conn, 1, 1
  54. If rsGetAdmin.BOF And rsGetAdmin.EOF Then
  55. rsGetAdmin.Close
  56. Set rsGetAdmin = Nothing
  57. Call CloseConn
  58. Response.redirect "login.asp"
  59. End If
  60. If rsGetAdmin("status") = False Then
  61. response.write "<font color=red>用户已锁定!</font>"
  62. response.End
  63. Call CloseConn
  64. End If
  65. Public Sub ShowJS_Manage(ItemName)
  66. Dim strJS
  67. Response.Write "<SCRIPT language=javascript>" & vbCrLf
  68. Response.Write "function CheckItem(CB){" & vbCrLf
  69. Response.Write " var tagname=(arguments.length>1)?arguments[1]:'TR';" & vbCrLf
  70. Response.Write " if(document.myform.chkAll.checked){" & vbCrLf
  71. Response.Write " document.myform.chkAll.checked = document.myform.chkAll.checked&0;" & vbCrLf
  72. Response.Write " }" & vbCrLf
  73. Response.Write " if (CB.checked){hL(CB,tagname)};else{dL(CB,tagname)};" & vbCrLf
  74. Response.Write " var TB=TO=0;" & vbCrLf
  75. Response.Write " for (var i=0;i<myform.elements.length;i++) {" & vbCrLf
  76. Response.Write " var e=myform.elements[i];" & vbCrLf
  77. Response.Write " if ((e.name != 'chkAll') && (e.type=='checkbox')) {" & vbCrLf
  78. Response.Write " TB++;" & vbCrLf
  79. Response.Write " if (e.checked) TO++;" & vbCrLf
  80. Response.Write " }" & vbCrLf
  81. Response.Write " }" & vbCrLf
  82. Response.Write " myform.chkAll.checked=(TO==TB)?true:false;" & vbCrLf
  83. Response.Write "}" & vbCrLf
  84. Response.Write "function CheckAll(form){" & vbCrLf
  85. Response.Write " var tagname=(arguments.length>1)?arguments[1]:'TR';" & vbCrLf
  86. Response.Write " for (var i=0;i<form.elements.length;i++){" & vbCrLf
  87. Response.Write " var e = form.elements[i];" & vbCrLf
  88. Response.Write " if (e.name != 'chkAll' && e.disabled == false && e.type == 'checkbox') {" & vbCrLf
  89. Response.Write " e.checked = form.chkAll.checked;" & vbCrLf
  90. Response.Write " if (e.checked){hL(e,tagname)};else{dL(e,tagname)};" & vbCrLf
  91. Response.Write " }" & vbCrLf
  92. Response.Write " }" & vbCrLf
  93. Response.Write "}" & vbCrLf
  94. Response.Write "function hL(E,tagname){" & vbCrLf
  95. Response.Write " while (E.tagName!=tagname) {E=E.parentElement;}" & vbCrLf
  96. Response.Write " E.className='tdbg2';" & vbCrLf
  97. Response.Write "}" & vbCrLf
  98. Response.Write "function dL(E,tagname){" & vbCrLf
  99. Response.Write " while (E.tagName!=tagname) {E=E.parentElement;}" & vbCrLf
  100. Response.Write " E.className='tdbg';" & vbCrLf
  101. Response.Write "}" & vbCrLf
  102. Response.Write "function ConfirmDel(){" & vbCrLf
  103. Response.Write " if(document.myform.Action.value=='Del'){" & vbCrLf
  104. Response.Write " if(confirm('确定要删除选中的" & ItemName & "吗?本操作将把选中的" & ItemName & "移到回收站中。必要时您可从回收站中恢复!'))" & vbCrLf
  105. Response.Write " return true;" & vbCrLf
  106. Response.Write " else" & vbCrLf
  107. Response.Write " return false;" & vbCrLf
  108. Response.Write " }" & vbCrLf
  109. Response.Write " else if(document.myform.Action.value=='ConfirmDel'){" & vbCrLf
  110. Response.Write " if(confirm('确定要彻底删除选中的" & ItemName & "吗?彻底删除后将不能恢复!'))" & vbCrLf
  111. Response.Write " return true;" & vbCrLf
  112. Response.Write " else" & vbCrLf
  113. Response.Write " return false;" & vbCrLf
  114. Response.Write " }" & vbCrLf
  115. Response.Write " else if(document.myform.Action.value=='ClearRecyclebin'){" & vbCrLf
  116. Response.Write " if(confirm('确定要清空回收站?一旦清空将不能恢复!'))" & vbCrLf
  117. Response.Write " return true;" & vbCrLf
  118. Response.Write " else" & vbCrLf
  119. Response.Write " return false;" & vbCrLf
  120. Response.Write " }" & vbCrLf
  121. Response.Write " else if(document.myform.Action.value=='DelFromSpecial'){" & vbCrLf
  122. Response.Write " if(confirm('确定要将选中的" & ItemName & "从其所属专题中删除吗?操作成功后" & ItemName & "将不属于任何专题。'))" & vbCrLf
  123. Response.Write " return true;" & vbCrLf
  124. Response.Write " else" & vbCrLf
  125. Response.Write " return false;" & vbCrLf
  126. Response.Write " }" & vbCrLf
  127. Response.Write "}" & vbCrLf
  128. Response.Write "</SCRIPT>" & vbCrLf
  129. End Sub
  130. Public Function GetRootClass()
  131. Dim sqlRoot, rsRoot, strRoot
  132. sqlRoot = "select ClassID,ClassName,RootID,Child from class where ChannelID=" & ChannelID & " and ParentID=0 and ClassType=1 order by RootID"
  133. Set rsRoot = Conn.Execute(sqlRoot)
  134. If rsRoot.BOF And rsRoot.EOF Then
  135. strRoot = "沒有分類"
  136. Else
  137. strRoot = "|&nbsp;"
  138. Do While Not rsRoot.EOF
  139. If rsRoot(2) = RootID Then
  140. strRoot = strRoot & "<a href='" & FileName & "&ClassID=" & rsRoot(0) & "'><font color=red>" & rsRoot(1) & "</font></a> | "
  141. Else
  142. strRoot = strRoot & "<a href='" & FileName & "&ClassID=" & rsRoot(0) & "'>" & rsRoot(1) & "</a> | "
  143. End If
  144. rsRoot.MoveNext
  145. Loop
  146. End If
  147. rsRoot.Close
  148. Set rsRoot = Nothing
  149. GetRootClass = strRoot
  150. End Function
  151. Public Function GetChild_Root()
  152. Dim sqlChild, rsChild, arrParentPath, isCurrent, strChild, i
  153. If RootID <= 0 Then
  154. GetChild_Root = ""
  155. Exit Function
  156. End If
  157. sqlChild = "select ClassID,ClassName,Child from class where ChannelID=" & ChannelID & " and Depth=1 and RootID=" & RootID & " order by OrderID"
  158. Set rsChild = Conn.Execute(sqlChild)
  159. If Not (rsChild.BOF And rsChild.EOF) Then
  160. i = 1
  161. arrParentPath = Split(ParentPath, ",")
  162. strChild = "<tr style='background:#f2f4f6;border-top:#FFF solid 1px;border-bottom:#c1c8d2 solid 1px;padding:0 20px'><td>"
  163. Do While Not rsChild.EOF
  164. If Depth <= 1 Then
  165. If rsChild(0) = ClassID Then
  166. isCurrent = True
  167. Else
  168. isCurrent = False
  169. End If
  170. Else
  171. If PE_CLng(arrParentPath(2)) = rsChild(0) Then
  172. isCurrent = True
  173. Else
  174. isCurrent = False
  175. End If
  176. End If
  177. If isCurrent = True Then
  178. strChild = strChild & "&nbsp;&nbsp;<a href='" & FileName & "&ClassID=" & rsChild(0) & "'><font color='red'>" & rsChild(1) & "</font></a>"
  179. Else
  180. strChild = strChild & "&nbsp;&nbsp;<a href='" & FileName & "&ClassID=" & rsChild(0) & "'>" & rsChild(1) & "</a>"
  181. End If
  182. If rsChild(2) > 0 Then
  183. strChild = strChild & "(" & rsChild(2) & ")"
  184. End If
  185. If i Mod 8 = 0 Then
  186. strChild = strChild & "<br>"
  187. Else
  188. strChild = strChild & "&nbsp;&nbsp;"
  189. End If
  190. rsChild.MoveNext
  191. i = i + 1
  192. Loop
  193. strChild = strChild & "</td></tr>"
  194. End If
  195. rsChild.Close
  196. Set rsChild = Nothing
  197. GetChild_Root = strChild
  198. End Function
  199. Function GetNewID(SheetName, FieldName)
  200. Dim mrs
  201. Set mrs = Conn.Execute("select max(" & FieldName & ") from " & SheetName & "")
  202. If IsNull(mrs(0)) Then
  203. GetNewID = 1
  204. Else
  205. GetNewID = mrs(0) + 1
  206. End If
  207. Set mrs = Nothing
  208. End Function
  209. Public Function ShowClassPath()
  210. If ParentPath = "" Or IsNull(ParentPath) Then
  211. ShowClassPath = "不属于任何区域"
  212. Exit Function
  213. End If
  214. Dim strPath
  215. If Depth > 0 Then
  216. Dim rsPath
  217. Set rsPath = Conn.Execute("select * from class where ClassID in (" & ParentPath & ") order by Depth")
  218. Do While Not rsPath.EOF
  219. strPath = strPath & rsPath("ClassName") & " >> "
  220. rsPath.MoveNext
  221. Loop
  222. rsPath.Close
  223. Set rsPath = Nothing
  224. End If
  225. strPath = strPath & ClassName
  226. ShowClassPath = strPath
  227. End Function
  228. Function GetClass_Option(ShowType, CurrentID)
  229. Dim rsClass, sqlClass, strClass_Option, tmpDepth, i, ClassNum
  230. Dim arrShowLine(20)
  231. ClassNum = 1
  232. 'CurrentID = PE_CLng(CurrentID)
  233. For i = 0 To UBound(arrShowLine)
  234. arrShowLine(i) = False
  235. Next
  236. sqlClass = "Select * from class where ChannelID=" & ChannelID & " order by RootID,OrderID"
  237. Set rsClass = Conn.Execute(sqlClass)
  238. If rsClass.BOF And rsClass.EOF Then
  239. strClass_Option = strClass_Option & "<option value=''>请先添加区域</option>"
  240. Else
  241. Do While Not rsClass.EOF
  242. ClassNum = ClassNum + 1
  243. tmpDepth = rsClass("Depth")
  244. If rsClass("NextID") > 0 Then
  245. arrShowLine(tmpDepth) = True
  246. Else
  247. arrShowLine(tmpDepth) = False
  248. End If
  249. If ShowType = 1 Then
  250. If rsClass("ClassType") = 2 Then
  251. strClass_Option = strClass_Option & "<option value=''"
  252. Else
  253. strClass_Option = strClass_Option & "<option value='" & rsClass("ClassID") & "'"
  254. End If
  255. If AdminPurview = 2 Then
  256. If CheckPurview_Class(arrClass_Check, rsClass("ClassID")) = True Then
  257. strClass_Option = strClass_Option & "style='background-color:#ff0000'"
  258. End If
  259. End If
  260. ElseIf ShowType = 2 Then
  261. If rsClass("ClassType") = 2 Then
  262. strClass_Option = strClass_Option & "<option value=''"
  263. Else
  264. strClass_Option = strClass_Option & "<option value='" & rsClass("ClassID") & "'"
  265. End If
  266. If AdminPurview = 2 Then
  267. If CheckPurview_Class(arrClass_Manage, rsClass("ClassID")) = True Then
  268. strClass_Option = strClass_Option & "style='background-color:#ff0000'"
  269. End If
  270. End If
  271. ElseIf ShowType = 3 Then
  272. If rsClass("ClassType") = 2 Then
  273. strClass_Option = strClass_Option & "<option value=''"
  274. Else
  275. If rsClass("Child") > 0 Then
  276. strClass_Option = strClass_Option & "<option value='0'"
  277. Else
  278. strClass_Option = strClass_Option & "<option value='" & rsClass("ClassID") & "'"
  279. End If
  280. End If
  281. Else
  282. If rsClass("ClassType") = 2 Then
  283. strClass_Option = strClass_Option & "<option value=''"
  284. Else
  285. strClass_Option = strClass_Option & "<option value='" & rsClass("ClassID") & "'"
  286. End If
  287. End If
  288. If FoundInArr(CurrentID, rsClass("ClassID"), ",") Then
  289. strClass_Option = strClass_Option & " selected"
  290. End If
  291. strClass_Option = strClass_Option & ">"
  292. If tmpDepth > 0 Then
  293. For i = 1 To tmpDepth
  294. strClass_Option = strClass_Option & "&nbsp;&nbsp;"
  295. If i = tmpDepth Then
  296. If rsClass("NextID") > 0 Then
  297. strClass_Option = strClass_Option & "├&nbsp;"
  298. Else
  299. strClass_Option = strClass_Option & "└&nbsp;"
  300. End If
  301. Else
  302. If arrShowLine(i) = True Then
  303. strClass_Option = strClass_Option & "|"
  304. Else
  305. strClass_Option = strClass_Option & "&nbsp;"
  306. End If
  307. End If
  308. Next
  309. End If
  310. strClass_Option = strClass_Option & rsClass("ClassName")
  311. If rsClass("ClassType") = 2 Then
  312. strClass_Option = strClass_Option & "(外)"
  313. End If
  314. strClass_Option = strClass_Option & "</option>"
  315. ClassNum = ClassNum + 1
  316. rsClass.MoveNext
  317. Loop
  318. End If
  319. rsClass.Close
  320. Set rsClass = Nothing
  321. If ShowType = 3 And AdminPurview = 1 Then
  322. strClass_Option = strClass_Option & "<option value='-1'"
  323. If oCLng(CurrentID) = -1 Then strClass_Option = strClass_Option & " selected"
  324. strClass_Option = strClass_Option & ">不指定任何区域</option>"
  325. End If
  326. If ShowType = 0 And AdminPurview = 1 Then
  327. strClass_Option = strClass_Option & "<option value='-1'"
  328. If oCLng(CurrentID) = -1 Then strClass_Option = strClass_Option & " selected"
  329. strClass_Option = strClass_Option & ">不指定任何区域</option>"
  330. End If
  331. GetClass_Option = strClass_Option
  332. End Function
  333. Sub ShowForm_MoveToClass()
  334. Dim tChannelID, BatchInfoID
  335. tChannelID = Trim(Request("tChannelID"))
  336. If tChannelID = "" Then
  337. tChannelID = ChannelID
  338. Else
  339. tChannelID = CLng(tChannelID)
  340. End If
  341. BatchInfoID = ReplaceBadChar(Request("Batch" & ModuleName & "ID"))
  342. If BatchInfoID = "" Then
  343. BatchInfoID = ReplaceBadChar(Request(ModuleName & "ID"))
  344. End If
  345. Response.Write "<form method='POST' name='myform' action='" & ModuleName & ".asp' target='_self'>"
  346. Response.Write " <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
  347. Response.Write " <tr class='title'>"
  348. Response.Write " <td height='22' colspan='4' align='center'><b>批量移动" & ChannelShortName & "</td>"
  349. Response.Write " </tr>"
  350. Response.Write " <tr align='left' class='tdbg'>"
  351. Response.Write " <td valign='top' width='300'>"
  352. Response.Write " <input type='radio' name='" & ModuleName & "Type' value='1' checked>指定" & ChannelShortName & "ID:<input type='text' name='Batch" & ModuleName & "ID' value='" & BatchInfoID & "' size='30'><br>"
  353. Response.Write " <input type='radio' name='" & ModuleName & "Type' value='2'>指定区域的" & ChannelShortName & ":<br><select name='BatchClassID' size='2' multiple style='height:240px;width:300px;'>" & GetClass_Option(channelid, 0) & "</select><br>"
  354. Response.Write " <input type='button' name='Submit' value=' 选定所有区域 ' onclick='SelectAll()'>"
  355. Response.Write " <input type='button' name='Submit' value='取消选定所有区域' onclick='UnSelectAll()'>"
  356. Response.Write " </td>"
  357. Response.Write " <td align='center' >移动到&gt;&gt;</td>"
  358. Response.Write " <td valign='top'>"
  359. Response.Write " 目标区域:<font color=red>(不能指定为外部区域)</font><br><select name='tClassID' size='2' style='height:290px;width:300px;'>" & GetClass_Channel(tChannelID) & "</select>"
  360. Response.Write " </td>"
  361. Response.Write " </tr>"
  362. Response.Write " </table>"
  363. Response.Write " <p align='center'>"
  364. Response.Write " <input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
  365. Response.Write " <input name='Action' type='hidden' id='Action' value='MoveToClass'>"
  366. Response.Write " <input name='add' type='submit' id='Add' value=' 执行批处理 ' style='cursor:hand;' onClick=""document.myform.Action.value='DoMoveToClass';"">&nbsp; "
  367. Response.Write " <input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick=""window.location.href='" & ModuleName & ".asp?ChannelID=" & ChannelID & "&Action=Manage';"" style='cursor:hand;'>"
  368. Response.Write " </p>"
  369. Response.Write "</form>"
  370. Response.Write "<script language='javascript'>" & vbCrLf
  371. Response.Write "function SelectAll(){" & vbCrLf
  372. Response.Write " for(var i=0;i<document.myform.BatchClassID.length;i++){" & vbCrLf
  373. Response.Write " document.myform.BatchClassID.options[i].selected=true;}" & vbCrLf
  374. Response.Write "}" & vbCrLf
  375. Response.Write "function UnSelectAll(){" & vbCrLf
  376. Response.Write " for(var i=0;i<document.myform.BatchClassID.length;i++){" & vbCrLf
  377. Response.Write " document.myform.BatchClassID.options[i].selected=false;}" & vbCrLf
  378. Response.Write "}" & vbCrLf
  379. Response.Write "</script>" & vbCrLf
  380. End Sub
  381. Function GetClass_Channel(iChannelID)
  382. Dim rsClass, sqlClass, strClass_Option, tmpDepth, i
  383. Dim arrShowLine(20)
  384. For i = 0 To UBound(arrShowLine)
  385. arrShowLine(i) = False
  386. Next
  387. sqlClass = "Select * from Class where ChannelID=" & iChannelID & " order by RootID,OrderID"
  388. Set rsClass = Conn.Execute(sqlClass)
  389. If rsClass.BOF And rsClass.EOF Then
  390. strClass_Option = strClass_Option & "<option value=''>请先添加区域</option>"
  391. Else
  392. Do While Not rsClass.EOF
  393. tmpDepth = rsClass("Depth")
  394. If rsClass("NextID") > 0 Then
  395. arrShowLine(tmpDepth) = True
  396. Else
  397. arrShowLine(tmpDepth) = False
  398. End If
  399. If rsClass("ClassType") = 2 Then
  400. strClass_Option = strClass_Option & "<option value=''"
  401. Else
  402. If rsClass("Child") > 0 And rsClass("EnableAdd") = False Then
  403. strClass_Option = strClass_Option & "<option value='0'"
  404. Else
  405. strClass_Option = strClass_Option & "<option value='" & rsClass("ClassID") & "'"
  406. End If
  407. End If
  408. strClass_Option = strClass_Option & ">"
  409. If tmpDepth > 0 Then
  410. For i = 1 To tmpDepth
  411. strClass_Option = strClass_Option & "&nbsp;&nbsp;"
  412. If i = tmpDepth Then
  413. If rsClass("NextID") > 0 Then
  414. strClass_Option = strClass_Option & "├&nbsp;"
  415. Else
  416. strClass_Option = strClass_Option & "└&nbsp;"
  417. End If
  418. Else
  419. If arrShowLine(i) = True Then
  420. strClass_Option = strClass_Option & "│"
  421. Else
  422. strClass_Option = strClass_Option & "&nbsp;"
  423. End If
  424. End If
  425. Next
  426. End If
  427. strClass_Option = strClass_Option & rsClass("ClassName")
  428. If rsClass("ClassType") = 2 Then
  429. strClass_Option = strClass_Option & "(外)"
  430. End If
  431. strClass_Option = strClass_Option & "</option>"
  432. rsClass.MoveNext
  433. Loop
  434. End If
  435. rsClass.Close
  436. Set rsClass = Nothing
  437. strClass_Option = strClass_Option & "<option value='-1'>未指定任何区域</option>"
  438. GetClass_Channel = strClass_Option
  439. End Function
  440. Function FilterArrNull(ByVal ArrString, ByVal CompartString)
  441. Dim arrContent, arrTemp, i
  442. If CompartString = "" Or ArrString = "" Then
  443. FilterArrNull = ArrString
  444. Exit Function
  445. End If
  446. If InStr(ArrString, CompartString) = 0 Then
  447. FilterArrNull = ArrString
  448. Exit Function
  449. Else
  450. arrContent = Split(ArrString, CompartString)
  451. For i = 0 To UBound(arrContent)
  452. If Trim(arrContent(i)) <> "" Then
  453. If arrTemp = "" Then
  454. arrTemp = Trim(arrContent(i))
  455. Else
  456. arrTemp = arrTemp & CompartString & Trim(arrContent(i))
  457. End If
  458. End If
  459. Next
  460. End If
  461. FilterArrNull = arrTemp
  462. End Function
  463. %>