PageRenderTime 30ms CodeModel.GetById 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Wap/Space/Index.asp

https://github.com/joechen2010/health
ASP | 137 lines | 122 code | 12 blank | 3 comment | 0 complexity | 1e0cd083aa9fc27bd31e5c5cdd046fde 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. <!--#include file="SpaceCls.asp"-->
  9. <%
  10. Dim KSCls
  11. Set KSCls = New BlogIndex
  12. KSCls.Kesion()
  13. Set KSCls = Nothing
  14. Class BlogIndex
  15. Private KS,KSSCls,KSBCls,KSRFObj
  16. Private UserName,BlogName,Template,UserType
  17. Private Sub Class_Initialize()
  18. Set KS=New PublicCls
  19. Set KSBCls=New BlogCls
  20. Set KSRFObj=New Refresh
  21. End Sub
  22. Private Sub Class_Terminate()
  23. Call CloseConn()
  24. Set KS=Nothing
  25. Set KSSCls=Nothing
  26. Set KSBCls=Nothing
  27. Set KSRFObj=Nothing
  28. End Sub
  29. Public Sub Kesion()
  30. If KS.SSetting(0)=0 Then
  31. Call KS.ShowError("对不起!","对不起,本站点关闭空间站点功能!")
  32. End If
  33. 'If Request.ServerVariables("QUERY_STRING")<>"" Then
  34. If Request.QueryString("i")<>"" Then
  35. Call Show()
  36. Else
  37. Dim FileContent
  38. FileContent = KSRFObj.LoadTemplate(KS.WSetting(29))
  39. FileContent = KSRFObj.KSLabelReplaceAll(FileContent)
  40. FileContent = KS.GetEncodeConversion(FileContent)
  41. Response.Write FileContent
  42. End If
  43. End Sub
  44. Sub Show()
  45. UserName=KS.R(KS.S("i"))
  46. If UserName="" Then Response.End()
  47. Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
  48. RS.Open "Select top 1 * From KS_Blog Where UserName='" & UserName & "'",Conn,1,1
  49. If RS.Eof And RS.Bof Then
  50. RS.Close:Set RS=Nothing
  51. Call KS.ShowError("该用户没有开通空间站点!","该用户没有开通空间站点!")
  52. End If
  53. If KSUser.GroupID<>4 Then
  54. If RS("Status")=0 Then
  55. RS.Close:Set RS=Nothing
  56. Call KS.ShowError("该空间站点尚未审核!","该空间站点尚未审核!")
  57. ElseIf RS("Status")=2 Then
  58. RS.Close:Set RS=Nothing
  59. Call KS.ShowError("该空间站点已被管理员锁定!","该空间站点已被管理员锁定!")
  60. End If
  61. End If
  62. BlogName=RS("BlogName")
  63. Template="<wml>" &vbcrlf
  64. Template=Template & "<head>" &vbcrlf
  65. Template=Template & "<meta http-equiv=""Cache-Control"" content=""no-Cache""/>" &vbcrlf
  66. Template=Template & "<meta http-equiv=""Cache-Control"" content=""max-age=0""/>" &vbcrlf
  67. Template=Template & "</head>" &vbcrlf
  68. Template=Template & "<card id=""main"" title=""" & BlogName & """>" &vbcrlf
  69. UserType=KS.ChkClng(Conn.Execute("Select top 1 UserType From KS_User Where UserName='" & UserName & "'")(0))
  70. If UserType=1 Then
  71. Template=Template & KSRFObj.KSLabelReplaceAll(KSRFObj.LoadTemplate(KS.WSetting(23)))'企业主模板
  72. Else
  73. Template=Template & KSRFObj.KSLabelReplaceAll(KSRFObj.LoadTemplate(KS.WSetting(20)))'个人主模板
  74. End If
  75. Template=KSBCls.ReplaceBlogLabel(RS,Template)
  76. Template=KSBCls.ReplaceAllLabel(UserName,Template)
  77. RS.Close:Set RS=Nothing
  78. Action=KS.S("Action")
  79. Set KSSCls=New SpaceCls
  80. Select Case Action
  81. Case "friend"
  82. Template=Replace(Template,"{$BlogMain}",KSSCls.FriendList)
  83. Case "group"
  84. Template=Replace(Template,"{$BlogMain}",KSSCls.GroupList)
  85. Case "photo"
  86. Template=Replace(Template,"{$BlogMain}",KSSCls.PhotoList)
  87. Case "log"
  88. Template=Replace(Template,"{$BlogMain}",KSSCls.LogList)
  89. Case "guest"
  90. Template=Replace(Template,"{$BlogMain}",KSSCls.GuestList)
  91. Case "info"
  92. Template=Replace(Template,"{$BlogMain}",KSSCls.UserInfo)
  93. Case "xx" Template=Replace(Template,"{$BlogMain}",KSSCls.xxList)
  94. Case "job" Template=Replace(Template,"{$BlogMain}",KSSCls.EnterPriseJob)
  95. Case "news" Template=Replace(Template,"{$BlogMain}",KSSCls.EnterpriseNews)
  96. case "intro" Template=Replace(Template,"{$BlogMain}",KSSCls.EnterpriseIntro)
  97. case "product" Template=Replace(Template,"{$BlogMain}",KSSCls.EnterprisePro)
  98. Case Else
  99. Template=Replace(Template,"{$BlogMain}",GetMain)
  100. End Select
  101. Template=Template & "</card>" &vbcrlf
  102. Template=Template & "</wml>" &vbcrlf
  103. Response.Write Template
  104. End Sub
  105. Function GetMain()
  106. Dim I,TemplateSub
  107. If UserType=1 Then
  108. TemplateSub=KSRFObj.LoadTemplate(KS.WSetting(24))'企业首页副模板
  109. Else
  110. TemplateSub=KSRFObj.LoadTemplate(KS.WSetting(21))'个人首页副模板
  111. End If
  112. TemplateSub=Replace(TemplateSub,"{$ShowNewAlbum}",GetNewAlbum)'照片
  113. TemplateSub=Replace(TemplateSub,"{$ShowNewInfo}",KSSCls.ListXX)'10条信息集
  114. '=================企业空间替换==========================
  115. TemplateSub=Replace(TemplateSub,"{$ShowNews}",GetEnterPriseNews)'公司动态
  116. TemplateSub=Replace(TemplateSub,"{$ShowSupply}",GetSupply)'供应信息
  117. TemplateSub=Replace(TemplateSub,"{$ShowProduct}",GetProduct)'最新产品
  118. TemplateSub=Replace(TemplateSub,"{$ShowProductList}",GetProductList)'文本方式显示最新产品
  119. TemplateSub=Replace(TemplateSub,"{$ShowIntro}",GetEnterpriseintro)'企业简介
  120. TemplateSub=Replace(TemplateSub,"{$ShowShortIntro}",GetEnterpriseShortintro)'企业简介(短)
  121. '========================================================
  122. GetMain=KSBCls.ReplaceAllLabel(UserName,TemplateSub)
  123. End Function
  124. End Class
  125. %>