WpDevArt Facebook Like Box Widget - Version 1.0

Version Description

  • Initial version of Facebook like box.

Wordpress Facebook like box step by step guide

Adding Facebook like box to your sidebar.

Install the plugin and add Facebook like box widget to your sidebar. And configure settings. That's all, now your users can see your Facebook like box.

Adding Facebook like box in posts/pages using shortcode button.

For adding Facebook like box in your pages/posts you just need to click on "Add like box" shorcode button and add Facebook like box.

Adding Facebook like box Popup.

After plugin install you need to click on "Like box" submenu from left admin menu panel. Then just set up options for Facebook like box Popup.

Facebook like box options

  • Page ID: - Type here your Facebook like box page url(without https://www.facebook.com/, if your Facebook like box page url is https://www.facebook.com/uefacom then type here just uefacom).
  • Facebook Like box Theme - Choose theme for your Facebook Like box
  • Facebook Like box Border Color - Type the Border Color of your Facebook Like box
  • Show Facebook Like box border - Hide or show Facebook like box border.
  • Show Facebook latest posts - Show or hide the latest posts from your Facebook Like box
  • Number of connections - Type the number of connections that you want to see in your Facebook Like box
  • Like box Width - Type Facebook Like box width
  • Like box Height - Type Facebook Like box height
  • Facebook Like box header - Show or hide the Facebook Like box header
  • Like box language - Type the Facebook Like box language code
Download this release

Release Info

Developer smplug-in
Plugin Icon 128x128 WpDevArt Facebook Like Box Widget
Version 1.0
Comparing to
See all releases

Version 1.0

images/loading.gif ADDED
Binary file
images/post.button.png ADDED
Binary file
images/remove_element.png ADDED
Binary file
images/success.png ADDED
Binary file
like-box.php ADDED
@@ -0,0 +1,669 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Facebook Like Box
4
+ Plugin URI: https://wordpress.org/plugins/like-box
5
+ Description: Our Facebook like box plugin will help you to display Facebook like box on your wesite, just add Facebook Like box widget to your sidebar and use it. Also you can use Facebook Like box on your pages/posts and create Facebook Like box popup for your website.
6
+ Version: 0.5.0
7
+ Author: smplug-in
8
+ Author URI: wordpress.org
9
+ License: GPL3
10
+ */
11
+ add_action('wp_head','requared_javascript_functions_fb_likbox_front');
12
+ function requared_javascript_functions_fb_likbox_front(){
13
+ wp_enqueue_script('jquery');
14
+ wp_enqueue_style('thickbox');
15
+ wp_print_scripts('thickbox');
16
+ }
17
+ add_action('admin_head','requared_javascript_functions_fb_likbox');
18
+ function requared_javascript_functions_fb_likbox(){
19
+ wp_enqueue_script('wp-color-picker');
20
+ wp_enqueue_style( 'wp-color-picker' );
21
+ }
22
+ function like_box_facebook($profile_id, $connections = 5, $width = 300, $height = 550, $header = 0, $locale = '') {
23
+ $output = '';
24
+ if ($profile_id != '') {
25
+ $header = ($header == 1) ? 'true' : 'false';
26
+ $output = '<iframe src="http://www.facebook.com/plugins/fan.php?id='.$profile_id.'&amp;width='.$width.'&amp;colorscheme=light&amp;height='.$height.'&amp;connections='.$connections.'&amp;stream=false&amp;header='.$header.'&amp;locale='.$locale.'" scrolling="no" frameborder="0" allowTransparency="true" style="border:1px solid #FFFFFF; overflow:hidden; width:'.$width.'px; height:'.$height.'px"></iframe>';
27
+ }
28
+ return $output;
29
+ }
30
+ class like_box_facbook extends WP_Widget {
31
+ // Constructor //
32
+ function __construct() {
33
+ $widget_ops = array( 'classname' => 'like_box_facbook', 'description' => 'Like box Facebook ' ); // Widget Settings
34
+ $control_ops = array( 'id_base' => 'like_box_facbook' ); // Widget Control Settings
35
+ $this->WP_Widget( 'like_box_facbook', 'Like box Facebook', $widget_ops, $control_ops ); // Create the widget
36
+ }
37
+
38
+ /*poll display in front*/
39
+ function widget($args, $instance) {
40
+ extract( $args );
41
+ $title = $instance['title'];
42
+ $profile_id = $instance['profile_id'];
43
+ $connections = $instance['connections'];
44
+ $width = $instance['width'];
45
+ $height = $instance['height'];
46
+ $header = ($instance['header']) ? 1 : 0;
47
+ $locale = $instance['locale'];
48
+ // Before widget //
49
+ echo $before_widget;
50
+
51
+ // Title of widget //
52
+ if ( $title ) { echo $before_title . $title . $after_title; }
53
+ // Widget output //
54
+ echo like_box_facebook($profile_id, $connections, $width, $height, $header, $locale);
55
+ // After widget //
56
+
57
+ echo $after_widget;
58
+ }
59
+
60
+ // Update Settings //
61
+ function update($new_instance, $old_instance) {
62
+ extract( $args );
63
+ $instance['title'] = strip_tags($new_instance['title']);
64
+ $instance['profile_id'] = $new_instance['profile_id'];
65
+ $instance['connections'] = $new_instance['connections'];
66
+ $instance['width'] = $new_instance['width'];
67
+ $instance['height'] = $new_instance['height'];
68
+ $instance['header'] = $new_instance['header'];
69
+ $instance['locale'] = $new_instance['locale'];
70
+ return $instance; /// return new value of parametrs
71
+
72
+ }
73
+
74
+ /* admin page opions */
75
+ function form($instance) {
76
+ global $wpdb;
77
+ $defaults = array( 'title' => '','profile_id' => '','theme_color' => 'light','border_color' => '#FFF','show_border' => 'yes','stream' => false, 'connections' => '6','width' => '300','height' => '550','header' => false,'locale' => 'en_US');
78
+ $instance = wp_parse_args( (array) $instance, $defaults );
79
+ $poll_answers=$wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'polls_question');
80
+ $poll_themes=$wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'polls_templates');
81
+ ?>
82
+
83
+
84
+ <p class="flb_field">
85
+ <label for="title">Title:</label>
86
+ <br>
87
+ <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $instance['title']; ?>" class="widefat">
88
+ </p>
89
+ <p class="flb_field">
90
+ <label for="<?php echo $this->get_field_id('profile_id'); ?>">Page ID:</label>
91
+ <br>
92
+ <input id="<?php echo $this->get_field_id('profile_id'); ?>" name="<?php echo $this->get_field_name('profile_id'); ?>" type="text" value="<?php echo $instance['profile_id']; ?>" class="widefat">
93
+ </p>
94
+
95
+ <label>Facebook Like box Theme <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label>
96
+ <br>
97
+ <select onclick="alert('To use this features get the pro version for only 8$ !')">
98
+ <option value="light">Light</option>
99
+ <option value="dark">Dark</option>
100
+ </select>
101
+ <br>
102
+ <br>
103
+
104
+ <label for="border_color">Facebook Like box Border Color <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
105
+ <br>
106
+ <div class="disabled_for_pro" onclick="alert('To use this features get the pro version for only 8$ !')">
107
+ <div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="Select Color" data-current="Current Color" style="background-color: rgb(255, 255, 255);"></a></div>
108
+ </div>
109
+ <br>
110
+
111
+ <label>Show Facebook Like box border <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
112
+ <br>
113
+ <input type="radio" value="yes" name="<?php echo $this->get_field_name('width'); ?>11" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" checked >Yes
114
+ <input type="radio" value="no" name="<?php echo $this->get_field_name('width'); ?>11" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" >No
115
+ <br>
116
+
117
+ <p class="flb_field">
118
+ <label>Show Facebook latest posts: <span style="color:rgba(10, 154, 62, 1); font-weight:bold;">Pro feature!</span></label>
119
+ &nbsp;
120
+ <input onclick="alert('To use this features get the pro version for only 8$ !'); return false;" type="checkbox" value="1" >
121
+ </p>
122
+
123
+ <p class="flb_field">
124
+ <label for="<?php echo $this->get_field_id('connections'); ?>">Number of connections:</label>
125
+ <br>
126
+ <input id="<?php echo $this->get_field_id('connections'); ?>" name="<?php echo $this->get_field_name('connections'); ?>" type="text" value="<?php echo $instance['connections']; ?>" class="" size="3">
127
+ <small>(Max. 100)</small>
128
+ </p>
129
+
130
+ <p class="flb_field">
131
+ <label for="<?php echo $this->get_field_id('width'); ?>">Like box Width:</label>
132
+ <br>
133
+ <input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo $instance['width']; ?>" class="" size="3">
134
+ <small>(px)</small>
135
+ </p>
136
+
137
+ <p class="flb_field">
138
+ <label for="<?php echo $this->get_field_id('height'); ?>">Like box Height:</label>
139
+ <br>
140
+ <input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo $instance['height']; ?>" class="" size="3">
141
+ <small>(px)</small>
142
+ </p>
143
+
144
+ <p class="flb_field">
145
+ <label for="<?php echo $this->get_field_id('header'); ?>">Facebook Like box header:</label>
146
+ &nbsp;
147
+ <input id="<?php echo $this->get_field_id('header'); ?>" name="<?php echo $this->get_field_name('header'); ?>" type="checkbox" value="1" class="" size="" <?php checked($instance['header'],1) ?>>
148
+ <small>Show/Hide</small>
149
+ </p>
150
+
151
+ <p class="flb_field">
152
+ <label for="<?php echo $this->get_field_id('locale'); ?>">Like box language:</label>
153
+ <br>
154
+ <input id="<?php echo $this->get_field_id('locale'); ?>" name="<?php echo $this->get_field_name('locale'); ?>" type="text" value="<?php echo $instance['locale']; ?>" class="" size="4">
155
+ <small>(en_US, de_DE...)</small>
156
+ </p>
157
+ <a href="http://wpdevart.com/wordpress-facebook-like-box-plugin/" target="_blank" style="color: rgba(10, 154, 62, 1);; font-weight: bold; font-size: 18px; text-decoration: none;">Upgrade to Pro Version</a><br>
158
+ <br>
159
+ <input type="hidden" id="flb-submit" name="flb-submit" value="1">
160
+ <script>
161
+ jQuery(document).ready(function(e) {
162
+ if(!jQuery(".color_my_likbox").hasClass('wp-color-picker')) jQuery(".color_my_likbox").wpColorPicker();
163
+ });
164
+ </script>
165
+ <?php
166
+ }
167
+ }
168
+ add_action('widgets_init', create_function('', 'return register_widget("like_box_facbook");'));
169
+
170
+ /* Like Box Button */
171
+
172
+ add_action('media_buttons_context', 'like_box_button');
173
+
174
+ function like_box_button($context) {
175
+
176
+ $img = plugins_url( '/images/post.button.png' , __FILE__ );
177
+
178
+ $title = 'Add Like Box';
179
+
180
+ $context .= '<a class="button thickbox" title="Create facebook like box and insert in posts/pages" href="'.admin_url("admin-ajax.php").'?action=like_box_window_manager&height=750">
181
+ <span class="wp-media-buttons-icon" style="background: url('.$img.'); background-repeat: no-repeat; background-position: left bottom;"></span>
182
+ Add like box
183
+ </a>';
184
+ return $context;
185
+ }
186
+
187
+
188
+ add_action( 'wp_ajax_like_box_window_manager', 'like_box_window_insert_content' );
189
+
190
+
191
+ function like_box_window_insert_content(){
192
+ ?> <?php
193
+ global $wpdb;
194
+ $instance = array( 'title' => '','profile_id' => '','theme_color' => 'light','border_color' => '#FFF','show_border' => 'yes','stream' => false, 'connections' => '6','width' => '300','height' => '550','header' => false,'locale' => 'en_US');
195
+ $poll_answers=$wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'polls_question');
196
+ $poll_themes=$wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'polls_templates');
197
+ ?>
198
+
199
+ <div id="miain_like_box_window_manager">
200
+
201
+ <label for="like_box_profile_id">Page ID:</label>
202
+ <br>
203
+ <input id="like_box_profile_id" type="text" value="<?php echo $instance['profile_id']; ?>" class="widefat">
204
+
205
+
206
+ <label for="like_box_theme_color">Facebook Like box Theme <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
207
+ <br>
208
+ <select id="like_box_theme_color" onclick="alert('To use this features get the pro version for only 8$ !'); return false;">
209
+ <option <?php selected( $instance['theme_color'],"light") ?> value="light">Light</option>
210
+ <option <?php selected( $instance['theme_color'],"dark") ?> value="dark">Dark</option>
211
+ </select>
212
+ <br>
213
+ <br>
214
+
215
+ <label for="border_color">Facebook Like box Border Color <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
216
+ <br>
217
+ <div class="disabled_for_pro" onclick="alert('To use this features get the pro version for only 8$ !')">
218
+ <div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="Select Color" data-current="Current Color" style="background-color: rgb(255, 255, 255);"></a></div>
219
+ </div>
220
+ <br>
221
+
222
+ <label>Show Facebook Like box border <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
223
+ <br>
224
+ <input type="radio" value="yes" name="like_box_show_bord11" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" checked >Yes
225
+ <input type="radio" value="no" name="like_box_show_bord11" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" >No
226
+ <br>
227
+
228
+ <p class="flb_field">
229
+ <label>Show Facebook latest posts: <span style="color:rgba(10, 154, 62, 1); font-weight:bold;">Pro feature!</span></label>
230
+ &nbsp;
231
+ <input onclick="alert('To use this features get the pro version for only 8$ !'); return false;" type="checkbox" value="1" >
232
+ </p>
233
+
234
+ <p class="flb_field">
235
+ <label for="like_box_connections">Number of connections:</label>
236
+ <br>
237
+ <input id="like_box_connections" type="text" value="<?php echo $instance['connections']; ?>" class="" size="3">
238
+ <small>(Max. 100)</small>
239
+ </p>
240
+
241
+ <p class="flb_field">
242
+ <label for="like_box_width">Like box Width:</label>
243
+ <br>
244
+ <input id="like_box_width" type="text" value="<?php echo $instance['width']; ?>" class="" size="3">
245
+ <small>(px)</small>
246
+ </p>
247
+
248
+ <p class="flb_field">
249
+ <label for="like_box_height">Like box Height:</label>
250
+ <br>
251
+ <input id="like_box_height" type="text" value="<?php echo $instance['height']; ?>" class="" size="3">
252
+ <small>(px)</small>
253
+ </p>
254
+
255
+ <p class="flb_field">
256
+ <label for="like_box_header">Facebook Like box header:</label>
257
+ &nbsp;
258
+ <input id="like_box_header" type="checkbox" value="1" class="" size="" <?php checked($instance['header'],1) ?>>
259
+ <small>Show/Hide</small>
260
+ </p>
261
+
262
+ <p class="flb_field">
263
+ <label for="like_box_locale">Like box language:</label>
264
+ <br>
265
+ <input id="like_box_locale" type="text" value="<?php echo $instance['locale']; ?>" class="" size="4">
266
+ <small>(en_US, de_DE...)</small>
267
+ </p>
268
+ </div>
269
+ <div class="mceActionPanel">
270
+ <div style="float: left">
271
+ <input type="button" id="cancel" name="cancel" value="Insert Like Box" class="button button-primary" onClick="insert_like_box();"/>
272
+ </div>
273
+ <div style="float: right">
274
+ <span style="float:right"><a href="http://wpdevart.com/wordpress-facebook-like-box-plugin/" target="_blank" style="color: rgba(10, 154, 62, 1);; font-weight: bold; font-size: 18px; text-decoration: none;">Upgrade to Pro Version</a><br></span>
275
+ </div>
276
+ </div>
277
+ <script type="text/javascript">
278
+ jQuery('#miain_like_box_window_manager').ready(function(e) {
279
+ jQuery(".color_my_likbox").wpColorPicker();
280
+ });
281
+ function insert_like_box() {
282
+
283
+ if(jQuery('#poll_answer_id').val()!='0'){
284
+ var tagtext;
285
+ like_box_header=0;
286
+ if(jQuery('#like_box_header').prop('checked'))
287
+ like_box_header=1;
288
+ like_box_stream=0;
289
+ if(jQuery('#like_box_stream').prop('checked'))
290
+ like_box_stream=1;
291
+ var generete_atributes = 'profile_id="'+jQuery('#like_box_profile_id').val()+'" connections="'+jQuery('#like_box_connections').val()+'" width="'+jQuery('#like_box_width').val()+'" height="'+jQuery('#like_box_height').val()+'" header="'+like_box_header+'" locale="'+jQuery('#like_box_locale').val()+'"';
292
+ tagtext = '[wpdevart_like_box '+generete_atributes+']';
293
+ window.send_to_editor(tagtext);
294
+ tb_remove()
295
+ }
296
+ else{
297
+ tb_remove()
298
+ }
299
+ }
300
+
301
+ </script>
302
+ </body>
303
+ </html>
304
+ <?php
305
+ die;
306
+ }
307
+ function wpdevart_like_box_shortcode( $atts ) {
308
+ return like_box_facebook($atts['profile_id'], $atts['connections'], $atts['width'], $atts['height'], $atts['header'], $atts['locale']);
309
+ }
310
+ add_shortcode( 'wpdevart_like_box', 'wpdevart_like_box_shortcode' );
311
+
312
+
313
+
314
+ /* Like Box admin menu*/
315
+
316
+
317
+
318
+ add_action( 'wp_ajax_like_box_popup_save_parametrs', 'like_box_save_in_databese' );
319
+ function like_box_save_in_databese(){
320
+ $instance= array(
321
+ 'like_box_enable_like_box' => '{"yes":false,"no":true}',
322
+ 'like_box_profile_id' => '',
323
+ 'like_box_connections' => '6',
324
+ 'like_box_width' => '300',
325
+ 'like_box_height' => '550',
326
+ 'like_box_header' => '1',
327
+ 'like_box_locale' => 'en_US',
328
+ );
329
+ $kk=1;
330
+ if(isset($_POST['like_box_save_nonce_request']) && wp_verify_nonce( $_POST['like_box_save_nonce_request'],'like_box_save_nonce')){
331
+
332
+ foreach($instance as $key => $value){
333
+ if(isset($_POST[$key])){
334
+ update_option($key,stripslashes($_POST[$key]));
335
+ }
336
+ else{
337
+ $kk=0;
338
+ printf('error saving %s <br>',$key);
339
+ }
340
+ }
341
+ }
342
+ else{
343
+ die('Authorization Problem ');
344
+ }
345
+ if($kk==0){
346
+ exit;
347
+ }
348
+ die('sax_normala');
349
+
350
+ }
351
+ add_action('admin_menu', 'like_box_create_menu');
352
+ function like_box_create_menu(){
353
+ $manage_page = add_menu_page('Like box','Like box', 'manage_options', 'like-box', 'facbook_like_box_menu');
354
+ add_action('admin_print_styles-' .$manage_page, 'like_box_menu_requeried_scripts');
355
+ }
356
+ function like_box_menu_requeried_scripts(){
357
+ wp_enqueue_style('like-box-admin-style',plugins_url('',__FILE__).'/style/admin_style.css');
358
+ }
359
+ function facbook_like_box_menu(){
360
+ $instance= array(
361
+ 'like_box_enable_like_box' => '{"yes":false,"no":true}',
362
+ 'like_box_profile_id' => '',
363
+ 'like_box_connections' => '6',
364
+ 'like_box_width' => '300',
365
+ 'like_box_height' => '550',
366
+ 'like_box_header' => '{"show":false}',
367
+ 'like_box_locale' => 'en_US'
368
+ );
369
+ foreach($instance as $key => $value){
370
+ if(!get_option($key,FALSE)===FALSE)
371
+ $instance[$key]=get_option($key);
372
+ }
373
+ ?>
374
+
375
+
376
+ <h2>Facebook like box popup</h2>
377
+ <div id="miain_like_box_popup_menu">
378
+ <table class="wp-list-table widefat fixed posts" style="width: 85%; min-width:320px !important">
379
+ <thead>
380
+ <tr>
381
+ <th>
382
+ <span> Facebook like box popup Settings </span>
383
+ </th>
384
+ <th>
385
+ <span style="float:right"><a href="http://wpdevart.com/wordpress-facebook-like-box-plugin/" target="_blank" style="color: rgba(10, 154, 62, 1);; font-weight: bold; font-size: 18px; text-decoration: none;">Upgrade to Pro Version</a><br></span>
386
+ </th>
387
+ </tr>
388
+ </thead>
389
+ <tbody>
390
+ <tr>
391
+ <td>
392
+ <?php $jsone_enable_like_box= json_decode(stripslashes($instance['like_box_enable_like_box']), true);?>
393
+ <label class="like_box_titile">Facebook Like box popup:</label><br>
394
+ <label style="margin-right:10px">
395
+ <input id="like_box_show_border_yes" class radio class="enable_like_box" type="radio" name="enable_like_box" value="yes" <?php checked($jsone_enable_like_box['yes'],true) ?> >Enable
396
+ </label>
397
+ <label>
398
+ <input id="like_box_show_border_no" class="enable_like_box" type="radio" name="enable_like_box" value="no" <?php checked($jsone_enable_like_box['no'],true) ?> >Disable
399
+ </label>
400
+ <input type="hidden" id="like_box_enable_like_box" class="like_box_hidden_parametr" value='<?php echo $instance['like_box_enable_like_box']; ?>'>
401
+ </td>
402
+ </tr>
403
+
404
+ <tr>
405
+ <td>
406
+ <label class="like_box_titile">Display Like box on: <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label><br>
407
+ <input id="like_box_show_in_home" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" type="checkbox" value="home" checked ><small>Home</small><br>
408
+ <input id="like_box_show_in_post" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" type="checkbox" value="post" checked><small>Post</small><br>
409
+ <input id="like_box_show_in_page" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" type="checkbox" value="page" checked><small>Page</small><br>
410
+ <input id="like_box_show_in_everywhere" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" type="checkbox" value="everywhere" checked><small>Everywhere</small><br>
411
+ </td>
412
+ </tr>
413
+
414
+ <tr>
415
+ <td>
416
+ <label class="like_box_titile">Show Like box One time or Every time when user visit website <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label></label>
417
+ <br>
418
+ <select onclick="alert('To use this features get the pro version for only 8$ !'); return false;" id="like_box_popup_show_quantity">
419
+ <option>Оne Тime</option>
420
+ <option selected>Еvery Тime</option>
421
+ </select>
422
+ </td>
423
+ </tr>
424
+
425
+ <tr>
426
+ <td>
427
+ <label class="like_box_titile">Seconds for Like box popup to appear ?: <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
428
+ <br>
429
+ <input id="like_box_secont_befor_show" type="text" value="3" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" size="3"><small>(Seconds)</small>
430
+ </td>
431
+ </tr>
432
+
433
+ <tr>
434
+ <td>
435
+ <label class="like_box_titile">Page ID:</label>
436
+ <br>
437
+ <input id="like_box_profile_id" type="text" placeholder="Example: uefachampionsleague" size="30" value="<?php echo $instance['like_box_profile_id']; ?>" >
438
+ </td>
439
+ </tr>
440
+
441
+ <tr>
442
+ <td>
443
+ <label class="like_box_titile">Facebook Like box Theme <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
444
+ <br>
445
+ <select id="like_box_theme_color" onclick="alert('To use this features get the pro version for only 8$ !'); return false;">
446
+ <option selected value="light">Light</option>
447
+ <option value="dark">Dark</option>
448
+ </select>
449
+ </td>
450
+ </tr>
451
+
452
+ <tr>
453
+ <td>
454
+ <label for="border_color" class="like_box_titile">Facebook Like box Border Color <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
455
+ <br>
456
+ <div class="disabled_for_pro" onclick="alert('To use this features get the pro version for only 8$ !')">
457
+ <div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="Select Color" data-current="Current Color" style="background-color: rgb(255, 255, 255);"></a></div>
458
+ </div>
459
+ <br>
460
+ </td>
461
+ </tr>
462
+
463
+ <tr>
464
+ <td>
465
+ <label class="like_box_titile">Show Facebook Like box border <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
466
+ <br>
467
+ <label style="margin-right:10px">
468
+ <input id="like_box_show_border33" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" class="like_box_show_border" type="radio" name="like_box_show_border" value="yes" checked >Yes
469
+ </label>
470
+ <label>
471
+ <input id="like_box_show_border1" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" class="like_box_show_border" type="radio" name="like_box_show_border" value="no" >No
472
+ </label>
473
+ </td>
474
+ </tr>
475
+
476
+ <tr>
477
+ <td>
478
+ <label class="like_box_titile">Show Facebook latest posts: <span style="color:rgba(10, 154, 62, 1);font-weight:bold;">Pro feature!</span></label>
479
+ <input id="like_box_stream_radio" onclick="alert('To use this features get the pro version for only 8$ !'); return false;" type="checkbox" value="show">
480
+ </td>
481
+ </tr>
482
+
483
+ <tr>
484
+ <td>
485
+ <label class="like_box_titile">Number of connections:</label>
486
+ <br>
487
+ <input id="like_box_connections" type="text" value="<?php echo $instance['like_box_connections']; ?>" class="" size="3"> <small>(Max. 100)</small>
488
+ </td>
489
+ </tr>
490
+
491
+ <tr>
492
+ <td>
493
+ <label class="like_box_titile">Like box Width:</label>
494
+ <br>
495
+ <input id="like_box_width" type="text" value="<?php echo $instance['like_box_width']; ?>" class="" size="3"><small>(px)</small>
496
+ </td>
497
+ </tr>
498
+
499
+ <tr>
500
+ <td>
501
+ <label class="like_box_titile">Like box Height:</label>
502
+ <br>
503
+ <input id="like_box_height" type="text" value="<?php echo $instance['like_box_height']; ?>" class="" size="3"><small>(px)</small>
504
+ </td>
505
+ </tr>
506
+
507
+ <tr>
508
+ <td>
509
+ <?php $jsone_like_box_header= json_decode(stripslashes($instance['like_box_header']), true);?>
510
+ <label class="like_box_titile">Facebook Like box header:</label>
511
+ <br>
512
+
513
+ <input id="like_box_headeras" type="checkbox" value="show" <?php checked($jsone_like_box_header['show'],true) ?>><small>Show/Hide</small>
514
+ <input id="like_box_header" type="hidden" class="like_box_hidden_parametr" value='<?php echo $instance['like_box_header']; ?>' >
515
+ </td>
516
+ </tr>
517
+
518
+ <tr>
519
+ <td>
520
+ <label class="like_box_titile">Like box language:</label>
521
+ <br>
522
+
523
+ <input id="like_box_locale" type="text" value="<?php echo $instance['like_box_locale']; ?>" class="" size="4">
524
+ </td>
525
+ </tr>
526
+ </tbody>
527
+ <tfoot>
528
+ <tr>
529
+ <th colspan="2" width="100%"><button type="button" id="save_button_design" class="save_button button button-primary"><span class="save_button_span">Save Settings</span> <span class="saving_in_progress"> </span><span class="sucsses_save"> </span><span class="error_in_saving"> </span></button></th>
530
+
531
+ </tr>
532
+ </tfoot>
533
+ </table>
534
+ </div>
535
+
536
+ <br /><br />
537
+ <span class="error_massage"></span>
538
+ <?php wp_nonce_field('like_box_save_nonce','like_box_save_nonce'); ?>
539
+ <script>
540
+ jQuery(document).ready(function(e) {
541
+
542
+ jQuery("#like_box_border_color").wpColorPicker();
543
+
544
+ //generete_radio_input(jQuery('#coming_soon_page_radio_backroundcolor'));
545
+ jQuery('#save_button_design').click(function(){
546
+
547
+ jQuery('#save_button_design').addClass('padding_loading');
548
+ jQuery("#save_button_design").prop('disabled', true);
549
+ jQuery('.saving_in_progress').css('display','inline-block');
550
+ jQuery('.like_box_hidden_parametr').each(function(index, element) {
551
+ generete_input_values(this);
552
+ });
553
+
554
+ //generete_radio_input_hidden(jQuery('#page_content_position'));
555
+ jQuery.ajax({
556
+ type:'POST',
557
+ url: "<?php echo admin_url( 'admin-ajax.php?action=like_box_popup_save_parametrs' ); ?>",
558
+ data: {like_box_save_nonce_request:jQuery('#like_box_save_nonce').val()<?php foreach($instance as $key => $value){echo ','.$key.':jQuery("#'.$key.'").val()';} ?>},
559
+ }).done(function(date) {
560
+ if(date=='sax_normala'){
561
+ console.log
562
+ jQuery('.saving_in_progress').css('display','none');
563
+ jQuery('.sucsses_save').css('display','inline-block');
564
+ setTimeout(function(){jQuery('.sucsses_save').css('display','none');jQuery('#save_button_design').removeClass('padding_loading');jQuery("#save_button_design").prop('disabled', false);},2500);
565
+ }else{
566
+ jQuery('.saving_in_progress').css('display','none');
567
+ jQuery('.error_in_saving').css('display','inline-block');
568
+ jQuery('.error_massage').css('display','inline-block');
569
+ jQuery('.error_massage').html(date);
570
+ setTimeout(function(){jQuery('#coming_soon_options_form .error_massage').css('display','none');jQuery('#coming_soon_options_form .error_in_saving').css('display','none');jQuery('#save_button_design').removeClass('padding_loading');jQuery("#save_button_design").prop('disabled', false);},5000);
571
+ }
572
+
573
+ });
574
+ });
575
+ function generete_input_values(hidden_element){
576
+ var element_array = {};
577
+ jQuery(hidden_element).parent().find('input[type=radio],input[type=checkbox]').each(function(index, element) {
578
+ element_array[jQuery(this).val()]=jQuery(this).prop('checked');
579
+ });
580
+ jQuery(hidden_element).val(JSON.stringify(element_array));
581
+ }
582
+
583
+ });
584
+
585
+ </script>
586
+ <?php
587
+ }
588
+ function leike_box_get_jsoned_parametrs($jsone_string){
589
+ $return_array= array();
590
+ if($jsone_string){
591
+ $jsone_array= json_decode(stripslashes($jsone_string), true);
592
+ if(count( $jsone_array)>0){
593
+ foreach($jsone_array as $key => $value){
594
+ if($value==true || $value=='true')
595
+ $return_array[$key]=$value;
596
+ }
597
+ }
598
+ }
599
+ return $return_array;
600
+ }
601
+
602
+
603
+
604
+
605
+
606
+ /*FRONT END*/
607
+ add_action( 'wp_ajax_likeboxfrontend', 'like_box_ifreame_generator' );
608
+ add_action( 'wp_ajax_nopriv_likeboxfrontend', 'like_box_ifreame_generator' );
609
+ function like_box_ifreame_generator(){
610
+ $instance= array(
611
+ 'like_box_enable_like_box' => '{"yes":false,"no":true}',
612
+ 'like_box_profile_id' => '',
613
+ 'like_box_connections' => '6',
614
+ 'like_box_width' => '300',
615
+ 'like_box_height' => '550',
616
+ 'like_box_header' => '{"show":false}',
617
+ 'like_box_locale' => 'en_US'
618
+ );
619
+ foreach($instance as $key => $value){
620
+ if(!get_option($key,FALSE)===FALSE)
621
+ $instance[$key]=get_option($key);
622
+ }
623
+ $jsone_like_box_header= json_decode(stripslashes($instance['like_box_header']), true);
624
+ echo like_box_facebook($instance['like_box_profile_id'], $instance['like_box_connections'], $instance['like_box_width'], $instance['like_box_height'], $jsone_like_box_header['show'], $instance['like_box_locale']);
625
+ die();
626
+ }
627
+ add_action( 'wp_footer','like_box_add_code_in_footer');
628
+ function like_box_add_code_in_footer(){
629
+
630
+ $instance= array(
631
+ 'like_box_enable_like_box' => '{"yes":false,"no":true}',
632
+ 'like_box_profile_id' => '',
633
+ 'like_box_connections' => '6',
634
+ 'like_box_width' => '300',
635
+ 'like_box_height' => '550',
636
+ 'like_box_header' => '{"show":false}',
637
+ 'like_box_locale' => 'en_US'
638
+ );
639
+ foreach($instance as $key => $value){
640
+ if(!get_option($key,FALSE)===FALSE)
641
+ $instance[$key]=get_option($key);
642
+ }
643
+ $instance['like_box_width']=$instance['like_box_width']-9;
644
+ $instance['like_box_height']=$instance['like_box_height']+9;
645
+ $jsone_enable_like_box= json_decode(stripslashes($instance['like_box_enable_like_box']), true);
646
+ if($jsone_enable_like_box['yes']== true){
647
+ ?><script>
648
+ function like_box_setCookie(cname, cvalue, exdays) {
649
+ var d = new Date();
650
+ d.setTime(d.getTime() + (exdays*24*60*60*1000));
651
+ var expires = "expires="+d.toUTCString();
652
+ document.cookie = cname + "=" + cvalue + "; " + expires+"; path=/";
653
+ }
654
+ function like_box_getCookie(cname) {
655
+ var name = cname + "=";
656
+ var ca = document.cookie.split(';');
657
+ for(var i=0; i<ca.length; i++) {
658
+ var c = ca[i];
659
+ while (c.charAt(0)==' ') c = c.substring(1);
660
+ if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
661
+ }
662
+ return "";
663
+ }
664
+
665
+ jQuery(document).ready(function(){
666
+ setTimeout(function(){tb_show('','<?php echo admin_url('admin-ajax.php').'?action=likeboxfrontend&TB_iframe=true&height='.$instance['like_box_height'].'&width='.$instance['like_box_width'] ?>')},3000);
667
+ })</script><?php
668
+ }
669
+ }
readme.txt ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Facebook Like Box ===
2
+ Contributors: smplug-in
3
+ Tags: Facebook, facebook badge, facebook connect, Facebook fan page, facebook group, facebook integration, facebook like box, Facebook like widget, facebook meta, facebook meta tag, Facebook Open Graph, Facebook Page, facebook platform, facebook plugin, facebook recommend, facebook share, facebook sidebar, facebook style, facebook wall, Facebook Widget, friends, google +1, google plus, google plus one, Like, like box, open graph, page, plugin, post to facebook, sharebar, sidebar, social, Social Plugins, social profiles, social share, social sidebar, wordpress like, seo, meta, Facebook like box widget, facebook like, facebook like button, facebook button, facebook facepile, like box facebook, like box widget, facebook likebox, facebook like box shortcode, likebox, wordpress facebook like box, facebook like box in PopUp, facebook likebox widget, nice facebook like box, custom facebook likebox, rt facebook like box, advanced responsive facebook likebox, fb like box, facebook like box shortcodes, like box sidebox
4
+ Requires at least: 2.9
5
+ Tested up to: 4.1
6
+ Stable tag: 0.5.0
7
+
8
+ Our Facebook like box plugin will help you to display Facebook like box on your wesite, just add Facebook Like box widget to your sidebar and use it. Also you can use Facebook Like box on your pages/posts and create Facebook Like box popup for your website.
9
+
10
+ == Description ==
11
+
12
+ Facebook Like box is awesome tool to show your visitors your Facebook like box. At the same time it's very useful, because you will get new users who will like your website on Facebook. Facebook like box is important part of social optimization, that's why a lot of people use Facebook like box on their websites.
13
+ It's very easy to use, you just need to install the plugin and add Facebook like box widget to your sidebar and set some settings(Page ID, Facebook like box width, height ...).
14
+ Also you can use Facebook Like box on your pages/posts and create Facebook Like box popup for your website.
15
+
16
+ ### Features of Facebook like box:
17
+
18
+ * **User friendly and easy to use.**
19
+ * **Tested with other popular plugins.**
20
+ * **Ability to set connections number.**
21
+ * **Ability to set Facebook like box width.**
22
+ * **Ability to set Facebook like box height.**
23
+ * **Ability to show/hide Facebook logo bar.**
24
+ * **Ability to change Facebook like box language.**
25
+ * **Ability to add Facebook like box in posts/pages using shortcode button.**
26
+ * **Ability to add Facebook like box Popup.**
27
+
28
+ You can upgrade WordPress Facebook like box plugin to [Facebook like box Pro](http://wpdevart.com/wordpress-facebook-like-box-plugin/) to add more features.
29
+
30
+ ### Features of Facebook like box Pro:
31
+
32
+ * **Ability to show posts from your Facebook page.**
33
+ * **Ability to Choose Facebook like box Theme.**
34
+ * **Ability to set Facebook like box border color.**
35
+ * **Ability to show/hide Facebook like box border.**
36
+ * **Ability to display Facebook like box Popup on Home, Post, Page, Everywhere.**
37
+ * **Ability to type seconds for Like box popup to appear.**
38
+ * **Premium Support**
39
+
40
+ ### If you found any bug in our WordPress Facebook like box plugin or have a question contact us at support@wpdevart.com.
41
+
42
+ Dear users, we also recommend you to take a look for this useful plugins - [WordPress Maintenance mode plugin](https://wordpress.org/plugins/coming-soon-page/), [WordPress Poll plugin](https://wordpress.org/plugins/polls-widget/) .
43
+
44
+ == Installation ==
45
+
46
+ ### That's simple:
47
+
48
+ 1. Download [WordPress Facebook like box](https://wordpress.org/plugins/like-box/) plugin.
49
+ 2. Upload the Facebook like box plugin from your admin panel.
50
+ 3. Activate the Facebook like box plugin.
51
+ 4. Add Facebook like box widget to your sidebar.
52
+ 5. Add Facebook like box in posts/pages using shortcode button.
53
+ 6. Add Facebook like box Popup from admin panel.
54
+
55
+ Dear users, we also recommend you to take a look for this useful plugins - [WordPress Maintenance mode plugin](https://wordpress.org/plugins/coming-soon-page/), [WordPress Poll plugin](https://wordpress.org/plugins/polls-widget/) .
56
+
57
+ == Screenshots ==
58
+
59
+ 1. [WordPress Facebook like box](https://wordpress.org/plugins/like-box/) Front-end
60
+ 2. WordPress Facebook Like box Back-end
61
+ 3. WordPress Facebook Like box Popup Front-end
62
+ 4. WordPress Facebook Like box Popup Back-end
63
+
64
+ == Changelog ==
65
+
66
+ = 1.0 =
67
+
68
+ * Initial version of Facebook like box.
69
+
70
+ ==Wordpress Facebook like box step by step guide==
71
+
72
+ ### Adding Facebook like box to your sidebar.
73
+
74
+ Install the plugin and add Facebook like box widget to your sidebar. And configure settings. That's all, now your users can see your Facebook like box.
75
+
76
+ ### Adding Facebook like box in posts/pages using shortcode button.
77
+
78
+ For adding Facebook like box in your pages/posts you just need to click on "Add like box" shorcode button and add Facebook like box.
79
+
80
+ ### Adding Facebook like box Popup.
81
+
82
+ After plugin install you need to click on "Like box" submenu from left admin menu panel.
83
+ Then just set up options for Facebook like box Popup.
84
+
85
+ ### Facebook like box options
86
+
87
+ * Page ID: - Type here your Facebook like box page url(without https://www.facebook.com/, if your Facebook like box page url is https://www.facebook.com/uefacom then type here just uefacom).
88
+ * Facebook Like box Theme - Choose theme for your Facebook Like box
89
+ * Facebook Like box Border Color - Type the Border Color of your Facebook Like box
90
+ * Show Facebook Like box border - Hide or show Facebook like box border.
91
+ * Show Facebook latest posts - Show or hide the latest posts from your Facebook Like box
92
+ * Number of connections - Type the number of connections that you want to see in your Facebook Like box
93
+ * Like box Width - Type Facebook Like box width
94
+ * Like box Height - Type Facebook Like box height
95
+ * Facebook Like box header - Show or hide the Facebook Like box header
96
+ * Like box language - Type the Facebook Like box language code
97
+
98
+
style/admin_style.css ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .like_box_titile{
2
+ font-weight:bold;
3
+ }
4
+ button{
5
+ webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
6
+ -moz-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
7
+ -ms-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
8
+ -o-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
9
+ transition:0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
10
+ }
11
+ #save_button_design{
12
+ width: 104px;
13
+ }
14
+ .save_button_span{
15
+ float:left;
16
+ }
17
+ .save_button {
18
+ overflow:hidden !important;
19
+ }
20
+ .padding_loading{
21
+ width: 130px !important;
22
+
23
+ }
24
+ .saving_in_progress{
25
+ position: relative;
26
+ display:none;
27
+ width: 18px;
28
+ height: 18px;
29
+ margin-left: 12px;
30
+ top: 4px;
31
+ background-image: url(../images/loading.gif);
32
+ background-size:100% 100%;
33
+ }
34
+ .sucsses_save{
35
+ position: relative;
36
+ display:none;
37
+ width: 18px;
38
+ height: 18px;
39
+ margin-left: 12px;
40
+ top: 4px;
41
+ background-image: url(../images/success.png);
42
+ background-size:100% 100%;
43
+ }
44
+ .error_in_saving{
45
+ position: relative;
46
+ display:none;
47
+ width: 18px;
48
+ height: 18px;
49
+ margin-left: 12px;
50
+ top: 4px;
51
+ background-image: url(../images/remove_element.png);
52
+ background-size:100% 100%;
53
+ }
54
+ .error_massage{
55
+ color: #BB1E1E;
56
+ font-size: 18px;
57
+ font-weight: bold;
58
+ padding-left: 21px;
59
+ }