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); $afs_code ="\n"; $afs_code .="\n"; $afs_code .="\n"; print $afs_code; } function redirect_afs() { $account = get_option('afs_account'); $accesskey= get_option('afs_accesskey'); $faccess=0; if (empty($account) || intval($account)==0) { print "
"; print "

"; _e('You have to define the plugin settings! Settings -> AFS Analytics settings.','afs'); print "

"; print "
"; return; } print "
"; print "

"; _e('Please be patient, AFS Analytics is loading ...','afs'); print "

"; print "
"; print "

"; if (empty($accesskey)==true || $accesskey=="none" || $accesskey=="NULL" || $accesskey=="null" || $accesskey=="NONE") { print "AFS Analytics"; } else { print "AFS Analytics"; $faccess=1; } print "

"; print "\n\n"; } function add_trackerfield() { global $post; $postID = get_the_ID(); if ($postID!=false) { $trackername = stripslashes(get_post_meta($postID, "afstrackername", true)); print "
"; print ""; _e('AFS Analytics tracker name','afs'); //print ":  $postID"; print ": "; print ""; print "
"; } } function save_trackerfield() { global $post; $postID=get_the_ID(); if ($postID!=false) { if (isset($_POST['afstrackername'])) $tracker = addslashes($_POST['afstrackername']); else $tracker = addslashes($_POST['post_title']); if (empty($tracker)) $tracker = $post->post_title; if (!empty($tracker)) { if (!add_post_meta($postID, 'afstrackername', $tracker, true)) { update_post_meta($postID, 'afstrackername', $tracker); } } } } function plugin_menu() { $message = null; $message_updated = __("Data Saved!","afs"); $message_empty = __("Error: AFS website ID number must be a 8 digits! ","afs"); // update options if (!empty($_POST)) { if ($_POST['afs_account']) { $accountstr=$_POST['afs_account']; $accountstr=trim($accountstr); $num=intval($accountstr); if ($num==0) { $message = $message_empty; } else { $accountstr=sprintf("%08d",$num); update_option('afs_account',$accountstr); if ($_POST['afs_accesskey']) update_option('afs_accesskey', $_POST['afs_accesskey']); // else update_option('afs_x', 0); //if ($_POST['afs_y']) update_option('afs_y', $_POST['afs_y']); //else update_option('afs_y', 0); // $message = $message_updated; //update_option('afs_code', $afs_code); } wp_cache_flush(); } } /* else { $message = $message_empty; //update_option('afs_account', ""); wp_cache_flush(); } */ ?>

\n"; ?>

"; _e('Click here','afs'); print " "; _e('to get a Website ID','afs'); print "
"; _e('2 - Type your Website ID into the Website ID field','afs'); print ".
"; _e("3 - Click on 'Update' button","afs"); print ".
"; _e('4 - AFS Analytics code will be inserted into the header','afs'); print ".
"; _e('5 - Optional! Type your access key for automatic login','afs'); print "
"; _e('For any Questions?','afs'); print " Facebook "; _e('or','afs'); print " "; _e('Contact-us','afs'); print ""; ?>
"; print "
View your website stats"; print "
"; } */ ?>

Plugin Options

"; _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'); ?>