コード例 #1
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");
            }
        }
コード例 #2
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.");
            }
        }