You are here

function drupagram_actions_has_linked in Drupagram 7

The callback function for the Rules condition

Parameters

$element: $element['user']: The user to be checked for.

Return value

TRUE if the user has linked his/her drupagram account.

1 string reference to 'drupagram_actions_has_linked'
drupagram_actions_rules_condition_info in drupagram_actions/drupagram_actions.rules.inc
Implements hook_rules_condition_info().

File

drupagram_actions/drupagram_actions.rules.inc, line 98
Provide better intergration into the rules module

Code

function drupagram_actions_has_linked($element) {
  return db_query("SELECT drupagram_id FROM {drupagram_account} WHERE uid = :uid", array(
    ':uid' => $element['user']->uid,
  ))
    ->fetchField() ? TRUE : FALSE;
}