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; if (isset($post->ID)) { $postID = $post->ID; $trackername = get_post_meta($postID, "afstrackername", true); if (empty($trackername)) $trackername = $post->post_title; } if (empty($trackername)) $trackername = "DetectName"; $trackername = stripslashes($trackername); if (strpos($trackername, '|') !== FALSE) $trackername = strstr($trackername, '|'); $afs_code = "\n"; $afs_code .="
\n"; //$afs_code .="
\n"; $afs_code .="\n"; $afs_code .="\n"; $afs_code .="
\n"; $afs_code .="\n"; //82 print $afs_code; } function redirect_afs() { $account = get_option('afs_account'); 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 "

"; print "AFS Analytics"; print "

"; print "\n\n"; } function add_trackerfield() { global $post; $postID = $post->ID; $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; if (isset($post->ID)) { $postID = $post->ID; 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 = __("Website ID 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_x']) update_option('afs_x', $_POST['afs_x']); // 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 footer','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 want to insert the code in other place, just paste the line:','afs'); print '<div id="addfreestats"></div> '; _e('where you want the code to appear.','afs'); ?>