请先登录 | 注册
MYCSG.CN
[ASP语法]在BBS里面关于(类型不匹配)问题求助 - 文章首页返回版区
■标题:[ASP语法]在BBS里面关于(类型不匹配)问题求助
■作者:痞子何 [2007/1/15 12:52:34]

海大哥,您好,好久没来光顾了.有个问题向您请教..

我跟据您这儿有个贴子,关于
5.x版本 同级版主之间不能编辑对方贴子,低级会员不能编辑高级会员贴子代码段...贴子如下-----
http://www.diybbsxp.com/diy/ShowPost.asp?id=2806

我跟据这个,在另外一个论坛来修改也是关于管理员,及版主之间不能编辑的问题..

我这数据库不一样..管理人员(管理员,超级版主,版主)有一个专门的数据表admin
里面字段包含:name ,password,bd(bd: 所属版块的版块ID(-1代表总版,0代表管理员))

然后,我在数据表admin里面加了一个字段membercode--数值类型

管理员=======0
超级版主=====1
版主=========2

 

在编辑的文件里,加了如下语句..

 

  if instr("|"&adminbd&"|","|"&bd&"|")>0 then
               canedit=true
              set ars=conn.execute("select * from admin where name='"&lgname&"'")
              set brs=conn.execute("select * from admin where name='"&oldname&"'")
              if not brs.eof and not ars.eof then
                    if  brs("useridtype")<ars("useridtype") then
                         exitb="错误原因:<font color=blue>你不能编辑级别比你高的用户的贴子!</font><br>"
                         canedit=false

这样后.版主是不能编辑管理员和超级版主的.但是,超级版主还是可以编辑管理员的..请问该怎样修改?/谢谢



回复/版区/上篇/下篇/发贴/仅文字/HTML
【倒序/最近21条回复】
■作者:IPSC [2007/3/3 20:15:27]
到时上QQ帮你吧,你加我,不用等我上传,我一向隐身。

■作者:痞子何 [2007/1/30 21:28:49]
这问题还没解决.不知海大哥有空没有?

■作者:痞子何 [2007/1/25 11:22:06]
管理员=======0
超级版主=====1
版主=========2

■作者:IPSC [2007/1/20 9:40:03]
由小到大的MEMBERCODE是什么数字,版主→超级版主→管理员

■作者:痞子何 [2007/1/15 23:19:26]

用您这种方法..(第一种方法也行.)

if Conn.Execute("select membercode from [admin] where name='"&lgname&"'")(0)>Conn.Execute("select membercode from [admin] where name='"&lguserid&"'")(0) then

错误是没有了.但是,版主就是可以编辑超级版主..只是管理员照样不能编辑..

请问,怎么样设置权限..由小到大...               版主→超级版主→管理员...



■作者:IPSC [2007/1/15 16:59:41]

if Conn.Execute("select membercode from [admin] where name='"&lgname&"'")>Conn.Execute("select membercode from [admin] where name='"&lguserid&"'") then

写成下面这样试试:

if Conn.Execute("select membercode from [admin] where name='"&lgname&"'")(0)>Conn.Execute("select membercode from [admin] where name='"&lguserid&"'")(0) then



■作者:痞子何 [2007/1/15 12:54:29]

改为像您这样的.

     if instr("|"&adminbd&"|","|"&bd&"|")>0 then
               canedit=true

              if Conn.Execute("select membercode from [admin] where name='"&lgname&"'")>Conn.Execute("select membercode from [admin] where name='"&lguserid&"'") then
                         exitb="错误原因:<font color=blue>你不能编辑级别比你高的用户的贴子!</font><br>"

却显示类型不匹配



(查看完整版网页)



短讯|首页|登录|算法|电脑版 .
DK MiniBBS Plus v2.0
mm0759.com
472 毫秒 .