Exemplo n.º 1
0
        protected string GetThreadCatalogLinks(string linkStyle, string currentLinkStyle)
        {
            if (Forum.ThreadCatalogStatus == ThreadCatalogStatus.DisEnable)
            {
                return(string.Empty);
            }

            if (string.IsNullOrEmpty(linkStyle))
            {
                linkStyle = "<a href=\"{0}\">{1}</a>";
            }
            if (string.IsNullOrEmpty(currentLinkStyle))
            {
                currentLinkStyle = "<a class=\"threadCatalogSelected\">{1}</a>";
            }

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            appendThreadTypeLink(sb, "list", "全部", linkStyle, currentLinkStyle);
            foreach (ThreadCatalog threadCatalog in ThreadCatalogs)
            {
                if (ThreadCatalogID == threadCatalog.ThreadCatalogID)
                {
                    sb.Append(string.Format(currentLinkStyle, BbsUrlHelper.GetThreadCatalogUrl(Forum.CodeName, threadCatalog.ThreadCatalogID, 1), threadCatalog.ThreadCatalogName));
                }
                //sb.Append("<a class=\"threadCatalogSelected\">" + threadCatalog.ThreadCatalogName + "</a> ");
                else
                {
                    sb.Append(string.Format(linkStyle, BbsUrlHelper.GetThreadCatalogUrl(Forum.CodeName, threadCatalog.ThreadCatalogID, 1), threadCatalog.ThreadCatalogName));
                }
            }
            if (Forum.ThreadCatalogStatus != ThreadCatalogStatus.EnableAndMust)
            {
                if (ThreadCatalogID == 0)
                {
                    sb.Append(string.Format(currentLinkStyle, BbsUrlHelper.GetThreadCatalogUrl(Forum.CodeName, 0, 1), "其他"));
                }
                else
                {
                    sb.Append(string.Format(linkStyle, BbsUrlHelper.GetThreadCatalogUrl(Forum.CodeName, 0, 1), "其他"));
                }
            }
            return(sb.ToString());
        }