ATB Source Codes

Like webmaster forums Show plus_Tools_const.asp Source code

Return Download Like webmaster forums: download plus_Tools_const.asp Source code - Download Like webmaster forums Source code - Type:.asp
  1. <%
  2. Dim Dv_Tools
  3. Set Dv_Tools=new Plus_Tools_Cls
  4.  
  5. Class Plus_Tools_Cls
  6.         Public ToolsID,ToolsInfo,ToUserInfo,UserToolsInfo,ToolsSetting
  7.         Private BuyCount
  8.  
  9.         Private Sub Class_Initialize()
  10.                 BuyCount = 1
  11.                 ToolsID = CheckNumeric(Request("ToolsID"))
  12.                 If DVbbs.Forum_Setting(90)=0 and IsEmpty(session("flag")) Then ShowErr(1)       '中心已关闭
  13.         End Sub
  14.  
  15.         Public Sub ChkToolsLogin()
  16.                 If Dvbbs.UserID=0 Then Dvbbs.AddErrCode(6):Dvbbs.Showerr()      '判断用户是否在线。
  17.                 If ToolsID=0 Then ShowErr(3):Exit Sub
  18.                 GetToolsInfo    '提取道具设置信息
  19.         End Sub
  20.  
  21.         '---------------------------------------------------
  22.         '读取道具系统信息
  23.         '---------------------------------------------------
  24.         Private Sub GetToolsInfo()
  25.                 Dim Sql,Rs
  26.                 'ID=0 ,ToolsName=1 ,ToolsInfo=2 ,IsStar=3 ,SysStock=4 ,UserStock=5 ,UserMoney=6 ,UserPost=7 ,UserWealth=8 ,UserEp=9 ,UserCp=10 ,UserGroupID=11 ,BoardID=12,UserTicket=13,BuyType=14,ToolsImg=15,ToolsSetting=16
  27.                 Sql = "Select ID,ToolsName,ToolsInfo,IsStar,SysStock,UserStock,UserMoney,UserPost,UserWealth,UserEp,UserCp,UserGroupID,BoardID,UserTicket,BuyType,ToolsImg,ToolsSetting From [Dv_Plus_Tools_Info] Where ID="& ToolsID
  28.                 Set Rs = Dvbbs.Plus_Execute(Sql)
  29.                 If Rs.Eof Then
  30.                         ShowErr(3):Exit Sub
  31.                 Else
  32.                         Sql = Rs.GetString(,1, "§§§", "", "")
  33.                         Sql = Split(Sql,"§§§")
  34.                 End If
  35.                 Rs.Close : Set Rs = Nothing
  36.                 ToolsInfo = Sql
  37.                 ToolsSetting = Split(ToolsInfo(16),",")
  38.         End Sub
  39.         '---------------------------------------------------
  40.         '读取用户道具信息
  41.         '---------------------------------------------------
  42.         Public Sub GetUserToolsInfo(G_USerID,G_ToolsID)
  43.                 Dim Sql,Rs
  44.                 G_USerID = CheckNumeric(G_USerID)
  45.                 G_ToolsID = CheckNumeric(G_ToolsID)
  46.                 If G_USerID = 0 or G_ToolsID = 0 Then ShowErr(3):Exit Sub
  47.                 'ID=0 ,UserID=1 ,UserName=2 ,ToolsID=3 ,ToolsName=4 ,ToolsCount=5 ,SaleCount=6 ,UpdateTime=7 ,SaleMoney=8 ,SaleTicket=9
  48.                 Sql = "Select ID,UserID,UserName,ToolsID,ToolsName,ToolsCount,SaleCount,UpdateTime,SaleMoney,SaleTicket From [Dv_Plus_Tools_Buss] Where ToolsCount>0 and UserID="& G_USerID &" and ToolsID="& G_ToolsID
  49.                 Set Rs = Dvbbs.Plus_Execute(Sql)
  50.                 If Rs.Eof Then
  51.                         ShowErr(3):Exit Sub
  52.                 Else
  53.                         Sql = Rs.GetString(,1, "§§§", "", "")
  54.                         Sql = Split(Sql,"§§§")
  55.                 End If
  56.                 Rs.Close : Set Rs = Nothing
  57.                 UserToolsInfo = Sql
  58.         End Sub
  59.         '---------------------------------------------------
  60.         '读取目标用户信息
  61.         '---------------------------------------------------
  62.         Public Sub GetToUserInfo()
  63.                 Dim Sql,Rs,ToUserID
  64.                 ToUserID = Dv_Tools.CheckNumeric(Request("ToUserID"))
  65.                 If ToUserID = 0 Then ShowErr(11):Exit Sub
  66.                 'UserID=0,UserName=1,LockUser=2,UserPost=3,UserTopic=4,UserMoney=5,UserTicket=6,userWealth=7,userEP=8,userCP=9,UserPower=10,UserGroupID=11
  67.                 Sql = "Select UserID,UserName,LockUser,UserPost,UserTopic,UserMoney,UserTicket,userWealth,userEP,userCP,UserPower,UserGroupID From [Dv_User] Where UserID="& ToUserID
  68.                 Set Rs = Dvbbs.Execute(Sql)
  69.                 If Rs.Eof Then
  70.                         ShowErr(11):Exit Sub
  71.                 Else
  72.                         Sql = Rs.GetString(,1, "§§§", "", "")
  73.                         Sql = Split(Sql,"§§§")
  74.                 End If
  75.                 Rs.Close : Set Rs = Nothing
  76.                 ToUserInfo = Sql
  77.         End Sub
  78.         '---------------------------------------------------
  79.         '检查用户使用道具权限
  80.         '---------------------------------------------------
  81.         Public Sub ChkUseTools()
  82.                 If Not IsArray(ToolsInfo) Then GetToolsInfo
  83.                 ChkUserGroup
  84.                 If Dvbbs.BoardID>0 Then ChkBoard
  85.                 If cCur(Dvbbs.MyUserInfo(8))<=cCur(ToolsInfo(7)) or cCur(Dvbbs.MyUserInfo(21))<=cCur(ToolsInfo(8)) or cCur(Dvbbs.MyUserInfo(22))<=cCur(ToolsInfo(9)) or cCur(Dvbbs.MyUserInfo(23))<=cCur(ToolsInfo(10))Then ShowErr(12):Exit Sub
  86.                 Call GetUserToolsInfo(Dvbbs.UserID,ToolsID)
  87.         End Sub
  88.  
  89.         '---------------------------------------------------
  90.         '检查目标用户使用道具权限
  91.         '---------------------------------------------------
  92.         Public Sub ChkToUseTools()
  93.                 If Not IsArray(ToUserInfo) Then GetToUserInfo
  94.                 If cCur(ToUserInfo(3))<=cCur(ToolsSetting(0)) or cCur(ToUserInfo(7))<=cCur(ToolsSetting(1)) or cCur(ToUserInfo(8))<=cCur(ToolsSetting(2)) or cCur(ToUserInfo(9))<=cCur(ToolsSetting(3)) Then ShowErr(13):Exit Sub
  95.         End Sub
  96.  
  97.         '---------------------------------------------------
  98.         '检查用户组限制使用道具权限
  99.         '---------------------------------------------------
  100.         Public Sub ChkUserGroup()
  101.                 If Not IsArray(ToolsInfo) Then GetToolsInfo
  102.                 If Cint(ToolsInfo(3)) = 0 Then ShowErr(6):Exit Sub
  103.                 If ToolsInfo(11) = "" or Instr(","& ToolsInfo(11) &",",","& Dvbbs.UserGroupID &",") = 0 Then ShowErr(4):Exit Sub
  104.         End Sub
  105.         '---------------------------------------------------
  106.         '检查版块限制使用道具权限
  107.         '---------------------------------------------------
  108.         Public Sub ChkBoard()
  109.                 If Not IsArray(ToolsInfo) Then GetToolsInfo
  110.                 If ToolsInfo(12) = "" or Instr(","& ToolsInfo(12) &",",","& Dvbbs.BoardID &",") = 0 Then ShowErr(5):Exit Sub
  111.         End Sub
  112.        
  113.         Public Property Let BuySum(ByVal Value)
  114.                 BuyCount = Value
  115.         End Property
  116.  
  117.         '---------------------------------------------------
  118.         '检查用户购买道具权限: BType 数字型,为用户选取的购买类型
  119.         '---------------------------------------------------
  120.         Public Sub ChkBuyTools(Byval BType)
  121.                 Dim CanBuyTools
  122.                 CanBuyTools = False
  123.                 If BType="" or Not Isnumeric(BType) Then
  124.                         BType = -1
  125.                 Else
  126.                         BType = Cint(BType)
  127.                 End If
  128.                 If Not IsArray(ToolsInfo) Then GetToolsInfo
  129.                 If Int(ToolsInfo(4)) = 0 OR BuyCount>Int(ToolsInfo(4)) OR BuyCount = 0 Then ShowErr(8):Exit Sub '库存不足
  130.                 Select Case Cint(ToolsInfo(14))
  131.                         Case 0 '只需金币
  132.                                 If cCur(Dvbbs.MyUserInfo(37))>=Int(ToolsInfo(6))*BuyCount and BType=0 Then
  133.                                         CanBuyTools = True
  134.                                 End If
  135.                         Case 1 '只需点券
  136.                                 If cCur(Dvbbs.MyUserInfo(38))>=Int(ToolsInfo(13))*BuyCount and BType=1 Then
  137.                                         CanBuyTools = True
  138.                                 End If
  139.                         Case 2 '金币+点券
  140.                                 If cCur(Dvbbs.MyUserInfo(37))<Int(ToolsInfo(6))*BuyCount Or cCur(Dvbbs.MyUserInfo(38))<Int(ToolsInfo(13))*BuyCount Then
  141.                                         CanBuyTools = False
  142.                                 Else
  143.                                         CanBuyTools = True
  144.                                 End If
  145.                         Case 3 '金币或点券
  146.                                 If BType=0 Then
  147.                                         If cCur(Dvbbs.MyUserInfo(37))>Int(ToolsInfo(6))*BuyCount Then CanBuyTools = True
  148.                                 ElseIf BType=1 Then
  149.                                         If cCur(Dvbbs.MyUserInfo(38))>Int(ToolsInfo(13))*BuyCount Then CanBuyTools = True
  150.                                 Else
  151.                                         CanBuyTools = False
  152.                                 End If
  153.                         Case Else
  154.                                 ShowErr(10):Exit Sub
  155.                 End Select
  156.                 If CanBuyTools = False Then ShowErr(7):Exit Sub
  157.         End Sub
  158.         '---------------------------------------------------
  159.         '购买方式
  160.         '---------------------------------------------------
  161.         Public Property Get BuyType(Byval BType)
  162.                 Select Case Cint(BType)
  163.                         Case 0 : BuyType = "只需金币"
  164.                         Case 1 : BuyType = "只需金币"
  165.                         Case 2 : BuyType = "金币+点券"
  166.                         Case 3 : BuyType = "金币或点券"
  167.                         Case Else : BuyType = "暂停购买"
  168.                 End Select
  169.                 BuyType = "<font class=redfont>"&BuyType&"</font>"
  170.         End Property
  171.  
  172.         Public Sub ShowErr(Byval Code)
  173.                 If Code<>"" Then Response.redirect "showerr.asp?ErrCodes="& ErrCodes(Code) &"&action=NoHeadErr"
  174.         End Sub
  175.         '---------------------------------------------------
  176.         '错误信息
  177.         '---------------------------------------------------
  178.         Public Function ErrCodes(Byval ErrNum)
  179.                 Select Case ErrNum
  180.                         Case 1 : ErrCodes = "<li>道具中心已经关闭!"
  181.                         Case 2 : ErrCodes = "<li>道具交易中心已经关闭,不能进行道具交易!"
  182.                         Case 3 : ErrCodes = "<li>该道具不存在或参数不正确!"
  183.                         Case 4 : ErrCodes = "<li>您没有购买或使用该道具的权限!"
  184.                         Case 5 : ErrCodes = "<li>本版块不能使用该道具!"
  185.                         Case 6 : ErrCodes = "<li>该道具已被系统禁止使用!"
  186.                         Case 7 : ErrCodes = "<li>您的金币或点券不足或选取的购买方式不正确,不能购买该道具!"
  187.                         Case 8 : ErrCodes = "<li>该道具系统库存不足,暂停购买!"
  188.                         Case 9 : ErrCodes = "<li>转让的数量已超过了您拥有的道具数据或没有填写正确的道具数量,出售中止!"
  189.                         Case 10 : ErrCodes = "<li>暂停购买!"
  190.                         Case 11 : ErrCodes = "<li>道具使用目标用户不存在或参数不正确!"
  191.                         Case 12 : ErrCodes = "<li>由于你的文章数或金钱值或积分值或魅力值不足,所以没有使用该道具的权限!"
  192.                         Case 13 : ErrCodes = "<li>由于使用的目标用户的文章数或金钱值或积分值或魅力值不足,所以你不能使用该道具!"
  193.                         Case 14 : ErrCodes = "<li>此操作不能在相同用户名之间进行!"
  194.                         Case 15 : ErrCodes = "<li>后悔药只能用在自己发表的帖子上!"
  195.                         Case 16 : ErrCodes = "<li>您设置的转让金币或点券数不正确!"
  196.                         Case 17 : ErrCodes = "<li>您的金币或点券不足,不能转让!"
  197.                         Case 18 : ErrCodes = "<li>该用户没有任何道具。"
  198.                 End Select
  199.         End Function
  200.  
  201.         Public Function CheckNumeric(Byval CHECK_ID)
  202.                 If CHECK_ID<>"" and IsNumeric(CHECK_ID) Then _
  203.                         CHECK_ID = Int(CHECK_ID) _
  204.                 Else _
  205.                         CHECK_ID = 0
  206.                 CheckNumeric = CHECK_ID
  207.         End Function
  208.  
  209. End Class
  210.  
  211. '--------------------------------------------------------------------------------
  212. '用户信息
  213. '--------------------------------------------------------------------------------
  214. Sub UserInfo()
  215.         Dim Sql,Rs,UserToolsCount
  216.         Sql = "Select Sum(ToolsCount) From [Dv_Plus_Tools_Buss] where UserID="& Dvbbs.UserID
  217.         Set Rs = Dvbbs.Plus_Execute(Sql)
  218.         UserToolsCount = Rs(0)
  219.         If IsNull(UserToolsCount) Then UserToolsCount = 0
  220. %>
  221. <table border="0" cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style="Width:100%">
  222.         <tr>
  223.         <th height=23 >个人资料</th>
  224.         </tr>
  225.         <tr>
  226.         <td align=center class=TableBody1>
  227.         <table border="0" cellpadding=3 cellspacing=1 align=center Style="Width:90%">
  228.         <tr><td class=TableBody2>金币:<B><font color="<%=Dvbbs.mainsetting(1)%>"><%=Dvbbs.MyUserInfo(37)%></font></B> 个</td></tr>
  229.         <tr><td class=TableBody1>点券:<B><font color="<%=Dvbbs.mainsetting(1)%>"><%=Dvbbs.MyUserInfo(38)%></font></B> 张</td></tr>
  230.         <tr><td class=TableBody2>道具:<a href="?action=UserTools_List"><B><font color="<%=Dvbbs.mainsetting(1)%>"><%=UserToolsCount%></font></B></a> 个</td></tr>
  231.         <tr><td class=TableBody1>金钱:<%=Dvbbs.MyUserInfo(21)%></td></tr>
  232.         <tr><td class=TableBody2>文章:<%=Dvbbs.MyUserInfo(8)%></td></tr>
  233.         <tr><td class=TableBody1>经验:<%=Dvbbs.MyUserInfo(22)%></td></tr>
  234.         <tr><td class=TableBody2>魅力:<%=Dvbbs.MyUserInfo(23)%></td></tr>
  235.         <tr><td class=TableBody1>威望:<%=Dvbbs.MyUserInfo(24)%></td></tr>
  236.         <tr><td class=TableBody2></td></tr>
  237.         </table>
  238.         </td>
  239.         </tr>
  240. </table>
  241. <%
  242. End Sub
  243.  
  244. Sub Tools_Nav_Link()
  245. %>
  246.         <table border="0" width="<%=Dvbbs.mainsetting(0)%>" cellpadding=2 cellspacing=0 align=center>
  247.                 <tr>
  248.                 <th height=23 id=TableTitleLink><a href="plus_Tools_Center.asp">系统交易中心</a></th>
  249.                 <th id=TableTitleLink><a href="plus_Tools_Center.asp?action=UserBussTools_List" >用户交易中心</a></th>
  250.                 <th id=TableTitleLink><a href="?action=UserTools_List">我的道具箱</a></th>
  251.                 <th id=TableTitleLink><a href="UserPay.asp">购买论坛点券</a></th>
  252.                 </tr>
  253.         </table>
  254. <%
  255. End Sub
  256. %>
  257.  
downloadplus_Tools_const.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