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"); } }
public string BlogAuthorFollow(int userID, string postGuid) { SueetieBlogPost sueetieBlogPost = SueetieBlogs.GetSueetieBlogPost(postGuid); if (userID > 0) { if (sueetieBlogPost.SueetiePostID > 0) { string result = "You are now following " + sueetieBlogPost.DisplayName; SueetieFollow sueetieFollow = new SueetieFollow { FollowerUserID = userID, FollowingUserID = sueetieBlogPost.UserID, ContentIDFollowed = sueetieBlogPost.SueetiePostID }; 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 " + sueetieBlogPost.DisplayName; } SueetieLogs.LogUserEntry(UserLogCategoryType.Following, sueetieBlogPost.UserID, userID); } return(result); } else { return("Sorry, we added following after this post was written. Please use a more current post to follow this member."); } } else { return("Please login or become a member to follow this person."); } }