当前位置: 首页>>代码示例>>C#>>正文


C# ForumBoard类代码示例

本文整理汇总了C#中ForumBoard的典型用法代码示例。如果您正苦于以下问题:C# ForumBoard类的具体用法?C# ForumBoard怎么用?C# ForumBoard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ForumBoard类属于命名空间,在下文中一共展示了ForumBoard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: setBoard

        private void setBoard( IBlock fbBlock, ForumBoard fb ) {

            fbBlock.Set( "board.StyleClass", "" );

            fbBlock.Set( "board.AddUrl", string.Format( "<a href='{0}' class='frmBox' title='" + alang( "addSubBoard" ) + "'>+" + lang( "add" ) + "</a>", to( AddSubBoard, fb.Id ) ) );

            fbBlock.Set( "board.EditUrl", to( EditBoard, fb.Id ) );
            fbBlock.Set( "board.DeleteUrl", to( DeleteBoard, fb.Id ) );
            fbBlock.Set( "lineStyle", "" );

            int categoryCount = categoryService.CountByBoard( fb.Id );
            String categoryCountStr = categoryCount > 0 ? "(" + categoryCount + ")" : "";
            String lnkSetCategory = string.Format( "<a href='{0}' class='frmBox' title='" + alang( "postCategoryAdmin" ) + "'>" + alang( "category" ) + "{1}</a>", to( new CategoryController().Admin, fb.Id ), categoryCountStr );

            String imgUser = strUtil.Join( sys.Path.Img, "users.gif" );
            String imgSecurity = strUtil.Join( sys.Path.Img, "security.gif" );

            String lnkSetModerator = string.Format( "<a href='{0}' class='frmBox' title='" + alang( "setModerator" ) + "'><img src=\"{1}\"/> " + alang( "setModerator" ) + "</a>", to( new ModeratorController().List, fb.Id ), imgUser );
            String lnkSetSecurity = string.Format( "<a href='{0}' class='frmBox' xwidth='600' title='" + alang( "setSecurity" ) + "'><img src=\"{1}\"/> " + alang( "setSecurity" ) + "</a>", to( new SecurityController().BoardSetting, fb.Id ), imgSecurity );

            fbBlock.Set( "board.SetCategory", lnkSetCategory );
            fbBlock.Set( "board.Moderator", moderatorService.GetModeratorText( fb.Moderator ) );
            fbBlock.Set( "board.SetModerator", lnkSetModerator );
            fbBlock.Set( "board.SetSecurity", lnkSetSecurity );
            fbBlock.Set( "deleteMsg", alang( "exDeleteBoardTip" ) );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:26,代码来源:BoardController.cs

示例2: DeleteModerator

 //--------------------------------------------------------------------------------------
 public virtual void DeleteModerator( ForumBoard fb, String moderatorName )
 {
     string[] arrM = fb.Moderator.Split( '|' );
     String str = this.getNewModeratorProperty( moderatorName, arrM );
     fb.Moderator = str;
     db.update( fb, "Moderator" );
 }
开发者ID:robin88,项目名称:wojilu,代码行数:8,代码来源:ModeratorService.cs

示例3: GetTopicAdminCmds

        //----------------------------------------------------------------------
        public static IList GetTopicAdminCmds( User user, ForumBoard board, MvcContext ctx )
        {
            IList results = new ArrayList();

            // 1、获取用户的角色
            SecurityTool tool = ForumSecurityService.GetSecurityTool( board, ctx );
            IList actions = tool.GetActionsByRole( user.Role );
            addAdminActionsToResults( actions, results );

            // 2、获取用户的等级
            if (user.RankId > 0) {
                actions = tool.GetActionsByRole( user.Rank );
                addAdminActionsToResults( actions, results );
            }

            // 3、owner的角色
            if (ctx.owner.obj.GetType() != typeof( Site )) {
                IRole roleInOwner = ctx.owner.obj.GetUserRole( user );
                actions = tool.GetActionsByRole( roleInOwner );
                addAdminActionsToResults( actions, results );
            }

            // 3、版主
            ModeratorService moderatorService = new ModeratorService();
            if (moderatorService.IsModerator( board, user )) {

                IList moderatorActions = tool.GetActionsByRole( ForumRole.Moderator );
                addAdminActionsToResults( moderatorActions, results );
            }

            return results;
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:33,代码来源:PermissionUtil.cs

示例4: CreateAppAndMenu

        public virtual void CreateAppAndMenu( Group group, MvcContext ctx ) {
            
            // 添加程序
            IMemberApp forumApp = appService.Add( (User)ctx.viewer.obj, @group, lang.get( "groupBoard" ), 1, AccessStatus.Public );

            // 论坛
            ForumApp app = forumService.GetById( forumApp.AppOid );
            ForumPermission.AddOwnerAdminPermission( app );

            // 添加一个论坛板块
            ForumBoard board = new ForumBoard();
            board.Name = lang.get( "groupBoard" );
            board.ParentId = 0;
            board.AppId = forumApp.AppOid;

            board.Creator = (User)ctx.viewer.obj;
            board.CreatorUrl = ctx.viewer.obj.Url;

            board.OwnerId = group.Id;
            board.OwnerUrl = group.Url;
            board.OwnerType = typeof( Group ).FullName;
            board.Ip = ctx.Ip;

            board.Security = app.Security;

            db.insert( board );

            // 添加menuUrl
            String forumUrl = UrlConverter.clearUrl( board, ctx );
            menuService.AddMenuByApp( forumApp, forumApp.Name, "default", forumUrl );

        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:32,代码来源:GroupUtil.cs

示例5: ValidateBoard

        public static ForumBoard ValidateBoard( ForumBoard board, MvcContext ctx )
        {
            if (board == null) board = new ForumBoard();

            String name = ctx.Post( "Name" );
            if (strUtil.IsNullOrEmpty( name )) {
                ctx.errors.Add( lang.get( "exName" ) );
            }

            String description = ctx.Post( "Description" );
            int parentId = ctx.PostInt( "ParentId" );
            String notice = ctx.PostHtml( "Notice" );

            board.ParentId = parentId;
            board.Name = name;
            board.Description = description;
            board.Notice = notice;

            board.AppId = ctx.app.Id;
            board.Creator = (User)ctx.viewer.obj;
            board.CreatorUrl = ctx.viewer.obj.Url;
            board.OwnerId = ctx.owner.Id;
            board.OwnerUrl = ctx.owner.obj.Url;
            board.OwnerType = ctx.owner.obj.GetType().FullName;
            board.Ip = ctx.Ip;

            board.IsCategory = ctx.PostInt( "IsCategory" );
            board.ViewId = ctx.PostInt( "ViewId" );

            return board;
        }
开发者ID:robin88,项目名称:wojilu,代码行数:31,代码来源:ForumValidator.cs

示例6: GetModeratorHtml

 //------------------------------------------------------------------------------------
 public virtual String GetModeratorHtml( ForumBoard fb )
 {
     if (strUtil.IsNullOrEmpty( fb.Moderator )) {
         return string.Empty;
     }
     string[] arrM = fb.Moderator.Split( '|' );
     return this.getHtml( arrM );
 }
开发者ID:robin88,项目名称:wojilu,代码行数:9,代码来源:ModeratorService.cs

示例7: Combine

 public virtual void Combine( ForumBoard fbSrc, ForumBoard fbTarget ) {
     String action = "set ForumBoardId=" + fbTarget.Id;
     String condition = "ForumBoardId=" + fbSrc.Id;
     db.updateBatch<ForumTopic>( action, condition );
     db.updateBatch<ForumPost>( action, condition );
     this.UpdateStats( fbSrc );
     this.UpdateStats( fbTarget );
 }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:8,代码来源:ForumBoardService.cs

示例8: GetModeratorList

 //--------------------------------------------------------
 public virtual List<User> GetModeratorList( ForumBoard fb )
 {
     if (strUtil.IsNullOrEmpty( fb.Moderator )) {
         return new List<User>();
     }
     string[] arrM = fb.Moderator.Split( '|' );
     return this.getModeratorFromString( arrM );
 }
开发者ID:robin88,项目名称:wojilu,代码行数:9,代码来源:ModeratorService.cs

示例9: updatePost

        private static void updatePost( ForumBoard post )
        {
            if (post.OwnerType != typeof( Site ).FullName) return;

            IMember owner = Site.Instance;
            int appId = post.AppId;

            //LayoutViewCacher.Update( owner, appId );
            IndexViewCacher.Update( owner, appId );
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:10,代码来源:ForumInterceptor.cs

示例10: setCategory

 private void setCategory( ForumTopic topic, ForumBoard board ) {
     List<ForumCategory> categories = categoryService.GetByBoard( board.Id );
     if (categories.Count > 0) {
         categories.Insert( 0, new ForumCategory( 0, alang( "plsSelectCategory" ) ) );
         long categoryId = topic.Category == null ? 0 : topic.Category.Id;
         set( "post.Category", Html.DropList( categories, "CategoryId", "Name", "Id", categoryId ) );
     }
     else {
         set( "post.Category", string.Empty );
     }
 }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:11,代码来源:TopicController.cs

示例11: getStatusImg

        private String getStatusImg( ForumBoard board ) {

            if (strUtil.HasText( board.Logo )) return sys.Path.GetPhotoOriginal( board.Logo );

            //if (board.TodayPosts > 0) return strUtil.Join( sys.Path.Skin, "apps/forum/normalNew.gif" );
            //return strUtil.Join( sys.Path.Skin, "apps/forum/normal.gif" );

            if (board.TodayPosts > 0) return strUtil.Join( sys.Path.Skin, "site/new/board-new.png" );
            return strUtil.Join( sys.Path.Skin, "site/new/board.png" );

        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:11,代码来源:BoardController.cs

示例12: GetModeratorJson

 public virtual String GetModeratorJson( ForumBoard fb )
 {
     String[] arrName = GetModeratorNames( fb );
     if (arrName.Length == 0) return "[]";
     String str = "[";
     for (int i = 0; i < arrName.Length; i++) {
         str += "'"+arrName[i]+"'";
         if (i < arrName.Length - 1) str += ",";
     }
     str += "]";
     return str;
 }
开发者ID:robin88,项目名称:wojilu,代码行数:12,代码来源:ModeratorService.cs

示例13: Delete

 //------------------------------------------------------------------------------------
 public virtual void Delete( ForumBoard fb )
 {
     db.delete( fb );
     String action = "set Status=" + 3;
     String condition = "ForumBoardId=" + fb.Id;
     db.updateBatch<ForumTopic>( action, condition );
     db.updateBatch<ForumPost>( action, condition );
     action = "set ForumBoardId=0";
     condition = "ForumBoardId=" + fb.Id;
     db.updateBatch<ForumTopic>( action, condition );
     db.updateBatch<ForumPost>( action, condition );
 }
开发者ID:Boshin,项目名称:wojilu,代码行数:13,代码来源:ForumBoardService.cs

示例14: bindAddSubBoard

        //------------------------------------------------------------------------------
        private void bindAddSubBoard( int boardId, ForumBoard board )
        {
            set( "lblForumAction", alang( "addSubBoard" ) );

            set( "Name", ctx.Post( "Name" ) );
            set( "Description", ctx.Post( "Description" ) );
            set( "Notice", ctx.Post( "Notice" ) );
            set( "boardLogo", string.Empty );

            set( "CategoryDropDown", Html.InputHidden( "ParentId", boardId.ToString() ) + board.Name );
            set( "ViewId", BoardViewStatus.GetDropList( "ViewId", 0 ) );

            set( "chkIsCategory", Html.CheckBox( "IsCategory", alang( "noPost" ), "1", false ) );
        }
开发者ID:Boshin,项目名称:wojilu,代码行数:15,代码来源:BoardController.cs

示例15: setCategory

        private void setCategory( IBlock fbBlock, ForumBoard fb ) {

            fbBlock.Set( "board.StyleClass", "categoryRow" );
            fbBlock.Set( "board.AddUrl", string.Format( "<a href='{0}' class='frmBox' title='" + alang( "addSubBoard" ) + "'>+" + alang( "addSubBoard" ) + "</a>", to( AddSubBoard, fb.Id ) ) );

            fbBlock.Set( "board.EditUrl", to( EditBoard, fb.Id ) );
            fbBlock.Set( "board.DeleteUrl", to( DeleteCategory, fb.Id ) );
            fbBlock.Set( "board.SetCategory", string.Empty );
            fbBlock.Set( "board.Moderator", string.Empty );
            fbBlock.Set( "board.SetModerator", string.Empty );
            fbBlock.Set( "board.SetSecurity", string.Empty );
            fbBlock.Set( "deleteMsg", alang( "exDeleteSubFirst" ) );

        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:14,代码来源:BoardController.cs


注:本文中的ForumBoard类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。