*/ $gads_loaded = 0; function gads_load() { global $gads_loaded, $gads_settings; $gads_file = dirname(__FILE__) . '/local_pref.php'; if ($gads_loaded == 0) { if (file_exists($gads_file)) { include($gads_file); $gads_loaded = 1; } } } function gads_write($fp, $name, $val) { fwrite($fp, '$gads_settings[\'' . $name . '\'] = \'' . $val . '\';' . "\n"); } function gads_save() { global $gads_loaded, $gads_settings; $gads_file = dirname(__FILE__) . '/local_pref.php'; if (is_writable($gads_file) || is_writable(dirname(__FILE__))) { $fp = fopen($gads_file, "w"); fwrite($fp, '' . 'Google AdSense preferences saved successfully.' . ''); } else { ptln('
' . 'Google AdSense preferences is not writable by the server.' . '
'); } } function gads_code() { global $gads_loaded, $gads_settings, $conf, $INFO; if ($gads_settings['code']) { if ($GLOBALS['ACT'] != 'show') { return; } if ($gads_settings['dontcountusers'] and $INFO['client']) { return; } if ($gads_settings['dontcountmanager'] and ($INFO['ismanager'] and not($INFO['isadmin']))) { return; } if ($gads_settings['dontcountadmin'] and $INFO['isadmin']) { return; } ptln(stripslashes($gads_settings['code'])); } } //Load settings gads_load();