ATB Source Codes

Like webmaster forums Show usersms.asp Source code

Return Download Like webmaster forums: download usersms.asp Source code - Download Like webmaster forums Source code - Type:.asp
  1. <!--#include file="Conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <%
  4. Dvbbs.LoadTemplates("usermanager")
  5. Dvbbs.Stats=Dvbbs.MemberName&template.Strings(4)
  6. Dvbbs.Nav()
  7. Dvbbs.Head_var 0,0,template.Strings(0),"usermanager.asp"
  8. Dim Sql,Rs,TempStr,ErrCodes
  9. Dim Sms_max
  10. Sms_max=Cint(Dvbbs.GroupSetting(35))                            '用户组短信限制,条数
  11. If Sms_max = 0 Then Sms_Max = 9999
  12. If Cint(Dvbbs.GroupSetting(16))=0 Then
  13.         Dvbbs.AddErrCode(28)
  14. End If
  15. If Dvbbs.userid=0 Then
  16.         Dvbbs.AddErrCode(6)
  17. End if
  18. Dvbbs.Showerr()
  19.  
  20. Dim boxName,smstype,readaction,turl,TempLateStr
  21. main()
  22. If ErrCodes<>"" Then Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
  23. Dvbbs.Showerr()
  24. Dvbbs.ActiveOnline()
  25. Dvbbs.Footer()
  26.  
  27. Sub main()
  28. Dim i,SmsCount,DelCount,boxinfo
  29. SmsCount=0
  30. boxinfo=split(template.Strings(63),",")
  31. Set Rs=Dvbbs.Execute("Select Count(id) From DV_Message Where incept='"&Dvbbs.MemberName&"'")
  32. SmsCount=Rs(0)
  33. '以下判断为自动删除多出来的短消息(2003-12-26 FIX BY YZ)
  34. If SmsCount>Sms_max Then
  35.         i=SmsCount-Sms_max
  36.         Set Rs=Dvbbs.Execute("Select top "&i&" id From DV_Message Where incept='"&Dvbbs.MemberName&"' Order by id,delR Desc")
  37.         While not rs.eof
  38.                 Dvbbs.Execute("Delete From DV_Message Where id="&rs(0))
  39.                 rs.movenext
  40.         Wend
  41.         SmsCount=Sms_max
  42. End if
  43. Rs.close:Set Rs=Nothing
  44. TempLateStr=template.html(12)
  45.  
  46. Sql="Select * From Dv_Message "
  47. Select Case request("action")
  48. Case "inbox"
  49.         TempLateStr=Replace(TempLateStr,"{$Sms_inbox}", template.pic(19))
  50.         TempLateStr=Replace(TempLateStr,"{$Sms_outbox}", template.pic(1))
  51.         TempLateStr=Replace(TempLateStr,"{$Sms_issend}", template.pic(2))
  52.         TempLateStr=Replace(TempLateStr,"{$Sms_recycle}", template.pic(3))
  53.         boxName = boxinfo(0)'"收件箱"
  54.         smstype = "inbox"
  55.         readaction = "read"
  56.         turl = "readsms"
  57.         Sql = Sql + " where issend = 1 and delR = 0 and incept = '"&Dvbbs.MemberName&"' order by flag,id desc"
  58. Case "outbox"
  59.         TempLateStr=Replace(TempLateStr,"{$Sms_inbox}", template.pic(0))
  60.         TempLateStr=Replace(TempLateStr,"{$Sms_outbox}", template.pic(20))
  61.         TempLateStr=Replace(TempLateStr,"{$Sms_issend}", template.pic(2))
  62.         TempLateStr=Replace(TempLateStr,"{$Sms_recycle}", template.pic(3))
  63.         boxName = boxinfo(1)'"草稿箱"
  64.         smstype = "outbox"
  65.         readaction = "edit"
  66.         turl = "sms"
  67.         Sql = Sql + " where sender = '"&Dvbbs.MemberName&"' and issend = 0 and delS = 0 order by id desc"
  68. Case "issend"
  69.         TempLateStr=Replace(TempLateStr,"{$Sms_inbox}", template.pic(0))
  70.         TempLateStr=Replace(TempLateStr,"{$Sms_outbox}", template.pic(1))
  71.         TempLateStr=Replace(TempLateStr,"{$Sms_issend}", template.pic(21))
  72.         TempLateStr=Replace(TempLateStr,"{$Sms_recycle}", template.pic(3))
  73.         boxName = boxinfo(2)'"已发送的消息"
  74.         smstype = "issend"
  75.         readaction = "outread"
  76.         turl = "readsms"
  77.         Sql = Sql + " where sender = '"&Dvbbs.MemberName&"' and issend = 1 and delS = 0 order by id desc"
  78. Case "recycle"
  79.         TempLateStr=Replace(TempLateStr,"{$Sms_inbox}", template.pic(0))
  80.         TempLateStr=Replace(TempLateStr,"{$Sms_outbox}", template.pic(1))
  81.         TempLateStr=Replace(TempLateStr,"{$Sms_issend}", template.pic(2))
  82.         TempLateStr=Replace(TempLateStr,"{$Sms_recycle}", template.pic(22))
  83.         boxName = boxinfo(3)'"垃圾箱"
  84.         smstype = "recycle"
  85.         readaction = "read"
  86.         turl = "readsms"
  87.         Sql = Sql + " where ((sender = '"&trim(Dvbbs.MemberName)&"' and delS = 1) or (incept = '"&trim(Dvbbs.MemberName)&"' and delR = 1)) and not delS = 2 order by id desc"
  88. Case Else
  89.         TempLateStr=Replace(TempLateStr,"{$Sms_inbox}", template.pic(19))
  90.         TempLateStr=Replace(TempLateStr,"{$Sms_outbox}", template.pic(1))
  91.         TempLateStr=Replace(TempLateStr,"{$Sms_issend}", template.pic(2))
  92.         TempLateStr=Replace(TempLateStr,"{$Sms_recycle}", template.pic(3))
  93.         boxName = boxinfo(0)'"收件箱"
  94.         smstype = "inbox"
  95.         readaction = "read"
  96.         turl = "readsms"
  97.         Sql = Sql + " where issend = 1 and delR = 0 and incept = '"&Dvbbs.MemberName&"' order by flag,id desc"
  98. End Select
  99. TempLateStr=Replace(TempLateStr,"{$Sms_address}", template.pic(4))
  100. TempLateStr=Replace(TempLateStr,"{$Sms_write}", template.pic(5))
  101. TempLateStr=Replace(TempLateStr,"{$Sms_issend_1}", template.pic(9))
  102. TempLateStr=Replace(TempLateStr,"{$Sms_issend_2}", template.pic(10))
  103. TempLateStr=Replace(TempLateStr,"{$Sms_news}", template.pic(11))
  104. TempLateStr=Replace(TempLateStr,"{$Sms_olds}", template.pic(12))
  105. Response.Write Template.Html(0)
  106. Response.Write TempLateStr
  107. Call smsbox()
  108. 'For i = 0 to SmsCount
  109.         Response.Write ShowTable("Sms_bar","Sms_txt",SmsCount,Sms_max)
  110.         'Response.Flush
  111. 'Next
  112. End Sub
  113.  
  114. Sub smsbox()
  115.         Dim newstyle
  116.         Dim currentPage,page_count,totalrec,Pcount,PageListNum
  117.         PageListNum = Cint(Dvbbs.Forum_Setting(11))
  118.         currentPage = request("page")
  119.         If currentpage = "" or not IsNumeric(currentpage) Then
  120.                 currentpage = 1
  121.         Else
  122.                 currentpage = clng(currentpage)
  123.         End If
  124.         Response.Write "<script>dvbbs_usersms_smsbox_top('"&smstype&"')</script>"
  125.         Set Rs = server.createobject("adodb.recordset")
  126.         If Not IsObject(Conn) Then ConnectionDatabase
  127.         Rs.open sql,conn,1,1
  128.                 Dvbbs.SqlQueryNum = Dvbbs.SqlQueryNum+1
  129.                 If Rs.eof and Rs.bof Then
  130.                 Response.Write "<script>dvbbs_usersms_smsbox_emp('"&boxname&"')</script>"
  131.                 Else
  132.                         Rs.PageSize = PageListNum
  133.                         Rs.AbsolutePage = currentpage
  134.                         page_count = 0
  135.                         totalrec = Rs.recordcount
  136.                 Do While Not Rs.EOF and (not page_count = Rs.PageSize)
  137.                         Response.Write VbCrLf
  138.                         Response.Write "<script>dvbbs_usersms_smsbox_loop("
  139.                         Response.Write Rs("flag")
  140.                         Response.Write ",'"
  141.                         Response.Write smstype
  142.                         Response.Write "','"
  143.                         Response.Write EncodeJS(Rs("sender"))
  144.                         Response.Write "','"
  145.                         Response.Write EncodeJS(Rs("incept"))
  146.                         Response.Write "','"
  147.                         Response.Write EncodeJS(Rs("title"))
  148.                         Response.Write "','"
  149.                         Response.Write Rs("sendtime")
  150.                         Response.Write "',"
  151.                         Response.Write len(Rs("content"))
  152.                         Response.Write ","
  153.                         Response.Write Rs("id")
  154.                         Response.Write ",'"
  155.                         Response.Write readaction
  156.                         Response.Write "')</script>"
  157.                         Response.Write VbCrLf
  158.                         page_count = page_count + 1
  159.                 Rs.movenext
  160.                 Loop
  161.                 End If
  162.                 Rs.close:Set Rs = nothing
  163.                 If totalrec Mod PageListNum = 0 Then
  164.                 Pcount =  totalrec \ PageListNum
  165.                 Else
  166.                 Pcount =  totalrec \ PageListNum+1
  167.                 End If
  168.                 If page_count = 0 Then CurrentPage = 0
  169.         Response.Write ShowPage(CurrentPage,Pcount,totalrec,PageListNum)
  170.         Response.Write VbCrLf
  171.         Response.Write "<script>dvbbs_usersms_smsbox_footer('"&boxname&"')</script>"
  172. End Sub
  173.  
  174. '分页输出
  175. Function ShowPage(CurrentPage,Pcount,totalrec,PageNum)
  176.         Dim SearchStr
  177.         SearchStr = "action="&Request("action")
  178.         ShowPage = template.html(16)
  179.         ShowPage = Replace(ShowPage,"{$colSpan}",6)
  180.         ShowPage = Replace(ShowPage,"{$CurrentPage}",CurrentPage)
  181.         ShowPage = Replace(ShowPage,"{$Pcount}",Pcount)
  182.         ShowPage = Replace(ShowPage,"{$PageNum}",PageNum)
  183.         ShowPage = Replace(ShowPage,"{$totalrec}",totalrec)
  184.         ShowPage = Replace(ShowPage,"{$SearchStr}",SearchStr)
  185.         ShowPage = Replace(ShowPage,"{$redcolor}",Dvbbs.mainsetting(1))
  186. End Function
  187.  
  188. '(图片对象名称,标题对象名称,更新数,总数)
  189. Function ShowTable(SrcName,TxtName,str,c)
  190. Dim Tempstr,Src_js,Txt_js,TempPercent
  191. If C = 0 Then C = 99999999
  192. Tempstr = str/C
  193. TempPercent = FormatPercent(tempstr,0,-1)
  194. Src_js = "document.getElementById(""" + SrcName + """)"
  195. Txt_js = "document.getElementById(""" + TxtName + """)"
  196.         ShowTable = VbCrLf + "<script>"
  197.         ShowTable = ShowTable + Src_js + ".width=""" & FormatNumber(tempstr*600,0,-1) & """;"
  198.         ShowTable = ShowTable + Src_js + ".title=""容量上限为:"&c&"条,总共已储存("&str&")条论坛短信!"";"
  199.         ShowTable = ShowTable + Txt_js + ".innerHTML="""
  200.         If FormatNumber(tempstr*100,0,-1) < 80 Then
  201.                 ShowTable = ShowTable + "已使用:" & TempPercent & """;"
  202.         Else
  203.                 ShowTable = ShowTable + "<font color=\"""&Dvbbs.mainsetting(1)&"\"">已使用:" & TempPercent & ",请赶快清理!</font>"";"
  204.         End If
  205.         ShowTable = ShowTable + "</script>"
  206. End Function
  207.  
  208. Function EncodeJS(str)
  209. str = Dvbbs.HtmlEncode(str)
  210. str = Replace(Replace(Replace(Replace(str,"\","\\"),"'","\'"),VbCrLf,"\n"),chr(13),"")
  211. EnCodeJs = str
  212. End Function
  213. %>
downloadusersms.asp Source code - Download Like webmaster forums Source code
Related Source Codes/Software:
Quanzhou China networks limited - Admin admin admin 21.45KB
Love agent shop navigation friendship China buffet chain V1.0 - Fully functional, application link, points into on... 4.34KB
Source of party and Government official open source Government TS version v1.0 - I am a Government webmaster, not a computer traini... 10.95KB
Sunzhuang town government - Simple and practical! 5.15KB
160 Shenzhen rental rental information network - Rental information network-a very good site, which... 79.99KB
Journey of legends ASP.NET version system - Abbreviation for Cms is a Content Management Syste... 18.45KB
M media corporate website system v3.5.2 - M media on the powerful systems in addition to foc... 5.69KB
M media enterprise open source Web System v1.0.0 - M media on the powerful systems in addition to foc... 4.9KB
M media management system voted v2.1.0 - As computer and electronic communications technolo... 6.01KB
Chinese women's network the entire station source code - A woman's Web site package download, and a present... 22.95KB
China source download System v1.0 - This 3-to beautify the program downloaded by the i... 5.26KB
Ganzhou Windows network - Cover feature:Windows Home | News vertical and... 34.61KB
Strains of strain of beautiful personal home page Build20061004 - -----------Modified part-------------1: added ... 7.7KB
Southwest agricultural information network - Southwest agricultural information network, an agr... 98.89KB
ZWMOBI 3G mobile station system - Powerful business modules, including mobile B2C mo... 3.89KB
As a campus site system v2.0 - For most school,, to built features powerful of ma... 44.88KB
Evening student seating system 7 - Evening student seating system is facilitated the ... 26.4KB
94KK be reluctant network community beautification bate3 (new year Edition) - Kernel KB 94kkBBS Forum, new landscaping, further ... 24.82KB
QQ Flash Word - 1. powerful DIY feature, which is now immeasurably... 67KB
Zoomla! Eall CMS v2.0 - Waves CMS is committed to providing our webmasters... 11.31KB

 Back to top