diff -r 000000000000 -r 03b0d1493584 web/wp-content/plugins/add-to-facebook-plugin/addtofacebook.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/add-to-facebook-plugin/addtofacebook.php Wed Dec 23 17:55:33 2009 +0000 @@ -0,0 +1,167 @@ +ID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; + break; + case "image": + $data=$data."

ID)."\" target=\"_blank\">\"Share

"; + break; + case "both": + $data=$data."

ID)."\" target=\"_blank\">\"ShareID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; + break; + } + return $data; +} + +function activate_add_to_facebook(){ + global $post; + $current_options = get_option('add_to_facebook_options'); + $insertiontype = $current_options['insertion_type']; + if ($insertiontype != 'template'){ + add_filter('the_content', 'add_to_facebook', 10); + add_filter('the_excerpt', 'add_to_facebook', 10); + } +} + +activate_add_to_facebook(); + +function addtofacebook(){ + global $post; + $current_options = get_option('add_to_facebook_options'); + $insertiontype = $current_options['insertion_type']; + if ($insertiontype != 'auto'){ + $linktype = $current_options['link_type']; + switch ($linktype) { + case "text": + echo "

ID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; + break; + case "image": + echo "

ID)."\" target=\"_blank\">\"Share

"; + break; + case "both": + echo "

ID)."\" target=\"_blank\">\"ShareID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; + break; + } + } +} + +// Create the options page +function add_to_facebook_options_page() { + $current_options = get_option('add_to_facebook_options'); + $link = $current_options["link_type"]; + $insert = $current_options["insertion_type"]; + if ($_POST['action']){ ?> +

Options saved.

+ +
+

Add to Facebook Options

+ +
"> +
+ Options: + + + + + + + + + + +
+
+

+ +

+
+
+ + + \ No newline at end of file