Version Description
- Fix Fatal Error on non object
Download this release
Release Info
Developer | poxtron |
Plugin | WP Embed Facebook |
Version | 1.9.6 |
Comparing to | |
See all releases |
Code changes from version 1.9.4 to 1.9.6
- lib/admin.php +8 -10
- lib/core.php +82 -75
- lib/js/wpembedfb.js +3 -2
- readme.txt +11 -3
- templates/classic/event.php +5 -4
- templates/classic/page.php +1 -1
- templates/classic/video.php +19 -17
- templates/classic/wpemfb.css +4 -4
- templates/default/com-page.php +1 -2
- templates/default/event.php +3 -3
- templates/default/page.php +1 -1
- templates/default/photo.php +1 -2
- templates/default/profile.php +1 -2
- templates/default/video.php +1 -1
- templates/default/wpemfb.css +2 -2
- wp-embed-facebook.php +1 -1
lib/admin.php
CHANGED
@@ -9,7 +9,7 @@ class EmbFbAdmin
|
|
9 |
global $wp_scripts;
|
10 |
wp_enqueue_script('wpemfb-admin', WPEMFBURL . 'lib/js/admin.js', array('jquery-ui-accordion'));
|
11 |
$queryui = $wp_scripts->query('jquery-ui-core');
|
12 |
-
$url = "
|
13 |
wp_enqueue_style('jquery-ui-start', $url, false, null);
|
14 |
}
|
15 |
$translation_array = array('local' => get_locale(), 'fb_id' => get_site_option('wpemfb_app_id'), 'fb_root' => get_site_option('wpemfb_fb_root'));
|
@@ -71,7 +71,6 @@ class EmbFbAdmin
|
|
71 |
'wpemfb_enq_fbjs' => 'true/false',
|
72 |
'wpemfb_ev_local_tz' => 'true/false',
|
73 |
'wpemfb_raw_video_fb' => 'true/false',
|
74 |
-
'wpemfb_raw_video_fb_sc'=> 'true/false',
|
75 |
);
|
76 |
foreach ($options as $option => $type) {
|
77 |
self::save_option($option, $type);
|
@@ -121,8 +120,8 @@ class EmbFbAdmin
|
|
121 |
ob_end_flush();
|
122 |
}
|
123 |
}
|
124 |
-
static function section($
|
125 |
-
if($
|
126 |
?>
|
127 |
<h5><?php echo $title ?></h5>
|
128 |
<div>
|
@@ -184,12 +183,12 @@ class EmbFbAdmin
|
|
184 |
<?php wp_nonce_field('wp-embed-facebook', 'save-data'); ?>
|
185 |
<div id="accordion">
|
186 |
<?php
|
187 |
-
self::section(
|
188 |
self::field('text', 'wpemfb_app_id', __('App ID', 'wp-embed-facebook'), array('required' => 'true'));
|
189 |
self::field('text', 'wpemfb_app_secret', __('App Secret', 'wp-embed-facebook'), array('required' => 'true'));
|
190 |
self::section();
|
191 |
?>
|
192 |
-
<?php self::section(
|
193 |
<tr valign="middle">
|
194 |
<th><?php _e("Template to use", 'wp-embed-facebook') ?></th>
|
195 |
<td>
|
@@ -211,24 +210,23 @@ class EmbFbAdmin
|
|
211 |
self::field('number', 'wpemfb_max_photos', __('Number of Photos <br>on Embedded Albums', 'wp-embed-facebook'));
|
212 |
self::field('checkbox', 'wpemfb_show_follow', __('Show follow button <br>on Embedded Profiles', 'wp-embed-facebook'));
|
213 |
self::section();
|
214 |
-
self::section(
|
215 |
self::field('checkbox', 'wpemfb_show_like', __('Show like button', 'wp-embed-facebook'));
|
216 |
self::field('checkbox', 'wpemfb_show_posts', __('Show latest posts', 'wp-embed-facebook'));
|
217 |
self::field('number', 'wpemfb_max_posts', __('Number of posts', 'wp-embed-facebook'));
|
218 |
self::field('checkbox', 'wpemfb_ev_local_tz', __('Show events on local time', 'wp-embed-facebook'));
|
219 |
self::section();
|
220 |
-
self::section(
|
221 |
self::field('checkbox', 'wpemfb_raw_video', __('Embed Videos Raw', 'wp-embed-facebook'));
|
222 |
self::field('checkbox', 'wpemfb_raw_photo', __('Embed Photos Raw', 'wp-embed-facebook'));
|
223 |
self::field('checkbox', 'wpemfb_raw_video_fb', __('Use Facebook embed code on raw videos', 'wp-embed-facebook'));
|
224 |
-
self::field('checkbox', 'wpemfb_raw_video_fb_sc', __('Use Facebook embed code on raw video shortcode', 'wp-embed-facebook'));
|
225 |
self::section();
|
226 |
/**
|
227 |
* Add more options to the plugin page save them with 'wpemfb_admin_save_data' action
|
228 |
* @since 1.8
|
229 |
*/
|
230 |
do_action('wpemfb_options');
|
231 |
-
self::section(
|
232 |
self::field('checkbox', 'wpemfb_enqueue_style', __('Enqueue Styles', 'wp-embed-facebook'));
|
233 |
self::field('checkbox', 'wpemfb_fb_root', __('Add fb-root on top of content', 'wp-embed-facebook'));
|
234 |
self::field('checkbox', 'wpemfb_enq_lightbox', __('Enqueue Lightbox script', 'wp-embed-facebook'));
|
9 |
global $wp_scripts;
|
10 |
wp_enqueue_script('wpemfb-admin', WPEMFBURL . 'lib/js/admin.js', array('jquery-ui-accordion'));
|
11 |
$queryui = $wp_scripts->query('jquery-ui-core');
|
12 |
+
$url = "https://ajax.googleapis.com/ajax/libs/jqueryui/" . $queryui->ver . "/themes/smoothness/jquery-ui.css";
|
13 |
wp_enqueue_style('jquery-ui-start', $url, false, null);
|
14 |
}
|
15 |
$translation_array = array('local' => get_locale(), 'fb_id' => get_site_option('wpemfb_app_id'), 'fb_root' => get_site_option('wpemfb_fb_root'));
|
71 |
'wpemfb_enq_fbjs' => 'true/false',
|
72 |
'wpemfb_ev_local_tz' => 'true/false',
|
73 |
'wpemfb_raw_video_fb' => 'true/false',
|
|
|
74 |
);
|
75 |
foreach ($options as $option => $type) {
|
76 |
self::save_option($option, $type);
|
120 |
ob_end_flush();
|
121 |
}
|
122 |
}
|
123 |
+
static function section($title=''){
|
124 |
+
if(!empty($title)) :
|
125 |
?>
|
126 |
<h5><?php echo $title ?></h5>
|
127 |
<div>
|
183 |
<?php wp_nonce_field('wp-embed-facebook', 'save-data'); ?>
|
184 |
<div id="accordion">
|
185 |
<?php
|
186 |
+
self::section(__('Facebook application data', 'wp-embed-facebook'));
|
187 |
self::field('text', 'wpemfb_app_id', __('App ID', 'wp-embed-facebook'), array('required' => 'true'));
|
188 |
self::field('text', 'wpemfb_app_secret', __('App Secret', 'wp-embed-facebook'), array('required' => 'true'));
|
189 |
self::section();
|
190 |
?>
|
191 |
+
<?php self::section(__("General Options", 'wp-embed-facebook')); ?>
|
192 |
<tr valign="middle">
|
193 |
<th><?php _e("Template to use", 'wp-embed-facebook') ?></th>
|
194 |
<td>
|
210 |
self::field('number', 'wpemfb_max_photos', __('Number of Photos <br>on Embedded Albums', 'wp-embed-facebook'));
|
211 |
self::field('checkbox', 'wpemfb_show_follow', __('Show follow button <br>on Embedded Profiles', 'wp-embed-facebook'));
|
212 |
self::section();
|
213 |
+
self::section(__('Embedded Fan Pages', 'wp-embed-facebook'));
|
214 |
self::field('checkbox', 'wpemfb_show_like', __('Show like button', 'wp-embed-facebook'));
|
215 |
self::field('checkbox', 'wpemfb_show_posts', __('Show latest posts', 'wp-embed-facebook'));
|
216 |
self::field('number', 'wpemfb_max_posts', __('Number of posts', 'wp-embed-facebook'));
|
217 |
self::field('checkbox', 'wpemfb_ev_local_tz', __('Show events on local time', 'wp-embed-facebook'));
|
218 |
self::section();
|
219 |
+
self::section(__('Raw Embedded Options', 'wp-embed-facebook'));
|
220 |
self::field('checkbox', 'wpemfb_raw_video', __('Embed Videos Raw', 'wp-embed-facebook'));
|
221 |
self::field('checkbox', 'wpemfb_raw_photo', __('Embed Photos Raw', 'wp-embed-facebook'));
|
222 |
self::field('checkbox', 'wpemfb_raw_video_fb', __('Use Facebook embed code on raw videos', 'wp-embed-facebook'));
|
|
|
223 |
self::section();
|
224 |
/**
|
225 |
* Add more options to the plugin page save them with 'wpemfb_admin_save_data' action
|
226 |
* @since 1.8
|
227 |
*/
|
228 |
do_action('wpemfb_options');
|
229 |
+
self::section(__('Advanced Options', 'wp-embed-facebook'));
|
230 |
self::field('checkbox', 'wpemfb_enqueue_style', __('Enqueue Styles', 'wp-embed-facebook'));
|
231 |
self::field('checkbox', 'wpemfb_fb_root', __('Add fb-root on top of content', 'wp-embed-facebook'));
|
232 |
self::field('checkbox', 'wpemfb_enq_lightbox', __('Enqueue Lightbox script', 'wp-embed-facebook'));
|
lib/core.php
CHANGED
@@ -127,12 +127,9 @@ class WP_Embed_FB {
|
|
127 |
static function the_content($the_content){
|
128 |
preg_match_all("/<p>(http|https):\/\/www\.facebook\.com\/([^<\s]*)<\/p>/", $the_content, $matches, PREG_SET_ORDER);
|
129 |
if(!empty($matches) && is_array($matches)){
|
130 |
-
self::$fbsdk = FaceInit::$fbsdk;
|
131 |
-
if(self::$fbsdk !== 'unactive'){
|
132 |
foreach($matches as $match) {
|
133 |
$the_content = preg_replace("/<p>(http|https):\/\/www\.facebook\.com\/([^<\s]*)<\/p>/", self::fb_embed($match), $the_content, 1);
|
134 |
}
|
135 |
-
}
|
136 |
}
|
137 |
return $the_content;
|
138 |
}
|
@@ -141,76 +138,83 @@ class WP_Embed_FB {
|
|
141 |
* @param array $match[2]=url without ' https://www.facebook.com/ '
|
142 |
* @return string Embedded content
|
143 |
*/
|
144 |
-
static function fb_embed($match){
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
$clean = explode('/', $url[0]);
|
152 |
-
$end = end($clean);
|
153 |
-
if(empty($end)){
|
154 |
-
array_pop($clean);
|
155 |
-
}
|
156 |
-
$last = end($clean);
|
157 |
-
$fb_id = $last;
|
158 |
-
//old embed ulr's
|
159 |
-
if( isset($vars['fbid']) )
|
160 |
-
$fb_id = $vars['fbid'];
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
|
185 |
-
if(!empty(self::$raw)){
|
186 |
-
$raw_photo = self::$raw;
|
187 |
-
$raw_video = self::$raw;
|
188 |
-
} else {
|
189 |
-
$raw_photo = get_option('wpemfb_raw_photo') == 'true' ? 'true' : 'false';
|
190 |
-
$raw_video = get_option('wpemfb_raw_video') == 'true' ? 'true' : 'false';
|
191 |
-
}
|
192 |
-
//is video
|
193 |
-
if(isset($vars['v'])){ //is video
|
194 |
-
if($raw_video == 'true'){
|
195 |
-
//$fb_data = array( 'v_id' => $vars['v'], 'is_video' => '' );
|
196 |
-
return self::fb_api_get($vars['v'], $match[2]);
|
197 |
-
//return self::print_fb_data($fb_data);
|
198 |
-
} else {
|
199 |
-
$fb_data = array( 'link' => $match[2],'is_post' => '' );
|
200 |
-
return self::print_fb_data($fb_data);
|
201 |
-
}
|
202 |
-
}
|
203 |
-
//photos
|
204 |
-
if( 'photo.php' == $last || ( array_search('photos',$clean) !== false ) ){
|
205 |
-
if($raw_photo == 'true'){
|
206 |
-
return self::fb_api_get($fb_id, $match[2]);
|
207 |
-
} else {
|
208 |
-
$fb_data = array( 'link' => $match[2],'is_post' => '' );
|
209 |
-
return self::print_fb_data($fb_data);
|
210 |
-
}
|
211 |
-
}
|
212 |
-
|
213 |
-
return self::fb_api_get($fb_id, $match[2], $type);
|
214 |
}
|
215 |
/**
|
216 |
* get data from fb using WP_Embed_FB::$fbsdk->api('/'.$fb_id) :)
|
@@ -461,11 +465,9 @@ class WP_Embed_FB {
|
|
461 |
self::$height = self::$width = self::$raw = self::$num_posts = '';
|
462 |
return $embed;
|
463 |
}
|
464 |
-
return;
|
465 |
}
|
466 |
static function embed_register_handler($match){
|
467 |
-
if(!is_object(self::$fbsdk))
|
468 |
-
self::$fbsdk = FaceInit::$fbsdk;
|
469 |
return self::fb_embed($match);
|
470 |
}
|
471 |
static function fb_root($ct){
|
@@ -487,7 +489,7 @@ class WP_Embed_FB {
|
|
487 |
* https://developers.facebook.com/docs/reference/php/
|
488 |
*/
|
489 |
class FaceInit {
|
490 |
-
static $fbsdk;
|
491 |
static function init(){
|
492 |
require('fb/facebook.php');
|
493 |
$config = array();
|
@@ -499,4 +501,9 @@ class FaceInit {
|
|
499 |
else
|
500 |
self::$fbsdk = 'unactive';
|
501 |
}
|
|
|
|
|
|
|
|
|
|
|
502 |
}
|
127 |
static function the_content($the_content){
|
128 |
preg_match_all("/<p>(http|https):\/\/www\.facebook\.com\/([^<\s]*)<\/p>/", $the_content, $matches, PREG_SET_ORDER);
|
129 |
if(!empty($matches) && is_array($matches)){
|
|
|
|
|
130 |
foreach($matches as $match) {
|
131 |
$the_content = preg_replace("/<p>(http|https):\/\/www\.facebook\.com\/([^<\s]*)<\/p>/", self::fb_embed($match), $the_content, 1);
|
132 |
}
|
|
|
133 |
}
|
134 |
return $the_content;
|
135 |
}
|
138 |
* @param array $match[2]=url without ' https://www.facebook.com/ '
|
139 |
* @return string Embedded content
|
140 |
*/
|
141 |
+
static function fb_embed($match){
|
142 |
+
self::$fbsdk = FaceInit::get_fbsdk();
|
143 |
+
if(self::$fbsdk !== 'unactive') {
|
144 |
+
//extract fbid from url good for profiles, pages, comunity pages, raw photos, events
|
145 |
+
$vars = array();
|
146 |
+
$type = '';
|
147 |
+
parse_str(parse_url($match[2], PHP_URL_QUERY), $vars);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
+
$url = explode('?', $match[2]);
|
150 |
+
$clean = explode('/', $url[0]);
|
151 |
+
$end = end($clean);
|
152 |
+
if (empty($end)) {
|
153 |
+
array_pop($clean);
|
154 |
+
}
|
155 |
+
$last = end($clean);
|
156 |
+
$fb_id = $last;
|
157 |
+
//old embed ulr's
|
158 |
+
if (isset($vars['fbid']))
|
159 |
+
$fb_id = $vars['fbid'];
|
160 |
+
|
161 |
+
//its an album
|
162 |
+
if (array_search('media', $clean) !== false || isset($vars['set']) || $last == 'album.php') {
|
163 |
+
$type = 'album';
|
164 |
+
if ($last !== 'album.php') {
|
165 |
+
$ids = explode('.', $vars['set']);
|
166 |
+
$fb_id = $ids[1];
|
167 |
+
}
|
168 |
+
}
|
169 |
+
/**
|
170 |
+
* Filter the embed type.
|
171 |
+
*
|
172 |
+
* @since 1.8
|
173 |
+
*
|
174 |
+
* @param string $type the embed type.
|
175 |
+
* @param array $clean url parts of the request.
|
176 |
+
*/
|
177 |
+
$type = apply_filters('wpemfb_embed_type', $type, $clean);
|
178 |
+
//its a post
|
179 |
+
if (array_search('posts', $clean) !== false) {
|
180 |
+
$fb_data = array('link' => $match[2], 'is_post' => '');
|
181 |
+
return self::print_fb_data($fb_data);
|
182 |
+
}
|
183 |
+
|
184 |
+
if (!empty(self::$raw)) {
|
185 |
+
$raw_photo = self::$raw;
|
186 |
+
$raw_video = self::$raw;
|
187 |
+
} else {
|
188 |
+
$raw_photo = get_option('wpemfb_raw_photo') == 'true' ? 'true' : 'false';
|
189 |
+
$raw_video = get_option('wpemfb_raw_video') == 'true' ? 'true' : 'false';
|
190 |
+
}
|
191 |
+
//is video
|
192 |
+
if (isset($vars['v'])) { //is video
|
193 |
+
if ($raw_video == 'true') {
|
194 |
+
//$fb_data = array( 'v_id' => $vars['v'], 'is_video' => '' );
|
195 |
+
return self::fb_api_get($vars['v'], $match[2]);
|
196 |
+
//return self::print_fb_data($fb_data);
|
197 |
+
} else {
|
198 |
+
$fb_data = array('link' => $match[2], 'is_post' => '');
|
199 |
+
return self::print_fb_data($fb_data);
|
200 |
+
}
|
201 |
+
}
|
202 |
+
//photos
|
203 |
+
if ('photo.php' == $last || (array_search('photos', $clean) !== false)) {
|
204 |
+
if ($raw_photo == 'true') {
|
205 |
+
return self::fb_api_get($fb_id, $match[2]);
|
206 |
+
} else {
|
207 |
+
$fb_data = array('link' => $match[2], 'is_post' => '');
|
208 |
+
return self::print_fb_data($fb_data);
|
209 |
+
}
|
210 |
+
}
|
211 |
+
return self::fb_api_get($fb_id, $match[2], $type);
|
212 |
+
} else {
|
213 |
+
$return = '<p>'.__('Add facebook App ID and Secret on admin to make this plugin work','').'</p>';
|
214 |
+
$return .= '<p><a href="https://www.facebook.com/'.$match[2].'" target="_blank" rel="nofollow">https://www.facebook.com/'.$match[2].'</a></p>';
|
215 |
+
return $return;
|
216 |
+
}
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
}
|
219 |
/**
|
220 |
* get data from fb using WP_Embed_FB::$fbsdk->api('/'.$fb_id) :)
|
465 |
self::$height = self::$width = self::$raw = self::$num_posts = '';
|
466 |
return $embed;
|
467 |
}
|
468 |
+
return '';
|
469 |
}
|
470 |
static function embed_register_handler($match){
|
|
|
|
|
471 |
return self::fb_embed($match);
|
472 |
}
|
473 |
static function fb_root($ct){
|
489 |
* https://developers.facebook.com/docs/reference/php/
|
490 |
*/
|
491 |
class FaceInit {
|
492 |
+
static $fbsdk = null;
|
493 |
static function init(){
|
494 |
require('fb/facebook.php');
|
495 |
$config = array();
|
501 |
else
|
502 |
self::$fbsdk = 'unactive';
|
503 |
}
|
504 |
+
static function get_fbsdk(){
|
505 |
+
if(self::$fbsdk == null)
|
506 |
+
self::init();
|
507 |
+
return self::$fbsdk;
|
508 |
+
}
|
509 |
}
|
lib/js/wpembedfb.js
CHANGED
@@ -7,9 +7,10 @@ jQuery(window).resize(function(){
|
|
7 |
resize_cover();
|
8 |
});
|
9 |
function resize_cover(){
|
10 |
-
|
|
|
11 |
var v_height = 0.368 * v_width;
|
12 |
-
|
13 |
//console.log(v_height);
|
14 |
//console.log(jQuery(".wpemfb-cover").height());
|
15 |
}
|
7 |
resize_cover();
|
8 |
});
|
9 |
function resize_cover(){
|
10 |
+
var cover = jQuery(".wpemfb-cover");
|
11 |
+
var v_width = cover.width();
|
12 |
var v_height = 0.368 * v_width;
|
13 |
+
cover.css("height",v_height );
|
14 |
//console.log(v_height);
|
15 |
//console.log(jQuery(".wpemfb-cover").height());
|
16 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
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.2.2
|
7 |
-
Stable tag: 1.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -82,6 +82,14 @@ The embedded post code comes directly from facebook so there is no easy way to c
|
|
82 |
|
83 |
== Changelog ==
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
= 1.9.4 =
|
86 |
* Added option to embed raw videos with facebook code
|
87 |
* Added poster on raw embed videos
|
@@ -190,5 +198,5 @@ The embedded post code comes directly from facebook so there is no easy way to c
|
|
190 |
|
191 |
== Upgrade Notice ==
|
192 |
|
193 |
-
= 1.9.
|
194 |
-
*
|
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.2.2
|
7 |
+
Stable tag: 1.9.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
82 |
|
83 |
== Changelog ==
|
84 |
|
85 |
+
= 1.9.6 =
|
86 |
+
* Fix Fatal Error on non object
|
87 |
+
|
88 |
+
= 1.9.5 =
|
89 |
+
* Fixed event templates
|
90 |
+
* Fixed album thumbnails
|
91 |
+
* Fixed jQuery UI error when admin is in https
|
92 |
+
|
93 |
= 1.9.4 =
|
94 |
* Added option to embed raw videos with facebook code
|
95 |
* Added poster on raw embed videos
|
198 |
|
199 |
== Upgrade Notice ==
|
200 |
|
201 |
+
= 1.9.6 =
|
202 |
+
* Fixed Fatal Error on non object
|
templates/classic/event.php
CHANGED
@@ -27,11 +27,12 @@ if (get_site_option('wpemfb_ev_local_tz', 'true') == 'true') {
|
|
27 |
</h4>
|
28 |
<?php echo date_i18n($start_time_format, $start_time) ?><br>
|
29 |
<?php
|
30 |
-
if(isset($fb_data['
|
31 |
-
echo '<a href="http://www.facebook.com/'.$fb_data['
|
32 |
} else {
|
33 |
-
echo $fb_data['
|
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>
|
27 |
</h4>
|
28 |
<?php echo date_i18n($start_time_format, $start_time) ?><br>
|
29 |
<?php
|
30 |
+
if(isset($fb_data['place']['id'])){
|
31 |
+
echo '<a href="http://www.facebook.com/'.$fb_data['place']['id'].'" target="_blank">'.$fb_data['location'].'</a>';
|
32 |
} else {
|
33 |
+
echo isset($fb_data['place']['name']) ? __('@ ', 'wp-embed-facebook') . $fb_data['place']['name'] : '';
|
34 |
+
}
|
35 |
+
?>
|
36 |
<br>
|
37 |
<?php echo __('Creator: ', 'wp-embed-facebook').'<a href="http://www.facebook.com/'.$fb_data['owner']['id'].'" target="_blank">'.$fb_data['owner']['name'].'</a>' ?>
|
38 |
</div>
|
templates/classic/page.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
style=" height:<?php echo $height ?>px;
|
15 |
width:<?php echo $width?>px;
|
16 |
background-image: url(<?php echo $fb_data['cover']['source'] ?>);
|
17 |
-
background-position: 0
|
18 |
">
|
19 |
|
20 |
</div>
|
14 |
style=" height:<?php echo $height ?>px;
|
15 |
width:<?php echo $width?>px;
|
16 |
background-image: url(<?php echo $fb_data['cover']['source'] ?>);
|
17 |
+
background-position: 0 <?php echo $fb_data['cover']['offset_y'] ?>%;
|
18 |
">
|
19 |
|
20 |
</div>
|
templates/classic/video.php
CHANGED
@@ -2,29 +2,31 @@
|
|
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 |
?>
|
7 |
<div style="width: <?php echo $width ?>px">
|
8 |
<div class="wpemfb-video">
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
</div>
|
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 |
*/
|
7 |
?>
|
8 |
<div style="width: <?php echo $width ?>px">
|
9 |
<div class="wpemfb-video">
|
10 |
+
<?php
|
11 |
+
$url = $fb_data['source'];
|
12 |
+
$file_array = explode('/',parse_url($url, PHP_URL_PATH));
|
13 |
+
$file = end($file_array);
|
14 |
+
$type_array = explode('.',$file);
|
15 |
+
$type = end($type_array);
|
16 |
+
$clean_type = strtolower($type);
|
17 |
+
if( get_site_option('wpemfb_raw_video_fb') == 'false' && $clean_type == 'mp4' ) : ?>
|
18 |
+
<?php $end = isset($fb_data['format']) ? end($fb_data['format']) : $fb_data; ?>
|
19 |
|
20 |
+
<video controls poster="<?php echo $end['picture'] ?>" >
|
21 |
+
<source src="<?php echo $fb_data['source'] ?>" type="video/<?php echo $clean_type ?>">
|
22 |
+
</video>
|
23 |
|
24 |
+
<?php else : ?>
|
25 |
|
26 |
+
<div class="fb-video" data-allowfullscreen="true"
|
27 |
+
data-href="/<?php echo $fb_data['from']['id'] ?>/videos/<?php echo $fb_data['id'] ?>">
|
28 |
+
</div>
|
29 |
|
30 |
+
<?php endif; ?>
|
31 |
+
</div>
|
32 |
</div>
|
templates/classic/wpemfb.css
CHANGED
@@ -38,7 +38,7 @@
|
|
38 |
.wpemfb-pic{
|
39 |
display: table-cell;
|
40 |
vertical-align: middle;
|
41 |
-
margin:
|
42 |
padding: 5px;
|
43 |
width: 10%;
|
44 |
}
|
@@ -46,7 +46,7 @@
|
|
46 |
display: table-cell;
|
47 |
vertical-align: middle;
|
48 |
}
|
49 |
-
.wpemfb-thmb {
|
50 |
border: 1px solid #808080;
|
51 |
height: 60px !important;
|
52 |
margin: 1px;
|
@@ -58,10 +58,10 @@
|
|
58 |
}
|
59 |
|
60 |
.wpemfb-posts-container{
|
61 |
-
margin:
|
62 |
width:100% !important;
|
63 |
border-top: 1px solid whitesmoke;
|
64 |
-
padding: 3px
|
65 |
display: table;
|
66 |
cursor: pointer;
|
67 |
}
|
38 |
.wpemfb-pic{
|
39 |
display: table-cell;
|
40 |
vertical-align: middle;
|
41 |
+
margin: 0;
|
42 |
padding: 5px;
|
43 |
width: 10%;
|
44 |
}
|
46 |
display: table-cell;
|
47 |
vertical-align: middle;
|
48 |
}
|
49 |
+
img.wpemfb-thmb {
|
50 |
border: 1px solid #808080;
|
51 |
height: 60px !important;
|
52 |
margin: 1px;
|
58 |
}
|
59 |
|
60 |
.wpemfb-posts-container{
|
61 |
+
margin:0 auto;
|
62 |
width:100% !important;
|
63 |
border-top: 1px solid whitesmoke;
|
64 |
+
padding: 3px 0;
|
65 |
display: table;
|
66 |
cursor: pointer;
|
67 |
}
|
templates/default/com-page.php
CHANGED
@@ -3,8 +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 print_r($fb_data)
|
5 |
*/
|
6 |
-
$
|
7 |
-
$height = $width * $prop;
|
8 |
?>
|
9 |
<div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
|
10 |
<div class="wpemfb-row">
|
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 |
?>
|
8 |
<div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
|
9 |
<div class="wpemfb-row">
|
templates/default/event.php
CHANGED
@@ -26,11 +26,11 @@ if (get_site_option('wpemfb_ev_local_tz', 'true') == 'true') {
|
|
26 |
<?php echo date_i18n($start_time_format, $start_time) ?>
|
27 |
<br>
|
28 |
<?php
|
29 |
-
if
|
30 |
_e('@ ', 'wp-embed-facebook');
|
31 |
-
echo '<a href="http://www.facebook.com/'
|
32 |
} else {
|
33 |
-
echo isset($fb_data['
|
34 |
}
|
35 |
?>
|
36 |
<br>
|
26 |
<?php echo date_i18n($start_time_format, $start_time) ?>
|
27 |
<br>
|
28 |
<?php
|
29 |
+
if(isset($fb_data['place']['id'])){
|
30 |
_e('@ ', 'wp-embed-facebook');
|
31 |
+
echo '<a href="http://www.facebook.com/'.$fb_data['place']['id'].'" target="_blank">'.$fb_data['place']['name'].'</a>';
|
32 |
} else {
|
33 |
+
echo isset($fb_data['place']['name']) ? __('@ ', 'wp-embed-facebook') . $fb_data['place']['name'] : '';
|
34 |
}
|
35 |
?>
|
36 |
<br>
|
templates/default/page.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
style= "
|
13 |
height:<?php echo $height ?>px;
|
14 |
background-image: url(<?php echo $fb_data['cover']['source'] ?>);
|
15 |
-
background-position: 0
|
16 |
" onclick="window.open('<?php echo $fb_data['link'] ?>', '_blank')" >
|
17 |
</div>
|
18 |
<div class="wpemfb-row wpemfb-pad-top">
|
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">
|
templates/default/photo.php
CHANGED
@@ -3,8 +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 print_r($fb_data)
|
5 |
*/
|
6 |
-
$
|
7 |
-
$height = $width * $prop;
|
8 |
?>
|
9 |
<a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
|
10 |
<img src="<?php echo $fb_data['source'] ?>" width="<?php echo $width ?>px" height="auto" style="max-width: <?php echo $width ?>px" />
|
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 |
?>
|
8 |
<a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
|
9 |
<img src="<?php echo $fb_data['source'] ?>" width="<?php echo $width ?>px" height="auto" style="max-width: <?php echo $width ?>px" />
|
templates/default/profile.php
CHANGED
@@ -3,8 +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 print_r($fb_data)
|
5 |
*/
|
6 |
-
$
|
7 |
-
$height = $width * $prop;
|
8 |
?>
|
9 |
<div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
|
10 |
<div class="wpemfb-row">
|
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 |
?>
|
8 |
<div class="wpemfb-container" style="max-width: <?php echo $width ?>px">
|
9 |
<div class="wpemfb-row">
|
templates/default/video.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
$type = end($type_array);
|
16 |
$clean_type = strtolower($type);
|
17 |
|
18 |
-
if( get_site_option('wpemfb_raw_video_fb') == 'false' && $clean_type == 'mp4' )
|
19 |
<?php $end = isset($fb_data['format']) ? end($fb_data['format']) : $fb_data; ?>
|
20 |
|
21 |
<video controls poster="<?php echo $end['picture'] ?>" >
|
15 |
$type = end($type_array);
|
16 |
$clean_type = strtolower($type);
|
17 |
|
18 |
+
if( get_site_option('wpemfb_raw_video_fb') == 'false' && $clean_type == 'mp4' ) : ?>
|
19 |
<?php $end = isset($fb_data['format']) ? end($fb_data['format']) : $fb_data; ?>
|
20 |
|
21 |
<video controls poster="<?php echo $end['picture'] ?>" >
|
templates/default/wpemfb.css
CHANGED
@@ -83,7 +83,7 @@
|
|
83 |
text-align: center;
|
84 |
}
|
85 |
.wpemfb-pl-none{
|
86 |
-
padding-left:
|
87 |
}
|
88 |
.wpemfb-color{
|
89 |
color: #23487F;
|
@@ -134,7 +134,7 @@ a.wpemfb-post-link{
|
|
134 |
/**
|
135 |
* Album Embed
|
136 |
*/
|
137 |
-
.wpemfb-thmb {
|
138 |
border: 1px solid #808080;
|
139 |
border-radius: 2px;
|
140 |
height: 60px !important;
|
83 |
text-align: center;
|
84 |
}
|
85 |
.wpemfb-pl-none{
|
86 |
+
padding-left: 0;
|
87 |
}
|
88 |
.wpemfb-color{
|
89 |
color: #23487F;
|
134 |
/**
|
135 |
* Album Embed
|
136 |
*/
|
137 |
+
img.wpemfb-thmb {
|
138 |
border: 1px solid #808080;
|
139 |
border-radius: 2px;
|
140 |
height: 60px !important;
|
wp-embed-facebook.php
CHANGED
@@ -4,7 +4,7 @@ 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.9.
|
8 |
Author URI: http://profiles.wordpress.org/poxtron/
|
9 |
*/
|
10 |
|
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.9.6
|
8 |
Author URI: http://profiles.wordpress.org/poxtron/
|
9 |
*/
|
10 |
|