【发布时间】:2013-09-21 16:12:40
【问题描述】:
我有一个内容类型“内容”,其中包含字段“值”(一个整数)和一个名为“发布内容并授予用户点数”的标志。每次内容被标记这个标记,我想授予内容的作者一些用户积分,等于“价值”字段中的值。 p>
我尝试使用规则模块解决我的问题的第一部分,如下所示:
*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: ...
但是,无法在“积分”部分选择flagged-node:field-value。我也试过了:
*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: ...
但是,变量“结果”不可用。我该如何解决这个问题?
【问题讨论】:
-
所以每次用户在节点上点击标记时,规则中必须在“值”字段中添加+1?
-
不,添加内容的用户必须获得与“价值”字段相同数量的用户积分。只有我作为管理员可以标记内容。标记后,“值”字段中的值不会改变。
-
您可以制定 5 条规则,每条规则都有条件:'If value is 1 = grants 1', 'If value has 2 = grants 2'...'If value has 5 = grants 5 '
-
好的,但这似乎需要做很多工作(想象一下,我最多想给 100 分之类的......)。我尝试了“计算一个值”:flagged-node:field-value + 0,因为这当然等于 Value 字段中的值。我将此结果称为“结果”。不幸的是,我不能授予标记内容“结果”用户积分的作者......或者我可以吗?
标签: drupal-7 flags drupal-rules userpoints