发新话题
打印

[已解] 发表文章,可视和UBB的用户列表的不同.

本主题由 haphic 于 2008-2-15 23:01 分类

发表文章,可视和UBB的用户列表的不同.

使用管理员帐号登陆后,发表文章,使用可视方式发表时,在用户中只能选择自己.而在UBB方式中却可以选择任一用户.
为何的?是刻意还是遗漏?
下面分析一下代码:
下面的是可视发表中的用户列表的代码,ZC_MSG003表示用户:
复制内容到剪贴板
代码:
        <p><%=ZC_MSG003%>:<select class="edit" size="1" id="cmbUser" onchange="edtAuthorID.value=this.options[this.selectedIndex].value"><option value="0"></option>
<%
        Dim User
        For Each User in Users
                If IsObject(User) Then

                        If User.ID=EditArticle.AuthorID Then
                                Response.Write "<option value="""&User.ID&""" "
                                Response.Write "selected=""selected"""
                                Response.Write ">"&User.Name&"</option>"
                        End If

                End If
        Next
%>
        </select><input type="hidden" name="edtAuthorID" id="edtAuthorID" value="<%=EditArticle.AuthorID%>"></p>
其中,判断User.ID=EditArticle.AuthorID(只显示与发表用户ID相同的ID后就显示发表用户的名称.


下面是UBB发表的代码:
复制内容到剪贴板
代码:
        <p><%=ZC_MSG003%>:<select class="edit" size="1" id="cmbUser" onchange="edtAuthorID.value=this.options[this.selectedIndex].value"><option value="0"></option>
<%
        GetUser()
        Dim User
        For Each User in Users
                If IsObject(User) Then
                        If CheckRights("Root")=True Then
                                Response.Write "<option value="""&User.ID&""" "
                                If User.ID=EditArticle.AuthorID Then
                                        Response.Write "selected=""selected"""
                                End If
                                Response.Write ">"&TransferHTML(User.Name,"[html-format]")&"</option>"
                        Else
                                If User.ID=EditArticle.AuthorID Then
                                        Response.Write "<option value="""&User.ID&""" "
                                        Response.Write "selected=""selected"""
                                        Response.Write ">"&TransferHTML(User.Name,"[html-format]")&"</option>"
                                End If
                        End If
                End If
        Next
%>
        </select><input type="hidden" name="edtAuthorID" id="edtAuthorID" value="<%=EditArticle.AuthorID%>"></p>
而这段代码,却在判断了一下当前用户权限级别是否大于"ROOT"也就是大于1(管理员值为1)后,如果大于则生成当前,不大于仍然生成所有用户的名称.


为什么两种发表方式要弄成不同呢?

[ 本帖最后由 江海客 于 2008-2-19 11:02 编辑 ]
地母深渊
http://www.i928.net/

TOP

估计是漏了

TOP

发新话题