You are here

function _rate_expiration_get_node_values in Rate 6.2

Same name and namespace in other branches
  1. 7 expiration/rate_expiration.module \_rate_expiration_get_node_values()

Get configuration for a widgets on a given node.

2 calls to _rate_expiration_get_node_values()
rate_expiration_form_alter in expiration/rate_expiration.module
Implements hook_form_alter().
rate_expiration_rate_widget in expiration/rate_expiration.module
Implements hook_rate_widget().

File

expiration/rate_expiration.module, line 87

Code

function _rate_expiration_get_node_values($nid) {
  static $cache = array();
  if (isset($cache[$nid])) {
    return $cache[$nid];
  }
  $output = array();
  $sql = 'SELECT re.widget_name, re.start, re.end
  FROM {rate_expiration} re
  WHERE nid = %d';
  $res = db_query($sql, $nid);
  while ($rec = db_fetch_array($res)) {
    $output[$rec['widget_name']] = $rec;
  }
  $cache[$nid] = $output;
  return $output;
}