WP Embed Facebook - Version 1.8

Version Description

  • Compatibility with twenty 15 theme
  • New css for embeds
  • Compatibility with premium plugin
Download this release

Release Info

Developer poxtron
Plugin Icon 128x128 WP Embed Facebook
Version 1.8
Comparing to
See all releases

Code changes from version 1.7.1 to 1.8

index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ //Nothing to see here
lib/admin.php CHANGED
@@ -4,7 +4,7 @@ class EmbFbAdmin{
4
  static function admin_enqueue_scripts($hook_suffix){
5
  if($hook_suffix == 'settings_page_embedfacebook'){
6
  global $wp_scripts;
7
- wp_enqueue_script('wpemfb-admin', WP_PLUGIN_URL."/".WPEMFBSLUG.'/lib/js/admin.js',array('jquery-ui-accordion'));
8
  $queryui = $wp_scripts->query('jquery-ui-core');
9
  $url = "http://ajax.googleapis.com/ajax/libs/jqueryui/".$queryui->ver."/themes/smoothness/jquery-ui.css";
10
  wp_enqueue_style('jquery-ui-start', $url, false, null);
@@ -14,7 +14,7 @@ class EmbFbAdmin{
14
  }
15
  static function admin_init(){
16
  $theme = get_option('wpemfb_theme');
17
- add_editor_style( plugins_url('/'.WPEMFBSLUG.'/templates/'.$theme.'/wpemfb.css') );
18
  }
19
  static function add_page(){
20
  add_options_page('EmbedFacebook', 'Embed Facebook', 'manage_options', 'embedfacebook', array('EmbFbAdmin', 'embedfb_page'));
@@ -95,6 +95,7 @@ class EmbFbAdmin{
95
  update_option('wpemfb_enq_fbjs', 'false');
96
  }
97
  }
 
98
  }
99
  static function embedfb_page() {
100
  if(isset($_POST['submit']) && check_admin_referer( 'wp-embed-facebook','save-data' )){
@@ -175,6 +176,7 @@ class EmbFbAdmin{
175
  <select name="wpemfb_theme">
176
  <option value="default" <?php echo $sel1 ?> >Default</option>
177
  <option value="classic" <?php echo $sel2 ?> >Classic</option>
 
178
  </select>
179
  </td>
180
  </tr>
@@ -298,11 +300,11 @@ class EmbFbAdmin{
298
  </form>
299
  </div>
300
  <div class="welcome-panel-column welcome-panel-last" >
301
- <h3><?php _e( 'PreBuy Premium Version', 'wp-embed-facebook') ?></h3>
302
- <h2><?php _e( 'Only $4.99 USD<br><small style="font-size: 12px">Final Price $6.99 USD</small>', 'wp-embed-facebook') ?></h2>
303
- <h3><?php _e( 'Release January 15th, 2015', 'wp-embed-facebook') ?></h3>
304
  <br>
305
- <a class="button button-primary" href="http://www.wpembedfb.com/register"><?php _e('Pre-Buy Now', 'wp-embed-facebook') ?></a>
306
  <br>
307
  <ul>
308
  <li>
@@ -310,10 +312,12 @@ class EmbFbAdmin{
310
  </li>
311
  <li>
312
  <?php _e('Fan Page Full Embed', 'wp-embed-facebook') ?>
313
- </li>
 
314
  <li>
315
  <?php _e('More Responsive Templates', 'wp-embed-facebook') ?>
316
  </li>
 
317
  <li>
318
  <?php _e('One Year Premium Support', 'wp-embed-facebook') ?>
319
  </li>
@@ -327,6 +331,7 @@ class EmbFbAdmin{
327
  <p>
328
  <img src="<?php echo plugins_url('/img/hechoenmexico.png', __FILE__) ?>" width="60px" />
329
  </p>
 
330
  </div>
331
  </div>
332
  </div>
4
  static function admin_enqueue_scripts($hook_suffix){
5
  if($hook_suffix == 'settings_page_embedfacebook'){
6
  global $wp_scripts;
7
+ wp_enqueue_script('wpemfb-admin', WPEMFBURL.'lib/js/admin.js',array('jquery-ui-accordion'));
8
  $queryui = $wp_scripts->query('jquery-ui-core');
9
  $url = "http://ajax.googleapis.com/ajax/libs/jqueryui/".$queryui->ver."/themes/smoothness/jquery-ui.css";
10
  wp_enqueue_style('jquery-ui-start', $url, false, null);
14
  }
15
  static function admin_init(){
16
  $theme = get_option('wpemfb_theme');
17
+ add_editor_style( WPEMFBURL.'templates/'.$theme.'/wpemfb.css' );
18
  }
19
  static function add_page(){
20
  add_options_page('EmbedFacebook', 'Embed Facebook', 'manage_options', 'embedfacebook', array('EmbFbAdmin', 'embedfb_page'));
95
  update_option('wpemfb_enq_fbjs', 'false');
96
  }
97
  }
98
+ do_action('wpemfb_admin_savedata');
99
  }
100
  static function embedfb_page() {
101
  if(isset($_POST['submit']) && check_admin_referer( 'wp-embed-facebook','save-data' )){
176
  <select name="wpemfb_theme">
177
  <option value="default" <?php echo $sel1 ?> >Default</option>
178
  <option value="classic" <?php echo $sel2 ?> >Classic</option>
179
+ <?php do_action('wpemfb_admin_theme'); ?>
180
  </select>
181
  </td>
182
  </tr>
300
  </form>
301
  </div>
302
  <div class="welcome-panel-column welcome-panel-last" >
303
+ <?php ob_start(); ?>
304
+ <h3><?php _e( 'Premium Version Available', 'wp-embed-facebook') ?></h3>
305
+ <h2><?php _e( 'Only $6.99 USD', 'wp-embed-facebook') ?></h2>
306
  <br>
307
+ <a class="button button-primary" href="http://www.wpembedfb.com/premium"><?php _e('Check it out', 'wp-embed-facebook') ?></a>
308
  <br>
309
  <ul>
310
  <li>
312
  </li>
313
  <li>
314
  <?php _e('Fan Page Full Embed', 'wp-embed-facebook') ?>
315
+ </li>
316
+ <!--
317
  <li>
318
  <?php _e('More Responsive Templates', 'wp-embed-facebook') ?>
319
  </li>
320
+ -->
321
  <li>
322
  <?php _e('One Year Premium Support', 'wp-embed-facebook') ?>
323
  </li>
331
  <p>
332
  <img src="<?php echo plugins_url('/img/hechoenmexico.png', __FILE__) ?>" width="60px" />
333
  </p>
334
+ <?php echo apply_filters('wpemfb_admin',ob_get_clean()); ?>
335
  </div>
336
  </div>
337
  </div>
lib/core.php CHANGED
@@ -9,6 +9,7 @@ class WP_Embed_FB {
9
  static $height = '';
10
  static $theme = '';
11
  static $raw = '';
 
12
  /*
13
  * Save default values to data base
14
  */
@@ -21,12 +22,14 @@ class WP_Embed_FB {
21
  update_option($option, $value);
22
  }
23
  else {
24
- $opt = get_option($option);
25
  if($opt === false)
26
  update_site_option($option, $value);
27
- }
 
 
28
  }
29
- self::whois();
30
  return;
31
  }
32
  /*
@@ -42,11 +45,11 @@ class WP_Embed_FB {
42
  delete_site_option($option);
43
  }
44
  }
45
- self::whois('uninstall');
46
  return;
47
  }
48
  static function deactivate(){
49
- self::whois('deactivate');
50
  return;
51
  }
52
  /*
@@ -75,10 +78,11 @@ class WP_Embed_FB {
75
  'wpemfb_enq_fbjs' => 'true'
76
  );
77
  }
78
- protected static function whois($install = 'install'){
79
- $home = esc_url(home_url());
80
- //no personal data only home page.
81
- @file_get_contents("http://www.wpembedfb.com/?new_ins2=$install&new_ins=$home");
 
82
  return true;
83
  }
84
  /*
@@ -94,37 +98,39 @@ class WP_Embed_FB {
94
  static function wp_enqueue_scripts(){
95
  if(get_option('wpemfb_enqueue_style') == 'true'){
96
  $theme = get_option('wpemfb_theme');
97
- wp_register_style( 'wpemfb-style', plugins_url('/'.WPEMFBSLUG.'/templates/'.$theme.'/wpemfb.css'));
98
- wp_register_style( 'wpemfb-lightbox', plugins_url('/'.WPEMFBSLUG.'/lib/lightbox2/css/lightbox.css'));
99
  wp_enqueue_style('wpemfb-style');
100
  wp_enqueue_style('wpemfb-lightbox');
101
  }
102
  if(get_option('wpemfb_enq_lightbox') == 'true'){
103
  wp_enqueue_script(
104
  'wpemfb-lightbox',
105
- plugins_url('/'.WPEMFBSLUG.'/lib/lightbox2/js/lightbox.min.js'),
106
  array( 'jquery' )
107
  );
108
  }
109
  if(get_option('wpemfb_enq_wpemfb') == 'true'){
110
  wp_enqueue_script(
111
  'wpemfb',
112
- plugins_url('/'.WPEMFBSLUG.'/lib/js/wpembedfb.js'),
113
  array( 'jquery' )
114
  );
115
  }
116
  if(get_option('wpemfb_enq_fbjs') == 'true'){
117
  wp_enqueue_script(
118
  'wpemfbjs',
119
- plugins_url('/'.WPEMFBSLUG.'/lib/js/fb.js'),
120
  array( 'jquery' )
121
  );
122
  $translation_array = array( 'local' => get_locale(), 'fb_id'=>get_option('wpemfb_app_id') );
123
  wp_localize_script( 'wpemfbjs', 'WEF', $translation_array );
124
  }
125
  }
 
126
  static function tiny_mce_before_init(){
127
- wp_register_style( 'wpemfb-style', plugins_url('/'.WPEMFBSLUG.'/templates/'.$theme.'/wpemfb.css'));
 
128
  }
129
  /*
130
  * the_content filter to process fb url's
@@ -171,15 +177,15 @@ class WP_Embed_FB {
171
  $fb_id = $ids[1];
172
  }
173
  }
174
-
 
 
175
  //its a post
176
  if( array_search('posts',$clean) !== false ){
177
  $fb_data = array( 'link' => $match[2],'is_post' => '' );
178
  return self::print_fb_data($fb_data);
179
  }
180
 
181
- //TODO: check if its event and pull cover photo, probably only fro premium
182
- do_action('fb_embed_plus');
183
  if(!empty(self::$raw)){
184
  $raw_photo = self::$raw;
185
  $raw_video = self::$raw;
@@ -216,30 +222,34 @@ class WP_Embed_FB {
216
  */
217
  static function fb_api_get($fb_id, $url, $type=""){
218
  $wp_emb_fbsdk = self::$fbsdk;
219
- try {
220
- if(empty($type))
221
- $fb_data = $wp_emb_fbsdk->api('/v1.0/'.$fb_id);
222
- elseif($type == 'album')
223
- $fb_data = $wp_emb_fbsdk->api('/'.$fb_id.'?fields=name,id,from,photos.fields(name,picture,source).limit('.get_option("wpemfb_max_photos").')');
224
- //$res = '<pre>'.print_r($fb_data,true).'</pre>'; //to inspect what elements are queried by default
225
- if(isset($fb_data['category']) && get_option("wpemfb_show_posts") == "true")
226
- $fb_data = $fb_data + $wp_emb_fbsdk->api('/'.$fb_data['id'].'?fields=posts.limit('.get_option("wpemfb_max_posts").'){message,shares,link,picture,object_id,likes.limit(1).summary(true),comments.limit(1).summary(true)}');
227
- elseif(isset($fb_data['embed_html']))
228
- $fb_data = array_merge($fb_data,array('is_video' => '1'));
229
- $res = self::print_fb_data($fb_data);
230
- } catch(FacebookApiException $e) {
231
- $res = '<p><a href="http://www.facebook.com/'.$url.'" target="_blank" rel="nofollow">http://wwww.facebook.com/'.$url.'</a>';
232
- //uncoment this lines to debug
233
- ///*
234
- if(is_super_admin()){
235
- $error = $e->getResult();
236
- $res .= '<br><span style="color: red">'.__('This facebook link is not public', 'wp-embed-facebook').'</span>';
237
- $res .= '<br>';
238
- $res .= $error['error']['message'];
 
 
 
 
239
  }
240
- //*/
241
- $res .= '</p>';
242
  }
 
 
243
  return $res;
244
  }
245
  /**
@@ -289,7 +299,7 @@ class WP_Embed_FB {
289
  $template = self::locate_template('profile');
290
  }
291
  ob_start();
292
- include($template);
293
  return preg_replace('/^\s+|\n|\r|\s+$/m', '', ob_get_clean());
294
  }
295
  /**
@@ -299,8 +309,14 @@ class WP_Embed_FB {
299
  static function locate_template($template_name){
300
  $theme = get_option('wpemfb_theme');
301
  $located = locate_template(array('plugins/'.WPEMFBSLUG.'/'.$template_name.'.php'));
302
- if(empty($located))
303
- $located = WP_PLUGIN_DIR.'/'.WPEMFBSLUG.'/templates/'.$theme.'/'.$template_name.'.php';
 
 
 
 
 
 
304
  return $located;
305
  }
306
  /*
@@ -384,6 +400,12 @@ class WP_Embed_FB {
384
  $root .= "\n";
385
  return $root.$ct;
386
  }
 
 
 
 
 
 
387
  }
388
 
389
  /*
@@ -405,4 +427,3 @@ class FaceInit {
405
  self::$fbsdk = 'unactive';
406
  }
407
  }
408
- ?>
9
  static $height = '';
10
  static $theme = '';
11
  static $raw = '';
12
+ static $premium = '';
13
  /*
14
  * Save default values to data base
15
  */
22
  update_option($option, $value);
23
  }
24
  else {
25
+ $opt = get_site_option($option);
26
  if($opt === false)
27
  update_site_option($option, $value);
28
+ }
29
+ if(!isset($type))
30
+ $type = $opt==false?"activated":"reactivated";
31
  }
32
+ self::whois($type);
33
  return;
34
  }
35
  /*
45
  delete_site_option($option);
46
  }
47
  }
48
+ self::whois('uninstalled');
49
  return;
50
  }
51
  static function deactivate(){
52
+ self::whois('deactivated');
53
  return;
54
  }
55
  /*
78
  'wpemfb_enq_fbjs' => 'true'
79
  );
80
  }
81
+ //("uninstalled","deactivated","activated","reactivated")
82
+ protected static function whois($install){
83
+ $home = is_multisite()?network_home_url():home_url();
84
+ $home = esc_url($home);
85
+ @file_get_contents("http://www.wpembedfb.com/api/?whois=$install&site_url=$home");
86
  return true;
87
  }
88
  /*
98
  static function wp_enqueue_scripts(){
99
  if(get_option('wpemfb_enqueue_style') == 'true'){
100
  $theme = get_option('wpemfb_theme');
101
+ wp_register_style( 'wpemfb-style', WPEMFBURL.'/templates/'.$theme.'/wpemfb.css');
102
+ wp_register_style( 'wpemfb-lightbox', WPEMFBURL.'/lib/lightbox2/css/lightbox.css');
103
  wp_enqueue_style('wpemfb-style');
104
  wp_enqueue_style('wpemfb-lightbox');
105
  }
106
  if(get_option('wpemfb_enq_lightbox') == 'true'){
107
  wp_enqueue_script(
108
  'wpemfb-lightbox',
109
+ WPEMFBURL.'lib/lightbox2/js/lightbox.min.js',
110
  array( 'jquery' )
111
  );
112
  }
113
  if(get_option('wpemfb_enq_wpemfb') == 'true'){
114
  wp_enqueue_script(
115
  'wpemfb',
116
+ WPEMFBURL.'lib/js/wpembedfb.js',
117
  array( 'jquery' )
118
  );
119
  }
120
  if(get_option('wpemfb_enq_fbjs') == 'true'){
121
  wp_enqueue_script(
122
  'wpemfbjs',
123
+ WPEMFBURL.'lib/js/fb.js',
124
  array( 'jquery' )
125
  );
126
  $translation_array = array( 'local' => get_locale(), 'fb_id'=>get_option('wpemfb_app_id') );
127
  wp_localize_script( 'wpemfbjs', 'WEF', $translation_array );
128
  }
129
  }
130
+ /* ?????? */
131
  static function tiny_mce_before_init(){
132
+ $theme = get_option('wpemfb_theme');
133
+ wp_register_style( 'wpemfb-style', WPEMFBURL.'templates/'.$theme.'/wpemfb.css');
134
  }
135
  /*
136
  * the_content filter to process fb url's
177
  $fb_id = $ids[1];
178
  }
179
  }
180
+ //TODO: check if its event and pull cover photo, probably only fro premium
181
+ //do_action('wpemfb_embed',$type,$clean,$vars,$match);
182
+ $type = apply_filters('wpemfb_embed_type',$type,$clean);
183
  //its a post
184
  if( array_search('posts',$clean) !== false ){
185
  $fb_data = array( 'link' => $match[2],'is_post' => '' );
186
  return self::print_fb_data($fb_data);
187
  }
188
 
 
 
189
  if(!empty(self::$raw)){
190
  $raw_photo = self::$raw;
191
  $raw_video = self::$raw;
222
  */
223
  static function fb_api_get($fb_id, $url, $type=""){
224
  $wp_emb_fbsdk = self::$fbsdk;
225
+ if(!self::$premium){
226
+ try {
227
+ if(empty($type))
228
+ $fb_data = $wp_emb_fbsdk->api('/v1.0/'.$fb_id);
229
+ elseif($type == 'album')
230
+ $fb_data = $wp_emb_fbsdk->api('/'.$fb_id.'?fields=name,id,from,photos.fields(name,picture,source).limit('.get_option("wpemfb_max_photos").')');
231
+ //$res = '<pre>'.print_r($fb_data,true).'</pre>'; //to inspect what elements are queried by default
232
+ if(isset($fb_data['category']) && get_option("wpemfb_show_posts") == "true")
233
+ $fb_data = $fb_data + $wp_emb_fbsdk->api('/'.$fb_data['id'].'?fields=posts.limit('.get_option("wpemfb_max_posts").'){message,shares,link,picture,object_id,likes.limit(1).summary(true),comments.limit(1).summary(true)}');
234
+ elseif(isset($fb_data['embed_html']))
235
+ $fb_data = array_merge($fb_data,array('is_video' => '1'));
236
+ $res = self::print_fb_data($fb_data);
237
+ } catch(FacebookApiException $e) {
238
+ $res = '<p><a href="https://www.facebook.com/'.$url.'" target="_blank" rel="nofollow">https://www.facebook.com/'.$url.'</a>';
239
+ //uncoment this lines to debug
240
+ ///*
241
+ if(is_super_admin()){
242
+ $error = $e->getResult();
243
+ $res .= '<br><span style="color: red">'.__('This facebook link is not public', 'wp-embed-facebook').'</span>';
244
+ $res .= '<br>';
245
+ $res .= $error['error']['message'];
246
+ }
247
+ //*/
248
+ $res .= '</p>';
249
  }
 
 
250
  }
251
+ else
252
+ $res = WP_Embed_FB_Premium::fb_api_get($fb_id, $url, $type, $wp_emb_fbsdk);
253
  return $res;
254
  }
255
  /**
299
  $template = self::locate_template('profile');
300
  }
301
  ob_start();
302
+ include(apply_filters('wpemfb_template',$template,$fb_data));
303
  return preg_replace('/^\s+|\n|\r|\s+$/m', '', ob_get_clean());
304
  }
305
  /**
309
  static function locate_template($template_name){
310
  $theme = get_option('wpemfb_theme');
311
  $located = locate_template(array('plugins/'.WPEMFBSLUG.'/'.$template_name.'.php'));
312
+ $file = '/templates/'.$theme.'/'.$template_name.'.php';
313
+ if(empty($located)){
314
+ if( self::$premium && file_exists(WPEMFBPLDIR.$file)){
315
+ $located = WPEMFBPLDIR.$file;
316
+ } else {
317
+ $located = WPEMFBDIR.$file;
318
+ }
319
+ }
320
  return $located;
321
  }
322
  /*
400
  $root .= "\n";
401
  return $root.$ct;
402
  }
403
+ static function plugins_loaded(){
404
+ if(class_exists('WP_Embed_FB_Premium'))
405
+ self::$premium = true;
406
+ else
407
+ self::$premium = false;
408
+ }
409
  }
410
 
411
  /*
427
  self::$fbsdk = 'unactive';
428
  }
429
  }
 
lib/js/wpembedfb.js CHANGED
@@ -1,13 +1,15 @@
1
- window.onresize = resize_cover;
2
-
3
  jQuery(document).ready(function() {
4
  resize_cover();
5
- var width = jQuery(".wpemfb-border").outerWidth();
6
- jQuery(".fb-post").attr("data-width",width+"px");
 
 
 
7
  });
8
-
9
  function resize_cover(){
10
- var width = jQuery(".wpemfb-cover").width();
11
- var height = 0.36867 * width;
12
- jQuery(".wpemfb-cover").height(height);
 
 
13
  }
 
 
1
  jQuery(document).ready(function() {
2
  resize_cover();
3
+ var v_width = jQuery(".wpemfb-container").outerWidth();
4
+ jQuery(".fb-post").attr("data-width",v_width+"px");
5
+ });
6
+ jQuery(window).resize(function(){
7
+ resize_cover();
8
  });
 
9
  function resize_cover(){
10
+ var v_width = jQuery(".wpemfb-cover").width();
11
+ var v_height = 0.368 * v_width;
12
+ jQuery(".wpemfb-cover").css("height",v_height );
13
+ //console.log(v_height);
14
+ //console.log(jQuery(".wpemfb-cover").height());
15
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: poxtron
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R8Q85GT3Q8Q26
4
  Tags: Facebook, facebook, Social Plugins, embed facebook, facebook video, facebook posts, facebook publication, facebook publications, facebook event, facebook events, facebook pages, facebook page, facebook profiles, facebook album, facebook albums, facebook photos, facebook photo, social,
5
  Requires at least: 3.8.1
6
- Tested up to: 4.0.1
7
- Stable tag: 1.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -66,6 +66,14 @@ width and raw are optional, raw only works for videos and photos
66
 
67
  It is posible that another plugin or your theme already has the Facebook SDK for javascript, you can disable the enqueue of the script on the advanced options
68
 
 
 
 
 
 
 
 
 
69
  == Screenshots ==
70
 
71
  1. Fan Page Embed
@@ -75,6 +83,11 @@ It is posible that another plugin or your theme already has the Facebook SDK for
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
78
  = 1.7.1 =
79
  * Documentation Update
80
  * New advanced option
@@ -145,6 +158,6 @@ It is posible that another plugin or your theme already has the Facebook SDK for
145
 
146
  == Upgrade Notice ==
147
 
148
- = 1.7.1 =
149
- Documentation Update & New advanced option
150
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R8Q85GT3Q8Q26
4
  Tags: Facebook, facebook, Social Plugins, embed facebook, facebook video, facebook posts, facebook publication, facebook publications, facebook event, facebook events, facebook pages, facebook page, facebook profiles, facebook album, facebook albums, facebook photos, facebook photo, social,
5
  Requires at least: 3.8.1
6
+ Tested up to: 4.1
7
+ Stable tag: 1.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
66
 
67
  It is posible that another plugin or your theme already has the Facebook SDK for javascript, you can disable the enqueue of the script on the advanced options
68
 
69
+ = I can only embed a max of 100 photos on albums =
70
+
71
+ This is a facebook limitation, will try to work around it and update this feature on the premium plugin.
72
+
73
+ = How to change embedded post background =
74
+
75
+ The embedded post code comes directly from facebook so there is no easy way to change it, for a moment there posts could be queried on the api but for the moment is not working. When it does an update will follow.
76
+
77
  == Screenshots ==
78
 
79
  1. Fan Page Embed
83
 
84
  == Changelog ==
85
 
86
+ = 1.8 =
87
+ * Compatibility with twenty 15 theme
88
+ * New css for embeds
89
+ * Compatibility with premium plugin
90
+
91
  = 1.7.1 =
92
  * Documentation Update
93
  * New advanced option
158
 
159
  == Upgrade Notice ==
160
 
161
+ = 1.8 =
162
+ Compatibility with twenty fifteen theme and premium plugin
163
 
templates/default/album.php CHANGED
@@ -3,33 +3,34 @@
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
- $width = $width - 20;
7
  ?>
8
- <div class="wpemfb-border" style="max-width: <?php echo $width ?>px">
9
- <div class="wpemfb-table">
10
- <div class="wpemfb-cell-left">
11
- <a class="wpemfb-clean-link" href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
12
  <img src="http://graph.facebook.com/<?php echo $fb_data['from']['id'] ?>/picture" />
13
  </a>
14
 
15
  </div>
16
- <div class="wpemfb-cell-right">
17
- <a class="wpemfb-title wpemfb-clean-link" href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
18
  <?php echo $fb_data['from']['name'] ?>
19
  </a>
20
  <br>
21
  <?php if(isset($fb_data['from']['category'])) : ?>
22
  <?php echo $fb_data['from']['category'].'<br>' ?>
23
  <?php endif; ?>
24
- <a class="wpemfb-color wpemfb-clean-link" href="https://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow"><?php echo $fb_data['name'] ?></a>
25
  </div>
26
  </div>
27
- <div class="wpemfb-table">
28
- <div class="wpemfb-cell" style="text-align: center">
 
29
  <?php
30
  foreach ($fb_data['photos']['data'] as $pic) {
31
  ?>
32
- <a class="wpemfb-clean-link" href="<?php echo $pic['source'] ?>" data-lightbox="roadtrip" data-title="<?php echo $pic['name'] ?>" >
33
  <img class="wpemfb-thmb" src="<?php echo $pic['picture'] ?>" />
34
  </a>
35
  <?php
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
+ $width = $width;
7
  ?>
8
+ <div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
9
+ <div class="wpemfb-row">
10
+ <div class="wpemfb-col-3 wpemfb-text-center">
11
+ <a href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
12
  <img src="http://graph.facebook.com/<?php echo $fb_data['from']['id'] ?>/picture" />
13
  </a>
14
 
15
  </div>
16
+ <div class="wpemfb-col-9 wpemfb-pl-none">
17
+ <a class="wpemfb-title" href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
18
  <?php echo $fb_data['from']['name'] ?>
19
  </a>
20
  <br>
21
  <?php if(isset($fb_data['from']['category'])) : ?>
22
  <?php echo $fb_data['from']['category'].'<br>' ?>
23
  <?php endif; ?>
24
+ <a href="https://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow"><?php echo $fb_data['name'] ?></a>
25
  </div>
26
  </div>
27
+ <hr>
28
+ <div class="wpemfb-row">
29
+ <div class="wpemfb-col-12 wpemfb-text-center">
30
  <?php
31
  foreach ($fb_data['photos']['data'] as $pic) {
32
  ?>
33
+ <a href="<?php echo $pic['source'] ?>" data-lightbox="roadtrip" data-title="<?php echo $pic['name'] ?>" >
34
  <img class="wpemfb-thmb" src="<?php echo $pic['picture'] ?>" />
35
  </a>
36
  <?php
templates/default/com-page.php CHANGED
@@ -3,29 +3,28 @@
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
- $width = $width - 20;
7
  $height = $width * $prop;
8
  ?>
9
- <div class="wpemfb-border" style="max-width: <?php echo $width ?>px">
10
- <div class="wpemfb-table">
11
- <div class="wpemfb-cell-left">
12
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
13
  <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" />
14
  </a>
15
  </div>
16
- <div class="wpemfb-cell-right">
17
- <div>
18
- <a class="wpemfb-title wpemfb-clean-link" href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
19
- <?php echo $fb_data['name'] ?>
20
- </a>
21
- </div>
22
  <div><?php WP_Embed_FB::like_btn($fb_data['id'],$fb_data['likes']) ?></div>
23
  <?php if(isset($fb_data["website"])) : ?>
24
- <div>
25
- <a class="wpemfb-clean-link wpemfb-color" href="http://<?php echo WP_Embed_FB::getwebsite($fb_data["website"]) ?>" title="<?php _e('Web Site', 'wp-embed-facebook') ?>" target="_blank">
26
  <?php _e('Web Site','wp-embed-facebook') ?>
27
- </a><?php endif; ?>
28
- </div>
29
  </div>
30
  </div>
31
  </div>
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
+ $width = $width;
7
  $height = $width * $prop;
8
  ?>
9
+ <div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
10
+ <div class="wpemfb-row">
11
+ <div class="wpemfb-col-3 wpemfb-text-center">
12
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
13
  <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" />
14
  </a>
15
  </div>
16
+ <div class="wpemfb-col-9 wpemfb-pl-none">
17
+ <a class="wpemfb-title" href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
18
+ <?php echo $fb_data['name'] ?>
19
+ </a>
20
+ <br>
 
21
  <div><?php WP_Embed_FB::like_btn($fb_data['id'],$fb_data['likes']) ?></div>
22
  <?php if(isset($fb_data["website"])) : ?>
23
+ <br>
24
+ <a href="http://<?php echo WP_Embed_FB::getwebsite($fb_data["website"]) ?>" title="<?php _e('Web Site', 'wp-embed-facebook') ?>" target="_blank">
25
  <?php _e('Web Site','wp-embed-facebook') ?>
26
+ </a>
27
+ <?php endif; ?>
28
  </div>
29
  </div>
30
  </div>
templates/default/event.php CHANGED
@@ -3,38 +3,37 @@
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
- $width_out = $width;
7
- $width = $width_out - 20;
8
- $height = $width * $prop;
9
  $start_time_format = !empty($fb_data['is_date_only']) ? '%e %b %Y' : '%e %b %Y %l:%M %P';
10
  $start_time = strtotime($fb_data['start_time']) + get_option('gmt_offset')*3600; //shows event date on local time
11
  ?>
12
  <?php //Events have now covers but are not pulled from default request, maybe this will change in time. ?>
13
 
14
- <div class="wpemfb-border" style="max-width: <?php echo $width ?>px">
15
- <div class="wpemfb-table">
16
- <div class="wpemfb-cell-left">
 
17
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
18
- <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" />
19
  </a>
20
  </div>
21
- <div class="wpemfb-cell-right">
22
- <a class="wpemfb-title wpemfb-clean-link" href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
23
  <?php echo $fb_data['name'] ?>
24
  </a>
25
  <br>
26
  <?php echo strftime($start_time_format, $start_time ) ?>
27
  <br>
28
  <?php
29
- echo __('@ ', 'wp-embed-facebook');
30
  if(isset($fb_data['venue']['id'])){
31
- echo '<a class="wpemfb-color wpemfb-clean-link" href="http://www.facebook.com/'.$fb_data['venue']['id'].'" target="_blank">'.$fb_data['location'].'</a>';
 
32
  } else {
33
- echo $fb_data['location'];
34
  }
35
  ?>
36
  <br>
37
- <?php echo __('Creator: ', 'wp-embed-facebook').'<a class="wpemfb-color wpemfb-clean-link" href="http://www.facebook.com/'.$fb_data['owner']['id'].'" target="_blank">'.$fb_data['owner']['name'].'</a>' ?>
38
  </div>
39
  </div>
40
  </div>
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
+ $height = $width * $prop;
 
 
7
  $start_time_format = !empty($fb_data['is_date_only']) ? '%e %b %Y' : '%e %b %Y %l:%M %P';
8
  $start_time = strtotime($fb_data['start_time']) + get_option('gmt_offset')*3600; //shows event date on local time
9
  ?>
10
  <?php //Events have now covers but are not pulled from default request, maybe this will change in time. ?>
11
 
12
+ <div class="wpemfb-container" style="max-width: <?php echo $width ?>px" >
13
+ <?php do_action('wpemfb_event',$height,$fb_data); ?>
14
+ <div class="wpemfb-row wpemfb-pad-top">
15
+ <div class="wpemfb-col-3 wpemfb-text-center">
16
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
17
+ <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture/large" />
18
  </a>
19
  </div>
20
+ <div class="wpemfb-col-9 wpemfb-pl-none">
21
+ <a class="wpemfb-title" href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
22
  <?php echo $fb_data['name'] ?>
23
  </a>
24
  <br>
25
  <?php echo strftime($start_time_format, $start_time ) ?>
26
  <br>
27
  <?php
 
28
  if(isset($fb_data['venue']['id'])){
29
+ _e('@ ', 'wp-embed-facebook');
30
+ echo '<a href="http://www.facebook.com/'.$fb_data['venue']['id'].'" target="_blank">'.$fb_data['location'].'</a>';
31
  } else {
32
+ echo isset($fb_data['location']) ? __('@ ', 'wp-embed-facebook') . $fb_data['location'] : '';
33
  }
34
  ?>
35
  <br>
36
+ <?php echo __('Creator: ', 'wp-embed-facebook').'<a href="http://www.facebook.com/'.$fb_data['owner']['id'].'" target="_blank">'.$fb_data['owner']['name'].'</a>' ?>
37
  </div>
38
  </div>
39
  </div>
templates/default/page.php CHANGED
@@ -3,33 +3,26 @@
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
- $width_out = $width;
7
- $width = $width_out - 20;
8
  $height = $width * $prop;
9
  $show_posts = get_option("wpemfb_show_posts") == "true" ? true : false;
10
  //$wp_emb_fbsdk = WP_Embed_FB::$fbsdk;
11
  ?>
12
- <div class="wpemfb-border" style="max-width: <?php echo $width ?>px">
13
- <div class="wpemfb-table">
14
- <div class="wpemfb-cell">
15
- <div class="wpemfb-cover"
16
- style= "
17
- min-height: <?php echo $height ?>px;
18
- max-width:<?php echo $width ?>px;
19
- background-image: url(<?php echo $fb_data['cover']['source'] ?>);
20
- background-position: 0% <?php echo $fb_data['cover']['offset_y'] ?>%;
21
- " onclick="window.open('<?php echo $fb_data['link'] ?>', '_blank')" >
22
- </div>
23
- </div>
24
- </div>
25
- <div class="wpemfb-table">
26
- <div class="wpemfb-cell-left">
27
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
28
  <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" width="50px" height="50px" />
29
  </a>
30
  </div>
31
- <div class="wpemfb-cell-right">
32
- <a class="wpemfb-title wpemfb-clean-link" href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
33
  <?php echo $fb_data['name'] ?>
34
  </a>
35
  <br>
@@ -41,7 +34,7 @@
41
  }
42
  ?><br>
43
  <?php if(isset($fb_data["website"])) : ?>
44
- <a class="wpemfb-clean-link wpemfb-color" href="<?php echo WP_Embed_FB::getwebsite($fb_data["website"]) ?>" title="<?php _e('Web Site', 'wp-embed-facebook') ?>" target="_blank">
45
  <?php _e('Web Site','wp-embed-facebook') ?>
46
  </a>
47
  <?php endif; ?>
@@ -49,26 +42,45 @@
49
  </div>
50
  </div>
51
  <?php if($show_posts) : ?>
52
- <br>
53
  <?php foreach($fb_data['posts']['data'] as $fbpost) : ?>
54
- <?php $link = explode("_", $fbpost['id']) ?>
55
- <div class="wpemfb-posts-table">
56
- <?php if(isset($fbpost['picture'])) : ?>
57
- <div class="wpemfb-cell-left">
58
- <a class="wpemfb-clean-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?>" target="_blank" rel="nofollow">
59
- <img src="<?php echo $fbpost['picture'] ?>" width="70px" height"70px" />
60
- </a>
61
- </div>
62
- <?php endif; ?>
63
- <div class="wpemfb-cell-right">
64
- <span class="wpemfb-page-post"><?php echo make_clickable($fbpost['message']) ?></span>
65
- <a class="wpemfb-post-link wpemfb-clean-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?> " target="_blank" rel="nofollow">
66
- <?php echo isset($fbpost['likes']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y6/r/l9Fe9Ugss0S.gif" />'.$fbpost['likes']['summary']['total_count'].' ' : "" ?>
67
- <?php echo isset($fbpost['comments']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/yg/r/V8Yrm0eKZpi.gif" />'.$fbpost['comments']['summary']['total_count'].' ' : "" ?>
68
- <?php echo isset($fbpost['shares']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y2/r/o19N6EzzbUm.png" />'.$fbpost['shares']['count'].' ' : "" ?>
69
- </a>
70
- </div>
71
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  <?php endforeach; ?>
73
  <?php endif; ?>
74
  </div>
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
 
 
6
  $height = $width * $prop;
7
  $show_posts = get_option("wpemfb_show_posts") == "true" ? true : false;
8
  //$wp_emb_fbsdk = WP_Embed_FB::$fbsdk;
9
  ?>
10
+ <div class="wpemfb-container" style="max-width: <?php echo $width ?>px" >
11
+ <div class="wpemfb-cover"
12
+ style= "
13
+ height:<?php echo $height ?>px;
14
+ background-image: url(<?php echo $fb_data['cover']['source'] ?>);
15
+ background-position: 0% <?php echo $fb_data['cover']['offset_y'] ?>%;
16
+ " onclick="window.open('<?php echo $fb_data['link'] ?>', '_blank')" >
17
+ </div>
18
+ <div class="wpemfb-row wpemfb-pad-top">
19
+ <div class="wpemfb-col-2 wpemfb-text-center">
 
 
 
 
 
20
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
21
  <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" width="50px" height="50px" />
22
  </a>
23
  </div>
24
+ <div class="wpemfb-col-10">
25
+ <a class="wpemfb-title" href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
26
  <?php echo $fb_data['name'] ?>
27
  </a>
28
  <br>
34
  }
35
  ?><br>
36
  <?php if(isset($fb_data["website"])) : ?>
37
+ <a href="<?php echo WP_Embed_FB::getwebsite($fb_data["website"]) ?>" title="<?php _e('Web Site', 'wp-embed-facebook') ?>" target="_blank">
38
  <?php _e('Web Site','wp-embed-facebook') ?>
39
  </a>
40
  <?php endif; ?>
42
  </div>
43
  </div>
44
  <?php if($show_posts) : ?>
 
45
  <?php foreach($fb_data['posts']['data'] as $fbpost) : ?>
46
+
47
+ <?php if(isset($fbpost['picture']) || isset($fbpost['message'])) : ?>
48
+ <?php $link = explode("_", $fbpost['id']); ?>
49
+ <hr>
50
+ <div class="wpemfb-row">
51
+ <?php if(isset($fbpost['picture']) && isset($fbpost['message'])) : ?>
52
+ <div class="wpemfb-col-3 wpemfb-text-center">
53
+ <a class="wpemfb-clean-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?>" target="_blank" rel="nofollow">
54
+ <img src="<?php echo $fbpost['picture'] ?>" width="70px" height"70px" />
55
+ </a>
56
+ </div>
57
+ <div class="wpemfb-col-9 wpemfb-pl-none">
58
+ <span class="wpemfb-page-post"><?php echo make_clickable($fbpost['message']) ?></span><br>
59
+ <a class="wpemfb-post-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?> " target="_blank" rel="nofollow">
60
+ <?php echo isset($fbpost['likes']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y6/r/l9Fe9Ugss0S.gif" />'.$fbpost['likes']['summary']['total_count'].' ' : "" ?>
61
+ <?php echo isset($fbpost['comments']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/yg/r/V8Yrm0eKZpi.gif" />'.$fbpost['comments']['summary']['total_count'].' ' : "" ?>
62
+ <?php echo isset($fbpost['shares']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y2/r/o19N6EzzbUm.png" />'.$fbpost['shares']['count'].' ' : "" ?>
63
+ </a>
64
+ </div>
65
+ <?php elseif(isset($fbpost['picture'])): ?>
66
+ <div class="wpemfb-col-12 wpemfb-text-center">
67
+ <a class="wpemfb-clean-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?>" target="_blank" rel="nofollow">
68
+ <img src="<?php echo $fbpost['picture'] ?>" />
69
+ </a>
70
+ </div>
71
+ <?php elseif(isset($fbpost['message'])): ?>
72
+ <div class="wpemfb-col-12">
73
+ <span class="wpemfb-page-post"><?php echo make_clickable($fbpost['message']) ?></span><br>
74
+ <a class="wpemfb-post-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?> " target="_blank" rel="nofollow">
75
+ <?php echo isset($fbpost['likes']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y6/r/l9Fe9Ugss0S.gif" />'.$fbpost['likes']['summary']['total_count'].' ' : "" ?>
76
+ <?php echo isset($fbpost['comments']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/yg/r/V8Yrm0eKZpi.gif" />'.$fbpost['comments']['summary']['total_count'].' ' : "" ?>
77
+ <?php echo isset($fbpost['shares']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y2/r/o19N6EzzbUm.png" />'.$fbpost['shares']['count'].' ' : "" ?>
78
+ </a>
79
+ </div>
80
+ <?php endif; ?>
81
+ </div>
82
+ <?php endif; ?>
83
+
84
  <?php endforeach; ?>
85
  <?php endif; ?>
86
  </div>
templates/default/page_old.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
+ * to access all fb data print_r($fb_data)
5
+ */
6
+ $width_out = $width;
7
+ $width = $width_out - 10;
8
+ $height = $width * $prop;
9
+ $show_posts = get_option("wpemfb_show_posts") == "true" ? true : false;
10
+ //$wp_emb_fbsdk = WP_Embed_FB::$fbsdk;
11
+ ?>
12
+ <div class="wpemfb-border" style="max-width: <?php echo $width ?>px">
13
+ <div class="wpemfb-table">
14
+ <div class="wpemfb-cell">
15
+ <div class="wpemfb-cover"
16
+ style= "
17
+ height: <?php echo $height ?>px;
18
+ background-image: url(<?php echo $fb_data['cover']['source'] ?>);
19
+ background-position: 0% <?php echo $fb_data['cover']['offset_y'] ?>%;
20
+ " onclick="window.open('<?php echo $fb_data['link'] ?>', '_blank')" >
21
+ </div>
22
+ </div>
23
+ </div>
24
+ <div class="wpemfb-table">
25
+ <div class="wpemfb-cell-left">
26
+ <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
27
+ <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" width="50px" height="50px" />
28
+ </a>
29
+ </div>
30
+ <div class="wpemfb-cell-right">
31
+ <a class="wpemfb-title wpemfb-clean-link" href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
32
+ <?php echo $fb_data['name'] ?>
33
+ </a>
34
+ <br>
35
+ <?php
36
+ if($fb_data['category'] == 'Musician/band'){
37
+ echo isset($fb_data['genre']) ? $fb_data['genre'] : '';
38
+ } else {
39
+ _e($fb_data['category'],'wp-embed-facebook');
40
+ }
41
+ ?><br>
42
+ <?php if(isset($fb_data["website"])) : ?>
43
+ <a class="wpemfb-clean-link wpemfb-color" href="<?php echo WP_Embed_FB::getwebsite($fb_data["website"]) ?>" title="<?php _e('Web Site', 'wp-embed-facebook') ?>" target="_blank">
44
+ <?php _e('Web Site','wp-embed-facebook') ?>
45
+ </a>
46
+ <?php endif; ?>
47
+ <div style="float: right;"><?php WP_Embed_FB::like_btn($fb_data['id'],$fb_data['likes']) ?></div>
48
+ </div>
49
+ </div>
50
+ <?php if($show_posts) : ?>
51
+ <br>
52
+ <?php foreach($fb_data['posts']['data'] as $fbpost) : ?>
53
+ <?php $link = explode("_", $fbpost['id']) ?>
54
+ <div class="wpemfb-posts-table">
55
+ <?php if(isset($fbpost['picture'])) : ?>
56
+ <div class="wpemfb-cell-left">
57
+ <a class="wpemfb-clean-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?>" target="_blank" rel="nofollow">
58
+ <img src="<?php echo $fbpost['picture'] ?>" width="70px" height"70px" />
59
+ </a>
60
+ </div>
61
+ <?php endif; ?>
62
+ <div class="wpemfb-cell-right">
63
+ <span class="wpemfb-page-post"><?php echo make_clickable($fbpost['message']) ?></span>
64
+ <a class="wpemfb-post-link wpemfb-clean-link" href="<?php echo "https://www.facebook.com/".$link[0]."/posts/".$link[1] ?> " target="_blank" rel="nofollow">
65
+ <?php echo isset($fbpost['likes']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y6/r/l9Fe9Ugss0S.gif" />'.$fbpost['likes']['summary']['total_count'].' ' : "" ?>
66
+ <?php echo isset($fbpost['comments']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/yg/r/V8Yrm0eKZpi.gif" />'.$fbpost['comments']['summary']['total_count'].' ' : "" ?>
67
+ <?php echo isset($fbpost['shares']) ? '<img src="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y2/r/o19N6EzzbUm.png" />'.$fbpost['shares']['count'].' ' : "" ?>
68
+ </a>
69
+ </div>
70
+ </div>
71
+ <?php endforeach; ?>
72
+ <?php endif; ?>
73
+ </div>
templates/default/photo.php CHANGED
@@ -3,13 +3,13 @@
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
- $width = $width - 20;
7
  $height = $width * $prop;
8
  ?>
9
 
10
- <div class="wpemfb-border" style="max-width: <?php echo $width ?>px">
11
- <div class="wpemfb-table">
12
- <div class="wpemfb-cell">
13
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
14
  <img src="<?php echo $fb_data['source'] ?>" width="100%" height="auto" style="max-width: <?php echo $width ?>px" />
15
  </a>
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
+ $width = $width;
7
  $height = $width * $prop;
8
  ?>
9
 
10
+ <div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
11
+ <div class="wpemfb-row">
12
+ <div class="wpemfb-col-12">
13
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
14
  <img src="<?php echo $fb_data['source'] ?>" width="100%" height="auto" style="max-width: <?php echo $width ?>px" />
15
  </a>
templates/default/posts.php CHANGED
@@ -1,9 +1,4 @@
1
- <div class="wpemfb-border" style="border:none; max-width: <?php echo $width ?>px">
2
- <div class="wpemfb-table">
3
- <div class="wpemfb-cell">
4
- </div>
5
- </div>
6
- </div>
7
  <div class="fb-post" data-href="https://www.facebook.com/<?php echo $fb_data['link'] ?>" data-width="<?php echo $width ?>">
8
  <?php _e('Embedded post will show on publish', 'wp-embed-facebook'); ?>
9
- </div>
1
+ <div class="wpemfb-container wpemfb-mesure" style="position:absolute; max-width: <?php echo $width ?>px;"></div>
 
 
 
 
 
2
  <div class="fb-post" data-href="https://www.facebook.com/<?php echo $fb_data['link'] ?>" data-width="<?php echo $width ?>">
3
  <?php _e('Embedded post will show on publish', 'wp-embed-facebook'); ?>
4
+ </div>
templates/default/profile.php CHANGED
@@ -3,19 +3,19 @@
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
- $width = $width - 20;
7
  $height = $width * $prop;
8
  ?>
9
- <div class="wpemfb-border" style="max-width: <?php echo $width ?>px">
10
- <div class="wpemfb-table">
11
- <div class="wpemfb-cell-left">
12
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
13
  <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" />
14
  </a>
15
  </div>
16
- <div class="wpemfb-cell-right">
17
  <div>
18
- <a class="wpemfb-title wpemfb-clean-link" href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
19
  <?php echo $fb_data['name'] ?>
20
  </a>
21
  </div>
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data print_r($fb_data)
5
  */
6
+ $width = $width;
7
  $height = $width * $prop;
8
  ?>
9
+ <div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
10
+ <div class="wpemfb-row">
11
+ <div class="wpemfb-col-3 wpemfb-text-center">
12
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
13
  <img src="http://graph.facebook.com/<?php echo $fb_data['id'] ?>/picture" />
14
  </a>
15
  </div>
16
+ <div class="wpemfb-col-9 wpemfb-pl-none">
17
  <div>
18
+ <a class="wpemfb-title" href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
19
  <?php echo $fb_data['name'] ?>
20
  </a>
21
  </div>
templates/default/video.php CHANGED
@@ -3,6 +3,7 @@
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data
5
  * <iframe src="https://www.facebook.com/video/embed?video_id=<?php echo $fb_data['v_id'] ?>" width="<?php echo $width ?>" height="280px"></iframe>
 
6
  */
7
  ?>
8
  <iframe src="https://www.facebook.com/video/embed?video_id=<?php echo $fb_data['id'] ?>" width="<?php echo $width ?>" height="280px"></iframe>
3
  * You can create your own template by placing a copy of this file on yourtheme/plugins/wp-embed-fb/
4
  * to access all fb data
5
  * <iframe src="https://www.facebook.com/video/embed?video_id=<?php echo $fb_data['v_id'] ?>" width="<?php echo $width ?>" height="280px"></iframe>
6
+ * TODO: resonsive iframe not very usefull since this embed is not mobile friendly
7
  */
8
  ?>
9
  <iframe src="https://www.facebook.com/video/embed?video_id=<?php echo $fb_data['id'] ?>" width="<?php echo $width ?>" height="280px"></iframe>
templates/default/wpemfb.css CHANGED
@@ -1,84 +1,144 @@
1
  /*
2
- * Table structure
3
  */
4
- .wpemfb-border {
5
- font-family: Helvetica;
6
- padding:10px;
7
- border: 1px solid #DEDEDE;
 
8
  border-radius: 2px;
 
 
9
  }
10
- .wpemfb-table{
11
- display: table;
12
- width: 100%;
 
 
13
  }
14
- .wpemfb-posts-table{
15
- display: table;
16
- width: 100%;
17
- border-top:1px solid #DEDEDE;
 
 
 
 
 
18
  }
19
- .wpemfb-cell{
20
- display: table-cell;
21
- vertical-align: middle;
22
- width: 100%;
23
  }
24
- .wpemfb-cell-left{
25
- display: table-cell;
26
- vertical-align: middle;
27
  }
28
- .wpemfb-cell-right{
29
- display: table-cell;
30
- vertical-align: middle;
31
- width: 85%;
32
- padding-left: 5px;
33
  }
34
- /*
35
- * Links
36
- */
37
- .wpemfb-cover{
38
- width: 100%;
39
- background-size: 100%;
40
  }
41
- .wpemfb-clean-link{
42
- border: none !important;
43
- text-decoration: none !important;
44
  }
45
- .wpemfb-clean-link:hover{
46
- color: inherit !important;
47
- text-decoration: underline !important;
48
  }
49
- .wpemfb-post-link{
50
- color: #6d84b4;
51
- font-size: 12px;
 
 
 
 
 
 
 
 
 
 
 
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  .wpemfb-title{
54
- color: #23487F;
55
  font-size: 20px;
56
  font-weight: bold;
57
  }
58
- .wpemfb-color{
59
- color: #23487F;
60
  }
61
- .wpemfb-thmb {
62
- border: 1px solid #808080;
63
- border-radius: 2px;
64
- height: 60px !important;
65
- margin: 1px;
66
- padding: 2px;
67
- width: 60px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
  /*
70
- * Page Posts
71
  */
72
  .wpemfb-page-post{
73
  text-align: justify;
74
- display:block;
75
  }
76
- .wpemfb-page-post a{
77
- font-family: Helvetica;
78
- color: #23487E;
79
- text-decoration: none !important;
80
  }
81
-
82
- .wpemfb-page-post a:hover{
83
- text-decoration: underline !important;
84
  }
 
 
 
 
 
 
 
 
 
 
 
1
  /*
2
+ * Table structure modification of bootstrap
3
  */
4
+ .wpemfb-container {
5
+ padding: 10px;
6
+ display: inline-block;
7
+ font-family: Helvetica;
8
+ border: 1px solid #DEDEDE;
9
  border-radius: 2px;
10
+ width: 100%;
11
+ font-size: 14px;
12
  }
13
+ .wpemfb-row {
14
+ margin-left: -10px;
15
+ margin-right: -10px;
16
+ display: table;
17
+ width: 100%;
18
  }
19
+ .wpemfb-col-1, .wpemfb-col-2, .wpemfb-col-3, .wpemfb-col-4, .wpemfb-col-5, .wpemfb-col-6, .wpemfb-col-7, .wpemfb-col-8, .wpemfb-col-9, .wpemfb-col-10, .wpemfb-col-11, .wpemfb-col-12 {
20
+ /*float: left;*/
21
+ position: relative;
22
+ min-height: 1px;
23
+ padding-left: 10px;
24
+ padding-right: 10px;
25
+ display: table-cell;
26
+ vertical-align: middle;
27
+ text-align: left;
28
  }
29
+ .wpemfb-col-12 {
30
+ width: 100%;
 
 
31
  }
32
+ .wpemfb-col-11 {
33
+ width: 91.66666667%;
 
34
  }
35
+ .wpemfb-col-10 {
36
+ width: 83.33333333%;
 
 
 
37
  }
38
+ .wpemfb-col-9 {
39
+ width: 75%;
 
 
 
 
40
  }
41
+ .wpemfb-col-8 {
42
+ width: 66.66666667%;
 
43
  }
44
+ .wpemfb-col-7 {
45
+ width: 58.33333333%;
 
46
  }
47
+ .wpemfb-col-6 {
48
+ width: 50%;
49
+ }
50
+ .wpemfb-col-5 {
51
+ width: 41.66666667%;
52
+ }
53
+ .wpemfb-col-4 {
54
+ width: 33.33333333%;
55
+ }
56
+ .wpemfb-col-3 {
57
+ width: 25%;
58
+ }
59
+ .wpemfb-col-2 {
60
+ width: 16.66666667%;
61
  }
62
+ .wpemfb-col-1 {
63
+ width: 8.33333333%;
64
+ }
65
+
66
+ /**
67
+ * Helpers
68
+ */
69
+
70
+ .wpemfb-container > hr {
71
+ margin-top: 10px;
72
+ margin-bottom: 10px;
73
+ border: 0;
74
+ border-top: 1px solid #DEDEDE;
75
+ -moz-box-sizing: content-box;
76
+ -webkit-box-sizing: content-box;
77
+ box-sizing: content-box;
78
+ height: 0;
79
+ float: left;
80
+ width: 100%
81
+ }
82
+ .wpemfb-text-center{
83
+ text-align: center;
84
+ }
85
+ .wpemfb-pl-none{
86
+ padding-left: 0px;
87
+ }
88
+ .wpemfb-color{
89
+ color: #23487F;
90
+ }
91
  .wpemfb-title{
 
92
  font-size: 20px;
93
  font-weight: bold;
94
  }
95
+ .wpemfb-container img {
96
+ display: inline-block !important;
97
  }
98
+ .wpemfb-pad-top{
99
+ padding-top:5px;
100
+ }
101
+ /*
102
+ * Links
103
+ */
104
+ .wpemfb-container a {
105
+ font-family: Helvetica !important;
106
+ color: #23487F !important;
107
+ text-decoration: none !important;
108
+ border:0 !important;
109
+ }
110
+ .wpemfb-container a:hover,
111
+ a:focus {
112
+ color: #23487F;
113
+ text-decoration: underline;
114
+ }
115
+ .wpemfb-container a:focus {
116
+ color: #23487F;
117
+ text-decoration: underline;
118
  }
119
  /*
120
+ * Page Embed
121
  */
122
  .wpemfb-page-post{
123
  text-align: justify;
124
+ overflow: hidden;
125
  }
126
+ a.wpemfb-post-link{
127
+ color: #6d84b4 !important;
128
+ font-size: 12px;
 
129
  }
130
+ .wpemfb-cover{
131
+ width: 100%;
132
+ background-size: 100%;
133
  }
134
+ /**
135
+ * Album Embed
136
+ */
137
+ .wpemfb-thmb {
138
+ border: 1px solid #808080;
139
+ border-radius: 2px;
140
+ height: 60px !important;
141
+ margin: 1px;
142
+ padding: 2px;
143
+ width: 60px !important;
144
+ }
wp-embed-fb.php → wp-embed-facebook.php RENAMED
@@ -4,17 +4,27 @@ Plugin Name: WP Embed Facebook
4
  Plugin URI: http://www.wpembedfb.com
5
  Description: Embed a Facebook video, photo, album, event, page, profile, or post. Copy any facebook url to a single line on your post, or use shortcode [facebook='url' width='' ] more info at <a href="http://www.wpembedfb.com" title="plugin website">www.wpembedfb.com</a>
6
  Author: Miguel Sirvent
7
- Version: 1.7.1
8
  Author URI: http://profiles.wordpress.org/poxtron/
9
  */
10
 
11
  /*
12
  * Constant definitions
 
 
 
 
 
 
 
 
 
13
  */
 
 
14
  define("WPEMFBSLUG",dirname(plugin_basename(__FILE__)));
15
-
16
  // core include
17
- require_once WP_PLUGIN_DIR."/".WPEMFBSLUG.'/lib/core.php';
18
 
19
  /*
20
  * ALL actions, filters and hooks.
@@ -26,7 +36,7 @@ add_action('init',array('WP_Embed_FB','init'),1);
26
  add_action('wp_enqueue_scripts', array('WP_Embed_FB', 'wp_enqueue_scripts') );
27
  add_filter('the_content', array('WP_Embed_FB','the_content'),10,2);
28
  add_shortcode('facebook', array('WP_Embed_FB','shortcode') );
29
-
30
  //optional filter to content anonymous function
31
  if( get_option('wpemfb_fb_root') === 'true' ){
32
  add_filter('the_content', array('WP_Embed_FB','fb_root'),10,1);
@@ -35,12 +45,12 @@ if( get_option('wpemfb_fb_root') === 'true' ){
35
  // wp-admin functions
36
 
37
  if(is_admin()){
38
- require_once WP_PLUGIN_DIR."/".WPEMFBSLUG.'/lib/admin.php';
39
  add_action('admin_menu', array('EmbFbAdmin','add_page'));
40
  add_action( 'admin_enqueue_scripts', array('EmbFbAdmin','admin_enqueue_scripts'), 10,1);
41
  add_action( 'admin_init', array('EmbFbAdmin','admin_init'));
42
  }
43
-
44
 
45
 
46
  ?>
4
  Plugin URI: http://www.wpembedfb.com
5
  Description: Embed a Facebook video, photo, album, event, page, profile, or post. Copy any facebook url to a single line on your post, or use shortcode [facebook='url' width='' ] more info at <a href="http://www.wpembedfb.com" title="plugin website">www.wpembedfb.com</a>
6
  Author: Miguel Sirvent
7
+ Version: 1.8
8
  Author URI: http://profiles.wordpress.org/poxtron/
9
  */
10
 
11
  /*
12
  * Constant definitions
13
+
14
+ echo "\n" . plugin_dir_path( __FILE__ );
15
+ echo "\n" . plugin_dir_url( __FILE__ );
16
+ echo "\n" . plugin_basename(__FILE__);
17
+ dirname(plugin_basename(__FILE__)
18
+ /srv/mnt/wpembedfb.com/dev/wp-content/plugins/wp-embed-facebook/
19
+ http://www.wpembedfb.com/wp-content/plugins/wp-embed-facebook/
20
+ wp-embed-facebook/wp-embed-fb.php
21
+ wp-embed-facebook
22
  */
23
+ define("WPEMFBDIR",plugin_dir_path( __FILE__ ));
24
+ define("WPEMFBURL",plugin_dir_url( __FILE__ ));
25
  define("WPEMFBSLUG",dirname(plugin_basename(__FILE__)));
 
26
  // core include
27
+ require_once WPEMFBDIR.'lib/core.php';
28
 
29
  /*
30
  * ALL actions, filters and hooks.
36
  add_action('wp_enqueue_scripts', array('WP_Embed_FB', 'wp_enqueue_scripts') );
37
  add_filter('the_content', array('WP_Embed_FB','the_content'),10,2);
38
  add_shortcode('facebook', array('WP_Embed_FB','shortcode') );
39
+ add_action('plugins_loaded',array('WP_Embed_FB','plugins_loaded'));
40
  //optional filter to content anonymous function
41
  if( get_option('wpemfb_fb_root') === 'true' ){
42
  add_filter('the_content', array('WP_Embed_FB','fb_root'),10,1);
45
  // wp-admin functions
46
 
47
  if(is_admin()){
48
+ require_once WPEMFBDIR.'lib/admin.php';
49
  add_action('admin_menu', array('EmbFbAdmin','add_page'));
50
  add_action( 'admin_enqueue_scripts', array('EmbFbAdmin','admin_enqueue_scripts'), 10,1);
51
  add_action( 'admin_init', array('EmbFbAdmin','admin_init'));
52
  }
53
+ add_action( 'after_wp_tiny_mce', 'custom_after_wp_tiny_mce' );
54
 
55
 
56
  ?>