--- adsense_click.module 2009-10-16 15:02:35.000000000 +0000 +++ adsense_click_js_init.module 2009-10-16 15:04:13.000000000 +0000 @@ -13,6 +13,15 @@ define('ADSENSE_CLICK_TRACKING_NAME_RESOLVE_DEFAULT', 0); /** + * Implementation of hook_init(). +*/ +function adsense_click_init() { + if (variable_get('adsense_click_tracking', ADSENSE_CLICK_TRACKING_DEFAULT)) { + drupal_add_js(drupal_get_path('module', 'adsense_click') .'/adsense_click.js'); + } +} + +/** * Implementation of hook_menu(). */ function adsense_click_menu() { @@ -66,17 +75,6 @@ return array('view clicks'); } -/** - * Implementation of hook_footer(). - */ -function adsense_click_footer($main = 0) { - if (variable_get('adsense_click_tracking', ADSENSE_CLICK_TRACKING_DEFAULT)) { - $path = base_path() . drupal_get_path('module', 'adsense_click') .'/adsense_click.js'; - $js = ''; - return $js; - } -} - function adsense_click_register() { if (variable_get('adsense_click_tracking', ADSENSE_CLICK_TRACKING_DEFAULT)) { db_query("INSERT INTO {adsense_clicks} (ip, timestamp, path, title, referrer) values('%s', %d, '%s', '%s', '%s')",