本文介绍了如何授予用户用户点数等于某个字段的值/计算值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个内容类型'Content',字段为'Value'(一个整数),还有一个标记叫做发布内容并授予用户。每次内容被标记为时,我希望授予内容作者一些用户点数,等于值字段中的值。 p>

我尝试解决我的问题的第一部分与规则模块,如下所示:

  *事件:在发布内容并向用户授予点下,已经标记了一个节点

*条件:内容类型为内容

*操作:给用户的赠款点:...

但是,不可能选择标记节点:字段值。我还尝试过:

  *事件:在发布内容并授予用户点下,已经标记了一个节点

*条件:内容类型为内容

*操作:

- 计算值:`[flagged-node:field-value] +0.(变量名=结果)

- 授予用户的点数:...

但是,变量'result'不可用。我如何解决这个问题?

解决方案

我终于找到了一个解决方案!我完成了第二个场景(用户积分的数量计算)成功!显然,用户点模块不知道计算是一个整数。因此,我不得不添加一个额外的动作转换数据类型目标类型:整数,要转换的值:[结果],舍入行为:始终向下。我称之为总计,并授予用户此数量的用户积分。


I've a content type 'Content' with the field 'Value' (an integer) and a flag called 'Publish Content and grant points to user'. Every time a Content is flagged with this flag, I'd like to grant the Content's author some User Points, equal to the value in the 'Value' field.

I tried solving the first part of my problem with the Rules module like this:

*Event: A node has been flagged, under "Publish Content and grant points to user"

*Conditions: Content is of type 'Content'

*Actions: Grant points to a user: ...

However, it's impossible to pick flagged-node:field-value in the Points section. I also tried:

*Event: A node has been flagged, under "Publish Content and grant points to user"

*Conditions: Content is of type 'Content'

*Actions:

 - Calculate a value: `[flagged-node:field-value]` "+" 0. (Variable name = result)

 - Grant points to a user: ...

But then, the variable 'result' is not available. How can I solve this issue?

解决方案

I finally found a solution! I completed the second scenario (the amount of User Points is calculated) successfuly! Apparently, the User Points module didn't know that the calculation was an integer. Therefore, I had to add an extra action Convert data type: Target type: Integer, Value to convert: [result], Rounding behavior: Always down. I called it 'total' and granted the user this amount of User Points.

这篇关于如何授予用户用户点数等于某个字段的值/计算值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 17:37