You are here

function _adsense_check_if_enabled in Google AdSense integration 5.2

Same name and namespace in other branches
  1. 5.3 adsense.module \_adsense_check_if_enabled()
  2. 5 adsense.module \_adsense_check_if_enabled()
  3. 6 adsense.module \_adsense_check_if_enabled()
  4. 7 adsense.module \_adsense_check_if_enabled()
1 call to _adsense_check_if_enabled()
adsense_display in ./adsense.module

File

./adsense.module, line 1034

Code

function _adsense_check_if_enabled() {
  $client_id = adsense_get_client_id();
  $disable_ads = variable_get(ADSENSE_DISABLE, '0');
  if (!$client_id) {

    // Google AdSense Client ID is not configured
    return FALSE;
  }
  if ($disable_ads) {
    return FALSE;
  }
  if (variable_get(ADSENSE_TEST_MODE, 0)) {
    return TRUE;
  }
  if (user_access('hide adsense')) {
    return FALSE;
  }
  return TRUE;
}