protected void Page_Load(object sender, EventArgs e)
        {
            string path = this.ViewName.ControlPath();

            ContentQuery contentQuery = new ContentQuery
            {
                NumRecords    = this.NumRecords,
                UserID        = this.UserID,
                ContentTypeID = (int)SueetieContentType.BlogComment,
                GroupID       = this.GroupID,
                ApplicationID = this.ApplicationID,
                IsRestricted  = this.IsRestricted,
                TruncateText  = false,
                CacheMinutes  = this.CacheMinutes
            };

            List <SueetieBlogComment> sueetieBlogComments = SueetieBlogs.GetSueetieBlogCommentList(contentQuery);

            foreach (SueetieBlogComment comment in sueetieBlogComments)
            {
                Sueetie.Controls.BlogCommentView control = (Sueetie.Controls.BlogCommentView)LoadControl(path);
                control.Comment = comment;
                phBlogComments.Controls.Add(control);
            }
        }
Exemplo n.º 2
0
    public List <SueetieBlogComment> GetRecentComments(int numRecords, int userID, int applicationID, bool isRestricted)
    {
        ContentQuery contentQuery = new ContentQuery
        {
            NumRecords    = numRecords,
            UserID        = userID,
            ContentTypeID = (int)SueetieContentType.BlogComment,
            GroupID       = -1,
            ApplicationID = applicationID,
            IsRestricted  = isRestricted,
            TruncateText  = true
        };

        List <SueetieBlogComment> _sueetieBlogComments = SueetieBlogs.GetSueetieBlogCommentList(contentQuery);

        foreach (SueetieBlogComment msg in _sueetieBlogComments)
        {
            msg.Comment = DataHelper.TruncateText(msg.Comment, SueetieConfiguration.Get().Core.TruncateTextCount);
        }
        return(_sueetieBlogComments);
    }