public static void PostTopic(int userId, IXForum forumInfo, bool isNeedAnimation) { if (userId == -1) { return; } float[] values = Forums.GetValues(forumInfo.PostcrEdits); if (values != null) { UpdateUserExtCredits(userId, values, false); } else { UpdateUserExtCredits(userId, 1, CreditsOperationType.PostTopic, 1, false); } if (isNeedAnimation) { WriteUpdateUserExtCreditsCookies((values != null) ? values : Scoresets.GetUserExtCredits(CreditsOperationType.PostTopic)); } }
//public static void PostReply(int userId, IXForum forumInfo, bool isNeedAnimation = false) public static void PostReply(int userId, String replyCredits, bool isNeedAnimation = false) { if (userId == -1) { return; } float[] values = Forums.GetValues(replyCredits); if (values != null) { UpdateUserExtCredits(userId, values, false); } else { UpdateUserExtCredits(userId, 1, CreditsOperationType.PostReply, 1, false); } if (isNeedAnimation) { WriteUpdateUserExtCreditsCookies((values != null) ? values : Scoresets.GetUserExtCredits(CreditsOperationType.PostReply)); } }
public static void DeletePost(Post pi, bool reserveAttach) { var config = GeneralConfigInfo.Current; if (config.Losslessdel == 0 || pi.PostDateTime.AddHours(config.Losslessdel * 24) > DateTime.Now) { var type = (pi.Layer == 0) ? CreditsOperationType.PostTopic : CreditsOperationType.PostReply; var forumInfo = pi.Forum as IXForum; float[] array = Forums.GetValues((type == CreditsOperationType.PostTopic) ? forumInfo.PostcrEdits : forumInfo.ReplycrEdits); if (array == null) { array = Scoresets.GetUserExtCredits(type); } UpdateUserExtCredits(pi.PosterID, array, 1, type, -1, true); if (!reserveAttach) { int att = Attachment.FindCountByPid(pi.ID); if (att != 0) { DeleteAttachments(pi.PosterID, att); } } } }
private static int UpdateUserExtCredits(int uid, int mount, CreditsOperationType creditsOperationType, int pos, bool allowMinus) { return(UpdateUserExtCredits(uid, Scoresets.GetUserExtCredits(creditsOperationType), mount, creditsOperationType, pos, allowMinus)); }