ID.";\n"; $roles = $current_user->roles; $role = array_shift( $roles ); if (!empty($role)) $code .="vdata.role='$role';\n"; if (!empty($current_user->user_login)) $code .="vdata.username='".$current_user->user_login."';\n"; if (!empty($current_user->user_email)) $code .="vdata.email='".$current_user->user_email."';\n"; if (!empty($current_user->user_firstname)) $code .="vdata.firstname='".$current_user->user_firstname."';\n"; if (!empty($current_user->user_lastname))$code .="vdata.lastname='".$current_user->user_lastname."';\n"; if (!empty($current_user->display_name)) $code .="vdata.displayedname='".$current_user->display_name."';\n"; $code.="var ol= Object.keys(vdata).length;\n"; //$code.="console.log('vdata->',ol);\n"; $code.="if (ol>2){\n"; $code .="aa('set','visitor',vdata);\n"; $code .="aa('send','visitor');\n"; $code.="var d = new Date();\n"; $code.="d.setTime(d.getTime() +((3600*12)*1000));\n"; $code.="var expires = 'expires='+ d.toUTCString();\n"; $code.="document.cookie = 'afssetuser=1;'+expires+';path=/';\n"; $code.="}\n"; } } return($code); } function admin_tracking() { $admin_pages_tracking= get_option("afs_admin_pages_tracking"); if ( $admin_pages_tracking==1) $this->wp_footer(); } function wp_footer() { //echo stripcslashes(get_option('afs_code')); $afs_account = stripcslashes(get_option('afs_account')); $afs_server = ""; if ($afs_account > 99999) $afs_server = '1'; if ($afs_account > 199999) $afs_server = '2'; if ($afs_account > 299999) $afs_server = '3'; if ($afs_account > 399999) $afs_server = '4'; if ($afs_account > 499999) $afs_server = '5'; if ($afs_account > 599999) $afs_server = '6'; if ($afs_account > 699999) $afs_server = '7'; if ($afs_account > 799999) $afs_server = '8'; if ($afs_account > 899999) $afs_server = '9'; if ($afs_account > 999999) $afs_server = '10'; global $post; $postID = get_the_ID(); $trackerflag=0; if (!isset($trackername)) { $flagid=0; if (is_home()) { $trackername = get_bloginfo('name'); $trackerflag=1; } else { if (is_attachment ($postID)==false && is_page ($postID)==false && is_single ($postID)==false) { $trackerflag=0; } else { if (isset($post->ID)) { $postID = $post->ID; $trackername = get_post_meta($postID, "afstrackername", true); if (empty($trackername)) $trackername = $post->post_title;} $trackerflag=1; } } } if (empty($trackername)) $trackerflag=0; if ( $trackerflag==1) { $trackername = stripslashes($trackername); if (strpos($trackername, '|') !== FALSE) $trackername = strstr($trackername, '|'); $trackername = addslashes($trackername); $trackername = trim($trackername); } $autotrack_all= intval(get_option('afs_autotrack_all')); $autotrack_outbound= intval(get_option('afs_autotrack_outbound')); $autotrack_inside= intval(get_option('afs_autotrack_inside')); $autotrack_download= intval(get_option('afs_autotrack_download')); $autotrack_video= intval(get_option('afs_autotrack_video')); $autotrack_iframe= intval(get_option('afs_autotrack_iframe')); $user_logged_tracking= intval(get_option('afs_user_logged_tracking')); $afs_code ="\n"; $afs_code .="\n"; $afs_code .="\n"; print $afs_code; } function account_ok($account) { if (empty($account) || intval($account)==0) { print "
"; _e('You have to define the plugin settings!','afs'); print "
"; print ""; _e('Please be patient, AFS Analytics is loading ...','afs'); print "
"; print ""; _e('Please be patient, AFS Analytics is loading ...','afs'); print "
"; print "
\n";
?>
"; _e('visible tracker','afs'); print ". "; _e('If you selected a visible tracker, you can specify exactly its location. You do this by adding this line:','afs'); print '<div id="afsanalytics"></div> '; _e('where you want it to show up.','afs'); */ ?>
Contact-us','afs');?> AFS Analytics','afs');?> DataSense','afs');?>