Version Description
Download this release
Release Info
Developer | bestwebsoft |
Plugin | Facebook Button by BestWebSoft |
Version | 2011.2.04 |
Comparing to | |
See all releases |
Version 2011.2.04
- facebook-button-plugin.php +432 -0
- img/facebook-ico.jpg +0 -0
- img/icon_16.png +0 -0
- img/icon_16_c.png +0 -0
- img/icon_36.png +0 -0
- img/px.png +0 -0
- img/standart-facebook-ico.jpg +0 -0
- readme.txt +91 -0
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.jpg +0 -0
- screenshot-5.jpg +0 -0
facebook-button-plugin.php
ADDED
@@ -0,0 +1,432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Facebook Button Plugin
|
4 |
+
Plugin URI: http://bestwebsoft.com/plugin/
|
5 |
+
Description: Put Facebook Button in to your post.
|
6 |
+
Author: BestWebSoft
|
7 |
+
Version: 2.04
|
8 |
+
Author URI: http://bestwebsoft.com/
|
9 |
+
License: GPLv2 or later
|
10 |
+
*/
|
11 |
+
|
12 |
+
/* Copyright 2011 BestWebSoft ( plugin@bestwebsoft.com )
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License, version 2, as
|
16 |
+
published by the Free Software Foundation.
|
17 |
+
|
18 |
+
This program is distributed in the hope that it will be useful,
|
19 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
+
GNU General Public License for more details.
|
22 |
+
|
23 |
+
You should have received a copy of the GNU General Public License
|
24 |
+
along with this program; if not, write to the Free Software
|
25 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
26 |
+
*/
|
27 |
+
|
28 |
+
if( ! function_exists( 'bws_add_menu_render' ) ) {
|
29 |
+
function bws_add_menu_render() {
|
30 |
+
global $title;
|
31 |
+
$active_plugins = get_option('active_plugins');
|
32 |
+
$all_plugins = get_plugins();
|
33 |
+
|
34 |
+
$array_activate = array();
|
35 |
+
$array_install = array();
|
36 |
+
$array_recomend = array();
|
37 |
+
$count_activate = $count_install = $count_recomend = 0;
|
38 |
+
$array_plugins = array(
|
39 |
+
array( 'captcha\/captcha.php', 'Captcha', 'http://wordpress.org/extend/plugins/captcha/', 'http://bestwebsoft.com/plugin/captcha-plugin/', '/wp-admin/update.php?action=install-plugin&plugin=captcha&_wpnonce=e66502ec9a' ),
|
40 |
+
array( 'contact-form-plugin\/contact_form.php', 'Contact Form', 'http://wordpress.org/extend/plugins/contact-form-plugin/', 'http://bestwebsoft.com/plugin/contact-form/', '/wp-admin/update.php?action=install-plugin&plugin=contact-form-plugin&_wpnonce=47757d936f' ),
|
41 |
+
array( 'facebook-button-plugin\/facebook-button-plugin.php', 'Facebook Like Button Plugin', 'http://wordpress.org/extend/plugins/facebook-button-plugin/', 'http://bestwebsoft.com/plugin/facebook-like-button-plugin/', '/wp-admin/update.php?action=install-plugin&plugin=facebook-button-plugin&_wpnonce=6eb654de19' ),
|
42 |
+
array( 'twitter-plugin\/twitter.php', 'Twitter Plugin', 'http://wordpress.org/extend/plugins/twitter-plugin/', 'http://bestwebsoft.com/plugin/twitter-plugin/', '/wp-admin/update.php?action=install-plugin&plugin=twitter-plugin&_wpnonce=1612c998a5' ),
|
43 |
+
array( 'portfolio\/portfolio.php', 'Portfolio', 'http://wordpress.org/extend/plugins/portfolio/', 'http://bestwebsoft.com/plugin/portfolio-plugin/', '/wp-admin/update.php?action=install-plugin&plugin=portfolio&_wpnonce=488af7391d' )
|
44 |
+
);
|
45 |
+
foreach($array_plugins as $plugins)
|
46 |
+
{
|
47 |
+
if( 0 < count( preg_grep( "/".$plugins[0]."/", $active_plugins ) ) )
|
48 |
+
{
|
49 |
+
$array_activate[$count_activate]['title'] = $plugins[1];
|
50 |
+
$array_activate[$count_activate]['link'] = $plugins[2];
|
51 |
+
$array_activate[$count_activate]['href'] = $plugins[3];
|
52 |
+
$count_activate++;
|
53 |
+
}
|
54 |
+
else if( array_key_exists(str_replace("\\", "", $plugins[0]), $all_plugins) )
|
55 |
+
{
|
56 |
+
$array_install[$count_install]['title'] = $plugins[1];
|
57 |
+
$array_install[$count_install]['link'] = $plugins[2];
|
58 |
+
$array_install[$count_install]['href'] = $plugins[3];
|
59 |
+
$count_install++;
|
60 |
+
}
|
61 |
+
else
|
62 |
+
{
|
63 |
+
$array_recomend[$count_recomend]['title'] = $plugins[1];
|
64 |
+
$array_recomend[$count_recomend]['link'] = $plugins[2];
|
65 |
+
$array_recomend[$count_recomend]['href'] = $plugins[3];
|
66 |
+
$array_recomend[$count_recomend]['slug'] = $plugins[4];
|
67 |
+
$count_recomend++;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
?>
|
71 |
+
<div class="wrap">
|
72 |
+
<div class="icon32 icon32-bws" id="icon-options-general"></div>
|
73 |
+
<h2><?php echo $title;?></h2>
|
74 |
+
<?php if($count_activate > 0) { ?>
|
75 |
+
<div>
|
76 |
+
<h3>Activated plugins</h3>
|
77 |
+
<?php foreach($array_activate as $activate_plugin) { ?>
|
78 |
+
<div style="float:left; width:200px;"><?php echo $activate_plugin['title']; ?></div> <p><a href="<?php echo $activate_plugin['link']; ?>">Read more</a></p>
|
79 |
+
<?php } ?>
|
80 |
+
</div>
|
81 |
+
<?php } ?>
|
82 |
+
<?php if($count_install > 0) { ?>
|
83 |
+
<div>
|
84 |
+
<h3>Installed plugins</h3>
|
85 |
+
<?php foreach($array_install as $install_plugin) { ?>
|
86 |
+
<div style="float:left; width:200px;"><?php echo $install_plugin['title']; ?></div> <p><a href="<?php echo $install_plugin['link']; ?>">Read more</a></p>
|
87 |
+
<?php } ?>
|
88 |
+
</div>
|
89 |
+
<?php } ?>
|
90 |
+
<?php if($count_recomend > 0) { ?>
|
91 |
+
<div>
|
92 |
+
<h3>Recommended plugins</h3>
|
93 |
+
<?php foreach($array_recomend as $recomend_plugin) { ?>
|
94 |
+
<div style="float:left; width:200px;"><?php echo $recomend_plugin['title']; ?></div> <p><a href="<?php echo $recomend_plugin['link']; ?>">Read more</a> <a href="<?php echo $recomend_plugin['href']; ?>">Download</a> <a class="install-now" href="<?php echo get_bloginfo("url") . $recomend_plugin['slug']; ?>" title="<?php esc_attr( sprintf( __( 'Install %s' ), $recomend_plugin['title'] ) ) ?>"><?php echo __( 'Install Now' ) ?></a></p>
|
95 |
+
<?php } ?>
|
96 |
+
<span style="color: rgb(136, 136, 136); font-size: 10px;">If you have any questions, please contact us via plugin@bestwebsoft.com or fill in our contact form on our site <a href="http://bestwebsoft.com/contact/">http://bestwebsoft.com/contact/</a></span>
|
97 |
+
</div>
|
98 |
+
<?php } ?>
|
99 |
+
</div>
|
100 |
+
<?php
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
if( ! function_exists( 'bws_plugin_header' ) ) {
|
105 |
+
function bws_plugin_header() {
|
106 |
+
global $post_type;
|
107 |
+
?>
|
108 |
+
<style>
|
109 |
+
#adminmenu #toplevel_page_bws_plugins div.wp-menu-image
|
110 |
+
{
|
111 |
+
background: url("<?php echo get_bloginfo('url');?>/wp-content/plugins/facebook-button-plugin/img/icon_16.png") no-repeat scroll center center transparent;
|
112 |
+
}
|
113 |
+
#adminmenu #toplevel_page_bws_plugins:hover div.wp-menu-image,#adminmenu #toplevel_page_bws_plugins.wp-has-current-submenu div.wp-menu-image
|
114 |
+
{
|
115 |
+
background: url("<?php echo get_bloginfo('url');?>/wp-content/plugins/facebook-button-plugin/img/icon_16_c.png") no-repeat scroll center center transparent;
|
116 |
+
}
|
117 |
+
.wrap #icon-options-general.icon32-bws
|
118 |
+
{
|
119 |
+
background: url("<?php echo get_bloginfo('url');?>/wp-content/plugins/facebook-button-plugin/img/icon_36.png") no-repeat scroll left top transparent;
|
120 |
+
}
|
121 |
+
#toplevel_page_bws_plugins .wp-submenu .wp-first-item
|
122 |
+
{
|
123 |
+
display:none;
|
124 |
+
}
|
125 |
+
</style>
|
126 |
+
<?php
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
add_action('admin_head', 'bws_plugin_header');
|
131 |
+
|
132 |
+
|
133 |
+
if( ! function_exists( 'fcbk_bttn_plgn_add_pages' ) ) {
|
134 |
+
function fcbk_bttn_plgn_add_pages() {
|
135 |
+
add_menu_page(__('BWS Plugins'), __('BWS Plugins'), 'manage_options', 'bws_plugins', 'bws_add_menu_render', WP_CONTENT_URL."/plugins/facebook-button-plugin/img/px.png", 101);
|
136 |
+
add_submenu_page('bws_plugins', 'FaceBook Button Options', 'FaceBook Button', 'manage_options', "facebook-button-plugin.php", 'fcbk_bttn_plgn_settings_page');
|
137 |
+
|
138 |
+
//call register settings function
|
139 |
+
add_action( 'admin_init', 'fcbk_bttn_plgn_settings' );
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
if( ! function_exists( 'fcbk_bttn_plgn_settings' ) ) {
|
144 |
+
function fcbk_bttn_plgn_settings() {
|
145 |
+
global $fcbk_bttn_plgn_options_array;
|
146 |
+
|
147 |
+
$fcbk_bttn_plgn_options_array_default = array(
|
148 |
+
'fcbk_bttn_plgn_link' => '',
|
149 |
+
'fcbk_bttn_plgn_where' => '',
|
150 |
+
'fcbk_bttn_plgn_display_option' => '',
|
151 |
+
'fcbk_bttn_plgn_count_icon' => 1,
|
152 |
+
'fb_img_link' => 'wp-content/plugins/facebook-button-plugin/img/standart-facebook-ico.jpg'
|
153 |
+
);
|
154 |
+
|
155 |
+
if( ! get_option( 'fcbk_bttn_plgn_options_array' ) )
|
156 |
+
add_option( 'fcbk_bttn_plgn_options_array', $fcbk_bttn_plgn_options_array_default, '', 'yes' );
|
157 |
+
|
158 |
+
$fcbk_bttn_plgn_options_array = get_option( 'fcbk_bttn_plgn_options_array' );
|
159 |
+
|
160 |
+
$fcbk_bttn_plgn_options_array = array_merge( $fcbk_bttn_plgn_options_array_default, $fcbk_bttn_plgn_options_array );
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
//Function formed content of the plugin's admin page.
|
165 |
+
if( ! function_exists( 'fcbk_bttn_plgn_settings_page' ) ) {
|
166 |
+
function fcbk_bttn_plgn_settings_page()
|
167 |
+
{
|
168 |
+
global $fcbk_bttn_plgn_options_array;
|
169 |
+
//$fcbk_bttn_plgn_options_array = get_option ( 'fcbk_bttn_plgn_options_array' );
|
170 |
+
|
171 |
+
$message = "";
|
172 |
+
$error = "";
|
173 |
+
if( isset( $_REQUEST['fcbk_bttn_plgn_form_submit'] ) ) {
|
174 |
+
// Takes all the changed settings on the plugin's admin page and saves them in array 'fcbk_bttn_plgn_options_array'.
|
175 |
+
if ( isset ( $_REQUEST['fcbk_bttn_plgn_where'] ) && isset ( $_REQUEST['fcbk_bttn_plgn_link'] ) && isset ( $_REQUEST['fcbk_bttn_plgn_display_option'] ) ) {
|
176 |
+
$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_link' ] = $_REQUEST [ 'fcbk_bttn_plgn_link' ];
|
177 |
+
$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ] = $_REQUEST [ 'fcbk_bttn_plgn_where' ];
|
178 |
+
$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_display_option' ] = $_REQUEST [ 'fcbk_bttn_plgn_display_option' ];
|
179 |
+
if ( isset ( $_FILES [ 'uploadfile' ] [ 'tmp_name' ] ) && $_FILES [ 'uploadfile' ] [ 'tmp_name' ] != "" ) {
|
180 |
+
$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_count_icon' ] = $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_count_icon' ] + 1;
|
181 |
+
}
|
182 |
+
if($fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_count_icon' ] > 2)
|
183 |
+
$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_count_icon' ] = 1;
|
184 |
+
update_option ( 'fcbk_bttn_plgn_options_array', $fcbk_bttn_plgn_options_array );
|
185 |
+
$message = "Options saved.";
|
186 |
+
}
|
187 |
+
// Form options
|
188 |
+
if ( isset ( $_FILES [ 'uploadfile' ] [ 'tmp_name' ] ) && $_FILES [ 'uploadfile' ] [ 'tmp_name' ] != "" ) {
|
189 |
+
$max_image_width = 100;
|
190 |
+
$max_image_height = 40;
|
191 |
+
$max_image_size = 32 * 1024;
|
192 |
+
$valid_types = array( 'jpg', 'jpeg' );
|
193 |
+
|
194 |
+
// Construction to rename downloading file
|
195 |
+
$new_name = 'facebook-ico'.$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_count_icon' ];
|
196 |
+
$new_ext = '.jpg';
|
197 |
+
$namefile = $new_name.$new_ext;
|
198 |
+
$uploaddir = $_REQUEST [ 'home' ] . 'wp-content/plugins/facebook-button-plugin/img/'; // The directory in which we will take the file:
|
199 |
+
$uploadfile = $uploaddir.$namefile;
|
200 |
+
|
201 |
+
//checks is file download initiated by user
|
202 |
+
if ( isset ( $_FILES [ 'uploadfile' ] ) && $_REQUEST [ 'fcbk_bttn_plgn_display_option' ] == 'custom' ) {
|
203 |
+
//Checking is allowed download file given parameters
|
204 |
+
if ( is_uploaded_file( $_FILES [ 'uploadfile' ] [ 'tmp_name' ] ) ) {
|
205 |
+
$filename = $_FILES [ 'uploadfile' ] [ 'tmp_name' ];
|
206 |
+
$ext = substr ( $_FILES [ 'uploadfile' ] [ 'name' ], 1 + strrpos( $_FILES [ 'uploadfile' ] [ 'name' ], '.' ) );
|
207 |
+
if ( filesize ( $filename ) > $max_image_size ) {
|
208 |
+
$error = "Error: File size > 32K";
|
209 |
+
}
|
210 |
+
elseif ( ! in_array ( $ext, $valid_types ) ) {
|
211 |
+
$error = "Error: Invalid file type";
|
212 |
+
}
|
213 |
+
else {
|
214 |
+
$size = GetImageSize ( $filename );
|
215 |
+
if ( ( $size ) && ( $size[0] <= $max_image_width ) && ( $size[1] <= $max_image_height ) ) {
|
216 |
+
//If file satisfies requirements, we will move them from temp to your plugin folder and rename to 'facebook_ico.jpg'
|
217 |
+
if (move_uploaded_file ( $_FILES [ 'uploadfile' ] [ 'tmp_name' ], $uploadfile ) ) {
|
218 |
+
$message .= " Upload successful.";
|
219 |
+
}
|
220 |
+
else {
|
221 |
+
$error = "Error: moving file failed";
|
222 |
+
}
|
223 |
+
}
|
224 |
+
else {
|
225 |
+
$error = "Error: check image width or height";
|
226 |
+
}
|
227 |
+
}
|
228 |
+
}
|
229 |
+
else {
|
230 |
+
$error = "Uploading Error: check image properties";
|
231 |
+
}
|
232 |
+
}
|
233 |
+
fcbk_bttn_plgn_update_option();
|
234 |
+
}
|
235 |
+
}
|
236 |
+
?>
|
237 |
+
<div class="wrap">
|
238 |
+
<style>
|
239 |
+
.wrap #icon-options-general.icon32-bws
|
240 |
+
{
|
241 |
+
background: url("../wp-content/plugins/facebook-button-plugin/img/icon_36.png") no-repeat scroll left top transparent;
|
242 |
+
}
|
243 |
+
</style>
|
244 |
+
<div class="icon32 icon32-bws" id="icon-options-general"></div>
|
245 |
+
<h2>FaceBook Button Options</h2>
|
246 |
+
<div class="updated fade" <?php if( ! isset( $_REQUEST['fcbk_bttn_plgn_form_submit'] ) || $error != "" ) echo "style=\"display:none\""; ?>><p><strong><?php echo $message; ?></strong></p></div>
|
247 |
+
<div class="error" <?php if( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div>
|
248 |
+
<div>
|
249 |
+
<form name="form1" method="post" action="admin.php?page=facebook-button-plugin.php" enctype="multipart/form-data" >
|
250 |
+
<table class="form-table">
|
251 |
+
<tr valign="top">
|
252 |
+
<th scope="row"><?php _e( "Your's FaceBook Id:" ); ?></th>
|
253 |
+
<td>
|
254 |
+
<input name='fcbk_bttn_plgn_link' type='text' value='<?php echo $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_link' ] ?>' style="width:200px;" />
|
255 |
+
</td>
|
256 |
+
</tr>
|
257 |
+
<tr>
|
258 |
+
<th>
|
259 |
+
Choose display option:
|
260 |
+
</th>
|
261 |
+
<td>
|
262 |
+
<select name="fcbk_bttn_plgn_display_option" onchange="if ( this . value == 'custom' ) { getElementById ( 'fcbk_bttn_plgn_display_option_custom' ) . style.display = 'block'; } else { getElementById ( 'fcbk_bttn_plgn_display_option_custom' ) . style.display = 'none'; }" style="width:200px;" >
|
263 |
+
<option <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_display_option' ] == 'standart' ) echo 'selected="selected"'; ?> value="standart">Standart FaceBook image</option>
|
264 |
+
<option <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_display_option' ] == 'custom' ) echo 'selected="selected"'; ?> value="custom">Custom FaceBook image</option>
|
265 |
+
</select>
|
266 |
+
</td>
|
267 |
+
</tr>
|
268 |
+
<tr>
|
269 |
+
<th>
|
270 |
+
Current image:
|
271 |
+
</th>
|
272 |
+
<td>
|
273 |
+
<img src="<?php echo home_url( '/' ).$fcbk_bttn_plgn_options_array [ 'fb_img_link' ]; ?>" style="margin-left:2px;" />
|
274 |
+
</td>
|
275 |
+
</tr>
|
276 |
+
<tr>
|
277 |
+
<td colspan="2">
|
278 |
+
<div id="fcbk_bttn_plgn_display_option_custom" <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_display_option' ] == 'custom' ) { echo ( 'style="display:block"' ); } else {echo ( 'style="display:none"' ); }?>>
|
279 |
+
<table>
|
280 |
+
<th style="padding-left:0px;font-size:13px;">
|
281 |
+
<input type="hidden" name="MAX_FILE_SIZE" value="64000"/>
|
282 |
+
<input type="hidden" name="home" value="<?php echo ABSPATH ; ?>"/>
|
283 |
+
FaceBook image:
|
284 |
+
</th>
|
285 |
+
<td>
|
286 |
+
<input name="uploadfile" type="file" style="width:196px;" />
|
287 |
+
<span style="color: rgb(136, 136, 136); font-size: 10px;">Image properties: max image width:100px; max image height:40px; max image size:32Kb; image types:"jpg", "jpeg".</span>
|
288 |
+
</td>
|
289 |
+
</table>
|
290 |
+
</div>
|
291 |
+
</td>
|
292 |
+
</tr>
|
293 |
+
<tr>
|
294 |
+
<th>
|
295 |
+
FaceBook Button Position:
|
296 |
+
</th>
|
297 |
+
<td>
|
298 |
+
<select name="fcbk_bttn_plgn_where" onchange="if ( this . value == 'shortcode' ) { getElementById ( 'shortcode' ) . style.display = 'inline'; } else { getElementById ( 'shortcode' ) . style.display = 'none'; }" style="width:200px;" >
|
299 |
+
<option <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ] == 'before' ) echo 'selected="selected"'; ?> value="before">Before</option>
|
300 |
+
<option <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ] == 'after' ) echo 'selected="selected"'; ?> value="after">After</option>
|
301 |
+
<option <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ] == 'beforeandafter' ) echo 'selected="selected"'; ?> value="beforeandafter">Before and After</option>
|
302 |
+
<option <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ] == 'shortcode ') echo 'selected="selected"'; ?> value="shortcode">Shortcode</option>
|
303 |
+
</select>
|
304 |
+
<span id="shortcode" style="color: rgb(136, 136, 136); font-size: 10px; <?php if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ] == 'shortcode' ) { echo ( 'display:inline' ); } else { echo ( 'display:none' ); }?>">If you would like to add a FaceBook button to your website, just copy and put this shortcode onto your post or page: [fb_button].</span>
|
305 |
+
</td>
|
306 |
+
</tr>
|
307 |
+
<tr>
|
308 |
+
<td colspan="2">
|
309 |
+
<input type="hidden" name="fcbk_bttn_plgn_form_submit" value="submit" />
|
310 |
+
<input type="submit" value="Save Changes" class="button-primary">
|
311 |
+
</td>
|
312 |
+
</tr>
|
313 |
+
</table>
|
314 |
+
</form>
|
315 |
+
</div>
|
316 |
+
</div>
|
317 |
+
|
318 |
+
<?php
|
319 |
+
}
|
320 |
+
}
|
321 |
+
|
322 |
+
//Function 'facebook_fcbk_bttn_plgn_display_option' reacts to changes type of picture (Standard or Custom) and generates link to image, link transferred to array 'fcbk_bttn_plgn_options_array'
|
323 |
+
if( ! function_exists( 'fcbk_bttn_plgn_update_option' ) ) {
|
324 |
+
function fcbk_bttn_plgn_update_option () {
|
325 |
+
global $fcbk_bttn_plgn_options_array;
|
326 |
+
if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_display_option' ] == 'standart' ){
|
327 |
+
$fb_img_link = 'wp-content/plugins/facebook-button-plugin/img/standart-facebook-ico.jpg';
|
328 |
+
} else if ( $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_display_option' ] == 'custom'){
|
329 |
+
$fb_img_link = 'wp-content/plugins/facebook-button-plugin/img/facebook-ico'.$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_count_icon' ].'.jpg';
|
330 |
+
}
|
331 |
+
$fcbk_bttn_plgn_options_array [ 'fb_img_link' ] = $fb_img_link ;
|
332 |
+
update_option( "fcbk_bttn_plgn_options_array", $fcbk_bttn_plgn_options_array );
|
333 |
+
}
|
334 |
+
}
|
335 |
+
|
336 |
+
//Function 'facebook_button' taking from array 'fcbk_bttn_plgn_options_array' necessary information to create FaceBook Button and reacting to your choise in plugin menu - points where it appears.
|
337 |
+
if( ! function_exists( 'fcbk_bttn_plgn_display_button' ) ) {
|
338 |
+
function fcbk_bttn_plgn_display_button ( $content ) {
|
339 |
+
//Query the database to receive array 'fcbk_bttn_plgn_options_array' and receiving necessary information to create button
|
340 |
+
$fcbk_bttn_plgn_options_array = get_option ( 'fcbk_bttn_plgn_options_array' );
|
341 |
+
$fcbk_bttn_plgn_where = $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ];
|
342 |
+
$img = home_url( '/' ).$fcbk_bttn_plgn_options_array [ 'fb_img_link' ];
|
343 |
+
$url = "profile.php?id=".$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_link' ];
|
344 |
+
$permalink_post = get_permalink ( $post_ID );
|
345 |
+
//Button
|
346 |
+
$button = '<div id="fb_share">
|
347 |
+
<div style="float:left;margin-right:10px;" >
|
348 |
+
<a name="fb_share" href="http://www.facebook.com/' . $url . '" target="blank">
|
349 |
+
<img src="' . $img . '" alt="Fb-Button" />
|
350 |
+
</a>
|
351 |
+
</div>
|
352 |
+
<div>
|
353 |
+
<div id="fb-root"></div>
|
354 |
+
<script src="http://connect.facebook.net/en_US/all.js#appId=224313110927811&xfbml=1"></script>
|
355 |
+
<fb:like href="' . $permalink_post . '" send="false" layout="button_count" width="450" show_faces="false" font=""></fb:like>
|
356 |
+
</div>
|
357 |
+
</div>';
|
358 |
+
//Indication where show FaceBook Button depending on selected item in admin page.
|
359 |
+
if ( $fcbk_bttn_plgn_where == 'before' ) {
|
360 |
+
return $button . $content;
|
361 |
+
} else if ( $fcbk_bttn_plgn_where == 'after' ) {
|
362 |
+
return $content . $button;
|
363 |
+
} else if ( $fcbk_bttn_plgn_where == 'beforeandafter' ) {
|
364 |
+
return $button . $content . $button;
|
365 |
+
} else if ( $fcbk_bttn_plgn_where == 'shortcode' ) {
|
366 |
+
return $content;
|
367 |
+
} else {
|
368 |
+
return $content;
|
369 |
+
}
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
+
//Function 'facebook_button_short' are using to create shortcode by FaceBook Button.
|
374 |
+
if( ! function_exists( 'fcbk_bttn_plgn_shortcode' ) ) {
|
375 |
+
function fcbk_bttn_plgn_shortcode( $content ) {
|
376 |
+
$fcbk_bttn_plgn_options_array = get_option ( 'fcbk_bttn_plgn_options_array' );
|
377 |
+
$fcbk_bttn_plgn_where = $fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_where' ];
|
378 |
+
$img = home_url( '/' ). $fcbk_bttn_plgn_options_array [ 'fb_img_link' ];
|
379 |
+
$url = "profile.php?id=".$fcbk_bttn_plgn_options_array [ 'fcbk_bttn_plgn_link' ];
|
380 |
+
$permalink_post = get_permalink ( $post_ID );
|
381 |
+
$button = '<div id="fb_share" >
|
382 |
+
<div style="float:left;margin-right:10px;" >
|
383 |
+
<a name="fb_share" href="http://www.facebook.com/'.$url.'" target="blank">
|
384 |
+
<img src="'.$img.'" alt="Fb-Button" />
|
385 |
+
</a>
|
386 |
+
</div>
|
387 |
+
<div>
|
388 |
+
<div id="fb-root"></div>
|
389 |
+
<script src="http://connect.facebook.net/en_US/all.js#appId=224313110927811&xfbml=1"></script>
|
390 |
+
<fb:like href="'.$permalink_post.'" send="false" layout="button_count" width="400" show_faces="false" font=""></fb:like>
|
391 |
+
</div>
|
392 |
+
</div>';
|
393 |
+
return $button;
|
394 |
+
}
|
395 |
+
}
|
396 |
+
|
397 |
+
function fcbk_bttn_plgn_action_links( $links, $file ) {
|
398 |
+
//Static so we don't call plugin_basename on every plugin row.
|
399 |
+
static $this_plugin;
|
400 |
+
if ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);
|
401 |
+
|
402 |
+
if ( $file == $this_plugin ){
|
403 |
+
$settings_link = '<a href="admin.php?page=facebook-button-plugin.php">' . __('Settings', 'facebook-button-plugin') . '</a>';
|
404 |
+
array_unshift( $links, $settings_link );
|
405 |
+
}
|
406 |
+
return $links;
|
407 |
+
} // end function fcbk_bttn_plgn_action_links
|
408 |
+
|
409 |
+
function fcbk_bttn_plgn_links($links, $file) {
|
410 |
+
$base = plugin_basename(__FILE__);
|
411 |
+
if ($file == $base) {
|
412 |
+
$links[] = '<a href="admin.php?page=facebook-button-plugin.php">' . __('Settings','facebook-button-plugin') . '</a>';
|
413 |
+
$links[] = '<a href="http://wordpress.org/extend/plugins/facebook-button-plugin/faq/" target="_blank">' . __('FAQ','facebook-button-plugin') . '</a>';
|
414 |
+
$links[] = '<a href="Mailto:plugin@bestwebsoft.com">' . __('Support','facebook-button-plugin') . '</a>';
|
415 |
+
}
|
416 |
+
return $links;
|
417 |
+
}
|
418 |
+
|
419 |
+
// adds "Settings" link to the plugin action page
|
420 |
+
add_filter( 'plugin_action_links', 'fcbk_bttn_plgn_action_links',10,2);
|
421 |
+
|
422 |
+
//Additional links on the plugin page
|
423 |
+
add_filter( 'plugin_row_meta', 'fcbk_bttn_plgn_links',10,2);
|
424 |
+
|
425 |
+
//Calling a function add administrative menu.
|
426 |
+
add_action( 'admin_menu', 'fcbk_bttn_plgn_add_pages' );
|
427 |
+
|
428 |
+
//Add shortcode.
|
429 |
+
add_shortcode( 'fb_button', 'fcbk_bttn_plgn_shortcode' );
|
430 |
+
|
431 |
+
//Add settings links.
|
432 |
+
add_filter( 'the_content', 'fcbk_bttn_plgn_display_button' );
|
img/facebook-ico.jpg
ADDED
Binary file
|
img/icon_16.png
ADDED
Binary file
|
img/icon_16_c.png
ADDED
Binary file
|
img/icon_36.png
ADDED
Binary file
|
img/px.png
ADDED
Binary file
|
img/standart-facebook-ico.jpg
ADDED
Binary file
|
readme.txt
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Facebook Like Button Plugin ===
|
2 |
+
Contributors: bestwebsoft
|
3 |
+
Contributors: bestwebsoft
|
4 |
+
Donate link: http://bestwebsoft.com/
|
5 |
+
Tags: Facebook, Facebook Button, Like, Like button, Share, Share button, Facebook like, Facebook like button, Facebook button like, Button like, Facebook share, Facebook share button, Facebook button share
|
6 |
+
Requires at least: 2.9
|
7 |
+
Tested up to: 3.2
|
8 |
+
Stable tag: 2011.2.04
|
9 |
+
|
10 |
+
Add Facebook button to your WordPress website
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
|
14 |
+
Facebook Button Plugin allows you to add follow button in the most easiest and flexible way.
|
15 |
+
|
16 |
+
== Installation ==
|
17 |
+
|
18 |
+
1. Upload `facebook-button-plugin` folder to the `/wp-content/plugins/` directory.
|
19 |
+
2. Activate the plugin through the 'Plugins' menu in your WordPress admin panel.
|
20 |
+
3. You can adjust necessary settings through your WordPress admin pane in "Settings" > "FaceBook Button".
|
21 |
+
|
22 |
+
== Frequently Asked Questions ==
|
23 |
+
|
24 |
+
= I cannot see Facebook Button icon in the post after plugin installation =
|
25 |
+
|
26 |
+
1. In the WordPress admin panel go to "Plugins", find "Facebook Button Plugin" plugin and press "Activate".
|
27 |
+
|
28 |
+
= How I can deactivate the plugin =
|
29 |
+
|
30 |
+
1. In the WordPress admin panel go to "Plugins", find "Facebook Button Plugin" plugin and press "Deactivate".
|
31 |
+
|
32 |
+
= After clicking on the the Facebook Button icon I got Facebook home page instead of necessary account page =
|
33 |
+
|
34 |
+
1. In the WordPress admin panel go to "Settings", find "Facebook Button" plugin settings page and enter login of your Facebook account. Then press "Update Changes" button.
|
35 |
+
2. If you do not have Facebook account yet you need to create it using this link: http://www.facebook.com . After that go through instructions from the 1st point.
|
36 |
+
|
37 |
+
= How to adjust Facebook Button icon position on the page =
|
38 |
+
|
39 |
+
1. In the WordPress admin panel go to "Settings", find "Facebook Button" plugin settings page and choose one from listed positions: Before, After, Before and After or Shortcode. Then press "Update Changes" button.
|
40 |
+
|
41 |
+
= How to change Facebook Button icon picture =
|
42 |
+
|
43 |
+
1. In the WordPress admin panel go to "Settings", find "Facebook Button" plugin settings page and choose one from listed positions: Standart FaceBook image or Custom FaceBook image. Then press "Update Changes" button.
|
44 |
+
2. If you choose Custom FaceBook image, you can upload yor's oun picture. To uload you must press "Choose file" button and chose yor image in to you folder. Then press "Update Changes" button.
|
45 |
+
|
46 |
+
= After installation and setting adjustment in plugin settings it is still not working =
|
47 |
+
|
48 |
+
1. You need to press "Update Changes" button to update all changes. Make sure that you got "Options Saved" message after saving action.
|
49 |
+
2. After saving your settings you need to refresh your web page where Facebook Button icon should be located.
|
50 |
+
|
51 |
+
== Screenshots ==
|
52 |
+
|
53 |
+
1. Plugin admin page.
|
54 |
+
2. Plugin admin page: select display option.
|
55 |
+
3. Plugin admin page: select FaceBook Button position.
|
56 |
+
4. Displaying FaceBook Button in your post by shortcode.
|
57 |
+
5. Displaying FaceBook Button ater your post.
|
58 |
+
|
59 |
+
== Changelog ==
|
60 |
+
|
61 |
+
= 2.04 =
|
62 |
+
*BWS Plugins sections was fixed and right now it is consisted with 3 parts: activated, installed and recommended plugins. The bug of position in the admin menu is fixed. Facebook button plugin functionality was changed in connection with the change of Facebook API.
|
63 |
+
|
64 |
+
= 2.03 =
|
65 |
+
*BWS Plugins sections was fixed and right now it is consisted with 2 parts: installed and recommended plugins. Icons displaying is fixed.
|
66 |
+
|
67 |
+
= 2.02 =
|
68 |
+
*The bug of the setting page link is fixed in this version. Please upgrade the plugin immediately. Thank you
|
69 |
+
|
70 |
+
= 2.01 =
|
71 |
+
*Usability at the settings page of plugin was improved.
|
72 |
+
|
73 |
+
= 1 =
|
74 |
+
*Ability to install Facebook Button icon with link to the account page, including settings adjustment functionality via WordPress admin panel.
|
75 |
+
|
76 |
+
== Upgrade Notice ==
|
77 |
+
|
78 |
+
= 2.04 =
|
79 |
+
BWS Plugins sections was fixed and right now it is consisted with 3 parts: activated, installed and recommended plugins. The bug of position in the admin menu is fixed. Facebook button plugin functionality was changed in connection with the change of Facebook API.
|
80 |
+
|
81 |
+
= 2.03 =
|
82 |
+
BWS Plugins sections was fixed and right now it is consisted with 2 parts: installed and recommended plugins. Icons displaying is fixed.
|
83 |
+
|
84 |
+
= 2.02 =
|
85 |
+
The bug of the setting page link is fixed in this version. Please upgrade the plugin immediately. Thank you
|
86 |
+
|
87 |
+
= 2.01 =
|
88 |
+
Usability at the settings page of plugin was improved.
|
89 |
+
|
90 |
+
= 1 =
|
91 |
+
Ability to install Facebook Button icon with link to the account page, including settings adjustment functionality via WordPress admin panel.
|
screenshot-1.jpg
ADDED
Binary file
|
screenshot-2.jpg
ADDED
Binary file
|
screenshot-3.jpg
ADDED
Binary file
|
screenshot-4.jpg
ADDED
Binary file
|
screenshot-5.jpg
ADDED
Binary file
|