'after',
'style'=>'toolbox_32x32',
'creditIsOn'=>'yes',
'pub_id'=>'');
add_option('all_in_one_social_network_button_options',$all_in_one_social_network_button_options);
}
global $all_in_one_social_network_button_options;
$all_in_one_social_network_button_options = get_option('all_in_one_social_network_button_options');
register_activation_hook( __FILE__, 'activate_all_in_one_social_network_button' );
function add_all_in_one_social_network_button_automatic($content){
global $all_in_one_social_network_button_options, $post;
$p_title = get_the_title($post->ID);
$voteUrl = get_permalink( $post->ID ).'&title='.str_replace(' ','+',$p_title).'&referenceUrl='.get_bloginfo( 'url' );
$style = $all_in_one_social_network_button_options['style'];
$pub_id = $all_in_one_social_network_button_options['pub_id'];
switch($style){
case "toolbox_16x16":
$htmlCode .= " \n";
$htmlCode .= "
\n";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
case "toolbox_32x32":
$htmlCode .= " \n";
$htmlCode .= " \n";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
case "sharecount_vertical":
$htmlCode .= "";
$htmlCode .= "
";
$htmlCode .= "";
$htmlCode .= "| ";
$htmlCode .= "";
$htmlCode .= " | ";
$htmlCode .= "";
$htmlCode .= " | ";
$htmlCode .= "";
$htmlCode .= "\n";
$htmlCode .= " | ";
$htmlCode .= "";
$htmlCode .= "\n";
$htmlCode .= " | ";
//$htmlCode .= "";
//$htmlCode .= "\n";
//$htmlCode .= " | ";
$htmlCode .= "
";
$htmlCode .= "
";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
case "sharecount_horizontal":
$htmlCode .= "";
$htmlCode .= "\n";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
}
$all_in_one_social_network_button = $htmlCode;
if($all_in_one_social_network_button_options['location'] == 'before' ){
$content = $all_in_one_social_network_button . $content;
}
else if($all_in_one_social_network_button_options['location'] == 'after' ){
$content = $content . $all_in_one_social_network_button;
} else if($all_in_one_social_network_button_options['location'] == 'before_and_after' ){
$content = $all_in_one_social_network_button. $content. $all_in_one_social_network_button;
}
return $content;
}
if ($all_in_one_social_network_button_options['location'] != 'manual'){
add_filter('the_content','add_all_in_one_social_network_button_automatic');
}
function add_all_in_one_social_network_button(){
global $all_in_one_social_network_button_options, $post;
$p_title = get_the_title($post->ID);
$voteUrl = get_permalink( $post->ID ).'&title='.str_replace(' ','+',$p_title).'&referenceUrl='.get_bloginfo( 'url' );
$pub_id = $all_in_one_social_network_button_options['pub_id'];
$style = $all_in_one_social_network_button_options['style'];
switch($style){
case "toolbox_16x16":
$htmlCode .= " \n";
$htmlCode .= " \n";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
case "toolbox_32x32":
$htmlCode .= " \n";
$htmlCode .= " \n";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
case "sharecount_vertical":
$htmlCode .= "";
$htmlCode .= "\n";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
case "sharecount_horizontal":
$htmlCode .= "";
$htmlCode .= "\n";
$htmlCode .= " \n";
$htmlCode .= " ";
break;
}
//$all_in_one_social_network_button = "
\n";
$all_in_one_social_network_button = $htmlCode;
echo $all_in_one_social_network_button;
}
// function for adding settings page to wp-admin
function all_in_one_social_network_button_settings() {
add_options_page('All In One Social Network Buttons', 'All In One Social Network Buttons', 9, basename(__FILE__), 'all_in_one_social_network_button_options_form');
}
function all_in_one_social_network_button_options_form(){
global $all_in_one_social_network_button_options;
?>