updateFunction.asp
上传用户:rblchem
上传日期:2022-04-27
资源大小:1941k
文件大小:20k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <script language="JavaScript" runat="server">
  2. function rfc_to_iso(DataRCC){
  3. var dateTimeObject = new Date(DataRCC);
  4. if(isNaN(dateTimeObject)){
  5.    var dateTimeObject2 = new Date(DataRCC.substring(0,DataRCC.lastIndexOf(" ")));
  6.    if (isNaN(dateTimeObject2)){
  7.            return DataRCC;
  8.    }
  9.    else{
  10.    return dateTimeObject2.toLocaleString();
  11.            }    
  12. }
  13. else{
  14. return dateTimeObject.toLocaleString();
  15. }
  16. }
  17. </script>
  18. <%
  19. Public ISUserUpdate,BLOGURL
  20. db="../data/"&dbname
  21. %>
  22. <!-- #include file="conn.asp" -->
  23. <!-- #include file="RegExpFunction.asp" -->
  24. <%
  25. IF ISServerScriptTimeout=1 Then
  26. Server.ScriptTimeout=Server_ScriptTimeout
  27. End IF
  28. Function FilterSQL(strSQL)
  29. FilterSQL=CStr(Replace(strSQL,chr(39),chr(39)&chr(39)))
  30. End Function
  31. Function StrangeTOISO(DataRCC)
  32. StrangeTOISO=ReplaceStr(DataRCC,"(?:D*)(d+)D(d+)D(d+)D(d+)D(d+)D(d+)(?:.*)","$1-$2-$3 $4:$5:$6")
  33. End function
  34. Function RegExpTest(patrn, strng)
  35. Dim regEx, retVal 
  36. Set regEx = New RegExp 
  37. regEx.Pattern = patrn  
  38. regEx.IgnoreCase = False  
  39. RegExpTest = regEx.Test(strng) 
  40. End Function
  41. Function GetList(ID)
  42. SET conn=connectDB()
  43.  set rs=server.createobject("adodb.recordset")
  44.  If ID=1 Then
  45.  sql="select * from [linkxml] where Category_id="&Request.QueryString("id")&" and Shenhe=1"
  46.  End IF
  47.  If ID=2 Then
  48.  sql="select * from [linkxml] where Shenhe=1"
  49.  End IF
  50.  rs.open sql,conn,1,3 
  51.  for i=1 to rs.recordcount
  52.  List=List&rs(0)&"|"
  53.  rs.movenext
  54.  Next
  55.  rs.close:set rs=nothing
  56.  closedb(conn)
  57.  GetList=List
  58. End Function
  59. Function ListReport(ID)
  60.              List=GetList(ID)
  61.  If trim(list)="" then exit function
  62.  session(SessionStr&"UpDateListByCategory")=List
  63.  List2=split(List,"|")
  64.  session(SessionStr&"ListTotalNumber")=Ubound(List2)
  65.  session(SessionStr&"UpdatePercentage")=0
  66.    session(SessionStr&"report")=""
  67.  Response.redirect "update_xml.asp?action=UpdateBySession"
  68. End Function
  69. Function ReplaceStr(source,para,str)
  70.   Set objRegExp=New RegExp
  71.   objRegExp.IgnoreCase =True
  72.   objRegExp.Global=True
  73.   objRegExp.Pattern=para
  74.   ReplaceStr= objRegExp.Replace(source,str)
  75.   Set objRegExp=Nothing
  76. End Function
  77. Function Showerr_Desciption(ErrorID)
  78. Set conn=ConnectDB()
  79. Set RS=conn.execute ("select * from [ErrHandle] where [ErrorID]=" & ErrorID )
  80. If not rs.eof Then
  81. Showerr_Desciption=" 错误代码:"&RS(0)&",错误描述:"&RS(1)&"&nbsp;"&RS(2)
  82. Else
  83. Showerr_Desciption="错误库中没有关于代码为"&ErrorID&"的描述,请向<a href=""http://www.sxna.cn"" target=_blank>www.sxna.cn</a>报告此问题"
  84. End IF
  85. rs.close:set rs=nothing
  86. CloseDB(conn)
  87. End Function
  88. Function Shengcheng(UpdateCatId,XmlId)
  89. Set conn=ConnectDB()
  90. APPLICATION.LOCK
  91. application(SessionStr&"SXNA_NOWTIME") = now()
  92. APPLICATION.UNLOCK
  93. If UpdateCatId<>"" and XmlId="" Then 
  94.     sql="select * from [linkxml] where Category_id="&UpdateCatId&" and Shenhe=1"
  95. Else
  96.     If UpdateCatId="" and XmlId<>"" Then 
  97.     sql="select * from [linkxml] where id="&XmlId&" and Shenhe=1"
  98.     Else
  99. sql="select * from [linkxml] where Shenhe=1"
  100. End If
  101. End If 
  102. set rs=server.createobject("adodb.recordset")
  103.     rs.open sql,conn,1,3 
  104.     DBcount=rs.recordcount
  105. Redim XMLLINK(DBcount)
  106. Redim XMLLINKID(DBcount)
  107. Redim XMLLINKLastUpdateTime(DBcount)
  108. Redim XMLLINKInteval(DBcount)
  109. Redim XMLLINKAggregateNumber(DBcount)
  110. Redim XMLLINKcategory_id(DBcount)
  111. Redim XMLLINKlastupdatetime(DBcount)
  112. Redim XMLLINKElements(DBcount)
  113. Redim XMLLINKHtmlURL(DBcount)
  114. for i = 1 to DBcount
  115. if rs.EOF then     
  116. Exit For 
  117. end if
  118. XMLLINK(i)=rs("linkxml")
  119. XMLLINKID(i)=rs("id")
  120. XMLLINKcategory_id(i)=rs("category_id")
  121. XMLLINKInteval(i)=rs("Inteval")
  122.         XMLLINKAggregateNumber(i)=rs("AggregateNumber")
  123. XMLLINKlastupdatetime(i)=rs("lastupdatetime")
  124. XMLLINKElements(i)=rs("Elements")
  125. XMLLINKHtmlURL(i)=rs("htmlUrl")
  126. rs.MoveNext
  127. Next
  128. rs.close:set rs=nothing
  129. CloseDB(conn)
  130. for j=1 to DBcount
  131. call InputXML(XMLLINKcategory_id(j),XMLLINK(j),XMLLINKID(j),XMLLINKInteval(j),XMLLINKAggregateNumber(j),XMLLINKlastupdatetime(j),XMLLINKElements(j),XMLLINKHtmlURL(j))
  132. next
  133. ShengCheng=True
  134. End Function
  135. Function Showerr(msg1,msg2,msg3)
  136. Report=Report& "<tr><td width=""80%"">"&msg1&"</td><td width=""20%"">"&msg2&"</td></tr><tr><td colspan=""2"">"&msg3&"</td></tr>"
  137. End Function
  138. Function InputXML(XLC_ID,RSSLINK_S,RSSLINKID_S,XMLLINKInteval,XMLLINKAggregateNumber,XMLLINKlastupdatetime,XMLLINKElements,XMLLINKHtmlURL)
  139. On Error Resume Next
  140. IF CheckRights2=False then
  141. If DateDiff("n",XMLLINKlastupdatetime,now())<XMLLINKInteval then
  142. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">未下载</td></tr><tr><td colspan=""2"">允许更新时间未到,上次更新时间是"&XMLLINKlastupdatetime&",允许前台更新时间为"&XMLLINKInteval&"分钟,现在过了"&DateDiff("n",XMLLINKlastupdatetime,now())&"分钟</td></tr>"
  143. Exit Function
  144. End IF
  145. End IF
  146. If isnull(XMLLINKElements) or trim(XMLLINKElements)="" then
  147. Report=Report&"<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">未设置元素</td></tr><tr><td colspan=""2"">请进行[重载]或[站点重载],设置提取元素.</td>"
  148. Exit Function
  149. Else
  150. elements=split(XMLLINKElements,"|||")
  151. End if
  152. If IsUseXmlHttp=1 then
  153.             On Error Resume Next
  154. Set http=Server.CreateObject("Microsoft.XMLHTTP")
  155. http.Open "GET",RSSLINK_S,False
  156. If Err Then
  157. Report=Report&"<tr><td colspan=""2"">您的地址有错误.请检查"&Err.Number&Err.description&"</td><tr>"
  158. Err.Clear
  159. set http=nothing
  160. Exit Function
  161. End If
  162. http.send
  163. Else        
  164.             on error resume next
  165.             Dim http
  166. Set http = Server.CreateObject("Msxml2.ServerXMLHTTP")
  167. http.setTimeouts lResolve*1000,lConnect*1000,lSend*1000,lReceive*1000
  168. http.Open "GET",RSSLINK_S,False
  169. http.Send
  170.             'response.write Err.Number&Err.Description&http.readyState
  171. 'response.end
  172. Select Case http.readyState
  173. Case 0
  174. call Showerr("对象初始化失败,估计你输入了一堆无效的字符....","请检查一下~","错误参数:"&Err.Number&Err.Description)
  175. Err.Clear
  176. set http=nothing
  177. Exit Function
  178. Case 1
  179. call Showerr(RSSLINK_S&"域名分析超时/连接站点超时!也许是这个网站有问题,或许是超时设定太短,或许机器没有联网","请检查","错误参数:"&Err.Number&Err.Description)
  180. Err.Clear
  181. set http=nothing
  182. Exit Function
  183. Case 2
  184. call Showerr(RSSLINK_S&"发送数据请求超时,是不是服务器出故障了?","请检查","错误参数:"&Err.Number&Err.Description)
  185. Err.Clear
  186. set http=nothing
  187. Exit Function
  188. Case 3
  189. ContentLength=http.GetResponseHeader("Content-Length")
  190. If err.number=-2147012746 then
  191. Call Showerr(RSSLINK_S&"数据下载超时/等待反馈时间超时","原因如下","没有获得文件大小的信息,估计网站有问题,可能是你的等待反馈时间超时设定太短")
  192. Else
  193.     Call Showerr(RSSLINK_S&"数据下载超时/等待反馈时间超时","原因如下","该文件大小"&Formatnumber(ContentLength/1000,2)&"KB,下载过程中超过你设定的等待反馈时间超时时间,可能是你的等待反馈时间超时设定太短了,或许这个网站他就是慢...")
  194. End If
  195. Err.Clear
  196. set http=nothing
  197. Exit Function
  198. Case 4
  199.     ErrContentLength=0
  200. ContentLength=http.GetResponseHeader("Content-Length")
  201. If err.number=-2147012746 then
  202. If http.Status=200 Then
  203. ErrContentLength=1   
  204. End If
  205. Err.clear
  206. ElseIf err.number<>0 then
  207. call Showerr(RSSLINK_S&"有未知错误发生","有错误","错误参数:"&Err.Number&Err.Description)
  208. Err.Clear
  209. set http=nothing
  210. Exit Function
  211. Else
  212. End If
  213. End Select
  214. End If
  215. If http.status<>200  then
  216. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">下载失败,描述如下</td></tr><tr><td colspan=""2"">"&Showerr_Desciption(http.status)&"</td></tr>"
  217. Err.Clear
  218. set http=nothing
  219. Exit Function
  220. END IF
  221. If http.status="200" then'1
  222.     If ErrContentLength=1 then
  223. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"(没找到文件长度信息)</td><td width=""20%"">下载成功</td></tr>"
  224. Else
  225. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">下载成功</td></tr>"
  226. End If
  227. Set xml=Server.CreateObject("Microsoft.XMLDOM")
  228. xml.Async=False
  229. xml.ValidateOnParse=False
  230. xml.Load(http.ResponseBody)
  231. Set http=Nothing
  232. If xml.ReadyState=4 Then'2
  233. If xml.parseError.errorCode <> 0 Then'3
  234. Report=Report& "<tr><td colspan=""2"">解析失败,此文件不是XML文件</td></tr>"
  235. set xml=nothing
  236. Exit Function
  237. Else
  238.        '获取链接
  239. If elements(0)="RSS" then
  240.    Set channel=xml.documentElement.selectSingleNode("channel")
  241.    Set item=xml.getElementsByTagName("item")
  242. Else' elements(0)="Atom" then
  243.    Set channel=xml.getElementsByTagName("feed")
  244.    set channel=channel(0)
  245.    Set item=xml.getElementsByTagName("entry")
  246. End if'If elements(0)="rss"
  247.     Rs_link2=XMLLINKHtmlURL
  248. BLOGURL=XMLLINKHtmlURL
  249.   If ((XMLLINKAggregateNumber)>(item.Length)) then
  250. ItemNum=item.Length
  251.    Else
  252. ItemNum=XMLLINKAggregateNumber
  253.   End if
  254. redim RS_title(ItemNum)
  255. redim RS_Author(ItemNum)
  256. redim RS_pubDate(ItemNum)
  257. redim RS_link(ItemNum)
  258. redim RS_Description(ItemNum)
  259. For i=0 To ItemNum-1
  260. If elements(0)="RSS" then
  261. '链接获取
  262. RS_link(i)=item(i).selectSingleNode(elements(9)).text
  263. '作者获取
  264. If elements(2)="Multi" then
  265.     RS_Author(i)=item(i).selectSingleNode(elements(3)).text
  266. If elements(14)="0" Then
  267. RS_Author(i)=RegExpHtml(RS_Author(i),RegExpType_Author)
  268. Else
  269. RS_Author(i)=RegExpHtml(RS_Author(i),elements(14))
  270. End IF
  271. Else
  272. RS_Author(i)=elements(4)
  273. End if
  274. Else
  275. '链接获取
  276. RS_link(i)=item(i).selectSingleNode(elements(9)).getAttributeNode("href").value
  277. '作者获取
  278. If elements(2)="Multi" then
  279. RS_Author(i)=item(i).selectSingleNode("author").selectSingleNode(elements(3)).text
  280. If elements(14)="0" Then
  281. RS_Author(i)=RegExpHtml(RS_Author(i),RegExpType_Author)
  282. Else
  283. RS_Author(i)=RegExpHtml(RS_Author(i),elements(14))
  284. End IF
  285. Else
  286. RS_Author(i)=elements(4)
  287. End if
  288. End IF
  289. '标题获取
  290. RS_title(i)=item(i).selectSingleNode(elements(1)).text
  291. If elements(13)="0" Then
  292.                 RS_title(i)=RegExpHtml(RS_title(i),RegExpType_Title)
  293. Else
  294. RS_title(i)=RegExpHtml(RS_title(i),elements(13))
  295.                 End If
  296. If isIntercept_title=1 then
  297. RS_title(i)=Left(RS_title(i),InterceptTitle)
  298. Else
  299. RS_title(i)=RS_title(i)
  300. End If
  301. '时间获取
  302. set pubDate=item(i).selectSingleNode(elements(5))
  303. If pubdate is nothing then
  304. Report=Report& "<tr><td colspan=""2"">时间设置有错误,老兄若实在搞不定,请提交"&RSSLINK_S&"到<A HREF=""http://www.sxna.cn"" target=""_blank"">SXNA交流论坛</A></tr></td>"
  305. Exit function
  306. set xml=nothing
  307. Else
  308. If elements(6)="Type1" then
  309. RS_pubDate(i)=StrangeTOISO(pubdate.text)
  310. End IF
  311. If elements(6)="Type2" then
  312. RS_pubDate(i)=rfc_to_iso(pubdate.text)
  313. End IF
  314. If elements(6)="Type3" then
  315. RS_pubDate(i)=ReplaceStr(pubdate.text,elements(7),elements(8))
  316. End IF
  317. End IF
  318.                     RS_Description(i)=item(i).selectSingleNode(elements(10)).text
  319. If DisplayDescriptionType=1 then
  320. RS_Description(i)=RS_Description(i)
  321. Else
  322.     '先判断转化模式
  323. If Elements(11)="0" Then
  324. '应用全局设定转化模式
  325. RS_Description(i)=RegExpHtml(RS_Description(i),RegExpType_Discription)
  326. Else
  327. '应用特定转化模式
  328. RS_Description(i)=RegExpHtml(RS_Description(i),Elements(11))
  329. End If
  330. '截取字符
  331. If Elements(12)="" Then
  332. '应用全局设定截取字符
  333. IF isIntercept_description=0 then
  334. RS_Description(i)=RS_Description(i)
  335. Else
  336. RS_Description(i)=Left(RS_Description(i),cint(InterceptDescriptin))
  337. End If
  338. Else
  339. '应用特定截取字符
  340. RS_Description(i)=Left(RS_Description(i),cint(Elements(12)))
  341. End If
  342. End IF
  343. RS_title(i)=EncodeJP(RS_title(i))
  344. RS_Description(i)=EncodeJP(RS_Description(i))
  345. Next
  346. SuccessFlag=1
  347.       End If ' 3 parseError.errorCode <> 0
  348. Else'2 
  349. Report=Report&"文档还未准备就绪。状态:"& xml.ReadyState &"<br>"
  350.     End If '2 xml ReadyState2
  351. End if '1 下载成功
  352. Set xml=Nothing
  353. If SuccessFlag=1 Then
  354. 'on error resume next
  355.     
  356.     Report=Report& "<tr><td colspan=""2"">解析完成,"
  357. Set CONN=ConnectDB()
  358.     If IsStoreArticle=0 then
  359. CONN.execute "delete * from Article where xmlid="&RSSLINKID_S
  360. End If
  361.     '初始化计数器
  362.     SuccessNumber=0
  363. '成功存入的数目
  364.     BadFilterNumber=0
  365. '过滤掉的数目
  366. BadFilterNumberButIn=0
  367.     '过滤掉字符但是入库了的数目
  368. OverlapNumber=0
  369. '重复的文章/更新的文章数目
  370. UnKnownErrNumber=0
  371. '未知错误条数
  372. TimeExceed=0
  373. '超前的文章时间
  374. TimeErrNumber=0
  375. '时间错误的文章数(...累死我了)
  376.     
  377.     For i=0 To ItemNum-1
  378.     
  379. If ISDate(RS_pubDate(i)) Then 
  380.     '如果时间条件满足,则放入相应的目录
  381.     IF DateDiff("n",RS_pubDate(i),now())>0 THEN
  382. '不储存利用时间调大的置顶文章
  383.                  RS_pubDate(i)=formatdatetime(RS_pubDate(i),2)&" "&formatdatetime(RS_pubDate(i),4)
  384.     
  385. If badfilter=0 then
  386. CONN.EXECUTE("INSERT INTO [Article] ([title],[author],[link],[pubDate],[description],[xmlid],[Category_id],[site]) VALUES ('"&FilterSQL(RS_title(i))&"','"&FilterSQL(RS_Author(i))&"','"&RS_link(i)&"','"&RS_pubDate(i)&"','"&FilterSQL(RS_Description(i))&"',"&RSSLINKID_S&","&XLC_ID&",'"&Rs_link2&"')")
  387. Else
  388.     If RegExpTest(badfilterWord, RS_title(i)) or RegExpTest(badfilterWord, RS_Description(i)) then
  389.                             '满足过滤
  390.   If badfilterMode="DeleteWord" then
  391.   '入库
  392.   RS_Description(i)=RegExpHtml(RS_Description(i),"[BadFilter]")
  393.   RS_title(i)=RegExpHtml(RS_title(i),"[BadFilter]")
  394.   BadFilterNumberButIn=BadFilterNumberButIn+1
  395. '过滤掉字符但是入库了的数目
  396.   CONN.EXECUTE("INSERT INTO [Article] ([title],[author],[link],[pubDate],[description],[xmlid],[Category_id],[site]) VALUES ('"&FilterSQL(RS_title(i))&"','"&FilterSQL(RS_Author(i))&"','"&RS_link(i)&"','"&RS_pubDate(i)&"','"&FilterSQL(RS_Description(i))&"',"&RSSLINKID_S&","&XLC_ID&",'"&Rs_link2&"')")
  397.   Report=Report&"已过滤字符(已入库):<a href="""&RS_link(i)&"""><b><font color=""#FF0000"">"&RS_title(i)&"</font></b></a><br />"
  398.   Else
  399.   '不入库
  400.   Report=Report&"已过滤(未入库):<a href="""&RS_link(i)&"""><b><font color=""#FF0000"">"&RS_title(i)&"</font></b></a><br />"
  401.   BadFilterNumber=BadFilterNumber+1
  402.   End If
  403. Else
  404. '不满足过滤
  405. CONN.EXECUTE("INSERT INTO [Article] ([title],[author],[link],[pubDate],[description],[xmlid],[Category_id],[site]) VALUES ('"&FilterSQL(RS_title(i))&"','"&FilterSQL(RS_Author(i))&"','"&RS_link(i)&"','"&RS_pubDate(i)&"','"&FilterSQL(RS_Description(i))&"',"&RSSLINKID_S&","&XLC_ID&",'"&Rs_link2&"')")
  406. End If
  407. End If
  408. If Err.number=-2147467259 Then
  409. 'Report=Report& "<a href="""&RS_link(i)&""" target=""_blank"" style=""color:red;"">"&RS_title(i)&"</a> &nbsp;有重复,未被记入<br>"
  410. err.clear
  411. CONN.EXECUTE("UPDATE [Article] set [title]='"&FilterSQL(RS_title(i))&"',[author]='"&FilterSQL(RS_Author(i))&"',[link]='"&RS_link(i)&"',[pubDate]='"&RS_pubDate(i)&"',[description]='"&FilterSQL(RS_Description(i))&"',[xmlid]="&RSSLINKID_S&",[Category_id]="&XLC_ID&",[site]='"&Rs_link2&"' WHERE [link]='"&RS_link(i)&"' ")
  412. If Err.number<>0 Then
  413. Report=Report& "错误!"&RS_link(i)&Err.number&err.description
  414. err.clear
  415. UnKnownErrNumber=UnKnownErrNumber+1
  416. Else
  417. OverlapNumber=OverlapNumber+1
  418. End If
  419. Else
  420.    If Err.number<>0 Then
  421.    Report=Report& "产生未知错误:"&RS_link(i)&Err.number&err.description&"请向www.sxna.cn报告"
  422.    err.clear
  423.    UnKnownErrNumber=UnKnownErrNumber+1
  424.    End IF
  425. End IF
  426. Else
  427. '由于时间制定而导致未被计入的不进行提示
  428. 'Report=Report&RS_title(i)&"的时间大于当前时间未被计入"
  429. TimeExceed=TimeExceed+1
  430. END IF 'IF RS_pubDate(i)<NOW() THEN 不储存利用时间调大的置顶文章
  431. Else
  432. '如果时间条件不满足
  433. TimeErrNumber=TimeErrNumber+1
  434. 'call ShowErr1(RS_title(i)&"时间"&RS_pubDate(i))
  435. End If 'If ISDate(RS_pubDate(i)) Then'如果时间条件不满足
  436. NEXT
  437. Report=Report& "要求存取"&ItemNum&"条记录"
  438.     
  439. If badfilter=1 then
  440. If BadFilterNumber<>0 then Report=Report&",过滤掉"&BadFilterNumber&"条"
  441. If BadFilterNumberButIn<>0 then Report=Report&",有"&BadFilterNumberButIn&"条中的字符被过滤掉"
  442. End If
  443.  
  444. If IsStoreArticle=1 then
  445. If (ItemNum-OverlapNumber-BadFilterNumber)<>0 then Report=Report&",有"&(ItemNum-OverlapNumber-BadFilterNumber)&"条新信息"
  446. Else
  447. If OverlapNumber<>0 then Report=Report&",有"&OverlapNumber&"条重复未计入"
  448. End If
  449. If TimeErrNumber<>0 then Report=Report&",有"&TimeErrNumber&"条时间错误未计入"
  450. If TimeExceed<>0 then Report=Report&",有"&TimeExceed&"条时间超前未计入"
  451.         
  452. If IsStoreArticle=1 then
  453. If (ItemNum-BadFilterNumber-OverlapNumber-TimeExceed-TimeErrNumber)=0 then
  454.             Report=Report& ",成功更新"&OverlapNumber&"条,没有新信息。"
  455. Else
  456. Report=Report& ",成功更新"&OverlapNumber&"条,成功存入"&(ItemNum-BadFilterNumber-OverlapNumber-TimeExceed-TimeErrNumber)&"条新信息"
  457. End If
  458. Else
  459. Report=Report& ",成功存入"&(ItemNum-BadFilterNumber-OverlapNumber-TimeExceed-TimeErrNumber)&"条。"
  460. End If
  461. Report=Report& "</td></tr>"
  462.     
  463. conn.Execute("UPDATE [linkxml] SET [lastupdatetime] = Now() WHERE [id] ="&RSSLINKID_S)
  464.     
  465. CloseDB(conn)
  466. Application.Lock
  467. Application(SessionStr&"Catelog")=empty
  468. Application(SessionStr&"Statistics")=empty
  469. Application(SessionStr&"SXNAindex")=empty
  470.         Application(SessionStr&"SXNAintPageCount")=empty
  471. Application.unlock
  472. End if
  473. End Function
  474. Public Function EncodeJP(StrHTML)
  475.     If StrHTML<>"" Then
  476.         StrHTML=Replace(StrHTML,"ガ","&#12460;")
  477.         StrHTML=Replace(StrHTML,"ギ","&#12462;")
  478.         StrHTML=Replace(StrHTML,"ア","&#12450;")
  479.         StrHTML=Replace(StrHTML,"ゲ","&#12466;")
  480.         StrHTML=Replace(StrHTML,"ゴ","&#12468;")
  481.         StrHTML=Replace(StrHTML,"ザ","&#12470;")
  482.         StrHTML=Replace(StrHTML,"ジ","&#12472;")
  483.         StrHTML=Replace(StrHTML,"ズ","&#12474;")
  484.         StrHTML=Replace(StrHTML,"ゼ","&#12476;")
  485.         StrHTML=Replace(StrHTML,"ゾ","&#12478;")
  486.         StrHTML=Replace(StrHTML,"ダ","&#12480;")
  487.         StrHTML=Replace(StrHTML,"ヂ","&#12482;")
  488.         StrHTML=Replace(StrHTML,"ヅ","&#12485;")
  489.         StrHTML=Replace(StrHTML,"デ","&#12487;")
  490.         StrHTML=Replace(StrHTML,"ド","&#12489;")
  491.         StrHTML=Replace(StrHTML,"バ","&#12496;")
  492.         StrHTML=Replace(StrHTML,"パ","&#12497;")
  493.         StrHTML=Replace(StrHTML,"ビ","&#12499;")
  494.         StrHTML=Replace(StrHTML,"ピ","&#12500;")
  495.         StrHTML=Replace(StrHTML,"ブ","&#12502;")
  496.         StrHTML=Replace(StrHTML,"ブ","&#12502;")
  497.         StrHTML=Replace(StrHTML,"プ","&#12503;")
  498.         StrHTML=Replace(StrHTML,"ベ","&#12505;")
  499.         StrHTML=Replace(StrHTML,"ペ","&#12506;")
  500.         StrHTML=Replace(StrHTML,"ボ","&#12508;")
  501.         StrHTML=Replace(StrHTML,"ポ","&#12509;")
  502.         StrHTML=Replace(StrHTML,"ヴ","&#12532;")
  503.     End If
  504.     EncodeJP=StrHTML
  505. End Function
  506. %>