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

/Wap/User/User_Blog.asp

https://github.com/joechen2010/health
ASP | 872 lines | 785 code | 50 blank | 37 comment | 10 complexity | c3987e3bb91f3360f4eeedd4f64cbf73 MD5 | raw file
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <!--#include file="../Conn.asp"-->
  3. <!--#include file="../KS_Cls/Kesion.CommonCls.asp"-->
  4. <!--#include file="../KS_Cls/Kesion.SpaceCls.asp"-->
  5. <%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
  6. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
  7. <wml>
  8. <head>
  9. <meta http-equiv="Cache-Control" content="no-Cache"/>
  10. <meta http-equiv="Cache-Control" content="max-age=0"/>
  11. </head>
  12. <card id="main" title="我的日志">
  13. <p>
  14. <%Set KS=New PublicCls%>
  15. <%
  16. IF Cbool(KSUser.UserLoginChecked)=False Then
  17. Response.redirect KS.GetDomain&"User/Login/"
  18. Response.End
  19. End If
  20. %>
  21. <%
  22. id=KS.S("id")
  23. Action=Trim(KS.S("Action"))
  24. If KS.SSetting(0)=0 Then
  25. Response.write "对不起,本站关闭个人空间功能!<br/>"
  26. ElseIf Conn.Execute("Select Count(BlogID) From KS_Blog Where UserName='"&KSUser.UserName&"'")(0)=0 Then
  27. 'Response.write "您还没有开通个人空间!<br/>"
  28. Select Case Action
  29. Case "BlogEdit"
  30. Call ApplyBlog()'申请日志
  31. Case "ApplyBlogSave"
  32. Call ApplyBlogSave()
  33. End Select
  34. ElseIf Conn.Execute("Select status From KS_Blog Where UserName='"&KSUser.UserName&"'")(0)<>1 Then
  35. Response.write "对不起,你的空间还没有通过审核或被锁定!<br/>"
  36. Else
  37. Select Case Action
  38. Case "Comment"
  39. Call Comment()'评论管理
  40. Case "ReplayComment"
  41. Call ReplayComment()'回复评论
  42. Case "SaveCommentReplay"
  43. Call SaveCommentReplay()'保存评论回复
  44. Case "CommentDel"
  45. Call CommentDel()'删除评论
  46. Case "Message"
  47. Call Message()'留言管理
  48. Case "ReplayMessage"
  49. Call ReplayMessage()'回复留言
  50. Case "SaveMessageReplay"
  51. Call SaveMessageReplay()'保存留言回复
  52. Case "MessageDel"
  53. Call MessageDel()'删除留言
  54. Case "ArticleDel"
  55. Call ArticleDel()'删除日志
  56. Case "Add","Edit"
  57. Call ArticleAdd()'添加日志
  58. Case "AddSave"
  59. Call AddSave()'发布日志
  60. Case "EditSave"
  61. Call EditSave()'日志修改
  62. Case "BlogEdit"
  63. Call ApplyBlog()'申请日志
  64. Case "ApplyBlogSave"
  65. Call ApplyBlogSave()'保存申请日志
  66. Case "rizhixuxie"
  67. Call rizhixuxie()'日志续写
  68. Case "xuxiebaocun"
  69. Call xuxiebaocun()'续写保存
  70. Case "rizhichakan"
  71. Call rizhichakan()'日志查看
  72. Case Else
  73. Call BlogList()'日志列表
  74. End Select
  75. End If
  76. '申请日志=================================================================================
  77. Sub ApplyBlog()
  78. Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
  79. RS.Open "Select * From KS_Blog Where UserName='" & KSUser.UserName &"'",Conn,1,1
  80. If Not RS.EOF Then
  81. BlogName=RS("BlogName")
  82. domain=RS("domain")
  83. ClassID=RS("ClassID")
  84. Descript=RS("Descript")
  85. Announce=RS("Announce")
  86. ContentLen=RS("ContentLen")
  87. ListBlogNum=RS("ListBlogNum")
  88. ListLogNum=RS("ListLogNum")
  89. ListReplayNum=RS("ListReplayNum")
  90. ListGuestNum=RS("ListGuestNum")
  91. OpStr="OK了,确定修改":TipStr="修改个人空间参数"
  92. Else
  93. BlogName=KSUser.UserName & "的个人空间"
  94. domain=KSUser.UserName
  95. ClassID="0"
  96. ContentLen=100
  97. ListBlogNum=3
  98. ListLogNum=3
  99. ListReplayNum=3
  100. ListGuestNum=3
  101. Announce="没有公告!"
  102. OpStr="OK了,立即申请":TipStr="申请开通个人空间"
  103. End if
  104. RS.Close:Set RS=Nothing
  105. %>
  106. <%=KS.GetReadMessage%>
  107. <%=TipStr%><br/>
  108. 空间名称:<input name="BlogName<%=minute(now)%><%=second(now)%>" type="text" value="<%=BlogName%>" maxlength="100" /><br/>
  109. 空间分类:<select name='ClassID'>
  110. <option value="0">-请选择类别-</option>
  111. <% Set RS=Server.CreateObject("ADODB.RECORDSET")
  112. RS.Open "Select * From KS_BlogClass order by orderid",conn,1,1
  113. If Not RS.EOF Then
  114. Do While Not RS.Eof
  115. Response.Write "<option value=""" & RS("ClassID") & """>" & RS("ClassName") & "</option>"
  116. RS.MoveNext
  117. Loop
  118. End If
  119. RS.Close:Set RS=Nothing
  120. %>
  121. </select><br/>
  122. 站点描述:<input name="Descript<%=minute(now)%><%=second(now)%>" type="text" value="<%=BlogName%>" maxlength="500" /><br/>
  123. 空间公告:<input name="Announce<%=minute(now)%><%=second(now)%>" type="text" value="<%=BlogName%>" maxlength="500" /><br/>
  124. 日志默认部分显示字数:<input name="ContentLen<%=minute(now)%><%=second(now)%>" type="text" value="<%=ContentLen%>" /><br/>
  125. 每页显示日志篇数:<input name="ListBlogNum<%=minute(now)%><%=second(now)%>" type="text" value="<%=ListBlogNum%>" /><br/>
  126. 显示最新回复条数:<input name="ListReplayNum<%=minute(now)%><%=second(now)%>" type="text" value="<%=ListReplayNum%>" /><br/>
  127. 显示最新日志篇数:<input name="ListLogNum<%=minute(now)%><%=second(now)%>" type="text" value="<%=ListLogNum%>" /><br/>
  128. 显示最新留言条数:<input name="ListGuestNum<%=minute(now)%><%=second(now)%>" type="text" value="<%=ListGuestNum%>" /><br/>
  129. <anchor><%=OpStr%><go href="User_Blog.asp?Action=ApplyBlogSave&amp;<%=KS.WapValue%>" method="post" accept-charset="utf-8">
  130. <postfield name='BlogName' value='$(BlogName<%=minute(now)%><%=second(now)%>)'/>
  131. <postfield name='ClassID' value='$(ClassID)'/>
  132. <postfield name='Descript' value='$(Descript<%=minute(now)%><%=second(now)%>)'/>
  133. <postfield name='Announce' value='$(Announce<%=minute(now)%><%=second(now)%>)'/>
  134. <postfield name='ContentLen' value='$(ContentLen<%=minute(now)%><%=second(now)%>)'/>
  135. <postfield name='ListBlogNum' value='$(ListBlogNum<%=minute(now)%><%=second(now)%>)'/>
  136. <postfield name='ListReplayNum' value='$(ListReplayNum<%=minute(now)%><%=second(now)%>)'/>
  137. <postfield name='ListLogNum' value='$(ListLogNum<%=minute(now)%><%=second(now)%>)'/>
  138. <postfield name='ListGuestNum' value='$(ListGuestNum<%=minute(now)%><%=second(now)%>)'/>
  139. </go></anchor>
  140. <br/>
  141. <%
  142. End Sub
  143. '保存个人空间申请=================================================================================
  144. Sub ApplyBlogSave()
  145. BlogName=KS.GotTopic(KS.S("BlogName"),16)'博客名称
  146. ClassID=KS.S("ClassID")''站点类型
  147. Descript=KS.GotTopic(KS.S("Descript"),500)'站点描述
  148. Announce=KS.GotTopic(KS.S("Announce"),500)'公告
  149. ContentLen=500'日志默认部分显示字数
  150. ListBlogNum=10'每页显示日志篇数
  151. ListLogNum=10'显示最新日志篇数
  152. ListReplayNum=10'显示最新回复条数
  153. ListGuestNum=10'显示最新留言条数
  154. Dim BlogName:BlogName=KS.S("BlogName")
  155. 'Dim Domain:Domain=KS.S("Domain")
  156. Dim ClassID:ClassID=KS.ChkClng(KS.S("ClassID"))
  157. Dim Descript:Descript=KS.S("Descript")
  158. Dim Announce:Announce=KS.S("Announce")
  159. Dim ContentLen:ContentLen=KS.ChkClng(KS.S("ContentLen"))
  160. Dim ListBlogNum:ListBlogNum=KS.ChkClng(KS.S("ListBlogNum"))
  161. Dim ListLogNum:ListLogNum=KS.ChkClng(KS.S("ListLogNum"))
  162. Dim ListReplayNum:ListReplayNum=KS.ChkClng(KS.S("ListReplayNum"))
  163. Dim ListGuestNum:ListGuestNum=KS.ChkClng(KS.S("ListGuestNum"))
  164. TemplateID=KS.ChkClng(Conn.Execute("Select Top 1 ID From KS_BlogTemplate Where flag=2 and IsDefault='true'")(0))'博客模板
  165. If BlogName="" Then
  166. Response.write "出错提示,请输入博客站点名称!<br/>"
  167. Response.Write "<a href='User_Blog.asp?action=ApplyBlog&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  168. ElseIF ClassID=0 Then
  169. Response.write "出错提示,请选择站点类型!<br/>"
  170. Response.Write "<a href='User_Blog.asp?action=ApplyBlog&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  171. 'ElseIF domain<>"" And not Conn.Execute("select username from ks_Blog where username<>'" & KSUser.UserName & "' and [domain]='" & domain &"'").eof Then
  172. 'Response.Write "对不起,你注册的二级域名已被其它用户使用!<br/>"
  173. 'Response.Write "<a href='User_Blog.asp?action=ApplyBlog&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  174. Else
  175. Set RS=Server.CreateObject("ADODB.RECORDSET")
  176. RS.Open "Select * From KS_Blog Where UserName='"&KSUser.UserName&"'",conn,1,3
  177. If RS.Eof And RS.Bof Then
  178. RS.AddNew
  179. RS("AddDate")=now'创建时间
  180. RS("TemplateID")=TemplateID'博客模板
  181. If KS.SSetting(2)=1 Then'站点状态:0未审1已审2锁定
  182. RS("Status")=0
  183. Else
  184. RS("Status")=1
  185. End If
  186. End If
  187. RS("UserName")=KSUser.UserName
  188. RS("BlogName")=BlogName
  189. RS("ClassID")=ClassID
  190. RS("Descript")=Descript
  191. RS("Announce")=Announce
  192. RS("ContentLen")=ContentLen
  193. RS("ListLogNum")=ListLogNum
  194. RS("ListBlogNum")=ListBlogNum
  195. RS("ListReplayNum")=ListReplayNum
  196. RS("ListGuestNum")=ListGuestNum
  197. RS.Update
  198. Response.write "操做成功!博客站点申请/修改成功。<br/>"
  199. Response.Write "<a href='User_Blog.asp?action=&amp;" & KS.WapValue & "'>日志列表</a><br/>"
  200. RS.Close:Set RS=Nothing
  201. End If
  202. End Sub
  203. '日志列表=================================================================================
  204. Sub BlogList()
  205. %>
  206. <%=KS.GetReadMessage%>
  207. <a href="User_Blog.asp?Action=Add&amp;<%=KS.WapValue%>">发布日志</a>
  208. <a href="User_Blog.asp?Action=Comment&amp;<%=KS.WapValue%>">日志评论</a>
  209. <br/>
  210. <%
  211. If KS.S("page") <> "" Then
  212. CurrentPage = KS.ChkClng(KS.S("page"))
  213. Else
  214. CurrentPage = 1
  215. End If
  216. Dim Param:Param=" Where UserName='"& KSUser.UserName &"'"
  217. Status=KS.S("Status")
  218. If Status<>"" and isnumeric(Status) Then
  219. Param= Param & " and Status=" & Status
  220. End If
  221. IF KS.S("Flag")<>"" Then
  222. IF KS.S("Flag")=0 Then Param=Param & " And Title like '%" & KS.S("KeyWord") & "%'"
  223. IF KS.S("Flag")=1 Then Param=Param & " And Tags like '%" & KS.S("KeyWord") & "%'"
  224. End if
  225. If KS.S("TypeID")<>"" And KS.S("TypeID")<>"0" Then Param=Param & " And TypeID=" & KS.ChkClng(KS.S("TypeID")) & ""
  226. Dim Sql:sql = "select * from KS_BlogInfo "& Param &" order by AddDate DESC"
  227. Select Case ks.s("Status")
  228. Case "0"
  229. response.write "=已审日志=<br/>"
  230. Case "1"
  231. response.write "=草稿日志=<br/>"
  232. Case "2"
  233. response.write "=未审日志=<br/>"
  234. Case Else
  235. response.write "=所有日志=<br/>"
  236. End Select
  237. %>
  238. <a href="User_Blog.asp?<%=KS.WapValue%>">所有</a>
  239. <a href="User_Blog.asp?Status=0&amp;<%=KS.WapValue%>">已审[<%=conn.execute("select count(id) from KS_BlogInfo where Status=0 and UserName='"& KSUser.UserName &"'")(0)%>]</a>
  240. <a href="User_Blog.asp?Status=2&amp;<%=KS.WapValue%>">未审[<%=conn.execute("select count(id) from KS_BlogInfo where Status=2 and UserName='"& KSUser.UserName &"'")(0)%>]</a>
  241. <a href="User_Blog.asp?Status=1&amp;<%=KS.WapValue%>">草稿[<%=conn.execute("select count(id) from KS_BlogInfo where Status=1 and UserName='"& KSUser.UserName &"'")(0)%>]</a>
  242. <br/>
  243. <%
  244. set rs=server.createobject("adodb.recordset")
  245. sql = "select * from KS_BlogInfo "& Param &" order by AddDate DESC"
  246. rs.open sql,conn,1,1
  247. if rs.bof and rs.eof then
  248. response.write "没有你要的日志!<br/>"
  249. else
  250. MaxPerPage =10
  251. totalPut = RS.RecordCount
  252. If CurrentPage < 1 Then CurrentPage = 1
  253. If (CurrentPage - 1) * MaxPerPage > totalPut Then
  254. If (totalPut Mod MaxPerPage) = 0 Then
  255. CurrentPage = totalPut \ MaxPerPage
  256. Else
  257. CurrentPage = totalPut \ MaxPerPage + 1
  258. End If
  259. End If
  260. If CurrentPage >1 and (CurrentPage - 1) * MaxPerPage < totalPut Then
  261. Rs.Move (CurrentPage - 1) * MaxPerPage
  262. Else
  263. CurrentPage = 1
  264. End If
  265. %>
  266. 搜索:<select name="Flag">
  267. <option value="0">标题</option>
  268. <option value="1">标签</option>
  269. </select>
  270. <select size='1' name='TypeID'>
  271. <option value="0">请选择分类</option>
  272. <%
  273. Dim RS1:Set RS1=Server.CreateObject("ADODB.RECORDSET")
  274. RS1.Open "Select * From KS_BlogType order by orderid",conn,1,1
  275. If Not RS1.EOF Then
  276. Do While Not RS1.Eof
  277. Response.Write "<option value=""" & RS1("TypeID") & """>" & RS1("TypeName") & "</option>"
  278. RS1.MoveNext
  279. Loop
  280. End If
  281. RS1.Close:Set RS1=Nothing
  282. %>
  283. </select>
  284. 关键字:<input type="text" name="KeyWord" class="textbox" value="关键字" size="20"/>
  285. <anchor>搜索<go href="User_Blog.asp?Status=<%=Status%>&amp;<%=KS.WapValue%>" method="post">
  286. <postfield name="Flag" value="$(Flag)"/>
  287. <postfield name="TypeID" value="$(TypeID)"/>
  288. <postfield name="KeyWord" value="$(KeyWord)"/>
  289. </go></anchor>
  290. <br/>
  291. <%
  292. Do While Not RS.Eof
  293. Response.write "---------<br/>"
  294. If Status="2" or Status="1" Then
  295. Response.write "<a href='User_Blog.asp?action=rizhichakan&amp;id="&rs("ID")&"&amp;" & KS.WapValue & "'>"&KS.GotTopic(trim(RS("title")),35)&"</a>"
  296. Else
  297. Response.write "<a href='../Space/List.asp?id="&rs("id")&"&amp;UserName="&KSUser.UserName&"&amp;" & KS.WapValue & "'>"&KS.GotTopic(trim(RS("title")),35)&"</a>"
  298. End If
  299. Select Case rs("Status")
  300. Case 0
  301. Response.Write "正常<br/>"
  302. Case 1
  303. Response.Write "草稿<br/>"
  304. Case 2
  305. Response.Write "未审<br/>"
  306. end select
  307. Response.write "分类:"&Conn.Execute("Select TypeName From KS_BlogType Where TypeID=" & RS("TypeID"))(0)&" "&formatdatetime(rs("AddDate"),2)&"<br/>"
  308. Response.Write "<a href='User_Blog.asp?action=rizhixuxie&amp;id="&rs("ID")&"&amp;" & KS.WapValue & "'>续写</a> "
  309. Response.Write "<a href='User_Blog.asp?action=Edit&amp;id="&rs("ID")&"&amp;" & KS.WapValue & "'>修改</a> "
  310. Response.Write "<a href='User_Blog.asp?action=ArticleDel&amp;id="&rs("ID")&"&amp;" & KS.WapValue & "'>删除</a><br/>"
  311. RS.MoveNext
  312. I = I + 1
  313. If I >= MaxPerPage Then Exit Do
  314. Loop
  315. Call KS.ShowPageParamter(totalPut, MaxPerPage, "User_Blog.asp", True, "篇日志", CurrentPage, "Status=" & Status &"&amp;" & KS.WapValue & "")
  316. end if
  317. rs.Close:Set rs=Nothing
  318. response.Write "---------<br/>"
  319. End Sub
  320. '日志查看=================================================================================
  321. Sub rizhichakan()
  322. Set rs=conn.execute("Select top 1 * From KS_BlogInfo Where ID="&ID&"")
  323. If Not rs.Eof Then
  324. Dim KSB:Set KSB=New BlogCls
  325. %>
  326. 标题:<%=rs("Title")%><br/>
  327. 心情:<img src="../User/images/face/<%=rs("Face")%>.gif" />
  328. 天气:<%Call KSB.GetWeather(rs)%><br/>
  329. 内容:<%=KS.ContentPage("User_Blog.asp?action=rizhichakan&amp;id="&rs("ID")&"&amp;" & KS.WapValue & "",KS.LoseHtml(rs("content")),80,False)%><br/>
  330. 时间:<%=rs("AddDate")%><br/>
  331. <a href='User_Blog.asp?action=rizhixuxie&amp;id=<%=rs("ID")%>&amp;<%=KS.WapValue%>'>续写</a>
  332. <a href='User_Blog.asp?action=Edit&amp;id=<%=rs("ID")%>&amp;<%=KS.WapValue%>'>修改</a>
  333. <a href='User_Blog.asp?action=ArticleDel&amp;id=<%=rs("ID")%>&amp;<%=KS.WapValue%>'>删除</a><br/>
  334. <a href='User_Blog.asp?action=&amp;<%=KS.WapValue%>'>日志列表</a><br/>
  335. <%
  336. Set KSB=Nothing
  337. Else
  338. Response.write "非法参数!<br/>"
  339. End If
  340. rs.close:Set rs=Nothing
  341. End Sub
  342. '删除日志=================================================================================
  343. Sub ArticleDel()
  344. Conn.Execute("Delete From KS_BlogInfo Where Status<>1 And ID="&ID&"")
  345. Response.write "日志删除成功。<br/>"
  346. Response.Write "<a href='User_Blog.asp?action=&amp;" & KS.WapValue & "'>日志列表</a><br/>"
  347. End Sub
  348. '日志续写=================================================================================
  349. Sub rizhixuxie()
  350. Set rs=conn.execute("Select Content From KS_BlogInfo Where ID="&ID&"")
  351. If Not rs.Eof Then
  352. %>
  353. =日志续写=<br/>
  354. 尾部内容:<%=Right(Rs("Content"),20)%><br/>
  355. 追加内容:<input name="Content<%=minute(now)%><%=second(now)%>" type="text" maxlength="500" size="20" value=""/><br/>
  356. <anchor>确定<go href="User_Blog.asp?Action=xuxiebaocun&amp;id=<%=id%>&amp;<%=KS.WapValue%>" method="post">
  357. <postfield name="Content" value="$(Content<%=minute(now)%><%=second(now)%>)"/>
  358. </go></anchor>
  359. <br/>
  360. <%
  361. Else
  362. Response.write "非法参数!<br/>"
  363. End If
  364. rs.close:Set rs=Nothing
  365. End Sub
  366. '续写保存=================================================================================
  367. Sub xuxiebaocun()
  368. Set rs=conn.execute("Select Content From KS_BlogInfo Where ID="&ID&"")
  369. If rs.Eof Then
  370. Response.write "非法参数!<br/>"
  371. Else
  372. Content=KS.GotTopic(KS.S("Content"),500)
  373. If Content="" Then
  374. Response.write "出错提示,你没有输入续写内容!<br/>"
  375. Response.Write "<a href='User_Blog.asp?action=rizhixuxie&amp;id="&id&"&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  376. Else
  377. Set RSObj=Server.CreateObject("Adodb.Recordset")
  378. RSObj.Open "Select Content From KS_BlogInfo Where ID="&ID,Conn,1,3
  379. RSObj("Content")=rs("Content")&Content
  380. RSObj.Update:RSObj.Close:Set RSObj=Nothing
  381. Response.write "续写成功。<br/>"
  382. Response.Write "<a href='User_Blog.asp?action=rizhichakan&amp;ID="&ID&"&amp;" & KS.WapValue & "'>日志查看</a><br/>"
  383. Response.Write "<a href='User_Blog.asp?action=&amp;" & KS.WapValue & "'>日志列表</a><br/>"
  384. End IF
  385. End If
  386. rs.close:Set rs=Nothing
  387. End Sub
  388. '添加日志=================================================================================
  389. Sub ArticleAdd()
  390. if Action="Edit" Then
  391. Set rs=Server.CreateObject("ADODB.RECORDSET")
  392. rs.Open "Select top 1 * From KS_BlogInfo Where ID="&ID,Conn,1,1
  393. If Not rs.Eof Then
  394. TypeID=rs("TypeID")
  395. ClassID=rs("ClassID")
  396. Title=rs("Title")
  397. Face=rs("Face")
  398. weather=rs("Weather")
  399. Content=rs("Content")
  400. PassWord=rs("PassWord")
  401. End If
  402. rs.Close:Set rs=Nothing
  403. Action="EditSave"
  404. OpStr="确定修改"
  405. titl="日志修改"
  406. Else
  407. Action="AddSave"
  408. OpStr="确定发布"
  409. titl="日志发布"
  410. End If
  411. %>
  412. =<%=titl%>=<br/>
  413. <%=KS.GetReadMessage%>
  414. 你的心情<select name="face">
  415. <option value="1">不错</option>
  416. <option value="2">茫然</option>
  417. <option value="3">开心</option>
  418. <option value="9">激动</option>
  419. <option value="7">郁闷</option>
  420. <option value="8">难受</option>
  421. <option value="11">寂寞</option>
  422. <option value="10">变态</option>
  423. <option value="4">其他</option>
  424. </select><br />
  425. 当天天气<select name="Weather">
  426. <option value="sun.gif">晴天</option>
  427. <option value="sun2.gif">和煦</option>
  428. <option value="yin.gif">阴天</option>
  429. <option value="qing.gif">清爽</option>
  430. <option value="yun.gif">多云</option>
  431. <option value="wu.gif">有雾</option>
  432. <option value="xiaoyu.gif">小雨</option>
  433. <option value="yinyu.gif">中雨</option>
  434. <option value="leiyu.gif">雷雨</option>
  435. <option value="caihong.gif">彩虹</option>
  436. <option value="hexu.gif">酷热</option>
  437. <option value="feng.gif">寒冷</option>
  438. <option value="xue.gif">小雪</option>
  439. <option value="daxue.gif">大雪</option>
  440. <option value="moon.gif">月圆</option>
  441. <option value="moon2.gif">月缺</option>
  442. </select><br/>
  443. 日志分类<select name='TypeID'>
  444. <option value="0">请选择日志类别</option>
  445. <%Set RS=Server.CreateObject("ADODB.RECORDSET")
  446. RS.Open "Select * From KS_BlogType order by orderid",conn,1,1
  447. If Not RS.EOF Then
  448. Do While Not RS.Eof
  449. Response.Write "<option value=""" & RS("TypeID") & """>" & RS("TypeName") & "</option>"
  450. RS.MoveNext
  451. Loop
  452. End If
  453. RS.Close
  454. Set RS=Nothing
  455. %></select><br/>
  456. 我的专栏<select name='ClassID'>
  457. <option value="0">选择我的专栏</option>
  458. <%=KSUser.UserClassOption(2,ClassID)%>
  459. </select>
  460. <br/>
  461. 日志标题<input name="Title<%=minute(now)%><%=second(now)%>" type="text" maxlength="40" value="<%=KS.LoseHtml(Title)%>"/><br/>
  462. 日志内容<input name="Content<%=minute(now)%><%=second(now)%>" type="text" maxlength="500" value="<%=KS.LoseHtml(Content)%>"/><br/>
  463. 日志密码<input name="Password<%=minute(now)%><%=second(now)%>" type="text" value="<%=PassWord%>" /><br/>
  464. <anchor><%=OpStr%><go href='User_Blog.asp?Action=<%=Action%>&amp;id=<%=id%>&amp;<%=KS.WapValue%>' method='post'>
  465. <postfield name='face' value='$(face)'/>
  466. <postfield name='Weather' value='$(Weather)'/>
  467. <postfield name='TypeID' value='$(TypeID)'/>
  468. <postfield name='ClassID' value='$(ClassID)'/>
  469. <postfield name='Title' value='$(Title<%=minute(now)%><%=second(now)%>)'/>
  470. <postfield name='Content' value='$(Content<%=minute(now)%><%=second(now)%>)'/>
  471. <postfield name='Password' value='$(Password<%=minute(now)%><%=second(now)%>)'/>
  472. </go></anchor>
  473. <anchor>放入草稿箱<go href='User_Blog.asp?Action=<%=Action%>&amp;id=<%=id%>&amp;<%=KS.WapValue%>' method='post'>
  474. <postfield name='Status' value='1'/>
  475. <postfield name='face' value='$(face)'/>
  476. <postfield name='Weather' value='$(Weather)'/>
  477. <postfield name='TypeID' value='$(TypeID)'/>
  478. <postfield name='ClassID' value='$(ClassID)'/>
  479. <postfield name='Title' value='$(Title<%=minute(now)%><%=second(now)%>)'/>
  480. <postfield name='Content' value='$(Content<%=minute(now)%><%=second(now)%>)'/>
  481. <postfield name='Password' value='$(Password<%=minute(now)%><%=second(now)%>)'/>
  482. </go></anchor>
  483. <br/>
  484. <%
  485. response.Write "---------<br/>"
  486. End Sub
  487. '日志修改=================================================================================
  488. Sub EditSave()
  489. face=KS.S("face")
  490. Weather=KS.S("Weather")
  491. TypeID=KS.S("TypeID")
  492. ClassID=KS.S("ClassID")
  493. Title=KS.GotTopic(KS.S("Title"),60)
  494. 'AddDate=S("AddDate")
  495. Content=KS.GotTopic(KS.S("Content"),500)
  496. Password=KS.S("Password")
  497. Status=KS.ChkClng(KS.S("Status"))
  498. If TypeID=0 Then
  499. Response.write "出错提示,你没有选择日志分类!<br/>"
  500. Response.Write "<a href='User_Blog.asp?action=Edit&amp;id="&id&"&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  501. 'ElseIF ClassID=0 Then
  502. ' Response.write "出错提示,你没有选择我的专栏!<br/>"
  503. ' Response.Write "<a href='User_Blog.asp?action=Edit&amp;id="&id&"&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  504. ElseIF Title="" Then
  505. Response.write "出错提示,你没有输入日志标题!<br/>"
  506. Response.Write "<a href='User_Blog.asp?action=Edit&amp;id="&id&"&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  507. 'ElseIF not isdate(adddate) Then
  508. 'Response.write "出错提示,你输入的日期不正确!<br/>"
  509. 'Response.Write "<a href='User_Blog.asp?action=Edit&amp;id="&id&"&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  510. ElseIF Content="" Then
  511. Response.write "出错提示,你没有输入日志内容!<br/>"
  512. Response.Write "<a href='User_Blog.asp?action=Edit&amp;id="&id&"&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  513. Else
  514. Set RSObj=Server.CreateObject("Adodb.Recordset")
  515. RSObj.Open "Select top 1 * From KS_BlogInfo Where ID="&ID,Conn,1,3
  516. RSObj("Title")=Title
  517. RSObj("TypeID")=TypeID
  518. RSObj("ClassID")=ClassID
  519. RSObj("UserName")=KSUser.UserName
  520. RSObj("Face")=Face
  521. RSObj("Weather")=weather
  522. RSObj("Adddate")=now()
  523. RSObj("Content")=Content
  524. RSObj("Password")=Password
  525. if status=1 then
  526. RSObj("Status")=1
  527. elseif KS.SSetting(3)=1 Then
  528. RSObj("Status")=2
  529. Else
  530. RSObj("Status")=0
  531. end if
  532. RSObj.Update
  533. RSObj.Close:Set RSObj=Nothing
  534. Response.write "操作成功。<br/>"
  535. Response.Write "<a href='User_Blog.asp?action=rizhichakan&amp;ID="&ID&"&amp;" & KS.WapValue & "'>日志查看</a><br/>"
  536. Response.Write "<a href='User_Blog.asp?action=&amp;" & KS.WapValue & "'>日志列表</a><br/>"
  537. End IF
  538. End Sub
  539. '发布日志=================================================================================
  540. Sub AddSave()
  541. face=KS.S("face")
  542. Weather=KS.S("Weather")
  543. TypeID=KS.S("TypeID")
  544. ClassID=KS.S("ClassID")
  545. Title=KS.S("Title")
  546. Tags=Trim(KS.S("Tags"))
  547. 'AddDate=S("AddDate")
  548. Content=KS.S("Content")
  549. Password=KS.S("Password")
  550. Status=KS.ChkClng(KS.S("Status"))
  551. If TypeID=0 Then
  552. Response.write "出错提示,你没有选择日志分类!<br/>"
  553. Response.Write "<a href='User_Blog.asp?action=Add&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  554. 'ElseIF ClassID=0 Then
  555. ' Response.write "出错提示,你没有选择我的专栏!<br/>"
  556. ' Response.Write "<a href='User_Blog.asp?action=Add&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  557. ElseIF Title="" Then
  558. Response.write "出错提示,你没有输入日志标题!<br/>"
  559. Response.Write "<a href='User_Blog.asp?action=Add&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  560. 'ElseIF not isdate(adddate) Then
  561. 'Response.write "出错提示,你输入的日期不正确!<br/>"
  562. 'Response.Write "<a href='User_Blog.asp?action=Add&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  563. ElseIF Content="" Then
  564. Response.write "出错提示,你没有输入日志内容!<br/>"
  565. Response.Write "<a href='User_Blog.asp?action=Add&amp;" & KS.WapValue & "'>返回重写</a><br/>"
  566. Else
  567. Set RSObj=Server.CreateObject("Adodb.Recordset")
  568. RSObj.Open "Select top 1 * From KS_BlogInfo",Conn,1,3
  569. RSObj.AddNew
  570. RSObj("Title")=Title
  571. RSObj("TypeID")=TypeID
  572. RSObj("ClassID")=ClassID
  573. RSObj("Tags")=Tags
  574. RSObj("UserName")=KSUser.UserName
  575. RSObj("Face")=Face
  576. RSObj("Weather")=weather
  577. RSObj("Adddate")=now()
  578. RSObj("Content")=Content
  579. RSObj("Password")=Password
  580. if status=1 then
  581. RSObj("Status")=1
  582. elseif KS.SSetting(3)=1 Then
  583. RSObj("Status")=2
  584. Else
  585. RSObj("Status")=0
  586. end if
  587. RSObj("Hits")=0
  588. ID=RSObj("ID")
  589. RSObj.Update
  590. RSObj.Close:Set RSObj=Nothing
  591. Response.write "操作成功。<br/>"
  592. Response.Write "<a href='User_Blog.asp?action=rizhichakan&amp;ID="&ID&"&amp;" & KS.WapValue & "'>日志查看</a><br/>"
  593. Response.Write "<a href='User_Blog.asp?action=&amp;" & KS.WapValue & "'>日志列表</a><br/>"
  594. End If
  595. End Sub
  596. '评论管理=================================================================================
  597. Sub Comment()
  598. %>
  599. =评论管理=<br/>
  600. <%
  601. Response.write KS.GetReadMessage
  602. If KS.S("page") <> "" Then
  603. CurrentPage = KS.ChkClng(KS.S("page"))
  604. Else
  605. CurrentPage = 1
  606. End If
  607. set rs=server.createobject("adodb.recordset")
  608. Dim Param:Param=" Where UserName='"& KSUser.UserName &"'"
  609. Dim Sql:sql = "select * from KS_BlogComment "& Param &" order by AddDate DESC"
  610. rs.open sql,conn,1,1
  611. if rs.bof and rs.eof then
  612. response.write "没有用户给你评论!<br/>"
  613. else
  614. MaxPerPage =3
  615. totalPut = RS.RecordCount
  616. If CurrentPage < 1 Then CurrentPage = 1
  617. If (CurrentPage - 1) * MaxPerPage > totalPut Then
  618. If (totalPut Mod MaxPerPage) = 0 Then
  619. CurrentPage = totalPut \ MaxPerPage
  620. Else
  621. CurrentPage = totalPut \ MaxPerPage + 1
  622. End If
  623. End If
  624. If CurrentPage >1 and (CurrentPage - 1) * MaxPerPage < totalPut Then
  625. Rs.Move (CurrentPage - 1) * MaxPerPage
  626. Else
  627. CurrentPage = 1
  628. End If
  629. do while not rs.eof
  630. %>
  631. 发表人:<%=RS("AnounName")%><br/>
  632. 时间:<%=formatdatetime(rs("AddDate"),2)%><br/>
  633. 评论标题:<%=KS.GotTopic(trim(RS("title")),35)%>
  634. <%
  635. if Not IsNull(RS("Replay")) or rs("replay")<>"" Then
  636. response.write "(已回复)"
  637. end if
  638. %><br/>
  639. <%if Not IsNull(RS("Replay")) or rs("replay")<>"" Then%>
  640. <a href="User_Blog.asp?id=<%=rs("id")%>&amp;Action=ReplayComment&amp;<%=KS.WapValue%>">修改回复</a>
  641. <%else%>
  642. <a href="User_Blog.asp?id=<%=rs("id")%>&amp;Action=ReplayComment&amp;<%=KS.WapValue%>">回复评论</a>
  643. <%End If%>
  644. <a href="User_Blog.asp?action=CommentDel&amp;id=<%=rs("id")%>&amp;<%=KS.WapValue%>">删除评论</a><br/>
  645. ----------<br/>
  646. <%
  647. I = I + 1
  648. If I >= MaxPerPage Then Exit Do
  649. loop
  650. Call KS.ShowPageParamter(totalPut, MaxPerPage, "User_Blog.asp", True, "条评论", CurrentPage, "Action=Comment&amp;" & KS.WapValue & "")
  651. end if
  652. rs.close
  653. End Sub
  654. '回复评论=================================================================================
  655. Sub ReplayComment()
  656. Set rs=Server.CreateObject("ADODB.RECORDSET")
  657. rs.Open "Select * From KS_BlogComment where id="&id,Conn,1,1
  658. If rs.Eof And rs.Bof Then
  659. Response.Write "参数出错!<br/>"
  660. Response.end
  661. End If
  662. Title=rs("Title")
  663. Content=rs("Content")
  664. Replay=rs("Replay")
  665. If IsNull(Replay) Then Replay=""
  666. rs.Close:Set rs=Nothing
  667. %>
  668. =回复评论=<br/>
  669. 评论标题<%=Title%><br/>
  670. 评论内容<%=KS.LoseHtml(Content)%><br/>
  671. <%if Not IsNull(Replay) or replay<>"" Then%>
  672. 回复内容<%=KS.LoseHtml(Replay)%><br/>
  673. 回复修改<input name="Replay<%=minute(now)%><%=second(now)%>" type="text" maxlength="500" size="20" value="<%=KS.LoseHtml(Replay)%>"/><br/>
  674. <%else%>
  675. 回复内容<input name="Replay<%=minute(now)%><%=second(now)%>" type="text" maxlength="500" size="20" value=""/><br/>
  676. <%End If%>
  677. <anchor>立即回复<go href="User_Blog.asp?action=SaveCommentReplay&amp;id=<%=id%>&amp;<%=KS.WapValue%>" method="post" accept-charset="utf-8">
  678. <postfield name="Replay" value="$(Replay)"/>
  679. </go></anchor>
  680. <br/>
  681. <%
  682. response.Write "---------<br/>"
  683. End Sub
  684. '保存评论回复=================================================================================
  685. Sub SaveCommentReplay()
  686. Replay=KS.S("Replay")
  687. Set RS=Server.CreateObject("ADODB.RECORDSET")
  688. RS.Open "Select * From KS_BlogComment Where ID="&ID,conn,1,3
  689. If Not RS.Eof Then
  690. RS("Replay")=Replay
  691. RS("ReplayDate")=Now
  692. RS.Update
  693. End If
  694. Response.write "评论成功回复。<br/>"
  695. Response.Write "<a href='User_Blog.asp?action=Comment&amp;" & KS.WapValue & "'>评论管理</a><br/>"
  696. RS.Close:Set RS=Nothing
  697. End Sub
  698. '删除评论=================================================================================
  699. Sub CommentDel()
  700. Conn.Execute("Delete From KS_BlogComment Where ID In("&ID&")")
  701. Response.write "评论删除成功。<br/>"
  702. Response.Write "<a href='User_Blog.asp?action=Comment&amp;" & KS.WapValue & "'>评论管理</a><br/>"
  703. End Sub
  704. '留言管理=================================================================================
  705. Sub Message()
  706. %>
  707. =留言管理=<br/>
  708. <%
  709. Response.write KS.GetReadMessage
  710. If KS.S("page") <> "" Then
  711. CurrentPage = KS.ChkClng(KS.S("page"))
  712. Else
  713. CurrentPage = 1
  714. End If
  715. Dim Param:Param=" Where UserName='"& KSUser.UserName &"'"
  716. Dim Sql:sql = "select * from KS_BlogMessage "& Param &" order by AddDate DESC"
  717. set rs=server.createobject("adodb.recordset")
  718. rs.open sql,conn,1,1
  719. if rs.bof and rs.eof then
  720. response.write "没有用户给你留言!<br/>"
  721. else
  722. MaxPerPage =3
  723. totalPut = RS.RecordCount
  724. If CurrentPage < 1 Then CurrentPage = 1
  725. If (CurrentPage - 1) * MaxPerPage > totalPut Then
  726. If (totalPut Mod MaxPerPage) = 0 Then
  727. CurrentPage = totalPut \ MaxPerPage
  728. Else
  729. CurrentPage = totalPut \ MaxPerPage + 1
  730. End If
  731. End If
  732. If CurrentPage >1 and (CurrentPage - 1) * MaxPerPage < totalPut Then
  733. Rs.Move (CurrentPage - 1) * MaxPerPage
  734. Else
  735. CurrentPage = 1
  736. End If
  737. do while not rs.eof
  738. %>
  739. 发表人:<%=RS("AnounName")%><br/>
  740. 时间:<%=rs("AddDate")%><br/>
  741. 标题:<%=trim(rs("title"))%>
  742. <%
  743. if Not IsNull(RS("Replay")) or rs("replay")<>"" Then
  744. response.write "(已回复)"
  745. end if
  746. %><br/>
  747. <%if Not IsNull(RS("Replay")) or rs("replay")<>"" Then%>
  748. <a href="User_Blog.asp?id=<%=rs("id")%>&amp;Action=ReplayMessage&amp;<%=KS.WapValue%>">修改回复</a>
  749. <%else%>
  750. <a href="User_Blog.asp?id=<%=rs("id")%>&amp;Action=ReplayMessage&amp;<%=KS.WapValue%>">回复留言</a>
  751. <%End If%>
  752. <a href="User_Blog.asp?action=MessageDel&amp;id=<%=rs("id")%>&amp;<%=KS.WapValue%>">删除留言</a><br/>
  753. ----------<br/>
  754. <%
  755. I = I + 1
  756. If I >= MaxPerPage Then Exit Do
  757. loop
  758. Call KS.ShowPageParamter(totalPut, MaxPerPage, "User_Blog.asp", True, "条留言", CurrentPage, "Action=Message&amp;" & KS.WapValue & "")
  759. end if
  760. rs.close
  761. End Sub
  762. '回复留言=================================================================================
  763. Sub ReplayMessage()
  764. Set rs=Server.CreateObject("ADODB.RECORDSET")
  765. rs.Open "Select * From KS_BlogMessage where id="&id,Conn,1,1
  766. If rs.Eof And rs.Bof Then
  767. Response.Write "参数出错!<br/>"
  768. Response.end
  769. End If
  770. Title=rs("Title")
  771. Content=rs("Content")
  772. Replay=rs("Replay")
  773. If IsNull(Replay) Then Replay=""
  774. rs.Close:Set rs=Nothing
  775. %>
  776. =回复留言=<br/>
  777. 留言标题<%=Title%><br/>
  778. 留言内容<%=KS.LoseHtml(Content)%><br/>
  779. <%if Not IsNull(Replay) or replay<>"" Then%>
  780. 回复内容<%=KS.LoseHtml(Replay)%><br/>
  781. 回复修改<input name="Replay<%=minute(now)%><%=second(now)%>" type="text" maxlength="500" size="20" value="<%=KS.LoseHtml(Replay)%>"/><br/>
  782. <%else%>
  783. 回复内容<input name="Replay<%=minute(now)%><%=second(now)%>" type="text" maxlength="500" size="20" value=""/><br/>
  784. <%End If%>
  785. <anchor>立即回复<go href="User_Blog.asp?action=SaveMessageReplay&amp;id=<%=id%>&amp;<%=KS.WapValue%>" method="post" accept-charset="utf-8">
  786. <postfield name="Replay" value="$(Replay<%=minute(now)%><%=second(now)%>)"/>
  787. </go></anchor>
  788. <br/>
  789. <%
  790. End Sub
  791. '保存留言回复=================================================================================
  792. Sub SaveMessageReplay()
  793. Replay=KS.S("Replay")
  794. Set RS=Server.CreateObject("ADODB.RECORDSET")
  795. RS.Open "Select * From KS_BlogMessage where id="&id,Conn,1,3
  796. If Not RS.Eof Then
  797. RS("Replay")=Replay
  798. RS("ReplayDate")=Now
  799. RS.Update
  800. End If
  801. Response.write "留言成功回复。<br/>"
  802. Response.Write "<a href=""User_Blog.asp?action=Message&amp;" & KS.WapValue & """>留言管理</a><br/>"
  803. RS.Close:Set RS=Nothing
  804. End Sub
  805. '删除留言=================================================================================
  806. Sub MessageDel()
  807. Conn.Execute("Delete From KS_BlogMessage where id In("&id&")")
  808. Response.Write "留言删除成功。<br/>"
  809. Response.Write "<a href='User_Blog.asp?action=Message&amp;" & KS.WapValue & "'>留言管理</a><br/>"
  810. End Sub
  811. %>
  812. <br/>
  813. <a href="Index.asp?<%=KS.WapValue%>">我的地盘</a>
  814. <a href="<%=KS.GetGoBackIndex%>">返回首页</a><br/>
  815. <%
  816. Set KSUser=Nothing
  817. Set KS=Nothing
  818. Call CloseConn
  819. %>
  820. </p>
  821. </card>
  822. </wml>