PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/Wap/Space/Show_News.asp

https://github.com/joechen2010/health
ASP | 76 lines | 74 code | 2 blank | 0 comment | 0 complexity | 4885986112ee1f7d662efe09f3ea1bbf MD5 | raw file
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
  3. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
  4. <!--#include file="../Conn.asp"-->
  5. <!--#include file="../KS_Cls/Kesion.CommonCls.asp"-->
  6. <!--#include file="../KS_Cls/Kesion.Label.CommonCls.asp"-->
  7. <!--#include file="../KS_Cls/Kesion.SpaceCls.asp"-->
  8. <%
  9. Dim KSCls
  10. Set KSCls = New Show_Product
  11. KSCls.Kesion()
  12. Set KSCls = Nothing
  13. Class Show_Product
  14. Private KS,KSBCls,KSRFObj,str
  15. Private UserName,Template,BlogName
  16. Private Sub Class_Initialize()
  17. Set KS=New PublicCls
  18. Set KSBCls=New BlogCls
  19. Set KSRFObj=New Refresh
  20. End Sub
  21. Private Sub Class_Terminate()
  22. Set KS=Nothing
  23. Set KSBCls=Nothing
  24. Set KSRFObj=Nothing
  25. End Sub
  26. Public Sub Kesion()
  27. If KS.SSetting(0)=0 Then
  28. Call KS.ShowError("对不起!","对不起,本站点关闭空间站点功能!")
  29. End If
  30. UserName=KS.S("i")
  31. If UserName="" Then Response.End()
  32. Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
  33. RS.Open "Select top 1 * From KS_Blog Where UserName='" & UserName & "'",Conn,1,1
  34. If RS.Eof And RS.Bof Then
  35. Call KS.ShowError("该用户没有开通空间站点!","该用户没有开通空间站点!")
  36. End If
  37. BlogName=RS("BlogName")
  38. Template="<wml>" &vbcrlf
  39. Template=Template & "<head>" &vbcrlf
  40. Template=Template & "<meta http-equiv=""Cache-Control"" content=""no-Cache""/>" &vbcrlf
  41. Template=Template & "<meta http-equiv=""Cache-Control"" content=""max-age=0""/>" &vbcrlf
  42. Template=Template & "</head>" &vbcrlf
  43. Template=Template & "<card id=""main"" title=""{$ShowTitle}-" & BlogName & """>" &vbcrlf
  44. Template=Template & KSRFObj.LoadTemplate(KS.WSetting(23))'企业主模板
  45. Template=KSBCls.ReplaceBlogLabel(RS,Template)
  46. Template=KSBCls.ReplaceAllLabel(UserName,Template)
  47. Template=Replace(Template,"{$BlogMain}",ShowNews)
  48. Template=Template & "</card>" &vbcrlf
  49. Template=Template & "</wml>" &vbcrlf
  50. Response.Write Template
  51. RS.Close:Set RS=Nothing
  52. End Sub
  53. Function ShowNews()
  54. Dim SQL,i,RS,PhotoUrl
  55. str="【查看新闻】<br/>"
  56. Set RS=Server.CreateObject("ADODB.RECORDSET")
  57. RS.Open "Select top 1 * From KS_EnterPriseNews Where UserName='" & UserName & "' and ID=" & KS.ChkClng(KS.S("ID")) ,conn,1,1
  58. If RS.EOF and RS.Bof Then
  59. str=str & "参数传递出错!<br/>"
  60. Else
  61. Template=Replace(Template,"{$ShowTitle}",RS("Title"))
  62. str=str & "" & RS("Title") & "<br/>"
  63. str=str & "作者:" & UserName & " 时间:" & RS("AddDate") & "<br/>"
  64. Dim Content
  65. Content=KS.UBBToHTML(KS.LoseHtml(KS.HTMLToUBB(KS.ReplaceTrim(KS.GetEncodeConversion(RS("Content"))))))
  66. str=str & KS.ContentPagination(Content,200,"Show_News.asp?i=" & UserName & "&amp;ID=" & KS.S("ID") & "&amp;" & KS.WapValue & "",True,True)
  67. str=str & " <br/><anchor>[返回公司动态]<prev/></anchor><br/>"
  68. End If
  69. str=str &"<br/>"
  70. ShowNews=str
  71. RS.Close:Set RS=Nothing
  72. End Function
  73. End Class
  74. %>