/// <summary> /// 发帖成功 /// </summary> /// <param name="values">版块积分设置</param> /// <param name="topicinfo">主题信息</param> /// <param name="topicid">主题ID</param> private void PostTopicSucceed(float[] values, TopicInfo topicinfo, int topicid) { if (values != null) ///使用版块内积分 { UserCredits.UpdateUserExtCredits(userid, values, false); if (userid != -1) UserCredits.WriteUpdateUserExtCreditsCookies(values); } else ///使用默认积分 { UserCredits.UpdateUserCreditsByPostTopic(userid); if (userid != -1) UserCredits.WriteUpdateUserExtCreditsCookies(Scoresets.GetUserExtCredits(CreditsOperationType.PostTopic)); } //当使用伪aspx if (config.Aspxrewrite == 1) SetUrl(topicinfo.Special == 4 ? ShowDebateAspxRewrite(topicid) : ShowTopicAspxRewrite(topicid, 0)); else SetUrl((topicinfo.Special == 4 ? ShowDebateAspxRewrite(topicid) : ShowTopicAspxRewrite(topicid, 0)) + "&forumpage=" + forumpageid); ForumUtils.WriteCookie("postmessage", ""); ForumUtils.WriteCookie("clearUserdata", "forum"); SetLastPostedForumCookie(); SetMetaRefresh(); MsgForward("posttopic_succeed"); AddMsgLine("发表主题成功, 返回该主题<br />(<a href=\"" + base.ShowForumAspxRewrite(forumid, forumpageid) + "\">点击这里返回 " + forum.Name + "</a>)<br />"); //通知应用有新主题 Sync.NewTopic(topicid.ToString(), topicinfo.Title, topicinfo.Poster, topicinfo.Posterid.ToString(), topicinfo.Fid.ToString(), ""); }
public void BindDownloadAttachmentTip() { if (!Scoresets.IsSetDownLoadAttachScore()) { return; } float[] userExtCredits = Scoresets.GetUserExtCredits(CreditsOperationType.DownloadAttachment); string[] validScoreName = Scoresets.GetValidScoreName(); string[] validScoreUnit = Scoresets.GetValidScoreUnit(); for (int i = 0; i < userExtCredits.Length; i++) { if (userExtCredits[i] < 0f) { this.downloadattachmenttip += string.Format("{0}:{1} {2};", validScoreName[i + 1], Math.Abs(userExtCredits[i]), validScoreUnit[i + 1]); } } this.downloadattachmenttip = this.downloadattachmenttip.TrimEnd(';'); }
/// <summary> /// 更新用户积分 /// </summary> /// <param name="values">版块积分设置</param> private void UpdateUserCredits(float[] values) { if (values != null) { UserCredits.UpdateUserExtCredits(userid, values, false);//使用版块内积分 if (userid != -1) { UserCredits.WriteUpdateUserExtCreditsCookies(values); } } else { UserCredits.UpdateUserCreditsByPosts(userid);//使用默认积分 if (userid != -1) { UserCredits.WriteUpdateUserExtCreditsCookies(Scoresets.GetUserExtCredits(CreditsOperationType.PostReply)); } } }
public string GetUserInviteScore(int mount) { float num = (float)(mount - this.invitationconfiginfo.InviteCodePayCount); if (num > 0f) { float[] userExtCredits = Scoresets.GetUserExtCredits(CreditsOperationType.Invite); string text = ""; for (int i = 0; i < userExtCredits.Length; i++) { if ((double)userExtCredits[i] != 0.0) { text += string.Format("{0}:{1}{2} ;", this.extcreditnames[i + 1], userExtCredits[i] * (float)mount, this.extcreditunits[i + 1]); } } return(text); } return("该邀请码尚未达到兑换条件!"); }
public void BindDownloadAttachmentTip() { if (!Scoresets.IsSetDownLoadAttachScore()) { return; } float[] extCredits = Scoresets.GetUserExtCredits(CreditsOperationType.DownloadAttachment); string[] extCreditNames = Scoresets.GetValidScoreName(); string[] extCreditUnits = Scoresets.GetValidScoreUnit(); for (int i = 0; i < extCredits.Length; i++) { if (extCredits[i] < 0)//只提示扣分的扩展积分信息 { downloadattachmenttip += string.Format("{0}:{1} {2};", extCreditNames[i + 1], System.Math.Abs(extCredits[i]), extCreditUnits[i + 1]); } } downloadattachmenttip = downloadattachmenttip.TrimEnd(';'); }
/// <summary> /// 获取用户开放式邀请码的兑换价值 /// </summary> /// <param name="mount"></param> /// <returns></returns> public string GetUserInviteScore(int mount) { float realMount = (float)(mount - invitationconfiginfo.InviteCodePayCount); if (realMount > 0) { float[] extCredits = Scoresets.GetUserExtCredits(CreditsOperationType.Invite); string userInviteScore = ""; for (int i = 0; i < extCredits.Length; i++) { if (extCredits[i] != 0.00) { userInviteScore += string.Format("{0}:{1}{2} ;", extcreditnames[i + 1], extCredits[i] * mount, extcreditunits[i + 1]); } } return(userInviteScore); } else { return("该邀请码尚未达到兑换条件!"); } }