Facebook Like Box - Version 3.0

Version Description

Download this release

Release Info

Developer johnnash1975
Plugin Icon 128x128 Facebook Like Box
Version 3.0
Comparing to
See all releases

Code changes from version 2.10.1 to 3.0

cardoza_facebook_like_box.php CHANGED
@@ -3,8 +3,8 @@
3
  Plugin Name: Facebook Like Box
4
  Plugin URI: https://johnnash.info/facebook-plugin/
5
  Description: Facebook Like Box enables you to display the facebook page likes in your website.
6
- Version: 2.10.1
7
- Author: Vinoj Cardoza
8
  Author URI: https://johnnash.info/facebook-plugin/
9
  License: GPL2
10
  */
@@ -15,6 +15,7 @@ add_action('admin_enqueue_scripts','cfblb_enq_scripts');
15
  add_action('wp_enqueue_scripts', 'cfblb_enq_scripts');
16
  add_action("plugins_loaded", "cardoza_fb_like_init");
17
  add_action("admin_menu", "cardoza_fb_like_options");
 
18
  add_shortcode("cardoza_facebook_like_box", "cardoza_facebook_like_box_sc");
19
  add_shortcode("cardoza_facebook_posts_like", "cardoza_facebook_posts_like_sc");
20
  add_action( 'admin_enqueue_scripts', 'cardoza_facebook_posts_scripts' );
@@ -29,7 +30,17 @@ function cfblb_activate()
29
  update_option('cfblb_show_faces', "true");
30
  update_option('cfpl_enable',"no");
31
  add_option('cfblb_header_do_activation_redirect', true);
32
-
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
  function cfblb_redirection()
@@ -58,8 +69,14 @@ function cardoza_facebook_posts_scripts()
58
 
59
  function cfblb_enq_scripts() {
60
  wp_enqueue_style('cfblbcss', plugins_url('/cardozafacebook.css', __FILE__));
61
- wp_enqueue_script('cfblbjs', plugins_url('/cardozafacebook.js', __FILE__), array('jquery'));
 
62
 
 
 
 
 
 
63
  }
64
 
65
  //The following function will retrieve all the avaialable
@@ -78,10 +95,21 @@ function cfblb_retrieve_options() {
78
  'header' => esc_html(get_option('cfblb_header')),
79
  'small_header' => esc_html(get_option('cfblb_small_header')),
80
  'lang' => esc_html(get_option('cfblb_lang')),
81
-
82
-
 
 
 
 
 
 
 
 
 
83
 
84
  );
 
 
85
  return $opt_val;
86
  }
87
 
@@ -103,7 +131,18 @@ function cardoza_fb_like_options_page() {
103
  'cfb_stream' => 'cfblb_stream',
104
  'cfb_header' => 'cfblb_header',
105
  'cfb_small_header'=>'cfblb_small_header',
106
- 'cfb_lang'=>'cfblb_lang'
 
 
 
 
 
 
 
 
 
 
 
107
  );
108
 
109
 
@@ -155,6 +194,28 @@ if(current_user_can('edit_posts'))
155
 
156
  }
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  if (isset($_POST['frm_submit'])) {
159
 
160
  if (isset( $_POST['cflb_noonce']) && wp_verify_nonce( $_POST['cflb_noonce'], 'cflb_verify'))
@@ -201,11 +262,80 @@ if(current_user_can('edit_posts'))
201
  die("Sorry! Your Noonce didn't verify");
202
  }
203
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
 
206
 
207
  $option_value = cfblb_retrieve_options();
208
-
209
 
210
 
211
 
@@ -414,6 +544,167 @@ if(current_user_can('edit_posts'))
414
  </form>
415
 
416
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
 
418
  </div>
419
  <div class="fb-preview" style="background: white;border: 1px solid #fbfbfb;margin: 20px;"></div>
@@ -579,8 +870,6 @@ function cardoza_facebook_like_box_sc($atts) {
579
  return $output_string;
580
  }
581
 
582
-
583
-
584
  function fb_like_button_for_post($content) {
585
 
586
  $cfpl_enable = get_option('cfpl_enable');
@@ -636,6 +925,179 @@ function cardoza_facebook_posts_like_sc($content) {
636
  echo $content;
637
  }
638
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
  function cardoza_fb_like_init() {
640
  load_plugin_textdomain('facebooklikebox', false, dirname(plugin_basename(__FILE__)) . '/languages');
641
  wp_register_sidebar_widget('FBLBX', __('Facebook Like Box'), 'widget_cardoza_fb_like');
3
  Plugin Name: Facebook Like Box
4
  Plugin URI: https://johnnash.info/facebook-plugin/
5
  Description: Facebook Like Box enables you to display the facebook page likes in your website.
6
+ Version: 3.0
7
+ Author: John Nash
8
  Author URI: https://johnnash.info/facebook-plugin/
9
  License: GPL2
10
  */
15
  add_action('wp_enqueue_scripts', 'cfblb_enq_scripts');
16
  add_action("plugins_loaded", "cardoza_fb_like_init");
17
  add_action("admin_menu", "cardoza_fb_like_options");
18
+ add_action("wp_footer", "cardoza_fb_like_popup");
19
  add_shortcode("cardoza_facebook_like_box", "cardoza_facebook_like_box_sc");
20
  add_shortcode("cardoza_facebook_posts_like", "cardoza_facebook_posts_like_sc");
21
  add_action( 'admin_enqueue_scripts', 'cardoza_facebook_posts_scripts' );
30
  update_option('cfblb_show_faces', "true");
31
  update_option('cfpl_enable',"no");
32
  add_option('cfblb_header_do_activation_redirect', true);
33
+ update_option('cfblb_popup_enable_disable',"");
34
+ update_option('cfblb_popup_title',"Like us on Facebook");
35
+ update_option('cfblb_popup_fb_url',"");
36
+ update_option('cfblb_popup_width',"400");
37
+ update_option('cfblb_popup_height',"250");
38
+ update_option('cfblb_popup_show_faces',"true");
39
+ update_option('cfblb_popup_stream',"false");
40
+ update_option('cfblb_popup_header',"true");
41
+ update_option('cfblb_popup_small_header',"false");
42
+ update_option('cfblb_popup_repeat_times',"3");
43
+
44
  }
45
 
46
  function cfblb_redirection()
69
 
70
  function cfblb_enq_scripts() {
71
  wp_enqueue_style('cfblbcss', plugins_url('/cardozafacebook.css', __FILE__));
72
+ wp_enqueue_script('cfblbjs', plugins_url('/cardozafacebook.js', __FILE__), array('jquery'));
73
+ $popup_enable_disable=get_option('cfblb_popup_enable_disable');
74
 
75
+ if($popup_enable_disable=="on")
76
+ {
77
+ wp_enqueue_style('cfblb_popup_css', plugins_url('/cardozafacebook_popup.css', __FILE__));
78
+ }
79
+
80
  }
81
 
82
  //The following function will retrieve all the avaialable
95
  'header' => esc_html(get_option('cfblb_header')),
96
  'small_header' => esc_html(get_option('cfblb_small_header')),
97
  'lang' => esc_html(get_option('cfblb_lang')),
98
+ 'popup_enable_disable' => esc_html(get_option('cfblb_popup_enable_disable')),
99
+ 'popup_title' => esc_html(get_option('cfblb_popup_title')),
100
+ 'popup_fb_url' => esc_html(get_option('cfblb_popup_fb_url')),
101
+ 'popup_width' => esc_html(get_option('cfblb_popup_width')),
102
+ 'popup_height' => esc_html(get_option('cfblb_popup_height')),
103
+ 'popup_show_faces' => esc_html(get_option('cfblb_popup_show_faces')),
104
+ 'popup_stream' => esc_html(get_option('cfblb_popup_stream')),
105
+ 'popup_header' => esc_html(get_option('cfblb_popup_header')),
106
+ 'popup_small_header' => esc_html(get_option('cfblb_popup_small_header')),
107
+ 'popup_lang' => esc_html(get_option('cfblb_popup_lang')),
108
+ 'popup_repeat_times' => esc_html(get_option('cfblb_popup_repeat_times')),
109
 
110
  );
111
+
112
+
113
  return $opt_val;
114
  }
115
 
131
  'cfb_stream' => 'cfblb_stream',
132
  'cfb_header' => 'cfblb_header',
133
  'cfb_small_header'=>'cfblb_small_header',
134
+ 'cfb_lang'=>'cfblb_lang',
135
+ 'popup_enable_disable'=>'cfblb_popup_enable_disable',
136
+ 'popup_title' => 'cfblb_popup_title',
137
+ 'popup_fb_url' => 'cfblb_popup_fb_url',
138
+ 'popup_width' => 'cfblb_popup_width',
139
+ 'popup_height' => 'cfblb_popup_height',
140
+ 'popup_show_faces' => 'cfblb_popup_show_faces',
141
+ 'popup_stream' => 'cfblb_popup_stream',
142
+ 'popup_header' => 'cfblb_popup_header',
143
+ 'popup_small_header'=>'cfblb_popup_small_header',
144
+ 'popup_lang'=>'cfblb_popup_lang',
145
+ 'popup_repeat_times'=>'cfblb_popup_repeat_times'
146
  );
147
 
148
 
194
 
195
  }
196
 
197
+ if (isset($_POST['reset_cookie'])) {
198
+ if (isset( $_POST['cflb_noonce']) && wp_verify_nonce( $_POST['cflb_noonce'], 'cflb_verify'))
199
+ {
200
+ $seed = str_split('abcdefghijklmnopqrstuvwxyz');
201
+ shuffle($seed);
202
+ $rand = '';
203
+ foreach (array_rand($seed, 5) as $k) $rand .= $seed[$k];
204
+
205
+ update_option('cffb_popup_cookie', 'popup_cookie_'.$rand);
206
+ ?>
207
+ <div id="message" class="updated fade"><p><strong><?php _e('Cookie Reset Saved .', 'facebooklikebox'); ?></strong></p></div>
208
+ <?php
209
+ }
210
+ else
211
+ {
212
+ die("Sorry! Your Noonce didn't verify");
213
+ }
214
+
215
+
216
+ }
217
+
218
+
219
  if (isset($_POST['frm_submit'])) {
220
 
221
  if (isset( $_POST['cflb_noonce']) && wp_verify_nonce( $_POST['cflb_noonce'], 'cflb_verify'))
262
  die("Sorry! Your Noonce didn't verify");
263
  }
264
  }
265
+
266
+
267
+ if (isset($_POST['popup_frm_submit'])) {
268
+
269
+ if (isset( $_POST['popup_cflb_noonce']) && wp_verify_nonce( $_POST['popup_cflb_noonce'], 'popup_cflb_verify'))
270
+ {
271
+
272
+ if (isset($_POST['popup_enable_disable'])){
273
+ update_option($cfblb_options['popup_enable_disable'], sanitize_text_field($_POST['popup_enable_disable']));
274
+ }
275
+ else
276
+ {
277
+ update_option($cfblb_options['popup_enable_disable'], "");
278
+ }
279
+
280
+ if (isset($_POST['popup_frm_title'])){
281
+ update_option($cfblb_options['popup_title'], sanitize_text_field($_POST['popup_frm_title']));
282
+ }
283
+ if (isset($_POST['popup_frm_url'])){
284
+ update_option($cfblb_options['popup_fb_url'], sanitize_text_field($_POST['popup_frm_url']));
285
+ }
286
+ if (isset($_POST['popup_frm_width'])){
287
+ update_option($cfblb_options['popup_width'],sanitize_text_field($_POST['popup_frm_width']));
288
+ }
289
+ if (isset($_POST['popup_frm_height'])){
290
+ update_option($cfblb_options['popup_height'], sanitize_text_field($_POST['popup_frm_height']));
291
+ }
292
+ if (!empty($_POST['popup_frm_show_faces'])){
293
+ update_option($cfblb_options['popup_show_faces'], sanitize_text_field($_POST['popup_frm_show_faces']));
294
+ }
295
+ if (!empty($_POST['popup_frm_stream'])){
296
+ update_option($cfblb_options['popup_stream'], sanitize_text_field($_POST['popup_frm_stream']));
297
+ }
298
+ if (!empty($_POST['popup_frm_header'])){
299
+ update_option($cfblb_options['popup_header'], sanitize_text_field($_POST['popup_frm_header']));
300
+ }
301
+ if (!empty($_POST['popup_frm_small_header'])){
302
+ update_option($cfblb_options['popup_small_header'], sanitize_text_field($_POST['popup_frm_small_header']));
303
+ }
304
+
305
+ if (!empty($_POST['popup_frm_lang'])){
306
+ update_option($cfblb_options['popup_lang'], sanitize_text_field($_POST['popup_frm_lang']));
307
+ }
308
+ if (isset($_POST['popup_repeat_times'])){
309
+ update_option($cfblb_options['popup_repeat_times'], sanitize_text_field($_POST['popup_repeat_times']));
310
+ }
311
+
312
+
313
+ $cffb_cookie=get_option('cffb_popup_cookie');
314
+
315
+ if(empty($cffb_cookie))
316
+ {
317
+ $seed = str_split('abcdefghijklmnopqrstuvwxyz');
318
+ shuffle($seed);
319
+ $rand = '';
320
+ foreach (array_rand($seed, 5) as $k) $rand .= $seed[$k];
321
+
322
+ update_option("cffb_popup_cookie","popup_cookie_".$rand);
323
+
324
+ }
325
+
326
+ ?>
327
+ <div id="message" class="updated fade"><p><strong><?php _e('Popup Options saved.', 'facebooklikebox'); ?></strong></p></div>
328
+ <?php
329
+ }
330
+ else
331
+ {
332
+ die("Sorry! Your Noonce didn't verify");
333
+ }
334
+ }
335
 
336
 
337
 
338
  $option_value = cfblb_retrieve_options();
 
339
 
340
 
341
 
544
  </form>
545
 
546
 
547
+ <form method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>">
548
+ <div class="postbox">
549
+ <h3 class="hndle">
550
+ <span>Auto Popup Settings</span>
551
+ </h3>
552
+ <div class="inside">
553
+ <table>
554
+
555
+ <tr height="35">
556
+ <td width="150"><b><?php _e('Enable/Disable Popup', 'facebooklikebox'); ?>:</b></td>
557
+ <td><input type="checkbox" name="popup_enable_disable" <?php if($option_value['popup_enable_disable']=="on"){ echo "checked";}?>/>
558
+ &nbsp;<label id="popup_enable_disable"><b>?</b></label></td>
559
+ </tr>
560
+ <tr id="popup_enable_disable_help"><td></td><td>(<?php _e('Enable or Disable Popup', 'facebooklikebox'); ?>)</td></tr>
561
+
562
+ <tr height="35">
563
+ <td width="150"><b><?php _e('Title', 'facebooklikebox'); ?>:</b></td>
564
+ <td><input type="text" name="popup_frm_title" size="50" value="<?php echo esc_html($option_value['popup_title']); ?>" placeholder="Like us on Facebook"/>
565
+ &nbsp;<label id="popuptitle"><b>?</b></label></td>
566
+ </tr>
567
+ <tr id="popup_title_help"><td></td><td>(<?php _e('Title of the facebook like box', 'facebooklikebox'); ?>)</td></tr>
568
+ <tr height="35">
569
+ <td width="150"><b><?php _e('Facebook Page URL:', 'facebooklikebox'); ?></b></td>
570
+ <td><input type="text" name="popup_frm_url" size="50" value="<?php echo esc_html($option_value['popup_fb_url']); ?>" required/>
571
+ &nbsp;<label id="popuppage_url"><b>?</b></label>
572
+
573
+ </tr>
574
+ <tr id="popup_page_url_help"><td></td><td>(<?php _e('Copy and paste your facebook page URL here - Example -> <a href="https://www.facebook.com/facebook" target="_blank">https://www.facebook.com/facebook</a>', 'facebooklikebox'); ?>)</td></tr>
575
+
576
+ <tr id="popup_border_help"><td></td><td>(<?php _e('Border Color of the facebook like box. HEX Code only - <a href="http://htmlcolorcodes.com/" target="_blank">http://htmlcolorcodes.com/</a>', 'facebooklikebox'); ?>)</td></tr>
577
+ <tr height="35">
578
+ <td width="150"><b><?php _e('Width', 'facebooklikebox'); ?>:</b></td>
579
+ <td><input type="text" name="popup_frm_width" value="<?php echo esc_html($option_value['popup_width']); ?>" placeholder="400" />px
580
+ &nbsp;<label id="popupwidth"><b>?</b></label></td>
581
+ </tr>
582
+ <tr id="popup_width_help"><td></td><td>(<?php _e('Width of the facebook like box', 'facebooklikebox'); ?>)</td></tr>
583
+ <tr height="35">
584
+ <td width="150"><b><?php _e('Height', 'facebooklikebox'); ?>:</b></td>
585
+ <td><input type="text" name="popup_frm_height" value="<?php echo esc_html($option_value['popup_height']); ?>" placeholder="250"/>px
586
+ &nbsp;<label id="popupheight"><b>?</b></label></td>
587
+ </tr>
588
+ <tr id="popup_height_help"><td></td><td>(<?php _e('Height of the facebook like box', 'facebooklikebox'); ?>)</td></tr>
589
+ <tr height="35">
590
+ <td width="150"><b><?php _e('Show Faces', 'facebooklikebox'); ?>:</b></td>
591
+ <td>
592
+ <select name="popup_frm_show_faces" style="margin-left:0px;width:100px;">
593
+ <option value="true" <?php if ($option_value['popup_show_faces'] == "true") echo "selected='selected'"; ?>><?php _e('Yes', 'facebooklikebox'); ?></option>
594
+ <option value="false" <?php if ($option_value['popup_show_faces'] == "false") echo "selected='selected'"; ?>><?php _e('No', 'facebooklikebox'); ?></option>
595
+ </select>
596
+ &nbsp;<label id="popupshow_faces"><b>?</b></label>
597
+ </td>
598
+ </tr>
599
+ <tr id="popup_show_faces_help"><td></td><td>(<?php _e('Show few facebook user face photos who liked your page', 'facebooklikebox'); ?>)</td></tr>
600
+ <tr height="35">
601
+ <td width="150"><b><?php _e('Facebook Feed Stream', 'facebooklikebox'); ?>:</b></td>
602
+ <td>
603
+ <select name="popup_frm_stream" style="margin-left:0px;width:100px;">
604
+ <option value="true" <?php if ($option_value['popup_stream'] == "true") echo "selected='selected'"; ?>><?php _e('Yes', 'facebooklikebox'); ?></option>
605
+ <option value="false" <?php if ($option_value['popup_stream'] == "false") echo "selected='selected'"; ?>><?php _e('No', 'facebooklikebox'); ?></option>
606
+ </select>
607
+ &nbsp;<label id="popupstream"><b>?</b></label>
608
+ </td>
609
+ </tr>
610
+ <tr id="popup_stream_help"><td></td><td>(<?php _e('Show your recet posts published on your facebook page', 'facebooklikebox'); ?>)</td></tr>
611
+ <tr height="35">
612
+ <td width="168"><b><?php _e('Header Image', 'facebooklikebox'); ?></b></td>
613
+ <td>
614
+ <select name="popup_frm_header" style="margin-left:0px;width:100px;">
615
+ <option value="true" <?php if ($option_value['popup_header'] == "true") echo "selected='selected'"; ?>><?php _e('Yes', 'facebooklikebox'); ?></option>
616
+ <option value="false" <?php if ($option_value['popup_header'] == "false") echo "selected='selected'"; ?>><?php _e('No', 'facebooklikebox'); ?></option>
617
+ </select>
618
+ &nbsp;<label id="popupheader"><b>?</b></label>
619
+ </td>
620
+ </tr>
621
+ <tr id="popup_header_help"><td></td><td>(<?php _e('Show / Hide your facebook cover image', 'facebooklikebox'); ?>)</td></tr>
622
+ <tr height="35">
623
+ <td width="168"><b><?php _e('Small Header', 'facebooklikebox'); ?></b></td>
624
+ <td>
625
+ <select name="popup_frm_small_header" style="margin-left:0px;width:100px;">
626
+ <option value="true" <?php if ($option_value['popup_small_header'] == "true") echo "selected='selected'"; ?>><?php _e('Yes', 'facebooklikebox'); ?></option>
627
+ <option value="false" <?php if ($option_value['popup_small_header'] == "false") echo "selected='selected'"; ?>><?php _e('No', 'facebooklikebox'); ?></option>
628
+ </select>
629
+ &nbsp;<label id="popupsmheader"><b>?</b></label>
630
+ </td>
631
+ </tr>
632
+ <tr id="popup_smheader_help"><td></td><td>(<?php _e('Show Small Header', 'facebooklikebox'); ?>)</td></tr>
633
+
634
+ <tr id="popup_header_help"><td></td><td>(<?php _e('Show / Hide your facebook cover image', 'facebooklikebox'); ?>)</td></tr>
635
+ <tr height="35">
636
+ <td width="168"><b><?php _e('Language', 'facebooklikebox'); ?></b></td>
637
+ <td>
638
+ <?php $current_lang=get_locale();
639
+
640
+ $cfb_langs=array("$current_lang"=>"Default",'af_ZA'=>'Afrikaans','sq_AL'=>'Albanian','ar_AR'=>'Arabic','hy_AM'=>'Armenian','ay_BO'=>'Aymara','az_AZ'=>'Azeri','eu_ES'=>'Basque','be_BY'=>'Belarusian','bn_IN'=>'Bengali','bs_BA'=>'Bosnian','bg_BG'=>'Bulgarian','ca_ES'=>'Catalan','ck_US'=>'Cherokee','hr_HR'=>'Croatian','cs_CZ'=>'Czech','da_DK'=>'Danish','nl_NL'=>'Dutch','nl_BE'=>'Dutch (Belgi?)','en_PI'=>'English (Pirate)','en_GB'=>'English (UK)','en_UD'=>'English (Upside Down)','en_US'=>'English (US)','eo_EO'=>'Esperanto','et_EE'=>'Estonian','fo_FO'=>'Faroese','tl_PH'=>'Filipino','fi_FI'=>'Finnish','fb_FI'=>'Finnish (test)','fr_FR'=>'French (Canada)','gl_ES'=>'Galician','ka_GE'=>'Georgian','de_DE'=>'German','el_GR'=>'Greek','gn_PY'=>'Guaran?','gu_IN'=>'Gujarati','he_IL'=>'Hebrew','hi_IN'=>'Hindi','hu_HU'=>'Hungarian','is_IS'=>'Icelandic','id_ID'=>'Indonesian','ga_IE'=>'Irish','it_IT'=>'Italian','ja_JP'=>'Japanese','jv_ID'=>'Javanese','kn_IN'=>'Kannada','kk_KZ'=>'Kazakh','km_KH'=>'Khmer','tl_ST'=>'Klingon','ko_KR'=>'Korean','ku_TR'=>'Kurdish','la_VA'=>'Latin','lv_LV'=>'Latvian','fb_LT'=>'Leet Speak','li_NL'=>'Limburgish','lt_LT'=>'Lithuanian','mk_MK'=>'Macedonian','mg_MG'=>'Malagasy','ms_MY'=>'Malay','ml_IN'=>'Malayalam','mt_MT'=>'Maltese','mr_IN'=>'Marathi','mn_MN'=>'Mongolian','ne_NP'=>'Nepali','se_NO'=>'Northern S?mi','nb_NO'=>'Norwegian (bokmal)','nn_NO'=>'Norwegian (nynorsk)','ps_AF'=>'Pashto','fa_IR'=>'Persian','pl_PL'=>'Polish','pt_BR'=>'Portuguese (Brazil)','pt_PT'=>'Portuguese (Portugal)','pa_IN'=>'Punjabi','qu_PE'=>'Quechua','ro_RO'=>'Romanian','rm_CH'=>'Romansh','ru_RU'=>'Russian','sa_IN'=>'Sanskrit','sr_RS'=>'Serbian','zh_CN'=>'Simplified Chinese (China)','sl_SI'=>'Slovak','rm_CH'=>'Slovenian','so_SO'=>'Somali','es_LA'=>'Spanish','es_CL'=>'Spanish (Chile)','es_CO'=>'Spanish (Colombia)','es_MX'=>'Spanish (Mexico)','es_ES'=>'Spanish (Spain)','es_VE'=>'Spanish (Venezuela)','sw_KE'=>'Swahili','sv_SE'=>'Swedish','sy_SY'=>'Syriac','tg_TJ'=>'Tajik','ta_IN'=>'Tamil','tt_RU'=>'Tatar','te_IN'=>'Telugu','th_TH'=>'Thai','zh_HK'=>'Traditional Chinese (Hong Kong)','zh_TW'=>'Traditional Chinese (Taiwan)','tr_TR'=>'Turkish','uk_UA'=>'Ukrainian','ur_PK'=>'Urdu','uz_UZ'=>'Uzbek','vi_VN'=>'Vietnamese','cy_GB'=>'Welsh','xh_ZA'=>'Xhosa','yi_DE'=>'Yiddish','zu_ZA'=>'Zulu');
641
+
642
+
643
+ ?>
644
+ <select name="popup_frm_lang" style="margin-left:0px;width:100px;">
645
+
646
+ <?php
647
+
648
+ foreach($cfb_langs as $ln_c=>$ln)
649
+ {
650
+ echo '<option value="'.$ln_c.'" ';
651
+
652
+ if($option_value['popup_lang']==$ln_c)
653
+ {
654
+ echo "selected";
655
+ }
656
+
657
+ echo '>'.$ln.'</option>';
658
+ }
659
+
660
+ ?>
661
+ </select>
662
+ &nbsp;<label id="popupsmlang"><b>?</b></label>
663
+ </td>
664
+ </tr>
665
+ <tr id="popup_smlang_help"><td></td><td>(<?php _e('Set the language for Likebox', 'facebooklikebox'); ?>)</td></tr>
666
+
667
+
668
+ <tr height="35">
669
+ <td width="168"><b><?php _e('Popup Repeat Time', 'facebooklikebox'); ?></b></td>
670
+ <td>
671
+ <select name="popup_repeat_times" style="margin-left:0px;width:100px;">
672
+ <?php
673
+
674
+ for($i=0;$i<=30;$i++)
675
+ {
676
+ echo '<option value="'.$i.'"';
677
+ if($i==$option_value['popup_repeat_times'])
678
+ echo "selected";
679
+ echo '>'.$i.'</option>';
680
+ }
681
+ ?>
682
+
683
+ </select>
684
+ </td>
685
+
686
+
687
+ </tr>
688
+ <tr><td colspan="2"><p style="font-size:80%;font-style:italic;">(If you select 3. Popup will be shown only 3 times maximum to a user. Please be advised, popups are bad for website-user-experience)</p></td></tr>
689
+
690
+
691
+
692
+ <tr height="60"><td></td><td><input type="submit" name="popup_frm_submit" value="<?php _e('Save', 'facebooklikebox'); ?>" class="button button-primary"/></td>
693
+ </tr>
694
+ </table>
695
+
696
+ </div> <!-- End of .inside -->
697
+
698
+ </div>
699
+ <?php wp_nonce_field( 'popup_cflb_verify', 'popup_cflb_noonce'); ?>
700
+ </form>
701
+
702
+ <form method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>">
703
+ <input type="submit" name="reset_cookie" value="Reset Cookie-Repeat-Counter" class="button"/>
704
+ <p style="font-size:80%;font-style:italic;">(This will reset the counter. Popup will be shown to users again for "Popup Repeat Times" [set this option above)</p>
705
+ <?php wp_nonce_field( 'cflb_verify', 'cflb_noonce'); ?>
706
+ </form>
707
+
708
 
709
  </div>
710
  <div class="fb-preview" style="background: white;border: 1px solid #fbfbfb;margin: 20px;"></div>
870
  return $output_string;
871
  }
872
 
 
 
873
  function fb_like_button_for_post($content) {
874
 
875
  $cfpl_enable = get_option('cfpl_enable');
925
  echo $content;
926
  }
927
 
928
+ function cardoza_fb_like_popup()
929
+ {
930
+ $option_value = cfblb_retrieve_options();
931
+
932
+ $cffb_cookie=get_option('cffb_popup_cookie');
933
+ $popup_repeat_times=$option_value['popup_repeat_times'];
934
+
935
+
936
+
937
+ $repeat_time=$_COOKIE[$cffb_cookie]==''?0:$_COOKIE[$cffb_cookie];
938
+
939
+
940
+
941
+ if($option_value['popup_enable_disable']=="on" && ($repeat_time<$popup_repeat_times || $popup_repeat_times==0))
942
+ {
943
+
944
+ if(empty($option_value['popup_width']))
945
+ {
946
+ $option_value['popup_width']=400;
947
+ }
948
+
949
+ if(empty($option_value['popup_height']))
950
+ {
951
+ $option_value['popup_height']=250;
952
+ }
953
+
954
+ ?>
955
+
956
+ <div id="cfblb_modal" class="cfblb_modal">
957
+ <div class="cfblb_modal-content" style="width:<?php echo $option_value['popup_width'];?>px;height:<?php echo $option_value['popup_height'];?>px;">
958
+ <span class="cfblb_close">&times;</span>
959
+ <h2><?php echo $option_value['popup_title'];?></h2>
960
+ <div class="fb-page"
961
+
962
+ <?php
963
+ $header="";
964
+ if($option_value['popup_header']=="true")
965
+ $header=false;
966
+ else
967
+ $header=true;
968
+ ?>
969
+ data-width="<?php echo $option_value['popup_width'];?>"
970
+ data-height="<?php echo $option_value['popup_height']-20;?>"
971
+ data-href="<?php echo $option_value['popup_fb_url'].'?locale="fr_FR"'; ?>"
972
+ data-small-header="<?php echo $option_value['popup_small_header'];?>"
973
+ data-hide-cover="<?php echo $header;?>"
974
+ data-show-facepile="<?php echo $option_value['popup_show_faces'];?>"
975
+ data-show-posts="false"
976
+ <?php
977
+ if($option_value['popup_stream']=="true")
978
+ {
979
+ ?>
980
+ data-tabs="timeline"
981
+ <?php
982
+ }
983
+
984
+ ?>
985
+
986
+
987
+ >
988
+
989
+ <?php
990
+
991
+ $current_lang="";
992
+
993
+ if(!empty($option_value['popup_lang']))
994
+ {
995
+ $current_lang=$option_value['popup_lang'];
996
+ }
997
+ else
998
+ {
999
+ $current_lang=get_locale();
1000
+ }
1001
+
1002
+
1003
+
1004
+
1005
+ ?>
1006
+
1007
+ </div>
1008
+ <div id="fb-root"></div>
1009
+ <script>
1010
+ (function(d, s, id) {
1011
+ var js, fjs = d.getElementsByTagName(s)[0];
1012
+ if (d.getElementById(id)) return;
1013
+ js = d.createElement(s); js.id = id;
1014
+ js.src = "//connect.facebook.net/<?php echo $current_lang;?>/sdk.js#xfbml=1&version=v2.4";
1015
+ fjs.parentNode.insertBefore(js, fjs);
1016
+ }(document, 'script', 'facebook-jssdk'));
1017
+ </script>
1018
+
1019
+ </div>
1020
+ </div>
1021
+
1022
+ <?php
1023
+
1024
+ }
1025
+
1026
+ ?>
1027
+ <script>
1028
+ var modal = document.getElementById('cfblb_modal');
1029
+ if(modal)
1030
+ {
1031
+ var span = document.getElementsByClassName("cfblb_close")[0];
1032
+
1033
+ span.onclick = function() {
1034
+ modal.style.display = "none";
1035
+ }
1036
+
1037
+ window.onclick = function(event) {
1038
+ if (event.target == modal) {
1039
+ modal.style.display = "none";
1040
+ }
1041
+ }
1042
+ }
1043
+ </script>
1044
+ <?php
1045
+
1046
+ if(!empty($cffb_cookie) && !empty($popup_repeat_times) && $option_value['popup_enable_disable']=="on")
1047
+ {
1048
+ ?>
1049
+ <script>
1050
+
1051
+
1052
+
1053
+
1054
+ function getcflbCookie(name) {
1055
+ var dc = document.cookie;
1056
+ var prefix = name + "=";
1057
+ var begin = dc.indexOf("; " + prefix);
1058
+ if (begin == -1) {
1059
+ begin = dc.indexOf(prefix);
1060
+ if (begin != 0) return null;
1061
+ }
1062
+ else
1063
+ {
1064
+ begin += 2;
1065
+ var end = document.cookie.indexOf(";", begin);
1066
+ if (end == -1) {
1067
+ end = dc.length;
1068
+ }
1069
+ }
1070
+ return decodeURI(dc.substring(begin + prefix.length, end));
1071
+ }
1072
+
1073
+ var cffb_cookie=getcflbCookie('<?php echo $cffb_cookie;?>');
1074
+
1075
+
1076
+ if(cffb_cookie == null)
1077
+ {
1078
+ document.cookie = '<?php echo $cffb_cookie;?>' + "=1;expires=2127483647;path=/";
1079
+ }
1080
+ else
1081
+ {
1082
+ if(parseInt(cffb_cookie)>=<?php echo $popup_repeat_times;?>)
1083
+ {
1084
+ document.getElementById('facebookpopupbox').style.display="none";
1085
+
1086
+ }
1087
+ else
1088
+ {
1089
+ cffb_cookie=parseInt(cffb_cookie)+1;
1090
+ document.cookie = '<?php echo $cffb_cookie;?>' + "="+cffb_cookie+";expires=2127483647;path=/";
1091
+ }
1092
+ }
1093
+
1094
+ </script>
1095
+ <?php
1096
+ }
1097
+
1098
+
1099
+ }
1100
+
1101
  function cardoza_fb_like_init() {
1102
  load_plugin_textdomain('facebooklikebox', false, dirname(plugin_basename(__FILE__)) . '/languages');
1103
  wp_register_sidebar_widget('FBLBX', __('Facebook Like Box'), 'widget_cardoza_fb_like');
cardozafacebook.css CHANGED
@@ -8,7 +8,19 @@
8
  #cfbstream,
9
  #cfbheader,
10
  #cfbsmheader,
11
- #cfbsmlang
 
 
 
 
 
 
 
 
 
 
 
 
12
  {
13
  font-size: 18px;
14
  }
@@ -22,6 +34,18 @@
22
  #stream_help,
23
  #header_help,
24
  #cfbsmheader_help,
25
- #cfbsmlang_help{
 
 
 
 
 
 
 
 
 
 
 
 
26
  display: none;
27
  }
8
  #cfbstream,
9
  #cfbheader,
10
  #cfbsmheader,
11
+ #cfbsmlang,
12
+ #popup_enable_disable,
13
+ #popuptitle,
14
+ #popuppage_url,
15
+ #popupborder,
16
+ #popupwidth,
17
+ #popupheight,
18
+ #popupcolor_scheme,
19
+ #popupshow_faces,
20
+ #popupstream,
21
+ #popupheader,
22
+ #popupsmheader,
23
+ #popupsmlang
24
  {
25
  font-size: 18px;
26
  }
34
  #stream_help,
35
  #header_help,
36
  #cfbsmheader_help,
37
+ #cfbsmlang_help,
38
+ #popup_enable_disable_help,
39
+ #popup_title_help,
40
+ #popup_page_url_help,
41
+ #popup_border_help,
42
+ #popup_width_help,
43
+ #popup_height_help,
44
+ #popup_color_scheme_help,
45
+ #popup_show_faces_help,
46
+ #popup_stream_help,
47
+ #popup_header_help,
48
+ #popup_smheader_help,
49
+ #popup_smlang_help{
50
  display: none;
51
  }
cardozafacebook.js CHANGED
@@ -34,4 +34,43 @@ jQuery(document).ready(function(e){
34
  jQuery('#cfbsmlang_help').toggle();
35
  })
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  })
34
  jQuery('#cfbsmlang_help').toggle();
35
  })
36
 
37
+ jQuery('#popup_enable_disable').click(function(){
38
+ jQuery('#popup_enable_disable_help').toggle();
39
+ })
40
+
41
+ jQuery('#popuptitle').click(function(){
42
+ jQuery('#popup_title_help').toggle();
43
+ })
44
+ jQuery('#popuppage_url').click(function(){
45
+ jQuery('#popup_page_url_help').toggle();
46
+ })
47
+ jQuery('#popupborder').click(function(){
48
+ jQuery('#popup_border_help').toggle();
49
+ })
50
+ jQuery('#popupwidth').click(function(){
51
+ jQuery('#popup_width_help').toggle();
52
+ })
53
+ jQuery('#popupheight').click(function(){
54
+ jQuery('#popup_height_help').toggle();
55
+ })
56
+ jQuery('#popupcolor_scheme').click(function(){
57
+ jQuery('#popup_color_scheme_help').toggle();
58
+ })
59
+ jQuery('#popupshow_faces').click(function(){
60
+ jQuery('#popup_show_faces_help').toggle();
61
+ })
62
+ jQuery('#popupstream').click(function(){
63
+ jQuery('#popup_stream_help').toggle();
64
+ })
65
+ jQuery('#popupheader').click(function(){
66
+ jQuery('#popup_header_help').toggle();
67
+ })
68
+ jQuery('#popupsmheader').click(function(){
69
+ jQuery('#popup_smheader_help').toggle();
70
+ })
71
+
72
+ jQuery('#popupsmlang').click(function(){
73
+ jQuery('#popup_smlang_help').toggle();
74
+ })
75
+
76
  })
cardozafacebook_popup.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cfblb_modal {
2
+
3
+ position: fixed; /* Stay in place */
4
+ z-index: 1; /* Sit on top */
5
+ padding-top: 100px; /* Location of the box */
6
+ left: 0;
7
+ top: 0;
8
+ width: 100%; /* Full width */
9
+ height: 100%; /* Full height */
10
+ overflow: auto; /* Enable scroll if needed */
11
+ background-color: rgb(0,0,0); /* Fallback color */
12
+ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
13
+ }
14
+
15
+ /* Modal Content */
16
+ .cfblb_modal-content {
17
+ background-color: #fefefe;
18
+ margin: auto;
19
+ padding: 10px 20px 20px 20px;
20
+ border: 1px solid #888;
21
+ width: 80%;
22
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
23
+ }
24
+
25
+ /* The Close Button */
26
+ .cfblb_close {
27
+ color: #aaaaaa;
28
+ float: right;
29
+ font-size: 28px;
30
+ font-weight: bold;
31
+ }
32
+
33
+ .cfblb_close:hover,
34
+ .cfblb_close:focus {
35
+ color: #000;
36
+ text-decoration: none;
37
+ cursor: pointer;
38
+ }
39
+
40
+ .cfblb_modal h2 {
41
+ display: inline;
42
+ color: #272727;
43
+ font-weight: bold;
44
+ line-height: 28px;
45
+ font-family: sans-serif;
46
+ font-size: 130%;
47
+ }
48
+
49
+ @media only screen and (max-device-width : 640px) {
50
+ #cfblb_modal
51
+ {
52
+ display:none;
53
+ }
54
+
55
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vinoj.cardoza
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vinoj%2ecardoza%40gmail%2ecom&currency_code=GBP&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: facebook, like, likebox, fb, facebook like, like button, facebook like box, fb like box, button
5
  Requires at least: 3.0
6
- Tested up to: 4.8.2
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
 
@@ -115,4 +115,7 @@ fixed below bugs which caused due to New Facebook Preview option.
115
  3. Added option to Change Language
116
  4. Kept `Facebook Like Box Options` under Primary Settings Menu in Admin Panel
117
  5. Fixed Padding Issue
118
- 6. Removed Ads [Affiliate Links] from Admin Panel
 
 
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vinoj%2ecardoza%40gmail%2ecom&currency_code=GBP&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: facebook, like, likebox, fb, facebook like, like button, facebook like box, fb like box, button
5
  Requires at least: 3.0
6
+ Tested up to: 5.0
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
 
115
  3. Added option to Change Language
116
  4. Kept `Facebook Like Box Options` under Primary Settings Menu in Admin Panel
117
  5. Fixed Padding Issue
118
+ 6. Removed Ads [Affiliate Links] from Admin Panel
119
+
120
+ = Version 3.0 =
121
+ 1. New Feature: Added Facebook Popup [Lightbox] modal