You are here

function radioactivity_node_ajax_callback in Radioactivity 6

AJAX Menu Callback.

1 string reference to 'radioactivity_node_ajax_callback'
radioactivity_node_menu in plugins/radioactivity_node.module

File

plugins/radioactivity_node.module, line 285
Node radioactivity

Code

function radioactivity_node_ajax_callback() {
  if (!isset($_GET['nid'])) {
    return drupal_not_found();
  }
  $nid = isset($_GET['nid']) ? $_GET['nid'] : NULL;
  if (!isset($_GET['js'])) {
    header('Content-type: image/gif');
    header('Expires: Sun, 19 Nov 1978 05:00:00 GMT');
    header('Cache-Control: no-cache');
    header('Cache-Control: must-revalidate');
    header('Content-Length: 0');
    header('Connection: close');
  }
  global $conf;
  $conf['cache'] = CACHE_DISABLED;

  // Silent ignore if the mode is not ajax. Also, check that nid is numeric and >0.
  if (variable_get('radioactivity_node_anon_hook_mode', '') == 'ajax' && is_numeric($nid) && $nid) {
    radioactivity_node_user_node_view($nid);
  }
}