Exemplo n.º 1
0
 protected string ShowForumAspxRewrite(int forumid, int pageid, string rewritename)
 {
     return(Urls.ShowForumAspxRewrite(forumid, pageid, rewritename));
 }
Exemplo n.º 2
0
        public static string GetForumsRankHtml(List <XForum> forums, string type, int maxrows)
        {
            var sb = new StringBuilder();

            foreach (IXForum current in forums)
            {
                sb.AppendFormat("<li><em>{0}</em><a href=\"{1}\" target=\"_blank\">{2}</a></li>", (type == "topics") ? current.Topics : current.Posts, Urls.ShowForumAspxRewrite(current.Fid, 0), current.Name);
                maxrows--;
            }
            for (int i = 0; i < maxrows; i++)
            {
                sb.Append("<li>&nbsp;</li>");
            }
            return(sb.ToString());
        }
Exemplo n.º 3
0
 protected string ShowForumAspxRewrite(string pathlist, int forumid, int pageid)
 {
     return(Urls.ShowForumAspxRewrite(pathlist, forumid, pageid));
 }
Exemplo n.º 4
0
        //public static string GetForumListBoxOptionsCache()
        //{
        //	return Caches.GetForumListBoxOptionsCache(false);
        //}

        public static string GetForumListMenuDivCache(int usergroupid, int userid, string extname)
        {
            var    cacheService = XCache.Current;
            string text         = cacheService.RetrieveObject(CacheKeys.FORUM_FORUM_LIST_MENU_DIV) as string;

            if (text.IsNullOrEmpty())
            {
                var sb        = new StringBuilder();
                var forumList = XForum.Root.Childs;
                if (forumList.Count > 0)
                {
                    sb.Append("<div class=\"popupmenu_popup\" id=\"forumlist_menu\" style=\"overflow-y: auto; display:none\">");
                    foreach (var item in forumList)
                    {
                        if (item.Visible && item.AllowView(7) && item.Layer == 0)
                        {
                            sb.AppendFormat("<dl><dt><a href=\"{0}\">{1}</a></dt><dd><ul>", BaseConfigs.GetForumPath + Urls.ShowForumAspxRewrite(item.ID, 0, item.Field.RewriteName), item.Name);
                            foreach (var elm in item.Childs)
                            {
                                if (elm.Layer == 1 && elm.Visible)
                                {
                                    sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", BaseConfigs.GetForumPath + Urls.ShowForumAspxRewrite(elm.ID, 0, elm.Field.RewriteName), elm.Name);
                                }
                            }
                            sb.Append("</ul></dd></dl>");
                        }
                    }
                }
                sb.Append("</div>");
                text = sb.ToString().Replace("<dd><ul></ul></dd>", "");
                XCache.Add(CacheKeys.FORUM_FORUM_LIST_MENU_DIV, text);
            }
            return(text);
        }