コード例 #1
0
        protected string FormatUrl(int threadId)
        {
            if (ForumConfiguration.CombineUrlParams)
            {
                return(SiteRoot + "/Forums/Thread.aspx?pageid="
                       + PageId.ToInvariantString()
                       + "&t=" + ThreadParameterParser.FormatCombinedParam(threadId, 1));
            }

            return(SiteRoot + "/Forums/Thread.aspx?pageid="
                   + PageId.ToInvariantString()
                   + "&mid=" + ModuleId.ToInvariantString()
                   + "&ItemID=" + itemId.ToInvariantString()
                   + "&thread=" + threadId.ToInvariantString()
                   );
        }
コード例 #2
0
ファイル: Thread.aspx.cs プロジェクト: pierreshiny/mojoportal
        private void LoadParams()
        {
            PageId = WebUtils.ParseInt32FromQueryString("pageid", PageId);
            //moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
            //ItemId = WebUtils.ParseInt32FromQueryString("ItemID", ItemId);
            //threadId = WebUtils.ParseInt32FromQueryString("thread", threadId);
            //PageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", PageNumber);

            threadParams = new ThreadParameterParser(this);
            threadParams.Parse();

            moduleId   = threadParams.ModuleId;
            ItemId     = threadParams.ItemId;
            threadId   = threadParams.ThreadId;
            PageNumber = threadParams.PageNumber;


            IsAdmin        = WebUser.IsAdmin;
            IsEditable     = UserCanEditModule(moduleId, Forum.FeatureGuid);
            moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
            config         = new ForumConfiguration(moduleSettings);

            postList.Config                 = config;
            postList.PageId                 = PageId;
            postList.ModuleId               = moduleId;
            postList.ItemId                 = ItemId;
            postList.ThreadId               = threadId;
            postList.PageNumber             = PageNumber;
            postList.IsAdmin                = IsAdmin;
            postList.IsCommerceReportViewer = WebUser.IsInRoles(siteSettings.CommerceReportViewRoles);
            postList.SiteRoot               = SiteRoot;
            postList.ImageSiteRoot          = ImageSiteRoot;
            postList.SiteSettings           = siteSettings;
            postList.IsEditable             = IsEditable;

            postListAlt.Config                 = config;
            postListAlt.PageId                 = PageId;
            postListAlt.ModuleId               = moduleId;
            postListAlt.ItemId                 = ItemId;
            postListAlt.ThreadId               = threadId;
            postListAlt.PageNumber             = PageNumber;
            postListAlt.IsAdmin                = IsAdmin;
            postListAlt.IsCommerceReportViewer = WebUser.IsInRoles(siteSettings.CommerceReportViewRoles);
            postListAlt.SiteRoot               = SiteRoot;
            postListAlt.ImageSiteRoot          = ImageSiteRoot;
            postListAlt.SiteSettings           = siteSettings;
            postListAlt.IsEditable             = IsEditable;

            if (Request.IsAuthenticated)
            {
                if (currentUser == null)
                {
                    currentUser = SiteUtils.GetCurrentSiteUser();
                }

                if ((currentUser != null) && (ItemId > -1))
                {
                    postList.UserId = currentUser.UserId;
                    postList.IsSubscribedToForum = Forum.IsSubscribed(ItemId, currentUser.UserId);

                    postListAlt.UserId = currentUser.UserId;
                    postListAlt.IsSubscribedToForum = postList.IsSubscribedToForum;
                }
            }

            if (displaySettings.UseAltPostList)
            {
                postList.Visible    = false;
                postListAlt.Visible = true;
            }

            if (displaySettings.OverrideThreadHeadingElement.Length > 0)
            {
                heading.HeadingTag = displaySettings.OverrideThreadHeadingElement;
            }

            AddClassToBody("forumthread");

            if (config.InstanceCssClass.Length > 0)
            {
                pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass);
            }

            if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0))
            {
                AddClassToBody(CurrentPage.BodyCssClass);
            }
        }
コード例 #3
0
ファイル: Thread.aspx.cs プロジェクト: joedavis01/mojoportal
        private void LoadParams()
        {
            PageId = WebUtils.ParseInt32FromQueryString("pageid", PageId);
            //moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
            //ItemId = WebUtils.ParseInt32FromQueryString("ItemID", ItemId);
            //threadId = WebUtils.ParseInt32FromQueryString("thread", threadId);
            //PageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", PageNumber);

            threadParams = new ThreadParameterParser(this);
            threadParams.Parse();

            moduleId = threadParams.ModuleId;
            ItemId = threadParams.ItemId;
            threadId = threadParams.ThreadId;
            PageNumber = threadParams.PageNumber;

            IsAdmin = WebUser.IsAdmin;
            IsEditable = UserCanEditModule(moduleId, Forum.FeatureGuid);
            moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
            config = new ForumConfiguration(moduleSettings);

            postList.Config = config;
            postList.PageId = PageId;
            postList.ModuleId = moduleId;
            postList.ItemId = ItemId;
            postList.ThreadId = threadId;
            postList.PageNumber = PageNumber;
            postList.IsAdmin = IsAdmin;
            postList.IsCommerceReportViewer = WebUser.IsInRoles(siteSettings.CommerceReportViewRoles);
            postList.SiteRoot = SiteRoot;
            postList.ImageSiteRoot = ImageSiteRoot;
            postList.SiteSettings = siteSettings;
            postList.IsEditable = IsEditable;

            postListAlt.Config = config;
            postListAlt.PageId = PageId;
            postListAlt.ModuleId = moduleId;
            postListAlt.ItemId = ItemId;
            postListAlt.ThreadId = threadId;
            postListAlt.PageNumber = PageNumber;
            postListAlt.IsAdmin = IsAdmin;
            postListAlt.IsCommerceReportViewer = WebUser.IsInRoles(siteSettings.CommerceReportViewRoles);
            postListAlt.SiteRoot = SiteRoot;
            postListAlt.ImageSiteRoot = ImageSiteRoot;
            postListAlt.SiteSettings = siteSettings;
            postListAlt.IsEditable = IsEditable;

            if (Request.IsAuthenticated)
            {
                if (currentUser == null) { currentUser = SiteUtils.GetCurrentSiteUser(); }

                if ((currentUser != null) && (ItemId > -1))
                {
                    postList.UserId = currentUser.UserId;
                    postList.IsSubscribedToForum = Forum.IsSubscribed(ItemId, currentUser.UserId);

                    postListAlt.UserId = currentUser.UserId;
                    postListAlt.IsSubscribedToForum = postList.IsSubscribedToForum;

                }

            }

            if (displaySettings.UseAltPostList)
            {
                postList.Visible = false;
                postListAlt.Visible = true;
            }

            if (displaySettings.OverrideThreadHeadingElement.Length > 0)
            {
                heading.HeadingTag = displaySettings.OverrideThreadHeadingElement;
            }

            AddClassToBody("forumthread");

            if (config.InstanceCssClass.Length > 0) { pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass); }

            if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0))
            {
                AddClassToBody(CurrentPage.BodyCssClass);
            }
        }