You are here

function radioactivity_add_energy in Radioactivity 6

Same name and namespace in other branches
  1. 5 radioactivity.inc \radioactivity_add_energy()

Add energy to nodes.

Parameters

$oid Object id:

$oclass Object base class, e.g. 'node'. Subclass will be resolved if necessary:

$source Energy source, e.g. 'view':

$allow_delayed_processing TRUE if delayed processing is allowed (memcache acceleration):

Return value

TRUE if successful

7 calls to radioactivity_add_energy()
radioactivity_debug_add_energy_form_submit in plugins/radioactivity_debug.module
radioactivity_fivestar_voting_votingapi_insert in plugins/radioactivity_fivestar_voting.module
Implement hook_votingapi_insert().
radioactivity_node_comment in plugins/radioactivity_node.module
radioactivity_node_nodeapi in plugins/radioactivity_node.module
radioactivity_node_user_node_view in plugins/radioactivity_node.module
Gives energy to node, if abuse control is passed.

... See full list

1 string reference to 'radioactivity_add_energy'
radioactivity_node_user_node_view in plugins/radioactivity_node.module
Gives energy to node, if abuse control is passed.

File

./radioactivity.inc, line 187

Code

function radioactivity_add_energy($oid, $oclass, $source, $allow_delayed_processing = TRUE) {
  if ($allow_delayed_processing && radioactivity_get_memcached_enable()) {

    // postpone event to memcache
    if (radioactivity_write_memcache_entry(array(
      'type' => 'add-energy',
      'oid' => $oid,
      'oclass' => $oclass,
      'source' => $source,
    ))) {
      return TRUE;
    }
  }
  return _radioactivity_add_energy_internal($oid, $oclass, $source, 1);
}