首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Drupal 7-5维斯特和用户点

Drupal 7-5维斯特和用户点
EN

Stack Overflow用户
提问于 2014-03-24 22:13:30
回答 1查看 314关注 0票数 1

我有一个内容类型和登录用户投票的可能性。节点上有5种不同的5种投票方式(类别)。现在我想添加用户名,并想问一问,当一个用户投票时,他在节点上的每一次投票都能得到1分,如果他在每一个类别中投票的话,他会得到5分。他有可能在稍后改变投票结果,但是他不应该再得到任何分数了。这个是可能的吗?

问候

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-25 10:21:34

虽然似乎没有一个现有的7.x或8.x模块可以实现这一点,但是有两种方法可以实现您的目标:

  • 编写一个模块,,,Userpoints有很好的文档记录。,应该可以创建一个模块,在修改5维斯特字段时增加用户的用户名计数。为了避免重复,请注意,这个字段看起来应该完成您正在寻找的去duping(假设您将txn_id设置为当前节点ID、字段ID和用户ID的某些组合:

'txn_id' => (int) Transaction ID of a current points record. If present an UPDATE occurs

  • 使用规则。用户点模块与规则集成,因此您应该能够完成您的用户名用例而无需编写任何代码。根据Userpoints规则集成说明,您可以将当前的用户名与事务之前的点数进行比较:

Compare Userpoints before the transaction - This condition is used to compare the amount of userpoints the user had before the userpoints was added to/deducted from the user against a specified value. - The 'Amount to compare' value is checked as >= (greater than or equal to) and the Negate checkbox will change the condition to < (less than) as it will be any value other than >=. If you would like to get an exact value, say 1, you can add two of the condition to use >= and < to specify one number. Simple math stuff here =)

我希望这能帮到你。告诉我是怎么回事!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22621698

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档