";
}
}
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);
if (strcasecmp($accountstr,"NULL")==0) update_option('afs_account',"");
else
{
$num=intval($accountstr);
if ($num==0) $message = $message_empty;
else
{
$accountstr=sprintf("%08d",$num);
update_option('afs_account',$accountstr);
$message = $message_updated;
}
}
}
if ($_POST['afs_accesskey'])
{
$accesskey=$_POST['afs_accesskey'];
$accesskey=trim($accesskey);
if (strcasecmp($accountstr,"NULL")==0) update_option('afs_accesskey',"");
else update_option('afs_accesskey', $accesskey);
}
if (isset($_POST['autotrack_all'])) update_option('afs_autotrack_all',$_POST['autotrack_all']);
if (isset($_POST['autotrack_outbound'])) update_option('afs_autotrack_outbound',$_POST['autotrack_outbound']);
if (isset($_POST['autotrack_inside'])) update_option('afs_autotrack_inside',$_POST['autotrack_inside']);
if (isset($_POST['autotrack_download'])) update_option('afs_autotrack_download',$_POST['autotrack_download']);
if (isset($_POST['autotrack_video'])) update_option('afs_autotrack_video',$_POST['autotrack_video']);
if (isset($_POST['autotrack_iframe'])) update_option('afs_autotrack_iframe',$_POST['autotrack_iframe']);
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 ". ";
?>
AFS Analytics Settings
";
_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');
?>