예제 #1
0
        public static int CreateSueetieApplication(int applicationId, string appKey, string appDescription, int groupId, int appTypeId)
        {
            var sueetieApplication = new SueetieApplication
            {
                ApplicationID     = applicationId,
                ApplicationKey    = appKey,
                GroupID           = groupId,
                ApplicationTypeID = appTypeId,
                Description       = appDescription
            };

            var provider = SueetieDataProvider.LoadProvider();

            provider.CreateSueetieApplication(sueetieApplication);
            if (sueetieApplication.ApplicationTypeID == (int)SueetieApplicationType.Blog && sueetieApplication.GroupID == 0)
            {
                var sueetieBlog = new SueetieBlog
                {
                    ApplicationID = applicationId,
                    BlogTitle     = sueetieApplication.Description
                };
                SueetieBlogs.CreateSueetieBlog(sueetieBlog);
            }

            ClearApplicationListCache();
            return(applicationId);
        }
예제 #2
0
        public string BlogFaveComment(int userID, string postGuid)
        {
            SueetieBlogComment sueetieBlogComment = SueetieBlogs.GetSueetieBlogComment(postGuid);

            if (userID > 0)
            {
                if (sueetieBlogComment.SueetieCommentID > 0)
                {
                    string      result      = "You tagged this comment by " + sueetieBlogComment.Author + " as a favorite!";
                    UserContent userContent = new UserContent
                    {
                        ContentID = sueetieBlogComment.ContentID,
                        UserID    = userID
                    };

                    int favoriteID = SueetieUsers.CreateFavorite(userContent);
                    if (favoriteID < 0)
                    {
                        result = "You already tagged this comment as a favorite.";
                    }

                    return(result);
                }
                else
                {
                    return("Sorry, we added favorites after this comment was written. Please consider tagging more recent comments as favorites.");
                }
            }
            else
            {
                return("Please login or become a member to tag this comment as a favorite");
            }
        }
예제 #3
0
        public string BlogFavePost(int userID, string postGuid)
        {
            SueetieBlogPost sueetieBlogPost = SueetieBlogs.GetSueetieBlogPost(postGuid);

            if (userID > 0)
            {
                if (sueetieBlogPost.SueetiePostID > 0)
                {
                    string      result      = "You have tagged " + sueetieBlogPost.Title + " as a favorite!";
                    UserContent userContent = new UserContent
                    {
                        ContentID = sueetieBlogPost.ContentID,
                        UserID    = userID
                    };

                    int favoriteID = SueetieUsers.CreateFavorite(userContent);
                    if (favoriteID < 0)
                    {
                        result = "You already tagged this post as a favorite.";
                    }

                    return(result);
                }
                else
                {
                    return("Sorry, we added favorites after this post was published. Please consider tagging more recent posts as favorites.");
                }
            }
            else
            {
                return("Please login or become a member to tag this post as a favorite");
            }
        }
예제 #4
0
        public string BlogCommenterFollow(int userID, string postGuid)
        {
            SueetieBlogComment sueetieBlogComment = SueetieBlogs.GetSueetieBlogComment(postGuid);

            if (userID > 0)
            {
                if (sueetieBlogComment.SueetieCommentID > 0)
                {
                    string        result        = "You are now following " + sueetieBlogComment.DisplayName;
                    SueetieFollow sueetieFollow = new SueetieFollow
                    {
                        FollowerUserID    = userID,
                        FollowingUserID   = sueetieBlogComment.UserID,
                        ContentIDFollowed = sueetieBlogComment.SueetieCommentID
                    };

                    if (sueetieBlogComment.UserID > 0)
                    {
                        if (sueetieFollow.FollowerUserID == sueetieFollow.FollowingUserID)
                        {
                            result = "Sorry, you cannot follow yourself...";
                        }
                        else
                        {
                            int followID = SueetieUsers.FollowUser(sueetieFollow);
                            if (followID < 0)
                            {
                                result = "You are already following " + sueetieBlogComment.DisplayName;
                            }
                            else
                            {
                                SueetieLogs.LogUserEntry(UserLogCategoryType.Following, sueetieBlogComment.UserID, userID);
                            }
                        }
                    }
                    else
                    {
                        result = "Sorry, " + sueetieBlogComment.Author + " is not a member and thus cannot be followed.";
                    }
                    return(result);
                }
                else
                {
                    return("Sorry, we added following after this comment was posted. Please use a more current comment to follow this member.");
                }
            }
            else
            {
                return("Please login or become a member to follow this person.");
            }
        }
예제 #5
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);
        }