WP Embed Facebook - Version 1.5

Version Description

  • Support for raw videos and photos
  • Support for albums
  • Spanish translations
Download this release

Release Info

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

Code changes from version 1.4 to 1.5

lang/wp-embed-facebook-es_ES.mo ADDED
Binary file
lang/wp-embed-facebook-es_ES.po ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Embed Facebook v1.4\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-04-02 08:53:31+0000\n"
7
+ "Last-Translator: Miguel Sirvent <miguel.sirvent@gmail.com>\n"
8
+ "Language-Team: Miguel Sirvent <miguel.sirvent@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: Poedit 1.6.4\n"
14
+ "X-Poedit-Language: \n"
15
+ "X-Poedit-Country: \n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
18
+ "X-Poedit-Basepath: ../\n"
19
+ "X-Poedit-Bookmarks: \n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Textdomain-Support: yes"
22
+
23
+ #: lib/admin.php:77
24
+ #@ wp-embed-facebook
25
+ msgid "Facebook application data"
26
+ msgstr "Datos de la App de Facebook"
27
+
28
+ #: lib/admin.php:92
29
+ #@ wp-embed-facebook
30
+ msgid "Theme to use"
31
+ msgstr "Tema a usar"
32
+
33
+ #: lib/admin.php:101
34
+ #@ wp-embed-facebook
35
+ msgid "Fb Cover Embed Width"
36
+ msgstr "Ancho del incrustado"
37
+
38
+ #: lib/admin.php:108
39
+ #@ wp-embed-facebook
40
+ msgid "Embed video as Post"
41
+ msgstr "Incrustar video como publicación"
42
+
43
+ #: lib/admin.php:114
44
+ #@ wp-embed-facebook
45
+ msgid "Embed photo as Post"
46
+ msgstr "Incrustar foto como publicación"
47
+
48
+ #: lib/admin.php:120
49
+ #@ wp-embed-facebook
50
+ msgid "Add like button to embedded pages"
51
+ msgstr "Agregar boton ¨me gusta¨ a las paginas incrustadas"
52
+
53
+ #: lib/admin.php:126
54
+ #@ wp-embed-facebook
55
+ msgid "Show follow button"
56
+ msgstr "Mostrar el boton de seguir"
57
+
58
+ #: lib/admin.php:134
59
+ #@ wp-embed-facebook
60
+ msgid "Advanced Options"
61
+ msgstr "Opciones Avanzadas"
62
+
63
+ #: lib/admin.php:138
64
+ #@ wp-embed-facebook
65
+ msgid "Enqueue Styles"
66
+ msgstr "Incluir css"
67
+
68
+ #: lib/admin.php:144
69
+ #@ wp-embed-facebook
70
+ msgid "Add fb-root and js on top of content"
71
+ msgstr "Incluir el fb-root y js al inicio del contenido"
72
+
73
+ #: lib/admin.php:144
74
+ #@ wp-embed-facebook
75
+ msgid "Some themes may not need this"
76
+ msgstr "Algunos themes pueden no necesitar esto"
77
+
78
+ #: lib/admin.php:152
79
+ #@ wp-embed-facebook
80
+ msgid "Save"
81
+ msgstr "Guardar"
82
+
83
+ #: lib/admin.php:161
84
+ #@ wp-embed-facebook
85
+ msgid "Customize"
86
+ msgstr "Customizar"
87
+
88
+ #: lib/admin.php:164
89
+ #@ wp-embed-facebook
90
+ msgid "Support"
91
+ msgstr "Soporte"
92
+
93
+ #: lib/admin.php:168
94
+ #@ wp-embed-facebook
95
+ msgid "Plugin Web Site"
96
+ msgstr "Sitio Web del Plugin"
97
+
98
+ #: lib/admin.php:176
99
+ #@ wp-embed-facebook
100
+ msgid "Donate!"
101
+ msgstr "¡Dona!"
102
+
103
+ #: lib/admin.php:177
104
+ #@ wp-embed-facebook
105
+ msgid "Help me keep this plugin up to date"
106
+ msgstr "Ayúdame a mantener este plugin actualizado"
107
+
108
+ #: lib/admin.php:178
109
+ #@ wp-embed-facebook
110
+ msgid "Click the taco !"
111
+ msgstr "¡Click en el Taco!"
112
+
113
+ #: lib/admin.php:187
114
+ #@ wp-embed-facebook
115
+ msgid "Searching for the Premium version ?"
116
+ msgstr "¿ Buscas la versión premium ?"
117
+
118
+ #: lib/admin.php:190
119
+ #@ wp-embed-facebook
120
+ msgid "Custom templates"
121
+ msgstr "Templates nuevos"
122
+
123
+ #: lib/admin.php:193
124
+ #@ wp-embed-facebook
125
+ msgid "Compatibility with all themes imaginable"
126
+ msgstr "Compatibilidad con más themes"
127
+
128
+ #: lib/admin.php:196
129
+ #@ wp-embed-facebook
130
+ msgid "Multiple fb app id's per each multisite site"
131
+ msgstr "Multiples apps de fb para cada sitio en multisite"
132
+
133
+ #: lib/admin.php:199
134
+ #@ wp-embed-facebook
135
+ msgid "Comming Soon"
136
+ msgstr "Proximamente"
137
+
138
+ #: lib/core.php:234
139
+ #@ wp-embed-facebook
140
+ msgid "Web Site"
141
+ msgstr "Sitio Web"
142
+
143
+ #: lib/core.php:242
144
+ #@ default
145
+ msgid "Museum/art gallery"
146
+ msgstr ""
147
+
148
+ #: lib/core.php:243
149
+ #@ default
150
+ msgid "Local business"
151
+ msgstr ""
152
+
153
+ #: lib/core.php:244
154
+ #@ default
155
+ msgid "Concert venue"
156
+ msgstr ""
157
+
158
+ #: lib/core.php:245
159
+ #@ default
160
+ msgid "Public places"
161
+ msgstr ""
162
+
163
+ #: lib/core.php:288
164
+ #, php-format
165
+ #@ wp-embed-facebook
166
+ msgid "%d people like this."
167
+ msgstr "%d les gusta esto"
168
+
169
+ #: templates/classic/event.php:33 templates/default/event.php:36
170
+ #@ wp-embed-facebook
171
+ msgid "Creator: "
172
+ msgstr "Creador: "
173
+
174
+ #: templates/classic/page.php:36 templates/default/page.php:34
175
+ #@ wp-embed-facebook
176
+ msgid "category"
177
+ msgstr "categoria"
178
+
lang/wp-embed-fb-es_ES.mo DELETED
Binary file
lang/wp-embed-fb-es_ES.po DELETED
@@ -1,122 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: wp-embed-fb\n"
4
- "POT-Creation-Date: 2014-02-28 20:03-0600\n"
5
- "PO-Revision-Date: 2014-02-28 20:03-0600\n"
6
- "Last-Translator: Miguel Sirvent <miguel.sirvent@gmail.com>\n"
7
- "Language-Team: Miguel Sirvent <miguel.sirvent@gmail.com>\n"
8
- "Language: es_ES\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.4\n"
13
- "X-Poedit-Basepath: .\n"
14
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __;_e\n"
17
- "X-Poedit-SearchPath-0: ..\n"
18
-
19
- #: ../lib/admin.php:67
20
- msgid "Facebook application data"
21
- msgstr "Datos de la aplicación de Facebook."
22
-
23
- #: ../lib/admin.php:84
24
- msgid "Other Options"
25
- msgstr "Otras Opciones"
26
-
27
- #: ../lib/admin.php:90
28
- msgid "Fb Cover Embed Width"
29
- msgstr "Ancho máximo del Embed"
30
-
31
- #: ../lib/admin.php:96
32
- msgid "Enqueue Styles"
33
- msgstr "Incluir css del plugin"
34
-
35
- #: ../lib/admin.php:104
36
- msgid "Save"
37
- msgstr "Guardar"
38
-
39
- #: ../lib/admin.php:112
40
- msgid "Customize"
41
- msgstr "Customizar"
42
-
43
- #: ../lib/admin.php:115
44
- msgid "Support"
45
- msgstr "Soporte"
46
-
47
- #: ../lib/admin.php:118
48
- msgid "Plugin Web Site"
49
- msgstr "Sitio Web del plugin"
50
-
51
- #: ../lib/admin.php:126
52
- msgid "Donate!"
53
- msgstr "Dona !"
54
-
55
- #: ../lib/admin.php:127
56
- msgid "Help me keep this plugin up to date"
57
- msgstr "Ayúdame a manter este plugin actualizado"
58
-
59
- #: ../lib/admin.php:129
60
- msgid "Click the taco !"
61
- msgstr "Click en el taco !"
62
-
63
- #: ../lib/admin.php:130
64
- msgid "3 USD Minimun Suggested Donation"
65
- msgstr "Mínimo Sugerido 3 USD"
66
-
67
- #: ../lib/admin.php:140
68
- msgid "Searching for the Premium version ?"
69
- msgstr "Buscando la versión premium ?"
70
-
71
- #: ../lib/admin.php:143
72
- msgid "Custom templates"
73
- msgstr "Templates personalizados"
74
-
75
- #: ../lib/admin.php:146
76
- msgid "Compatibility with all themes imaginable"
77
- msgstr "Compatibilidad con todos los themes imaginables"
78
-
79
- #: ../lib/admin.php:149
80
- msgid "Multiple fb app id's per each multisite site"
81
- msgstr "Multiples app's en multisite"
82
-
83
- #: ../lib/admin.php:152
84
- msgid "Comming Soon"
85
- msgstr "Pronto muy pronto"
86
-
87
- #: ../lib/core.php:89
88
- msgid "This facebook link is not public"
89
- msgstr "Este link de Facebook no es público"
90
-
91
- #: ../lib/core.php:134
92
- msgid "Web Site"
93
- msgstr "Sitio Web"
94
-
95
- #: ../lib/core.php:139
96
- msgid "Museum/art gallery"
97
- msgstr "Museo / Galería de Arte"
98
-
99
- #: ../lib/core.php:140
100
- msgid "Local business"
101
- msgstr "Negocio Local"
102
-
103
- #: ../lib/core.php:141
104
- msgid "Concert venue"
105
- msgstr "Foro de Conciertos"
106
-
107
- #: ../lib/core.php:142
108
- msgid "Public places"
109
- msgstr "Lugar publico"
110
-
111
- #: ../templates/default/band.php:29 ../templates/default/com-page.php:20
112
- #: ../templates/default/other.php:33
113
- #, php-format
114
- msgid "%d people like this."
115
- msgstr "a %d les gusta esto."
116
-
117
- #: ../templates/default/event.php:33
118
- msgid "Creator: "
119
- msgstr "Creador:"
120
-
121
- #~ msgid "Something is wrong with this link"
122
- #~ msgstr "Algo le pasa a este link"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/wp-embed-fb.mo DELETED
Binary file
lang/wp-embed-fb.pot DELETED
@@ -1,119 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: wp-embed-fb\n"
4
- "POT-Creation-Date: 2014-02-28 20:05-0600\n"
5
- "PO-Revision-Date: 2014-02-28 20:05-0600\n"
6
- "Last-Translator: Miguel Sirvent <miguel.sirvent@gmail.com>\n"
7
- "Language-Team: Miguel Sirvent <miguel.sirvent@gmail.com>\n"
8
- "Language: en_US\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.4\n"
13
- "X-Poedit-Basepath: .\n"
14
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __;_e\n"
17
- "X-Poedit-SearchPath-0: ..\n"
18
-
19
- #: ../lib/admin.php:67
20
- msgid "Facebook application data"
21
- msgstr ""
22
-
23
- #: ../lib/admin.php:84
24
- msgid "Other Options"
25
- msgstr ""
26
-
27
- #: ../lib/admin.php:90
28
- msgid "Fb Cover Embed Width"
29
- msgstr ""
30
-
31
- #: ../lib/admin.php:96
32
- msgid "Enqueue Styles"
33
- msgstr ""
34
-
35
- #: ../lib/admin.php:104
36
- msgid "Save"
37
- msgstr ""
38
-
39
- #: ../lib/admin.php:112
40
- msgid "Customize"
41
- msgstr ""
42
-
43
- #: ../lib/admin.php:115
44
- msgid "Support"
45
- msgstr ""
46
-
47
- #: ../lib/admin.php:118
48
- msgid "Plugin Web Site"
49
- msgstr ""
50
-
51
- #: ../lib/admin.php:126
52
- msgid "Donate!"
53
- msgstr ""
54
-
55
- #: ../lib/admin.php:127
56
- msgid "Help me keep this plugin up to date"
57
- msgstr ""
58
-
59
- #: ../lib/admin.php:129
60
- msgid "Click the taco !"
61
- msgstr ""
62
-
63
- #: ../lib/admin.php:130
64
- msgid "3 USD Minimun Suggested Donation"
65
- msgstr ""
66
-
67
- #: ../lib/admin.php:140
68
- msgid "Searching for the Premium version ?"
69
- msgstr ""
70
-
71
- #: ../lib/admin.php:143
72
- msgid "Custom templates"
73
- msgstr ""
74
-
75
- #: ../lib/admin.php:146
76
- msgid "Compatibility with all themes imaginable"
77
- msgstr ""
78
-
79
- #: ../lib/admin.php:149
80
- msgid "Multiple fb app id's per each multisite site"
81
- msgstr ""
82
-
83
- #: ../lib/admin.php:152
84
- msgid "Comming Soon"
85
- msgstr ""
86
-
87
- #: ../lib/core.php:89
88
- msgid "This facebook link is not public"
89
- msgstr ""
90
-
91
- #: ../lib/core.php:134
92
- msgid "Web Site"
93
- msgstr ""
94
-
95
- #: ../lib/core.php:139
96
- msgid "Museum/art gallery"
97
- msgstr ""
98
-
99
- #: ../lib/core.php:140
100
- msgid "Local business"
101
- msgstr ""
102
-
103
- #: ../lib/core.php:141
104
- msgid "Concert venue"
105
- msgstr ""
106
-
107
- #: ../lib/core.php:142
108
- msgid "Public places"
109
- msgstr ""
110
-
111
- #: ../templates/default/band.php:29 ../templates/default/com-page.php:20
112
- #: ../templates/default/other.php:33
113
- #, php-format
114
- msgid "%d people like this."
115
- msgstr ""
116
-
117
- #: ../templates/default/event.php:33
118
- msgid "Creator: "
119
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/admin.php CHANGED
@@ -7,95 +7,59 @@ class EmbFbAdmin{
7
  static function savedata(){
8
  if(isset($_POST['wpemfb_app_secret'], $_POST['wpemfb_app_id' ] )) {
9
  if($_POST['wpemfb_app_id'] && $_POST['wpemfb_app_secret']){
10
- if ( !is_multisite() ) {
11
- update_option('wpemfb_app_id',$_POST['wpemfb_app_id']);
12
- update_option('wpemfb_app_secret',$_POST['wpemfb_app_secret']);
13
- }
14
- else {
15
- update_site_option('wpemfb_app_id',$_POST['wpemfb_app_id']);
16
- update_site_option('wpemfb_app_secret',$_POST['wpemfb_app_secret']);
17
- }
18
  }
19
  if(isset($_POST['wpemfb_max_width'])){
20
  $prop = get_option('wpemfb_proportions') * $_POST['wpemfb_max_width'];
21
- if ( !is_multisite() ) {
22
- update_option('wpemfb_max_width', $_POST['wpemfb_max_width']);
23
- update_option('wpemfb_height', $prop );
24
- }
25
- else {
26
- update_site_option('wpemfb_max_width', $_POST['wpemfb_max_width']);
27
- update_site_option('wpemfb_height', $prop);
28
- }
29
  }
30
  if(isset($_POST['wpemfb_theme'])){
31
- if ( !is_multisite() )
32
- update_option('wpemfb_theme', $_POST['wpemfb_theme']);
33
- else
34
- update_site_option('wpemfb_theme', $_POST['wpemfb_theme']);
35
  }
36
  if(isset($_POST['wpemfb_show_like'])){
37
- if ( !is_multisite() )
38
- update_option('wpemfb_show_like', 'true');
39
- else
40
- update_site_option('wpemfb_show_like', 'true');
41
  }else{
42
- if ( !is_multisite() ) {
43
- update_option('wpemfb_show_like', 'false');
44
- }
45
- else {
46
- update_site_option('wpemfb_show_like', 'false');
47
- }
48
  }
49
  if(isset($_POST['wpemfb_enqueue_style'])){
50
- if ( !is_multisite() )
51
- update_option('wpemfb_enqueue_style', 'true');
52
- else
53
- update_site_option('wpemfb_enqueue_style', 'true');
54
  }else{
55
- if ( !is_multisite() ) {
56
- update_option('wpemfb_enqueue_style', 'false');
57
- }
58
- else {
59
- update_site_option('wpemfb_enqueue_style', 'false');
60
- }
61
  }
62
  if(isset($_POST['wpemfb_fb_root'])){
63
- if ( !is_multisite() )
64
- update_option('wpemfb_fb_root', 'true');
65
- else
66
- update_site_option('wpemfb_fb_root', 'true');
67
  }else{
68
- if ( !is_multisite() ) {
69
- update_option('wpemfb_fb_root', 'false');
70
- }
71
- else {
72
- update_site_option('wpemfb_fb_root', 'false');
73
- }
74
  }
75
  if(isset($_POST['wpemfb_show_follow'])){
76
- if ( !is_multisite() )
77
- update_option('wpemfb_show_follow', 'true');
78
- else
79
- update_site_option('wpemfb_show_follow', 'true');
80
  }else{
81
- if ( !is_multisite() ) {
82
- update_option('wpemfb_show_follow', 'false');
83
- }
84
- else {
85
- update_site_option('wpemfb_show_follow', 'false');
86
- }
 
 
 
 
 
87
  }
88
  }
89
  }
90
  static function embedfb_page() {
91
- if(isset($_POST['submit']) && check_admin_referer( 'wp-embed-fb','save-data' )){
92
  self::savedata();
93
  }
94
-
95
  $checked = (get_option('wpemfb_enqueue_style') === 'true') ? 'checked' : '' ;
96
  $checked2 = (get_option('wpemfb_show_like') === 'true') ? 'checked' : '' ;
97
  $checked3 = (get_option('wpemfb_fb_root') === 'true') ? 'checked' : '' ;
98
  $checked4 = (get_option('wpemfb_show_follow') === 'true') ? 'checked' : '' ;
 
 
99
  $sel1 = (get_option('wpemfb_theme') === 'default') ? 'selected' : '' ;
100
  $sel2 = (get_option('wpemfb_theme') === 'classic') ? 'selected' : '' ;
101
  ?>
@@ -107,10 +71,10 @@ class EmbFbAdmin{
107
  <div class="welcome-panel-column">
108
  <form id="config-form" action="#" method="post">
109
  <table class="form-table">
110
- <?php wp_nonce_field( 'wp-embed-fb','save-data' ); ?>
111
  <tbody>
112
  <tr>
113
- <h3><?php _e('Facebook application data', 'wp-embed-fb') ?></h3>
114
  </tr>
115
  <tr valign="middle">
116
  <th>App ID</th>
@@ -125,7 +89,7 @@ class EmbFbAdmin{
125
  </td>
126
  </tr>
127
  <tr>
128
- <th><?php _e("Theme to use", 'wp-embed-fb') ?></th>
129
  <td>
130
  <select name="wpemfb_theme">
131
  <option value="default" <?php echo $sel1 ?> >Default</option>
@@ -133,42 +97,51 @@ class EmbFbAdmin{
133
  </select>
134
  </td>
135
  </tr>
136
- <tr>
137
- <th>
138
- <h4><?php _e("Other Options", 'wp-embed-fb') ?></h4>
139
- </th>
140
- </tr>
141
  <tr valign="middle">
142
- <th><?php _e('Fb Cover Embed Width','wp-embed-fb') ?></th>
143
  <td>
144
  <input type="text" name="wpemfb_max_width" value="<?php echo get_option('wpemfb_max_width') ?>" />
145
  </td>
146
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  <tr valign="middle">
148
- <th><?php _e('Add like button to pages','wp-embed-fb') ?></th>
149
  <td>
150
  <input type="checkbox" name="wpemfb_show_like" <?php echo $checked2 ?> />
151
  </td>
152
  </tr>
153
  <tr valign="middle">
154
- <th><?php _e('Show follow button','wp-embed-fb') ?></th>
155
  <td>
156
  <input type="checkbox" name="wpemfb_show_follow" <?php echo $checked4 ?> />
157
  </td>
158
  </tr>
 
159
  <tr>
160
  <th>
161
- <h4><?php _e("Advanced Options", 'wp-embed-fb') ?></h4>
162
  </th>
163
  </tr>
164
  <tr valign="middle">
165
- <th><?php _e('Enqueue Styles','wp-embed-fb') ?></th>
166
  <td>
167
  <input type="checkbox" name="wpemfb_enqueue_style" <?php echo $checked ?> />
168
  </td>
169
  </tr>
170
  <tr valign="middle">
171
- <th><?php _e('Add fb-root and javascript on top of content','wp-embed-fb') ?><br><small><?php _e('Some themes may not need this','wp-embed-fb') ?></small></th>
172
  <td>
173
  <input type="checkbox" name="wpemfb_fb_root" <?php echo $checked3 ?> />
174
  </td>
@@ -176,7 +149,7 @@ class EmbFbAdmin{
176
  <tr>
177
  <td>
178
  <?php //echo wp_nonce_field('wpebfb','nonce'); ?>
179
- <input type="submit" name="submit" class="button button-primary button-hero" value="<?php _e('Save','wp-embed-fb') ?>" />
180
  </td>
181
  </tr>
182
  </tbody>
@@ -185,14 +158,14 @@ class EmbFbAdmin{
185
  <ul class="">
186
  <!--
187
  <li>
188
- <a href="http://www.saliuitl.org/wp-embed-fb/customize"><?php _e('Customize','wp-embed-fb') ?></a>
189
  </li>
190
  <li>
191
- <a href="http://www.saliuitl.org/wp-embed-fb/support"><?php _e('Support','wp-embed-fb') ?></a>
192
  </li>
193
  -->
194
  <li>
195
- <a href="http://www.saliuitl.org/en/wp-embed-facebook"><?php _e('Plugin Web Site','wp-embed-fb') ?></a>
196
  </li>
197
  </ul>
198
  </div>
@@ -200,9 +173,9 @@ class EmbFbAdmin{
200
  <p></p>
201
  </div>
202
  <div class="welcome-panel-column welcome-panel-last">
203
- <h3 style="color:red;"><?php _e('Donate!', 'wp-embed-fb') ?></h3>
204
- <p><?php _e('Help me keep this plugin up to date', 'wp-embed-fb') ?></p>
205
- <p><strong><?php _e('Click the taco !', 'wp-embed-fb') ?></strong></p>
206
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
207
  <input type="hidden" name="cmd" value="_s-xclick">
208
  <input type="hidden" name="hosted_button_id" value="9TEJ8CGXMJEDG">
@@ -211,19 +184,19 @@ class EmbFbAdmin{
211
  </form>
212
  <img src="<?php echo plugins_url('/img/paypal.png', __FILE__) ?>" width="50px" />
213
  <p>
214
- <h3 style="color:red;"><?php _e('Searching for the Premium version ?', 'wp-embed-fb') ?></h3>
215
  <ul>
216
  <li>
217
- <?php _e('Custom templates', 'wp-embed-fb') ?>
218
  </li>
219
  <li>
220
- <?php _e('Compatibility with all themes imaginable', 'wp-embed-fb') ?>
221
  </li>
222
  <li>
223
- <?php _e("Multiple fb app id's per each multisite site", 'wp-embed-fb') ?>
224
  </li>
225
  </ul>
226
- <h4 style="color:#01007E;"><?php _e('Comming Soon', 'wp-embed-fb') ?></h4>
227
  </p>
228
  <p style="text-align: center">
229
  <img src="<?php echo plugins_url('/img/hechoenmexico.png', __FILE__) ?>" width="80px" />
7
  static function savedata(){
8
  if(isset($_POST['wpemfb_app_secret'], $_POST['wpemfb_app_id' ] )) {
9
  if($_POST['wpemfb_app_id'] && $_POST['wpemfb_app_secret']){
10
+ update_option('wpemfb_app_id',$_POST['wpemfb_app_id']);
11
+ update_option('wpemfb_app_secret',$_POST['wpemfb_app_secret']);
 
 
 
 
 
 
12
  }
13
  if(isset($_POST['wpemfb_max_width'])){
14
  $prop = get_option('wpemfb_proportions') * $_POST['wpemfb_max_width'];
15
+ update_option('wpemfb_max_width', $_POST['wpemfb_max_width']);
16
+ update_option('wpemfb_height', $prop );
 
 
 
 
 
 
17
  }
18
  if(isset($_POST['wpemfb_theme'])){
19
+ update_option('wpemfb_theme', $_POST['wpemfb_theme']);
 
 
 
20
  }
21
  if(isset($_POST['wpemfb_show_like'])){
22
+ update_option('wpemfb_show_like', 'true');
 
 
 
23
  }else{
24
+ update_option('wpemfb_show_like', 'false');
 
 
 
 
 
25
  }
26
  if(isset($_POST['wpemfb_enqueue_style'])){
27
+ update_option('wpemfb_enqueue_style', 'true');
 
 
 
28
  }else{
29
+ update_option('wpemfb_enqueue_style', 'false');
 
 
 
 
 
30
  }
31
  if(isset($_POST['wpemfb_fb_root'])){
32
+ update_option('wpemfb_fb_root', 'true');
 
 
 
33
  }else{
34
+ update_option('wpemfb_fb_root', 'false');
 
 
 
 
 
35
  }
36
  if(isset($_POST['wpemfb_show_follow'])){
37
+ update_option('wpemfb_show_follow', 'true');
 
 
 
38
  }else{
39
+ update_option('wpemfb_show_follow', 'false');
40
+ }
41
+ if(isset($_POST['wpemfb_raw_video'])){
42
+ update_option('wpemfb_raw_video', 'true');
43
+ }else{
44
+ update_option('wpemfb_raw_video', 'false');
45
+ }
46
+ if(isset($_POST['wpemfb_raw_photo'])){
47
+ update_option('wpemfb_raw_photo', 'true');
48
+ }else{
49
+ update_option('wpemfb_raw_photo', 'false');
50
  }
51
  }
52
  }
53
  static function embedfb_page() {
54
+ if(isset($_POST['submit']) && check_admin_referer( 'wp-embed-facebook','save-data' )){
55
  self::savedata();
56
  }
 
57
  $checked = (get_option('wpemfb_enqueue_style') === 'true') ? 'checked' : '' ;
58
  $checked2 = (get_option('wpemfb_show_like') === 'true') ? 'checked' : '' ;
59
  $checked3 = (get_option('wpemfb_fb_root') === 'true') ? 'checked' : '' ;
60
  $checked4 = (get_option('wpemfb_show_follow') === 'true') ? 'checked' : '' ;
61
+ $checked5 = (get_option('wpemfb_raw_video') === 'true') ? 'checked' : '' ;
62
+ $checked6 = (get_option('wpemfb_raw_photo') === 'true') ? 'checked' : '' ;
63
  $sel1 = (get_option('wpemfb_theme') === 'default') ? 'selected' : '' ;
64
  $sel2 = (get_option('wpemfb_theme') === 'classic') ? 'selected' : '' ;
65
  ?>
71
  <div class="welcome-panel-column">
72
  <form id="config-form" action="#" method="post">
73
  <table class="form-table">
74
+ <?php wp_nonce_field( 'wp-embed-facebook','save-data' ); ?>
75
  <tbody>
76
  <tr>
77
+ <h3><?php _e('Facebook application data', 'wp-embed-facebook') ?></h3>
78
  </tr>
79
  <tr valign="middle">
80
  <th>App ID</th>
89
  </td>
90
  </tr>
91
  <tr>
92
+ <th><?php _e("Theme to use", 'wp-embed-facebook') ?></th>
93
  <td>
94
  <select name="wpemfb_theme">
95
  <option value="default" <?php echo $sel1 ?> >Default</option>
97
  </select>
98
  </td>
99
  </tr>
 
 
 
 
 
100
  <tr valign="middle">
101
+ <th><?php _e('Fb Cover Embed Width','wp-embed-facebook') ?></th>
102
  <td>
103
  <input type="text" name="wpemfb_max_width" value="<?php echo get_option('wpemfb_max_width') ?>" />
104
  </td>
105
  </tr>
106
+
107
+ <tr valign="middle">
108
+ <th><?php _e('Embed video as Post','wp-embed-facebook') ?></th>
109
+ <td>
110
+ <input type="checkbox" name="wpemfb_raw_video" <?php echo $checked5 ?> />
111
+ </td>
112
+ </tr>
113
+ <tr valign="middle">
114
+ <th><?php _e('Embed photo as Post','wp-embed-facebook') ?></th>
115
+ <td>
116
+ <input type="checkbox" name="wpemfb_raw_photo" <?php echo $checked6 ?> />
117
+ </td>
118
+ </tr>
119
  <tr valign="middle">
120
+ <th><?php _e('Add like button to embedded pages','wp-embed-facebook') ?></th>
121
  <td>
122
  <input type="checkbox" name="wpemfb_show_like" <?php echo $checked2 ?> />
123
  </td>
124
  </tr>
125
  <tr valign="middle">
126
+ <th><?php _e('Show follow button','wp-embed-facebook') ?></th>
127
  <td>
128
  <input type="checkbox" name="wpemfb_show_follow" <?php echo $checked4 ?> />
129
  </td>
130
  </tr>
131
+
132
  <tr>
133
  <th>
134
+ <h4><?php _e("Advanced Options", 'wp-embed-facebook') ?></h4>
135
  </th>
136
  </tr>
137
  <tr valign="middle">
138
+ <th><?php _e('Enqueue Styles','wp-embed-facebook') ?></th>
139
  <td>
140
  <input type="checkbox" name="wpemfb_enqueue_style" <?php echo $checked ?> />
141
  </td>
142
  </tr>
143
  <tr valign="middle">
144
+ <th><?php _e('Add fb-root and js on top of content','wp-embed-facebook') ?><br><small><?php _e('Some themes may not need this','wp-embed-facebook') ?></small></th>
145
  <td>
146
  <input type="checkbox" name="wpemfb_fb_root" <?php echo $checked3 ?> />
147
  </td>
149
  <tr>
150
  <td>
151
  <?php //echo wp_nonce_field('wpebfb','nonce'); ?>
152
+ <input type="submit" name="submit" class="button button-primary button-hero" value="<?php _e('Save','wp-embed-facebook') ?>" />
153
  </td>
154
  </tr>
155
  </tbody>
158
  <ul class="">
159
  <!--
160
  <li>
161
+ <a href="http://www.saliuitl.org/wp-embed-fb/customize"><?php _e('Customize','wp-embed-facebook') ?></a>
162
  </li>
163
  <li>
164
+ <a href="http://www.saliuitl.org/wp-embed-fb/support"><?php _e('Support','wp-embed-facebook') ?></a>
165
  </li>
166
  -->
167
  <li>
168
+ <a href="http://www.saliuitl.org/en/wp-embed-facebook"><?php _e('Plugin Web Site','wp-embed-facebook') ?></a>
169
  </li>
170
  </ul>
171
  </div>
173
  <p></p>
174
  </div>
175
  <div class="welcome-panel-column welcome-panel-last">
176
+ <h3 style="color:red;"><?php _e('Donate!', 'wp-embed-facebook') ?></h3>
177
+ <p><?php _e('Help me keep this plugin up to date', 'wp-embed-facebook') ?></p>
178
+ <p><strong><?php _e('Click the taco !', 'wp-embed-facebook') ?></strong></p>
179
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
180
  <input type="hidden" name="cmd" value="_s-xclick">
181
  <input type="hidden" name="hosted_button_id" value="9TEJ8CGXMJEDG">
184
  </form>
185
  <img src="<?php echo plugins_url('/img/paypal.png', __FILE__) ?>" width="50px" />
186
  <p>
187
+ <h3 style="color:red;"><?php _e('Searching for the Premium version ?', 'wp-embed-facebook') ?></h3>
188
  <ul>
189
  <li>
190
+ <?php _e('Custom templates', 'wp-embed-facebook') ?>
191
  </li>
192
  <li>
193
+ <?php _e('Compatibility with all themes imaginable', 'wp-embed-facebook') ?>
194
  </li>
195
  <li>
196
+ <?php _e("Multiple fb app id's per each multisite site", 'wp-embed-facebook') ?>
197
  </li>
198
  </ul>
199
+ <h4 style="color:#01007E;"><?php _e('Comming Soon', 'wp-embed-facebook') ?></h4>
200
  </p>
201
  <p style="text-align: center">
202
  <img src="<?php echo plugins_url('/img/hechoenmexico.png', __FILE__) ?>" width="80px" />
lib/core.php CHANGED
@@ -7,6 +7,7 @@ class WP_Embed_FB {
7
  static $width = '';
8
  static $height = '';
9
  static $theme = '';
 
10
  /*
11
  * Save default values to data base
12
  */
@@ -46,7 +47,7 @@ class WP_Embed_FB {
46
  */
47
  static function getdefaults(){
48
  return array(
49
- 'wpemfb_max_width' => '450',
50
  'wpemfb_enqueue_style' => 'true',
51
  'wpemfb_app_id' => '0',
52
  'wpemfb_app_secret' => '0',
@@ -56,13 +57,15 @@ class WP_Embed_FB {
56
  'wpemfb_fb_root' => 'true',
57
  'wpemfb_theme' => 'default',
58
  'wpemfb_show_follow' => 'true',
 
 
59
  );
60
  }
61
  /*
62
  * load translations and facebook sdk
63
  */
64
  static function init(){
65
- load_plugin_textdomain( 'wp-embed-fb', '', WPEMFBLIB.'/lang' );
66
  FaceInit::init();
67
  }
68
  /*
@@ -71,7 +74,17 @@ class WP_Embed_FB {
71
  static function wp_enqueue_scripts(){
72
  $theme = get_option('wpemfb_theme');
73
  wp_register_style( 'wpemfb-style', plugins_url('/wp-embed-facebook/templates/'.$theme.'/wpemfb.css'));
74
- wp_enqueue_style( 'wpemfb-style' );
 
 
 
 
 
 
 
 
 
 
75
  }
76
  /*
77
  * the_content filter to process fb url's
@@ -93,40 +106,78 @@ class WP_Embed_FB {
93
  * @param array $match[2]=
94
  */
95
  static function fb_embed($match){ //TODO: photos!
96
- $url = explode('?', $match[2]);
97
- $clean = explode('/', $url[0]);
98
- $end = end($clean);
99
- if(empty($end)){
100
- array_pop($clean);
101
- }
102
- $fb_id = end($clean);
103
- if( $key = array_search('posts',$clean) !== false ){
104
- $user = $clean[$key -1]; //this may not be necesary in the future
105
- $post = $clean[$key +1];
106
- $fb_data = array( 'user' => $user ,'is_post' => $post );
107
- return self::print_fb_data($fb_data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
109
- /* For albums, next's week update.
110
- if( $key = array_search('media',$clean) !== false ){
111
- $user = $clean[$key -1]; //this may not be necesary in the future
112
- $post = $clean[$key +1];
113
- $fb_data = array( 'user' => $user ,'is_post' => $post );
114
- return self::print_fb_data($fb_data);
 
 
 
 
 
 
 
 
 
115
  }
116
- */
117
- if( ('photo.php' == trim($fb_id)) || ( array_search('photos',$clean) !== false ) ){ //for videos and some photos
118
- $fb_data = array( 'link' => $match[2],'is_post' => '' );
119
- return self::print_fb_data($fb_data);
120
- }
121
- return self::fb_api_get($fb_id, $match[2]);
122
  }
123
  /*
124
  * get data from fb using $fbsdk->api('/'.$fb_id) :)
125
  */
126
- static function fb_api_get($fb_id, $url){
127
  $wp_emb_fbsdk = self::$fbsdk;
128
  try {
129
- $fb_data = $wp_emb_fbsdk->api('/'.$fb_id);
 
 
 
130
  //$res = '<pre>'.print_r($fb_data,true).'</pre>'; //to inspect what elements are queried by default
131
  $res = self::print_fb_data($fb_data);
132
  } catch(FacebookApiException $e) {
@@ -134,7 +185,7 @@ class WP_Embed_FB {
134
  //uncoment this lines to debug
135
  /*
136
  if(is_super_admin()){
137
- $res .= '<span style="color: red">'.__('This facebook link is not public', 'wp-embed-fb').'</span></p>';
138
  $res .= print_r($e->getResult(),true);
139
  $res .= 'fb_id'.$fb_id;
140
  }
@@ -154,11 +205,18 @@ class WP_Embed_FB {
154
  $height = self::$height;
155
  }
156
  $prop = get_option('wpemfb_proportions');
157
- if(isset($fb_data['start_time'])) { //is event
 
 
 
 
 
158
  $template = self::locate_template('event');
159
- //} elseif(isset($fb_data['source'])) { //is photo Deprecated by facebook
160
- //$template = self::locate_template('photo');
161
- } elseif(isset($fb_data['category'])) { //is a page
 
 
162
  if(isset($fb_data['is_community_page']) && $fb_data['is_community_page'] == "1" ){
163
  $template = self::locate_template('com-page'); //is community page
164
  }else {
@@ -177,17 +235,16 @@ class WP_Embed_FB {
177
  */
178
  $template = apply_filters('wpemfb_category_template', $default, $fb_data['category']);
179
  }
180
- } elseif(isset($fb_data['is_post'])) {
181
- $template = self::locate_template('posts');
182
- }else { //is profile
183
  $template = self::locate_template('profile');
184
  }
185
  ob_start();
186
  include($template);
187
  return ob_get_clean();
188
  }
189
- /*
190
- * locate the proper template to show the embed
 
191
  */
192
  static function locate_template($template_name){
193
  $theme = get_option('wpemfb_theme');
@@ -206,7 +263,7 @@ class WP_Embed_FB {
206
  $url = explode(' ',$urls);
207
  $clean = explode('?', $url[0]);
208
  $cleaner = str_replace(array('http://', 'https://'), array('',''), $clean[0]);
209
- $ret = '<a href="http://'.$cleaner.'" title="'.__('Web Site', 'wp-embed-fb').'" target="_blank">'.__('Web Site','wp-embed-fb').'</a>';
210
  return $ret;
211
  }
212
  /*
@@ -245,10 +302,10 @@ class WP_Embed_FB {
245
  }
246
  /**
247
  * Shows a like button or a facebook like count of a page depending on settings
248
- * @param facebook id
249
- * @param show likes count
250
- * @param show share button
251
- * @param show faces
252
  */
253
  static function like_btn($fb_id,$likes=null,$share=false,$faces=false){
254
  $opt = get_option('wpemfb_show_like');
@@ -260,7 +317,7 @@ class WP_Embed_FB {
260
  ob_end_flush();
261
  return;
262
  else :
263
- printf( __( '%d people like this.', 'wp-embed-fb' ), $likes );
264
  return;
265
  endif;
266
  }
@@ -282,7 +339,7 @@ class WP_Embed_FB {
282
  /**
283
  * Shotcode function
284
  * [facebook='url' width='600'] width is optional
285
- * @param array [0]=>url ['width']=>embed width
286
  */
287
  static function shortcode($atts){
288
  if(!empty($atts) && isset($atts[0])){
@@ -292,23 +349,17 @@ class WP_Embed_FB {
292
  self::$width = $atts['width'];
293
  self::$height = $prop * $atts['width'];
294
  }
 
 
 
295
  $embed = self::the_content($url);
296
  self::$height = '';
297
  self::$width = '';
298
- self::$theme = '';
299
  return $embed;
300
  }
301
  return;
302
  }
303
- static function shortcode_atts($atts){
304
- if(isset($atts['width'])){
305
- $width = $atts['width'];
306
- $prop = get_option('wpemfb_proportions');
307
- $height = $width * $prop;
308
- }
309
- if(isset($atts['theme']))
310
- $temp = $atts['theme'];
311
- }
312
  }
313
  /*
314
  * Trigering the FaceInit::init(); will give you access to the fb php sdk on FaceInit::$fbsdk which you can use to make any call shown here
7
  static $width = '';
8
  static $height = '';
9
  static $theme = '';
10
+ static $raw = '';
11
  /*
12
  * Save default values to data base
13
  */
47
  */
48
  static function getdefaults(){
49
  return array(
50
+ 'wpemfb_max_width' => '600',
51
  'wpemfb_enqueue_style' => 'true',
52
  'wpemfb_app_id' => '0',
53
  'wpemfb_app_secret' => '0',
57
  'wpemfb_fb_root' => 'true',
58
  'wpemfb_theme' => 'default',
59
  'wpemfb_show_follow' => 'true',
60
+ 'wpemfb_raw_video' => 'true',
61
+ 'wpemfb_raw_photo' => 'false',
62
  );
63
  }
64
  /*
65
  * load translations and facebook sdk
66
  */
67
  static function init(){
68
+ load_plugin_textdomain( 'wp-embed-facebook', false, WPEMFBDIRFULL . '/lang' );
69
  FaceInit::init();
70
  }
71
  /*
74
  static function wp_enqueue_scripts(){
75
  $theme = get_option('wpemfb_theme');
76
  wp_register_style( 'wpemfb-style', plugins_url('/wp-embed-facebook/templates/'.$theme.'/wpemfb.css'));
77
+ wp_register_style( 'wpemfb-lightbox', plugins_url('/wp-embed-facebook/lib/lightbox2/css/lightbox.css'));
78
+ if(get_option('wpemfb_enqueue_style') == 'true'){
79
+ wp_enqueue_style('wpemfb-style');
80
+ wp_enqueue_style('wpemfb-lightbox');
81
+ }
82
+
83
+ wp_enqueue_script(
84
+ 'wpemfb-lightbox',
85
+ plugins_url('/wp-embed-facebook/lib/lightbox2/js/lightbox.min.js'),
86
+ array( 'jquery' )
87
+ );
88
  }
89
  /*
90
  * the_content filter to process fb url's
106
  * @param array $match[2]=
107
  */
108
  static function fb_embed($match){ //TODO: photos!
109
+
110
+ //extract fbid from url good for profiles, pages, comunity pages, raw photos, events
111
+ $vars = array();
112
+ $type = '';
113
+ parse_str(parse_url($match[2], PHP_URL_QUERY), $vars);
114
+
115
+ $url = explode('?', $match[2]);
116
+ $clean = explode('/', $url[0]);
117
+ $end = end($clean);
118
+ if(empty($end)){
119
+ array_pop($clean);
120
+ }
121
+ $last = end($clean);
122
+ $fb_id = $last;
123
+ //old embed ulr's
124
+ if( isset($vars['fbid']) )
125
+ $fb_id = $vars['fbid'];
126
+
127
+ //its an album
128
+ if( array_search('media',$clean) !== false || isset($vars['set']) || $last == 'album.php' ){
129
+ $type = 'album';
130
+ if ($last !== 'album.php') {
131
+ $ids = explode('.', $vars['set']);
132
+ $fb_id = $ids[1];
133
+ }
134
+ }
135
+
136
+ //its a post
137
+ if( array_search('posts',$clean) !== false ){
138
+ $fb_data = array( 'link' => $match[2],'is_post' => '' );
139
+ return self::print_fb_data($fb_data);
140
+ }
141
+
142
+ //photos and videos
143
+ if( 'photo.php' == $last || ( array_search('photos',$clean) !== false ) ){
144
+ if(!empty(self::$raw)){
145
+ $raw_photo = self::$raw;
146
+ $raw_video = self::$raw;
147
+ } else {
148
+ $raw_photo = get_option('wpemfb_raw_photo') == 'true' ? 'false' : 'true';
149
+ $raw_video = get_option('wpemfb_raw_video') == 'true' ? 'false' : 'true';
150
  }
151
+ if(isset($vars['v'])){ //is video
152
+ if($raw_video == 'true'){
153
+ $fb_data = array( 'v_id' => $vars['v'], 'is_video' => '' );
154
+ return self::print_fb_data($fb_data);
155
+ } else {
156
+ $fb_data = array( 'link' => $match[2],'is_post' => '' );
157
+ return self::print_fb_data($fb_data);
158
+ }
159
+ } else { //is photo
160
+ if($raw_photo == 'true'){
161
+ return self::fb_api_get($fb_id, $match[2]);
162
+ } else {
163
+ $fb_data = array( 'link' => $match[2],'is_post' => '' );
164
+ return self::print_fb_data($fb_data);
165
+ }
166
  }
167
+ }
168
+
169
+ return self::fb_api_get($fb_id, $match[2], $type);
 
 
 
170
  }
171
  /*
172
  * get data from fb using $fbsdk->api('/'.$fb_id) :)
173
  */
174
+ static function fb_api_get($fb_id, $url, $type){
175
  $wp_emb_fbsdk = self::$fbsdk;
176
  try {
177
+ if(empty($type))
178
+ $fb_data = $wp_emb_fbsdk->api('/'.$fb_id);
179
+ elseif($type == 'album')
180
+ $fb_data = $wp_emb_fbsdk->api('/'.$fb_id.'?fields=name,id,from,photos.fields(name,picture,source)');
181
  //$res = '<pre>'.print_r($fb_data,true).'</pre>'; //to inspect what elements are queried by default
182
  $res = self::print_fb_data($fb_data);
183
  } catch(FacebookApiException $e) {
185
  //uncoment this lines to debug
186
  /*
187
  if(is_super_admin()){
188
+ $res .= '<span style="color: red">'.__('This facebook link is not public', 'wp-embed-facebook').'</span></p>';
189
  $res .= print_r($e->getResult(),true);
190
  $res .= 'fb_id'.$fb_id;
191
  }
205
  $height = self::$height;
206
  }
207
  $prop = get_option('wpemfb_proportions');
208
+
209
+ if(isset($fb_data['is_video'])) { //is raw video
210
+ $template = self::locate_template('video');
211
+ } elseif(isset($fb_data['is_post'])) { //is post
212
+ $template = self::locate_template('posts');
213
+ } elseif(isset($fb_data['start_time'])) { //is event
214
  $template = self::locate_template('event');
215
+ } elseif(isset($fb_data['photos'])) { //is album
216
+ $template = self::locate_template('album');
217
+ } elseif(isset($fb_data['width'])) { //is raw photo
218
+ $template = self::locate_template('photo');
219
+ } elseif(isset($fb_data['category'])) { //is page
220
  if(isset($fb_data['is_community_page']) && $fb_data['is_community_page'] == "1" ){
221
  $template = self::locate_template('com-page'); //is community page
222
  }else {
235
  */
236
  $template = apply_filters('wpemfb_category_template', $default, $fb_data['category']);
237
  }
238
+ } else { //is profile
 
 
239
  $template = self::locate_template('profile');
240
  }
241
  ob_start();
242
  include($template);
243
  return ob_get_clean();
244
  }
245
+ /**
246
+ * Locate the template inside plugin or theme
247
+ * @param string Template Name album,profile...
248
  */
249
  static function locate_template($template_name){
250
  $theme = get_option('wpemfb_theme');
263
  $url = explode(' ',$urls);
264
  $clean = explode('?', $url[0]);
265
  $cleaner = str_replace(array('http://', 'https://'), array('',''), $clean[0]);
266
+ $ret = '<a href="http://'.$cleaner.'" title="'.__('Web Site', 'wp-embed-facebook').'" target="_blank">'.__('Web Site','wp-embed-facebook').'</a>';
267
  return $ret;
268
  }
269
  /*
302
  }
303
  /**
304
  * Shows a like button or a facebook like count of a page depending on settings
305
+ * @param int facebook id
306
+ * @param int show likes count
307
+ * @param bool show share button
308
+ * @param bool show faces
309
  */
310
  static function like_btn($fb_id,$likes=null,$share=false,$faces=false){
311
  $opt = get_option('wpemfb_show_like');
317
  ob_end_flush();
318
  return;
319
  else :
320
+ printf( __( '%d people like this.', 'wp-embed-facebook' ), $likes );
321
  return;
322
  endif;
323
  }
339
  /**
340
  * Shotcode function
341
  * [facebook='url' width='600'] width is optional
342
+ * @param array [0]=>url ['width']=>embed width ['raw']=>for videos and photos
343
  */
344
  static function shortcode($atts){
345
  if(!empty($atts) && isset($atts[0])){
349
  self::$width = $atts['width'];
350
  self::$height = $prop * $atts['width'];
351
  }
352
+ if(isset($atts['raw'])){
353
+ self::$raw = $atts['raw'];
354
+ }
355
  $embed = self::the_content($url);
356
  self::$height = '';
357
  self::$width = '';
358
+ self::$raw = '';
359
  return $embed;
360
  }
361
  return;
362
  }
 
 
 
 
 
 
 
 
 
363
  }
364
  /*
365
  * Trigering the FaceInit::init(); will give you access to the fb php sdk on FaceInit::$fbsdk which you can use to make any call shown here
lib/lightbox2/css/lightbox.css ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Preload images */
2
+ body:after {
3
+ content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png);
4
+ display: none;
5
+ }
6
+
7
+ .lightboxOverlay {
8
+ position: absolute;
9
+ top: 0;
10
+ left: 0;
11
+ z-index: 9999;
12
+ background-color: black;
13
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
14
+ opacity: 0.8;
15
+ display: none;
16
+ }
17
+
18
+ .lightbox {
19
+ position: absolute;
20
+ left: 0;
21
+ width: 100%;
22
+ z-index: 10000;
23
+ text-align: center;
24
+ line-height: 0;
25
+ font-weight: normal;
26
+ }
27
+
28
+ .lightbox .lb-image {
29
+ display: block;
30
+ height: auto;
31
+ max-width: inherit;
32
+ -webkit-border-radius: 3px;
33
+ -moz-border-radius: 3px;
34
+ -ms-border-radius: 3px;
35
+ -o-border-radius: 3px;
36
+ border-radius: 3px;
37
+ }
38
+
39
+ .lightbox a img {
40
+ border: none;
41
+ }
42
+
43
+ .lb-outerContainer {
44
+ position: relative;
45
+ background-color: white;
46
+ *zoom: 1;
47
+ width: 250px;
48
+ height: 250px;
49
+ margin: 0 auto;
50
+ -webkit-border-radius: 4px;
51
+ -moz-border-radius: 4px;
52
+ -ms-border-radius: 4px;
53
+ -o-border-radius: 4px;
54
+ border-radius: 4px;
55
+ }
56
+
57
+ .lb-outerContainer:after {
58
+ content: "";
59
+ display: table;
60
+ clear: both;
61
+ }
62
+
63
+ .lb-container {
64
+ padding: 4px;
65
+ }
66
+
67
+ .lb-loader {
68
+ position: absolute;
69
+ top: 43%;
70
+ left: 0;
71
+ height: 25%;
72
+ width: 100%;
73
+ text-align: center;
74
+ line-height: 0;
75
+ }
76
+
77
+ .lb-cancel {
78
+ display: block;
79
+ width: 32px;
80
+ height: 32px;
81
+ margin: 0 auto;
82
+ background: url(../img/loading.gif) no-repeat;
83
+ }
84
+
85
+ .lb-nav {
86
+ position: absolute;
87
+ top: 0;
88
+ left: 0;
89
+ height: 100%;
90
+ width: 100%;
91
+ z-index: 10;
92
+ }
93
+
94
+ .lb-container > .nav {
95
+ left: 0;
96
+ }
97
+
98
+ .lb-nav a {
99
+ outline: none;
100
+ background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
101
+ }
102
+
103
+ .lb-prev, .lb-next {
104
+ height: 100%;
105
+ cursor: pointer;
106
+ display: block;
107
+ }
108
+
109
+ .lb-nav a.lb-prev {
110
+ width: 34%;
111
+ left: 0;
112
+ float: left;
113
+ background: url(../img/prev.png) left 48% no-repeat;
114
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
115
+ opacity: 0;
116
+ -webkit-transition: opacity 0.6s;
117
+ -moz-transition: opacity 0.6s;
118
+ -o-transition: opacity 0.6s;
119
+ transition: opacity 0.6s;
120
+ }
121
+
122
+ .lb-nav a.lb-prev:hover {
123
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
124
+ opacity: 1;
125
+ }
126
+
127
+ .lb-nav a.lb-next {
128
+ width: 64%;
129
+ right: 0;
130
+ float: right;
131
+ background: url(../img/next.png) right 48% no-repeat;
132
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
133
+ opacity: 0;
134
+ -webkit-transition: opacity 0.6s;
135
+ -moz-transition: opacity 0.6s;
136
+ -o-transition: opacity 0.6s;
137
+ transition: opacity 0.6s;
138
+ }
139
+
140
+ .lb-nav a.lb-next:hover {
141
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
142
+ opacity: 1;
143
+ }
144
+
145
+ .lb-dataContainer {
146
+ margin: 0 auto;
147
+ padding-top: 5px;
148
+ *zoom: 1;
149
+ width: 100%;
150
+ -moz-border-radius-bottomleft: 4px;
151
+ -webkit-border-bottom-left-radius: 4px;
152
+ border-bottom-left-radius: 4px;
153
+ -moz-border-radius-bottomright: 4px;
154
+ -webkit-border-bottom-right-radius: 4px;
155
+ border-bottom-right-radius: 4px;
156
+ }
157
+
158
+ .lb-dataContainer:after {
159
+ content: "";
160
+ display: table;
161
+ clear: both;
162
+ }
163
+
164
+ .lb-data {
165
+ padding: 0 4px;
166
+ color: #ccc;
167
+ }
168
+
169
+ .lb-data .lb-details {
170
+ width: 85%;
171
+ float: left;
172
+ text-align: left;
173
+ line-height: 1.1em;
174
+ }
175
+
176
+ .lb-data .lb-caption {
177
+ font-size: 13px;
178
+ font-weight: bold;
179
+ line-height: 1em;
180
+ }
181
+
182
+ .lb-data .lb-number {
183
+ display: block;
184
+ clear: left;
185
+ padding-bottom: 1em;
186
+ font-size: 12px;
187
+ color: #999999;
188
+ }
189
+
190
+ .lb-data .lb-close {
191
+ display: block;
192
+ float: right;
193
+ width: 30px;
194
+ height: 30px;
195
+ background: url(../img/close.png) top right no-repeat;
196
+ text-align: right;
197
+ outline: none;
198
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
199
+ opacity: 0.7;
200
+ -webkit-transition: opacity 0.2s;
201
+ -moz-transition: opacity 0.2s;
202
+ -o-transition: opacity 0.2s;
203
+ transition: opacity 0.2s;
204
+ }
205
+
206
+ .lb-data .lb-close:hover {
207
+ cursor: pointer;
208
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
209
+ opacity: 1;
210
+ }
lib/lightbox2/img/close.png ADDED
Binary file
lib/lightbox2/img/loading.gif ADDED
Binary file
lib/lightbox2/img/next.png ADDED
Binary file
lib/lightbox2/img/prev.png ADDED
Binary file
lib/lightbox2/js/lightbox.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Lightbox v2.7.1
3
+ * by Lokesh Dhakar - http://lokeshdhakar.com/projects/lightbox2/
4
+ *
5
+ * @license http://creativecommons.org/licenses/by/2.5/
6
+ * - Free for use in both personal and commercial projects
7
+ * - Attribution requires leaving author name, author link, and the license info intact
8
+ */
9
+ (function(){var a=jQuery,b=function(){function a(){this.fadeDuration=500,this.fitImagesInViewport=!0,this.resizeDuration=700,this.positionFromTop=50,this.showImageNumberLabel=!0,this.alwaysShowNavOnTouchDevices=!1,this.wrapAround=!1}return a.prototype.albumLabel=function(a,b){return"Image "+a+" of "+b},a}(),c=function(){function b(a){this.options=a,this.album=[],this.currentImageIndex=void 0,this.init()}return b.prototype.init=function(){this.enable(),this.build()},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){var b=this;a("<div id='lightboxOverlay' class='lightboxOverlay'></div><div id='lightbox' class='lightbox'><div class='lb-outerContainer'><div class='lb-container'><img class='lb-image' src='' /><div class='lb-nav'><a class='lb-prev' href='' ></a><a class='lb-next' href='' ></a></div><div class='lb-loader'><a class='lb-cancel'></a></div></div></div><div class='lb-dataContainer'><div class='lb-data'><div class='lb-details'><span class='lb-caption'></span><span class='lb-number'></span></div><div class='lb-closeContainer'><a class='lb-close'></a></div></div></div></div>").appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return b.changeImage(0===b.currentImageIndex?b.album.length-1:b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.changeImage(b.currentImageIndex===b.album.length-1?0:b.currentImageIndex+1),!1}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})},b.prototype.start=function(b){function c(a){d.album.push({link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),a("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;i<f.length;i=++i)c(a(f[i])),f[i]===b[0]&&(g=i)}else if("lightbox"===b.attr("rel"))c(b);else{f=a(b.prop("tagName")+'[rel="'+b.attr("rel")+'"]');for(var j=0;j<f.length;j=++j)c(a(f[j])),f[j]===b[0]&&(g=j)}var k=e.scrollTop()+this.options.positionFromTop,l=e.scrollLeft();this.$lightbox.css({top:k+"px",left:l+"px"}).fadeIn(this.options.fadeDuration),this.changeImage(g)},b.prototype.changeImage=function(b){var c=this;this.disableKeyboardNav();var d=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),a(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var e=new Image;e.onload=function(){var f,g,h,i,j,k,l;d.attr("src",c.album[b].link),f=a(e),d.width(e.width),d.height(e.height),c.options.fitImagesInViewport&&(l=a(window).width(),k=a(window).height(),j=l-c.containerLeftPadding-c.containerRightPadding-20,i=k-c.containerTopPadding-c.containerBottomPadding-120,(e.width>j||e.height>i)&&(e.width/j>e.height/i?(h=j,g=parseInt(e.height/(e.width/h),10),d.width(h),d.height(g)):(g=i,h=parseInt(e.width/(e.height/g),10),d.width(h),d.height(g)))),c.sizeContainer(d.width(),d.height())},e.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){this.$overlay.width(a(window).width()).height(a(document).height())},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerLeftPadding+this.containerRightPadding,h=b+this.containerTopPadding+this.containerBottomPadding;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(b){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),a&&this.$lightbox.find(".lb-next").css("opacity","1"))))},b.prototype.updateDetails=function(){var b=this;"undefined"!=typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",function(){location.href=a(this).attr("href")}),this.album.length>1&&this.options.showImageNumberLabel?this.$lightbox.find(".lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".lb-number").hide(),this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===f||e===d)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"})},b}();a(function(){{var a=new b;new c(a)}})}).call(this);
10
+ //# sourceMappingURL=lightbox.min.map
readme.txt CHANGED
@@ -1,27 +1,28 @@
1
  === WP Embed Facebook ===
2
  Contributors: poxtron
3
- Donate link: http://www.wpembedfb.com/donate
4
- Tags: facebook, embed, opengraph, fbsdk, facebook events, facebook pages, facebook profiles, facebook videos, facebook posts,
5
- Requires at least: 3.0
6
  Tested up to: 3.8.1
7
- Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Embed a Facebook page, post, event, photo or profile to any Wordpress post or page.
12
 
13
  == Description ==
14
 
15
- With this plugin you can embed any public facebook page, post, profile, photo or event directly into a wordpress post, without having to write a single line of code. Simply put the facebook url on a separate line on the content of any post, and this plugin will try to fetch data associated with that url and display it on publishing, if the data is not public, like “invite only” events or private profiles, it'll return a link.
16
 
17
  = Supported Embeds =
18
- * Profiles
19
- * Community pages
20
- * Fan pages
21
- * Videos
22
- * Events
23
- * Posts
24
- * Photos
 
25
 
26
  = Requirements =
27
  * Facebook App id and Secret
@@ -29,24 +30,24 @@ With this plugin you can embed any public facebook page, post, profile, photo or
29
  = How to use it =
30
  Put on a single and separate line the Facebook URL.
31
  Or you can use a shortcode
32
- `[facebook=url width=200]`
33
- width is optional
34
 
35
  = Options =
36
  In Settings > Embed Facebook.
37
  * Change embed width
38
  * Show like buttons on embedded Facebook pages and photos
 
39
  * Remove plugin styles
40
  * Change Theme
41
  * Add fb-root
42
 
43
- **[Demo](http://www.wpembedfb.com)**
44
 
45
  * The information that shown on your post, is from facebook directly, no images or data are stored on your server.
46
 
47
- = On the next version : =
48
- * Page Albums
49
- * Responsive theme
50
 
51
  == Installation ==
52
 
@@ -57,17 +58,21 @@ In Settings > Embed Facebook.
57
  1. Copy on a single line any facebook url.
58
  1. Enjoy and tell someone !
59
 
60
- == Customisation ==
61
 
62
  1. Copy the contents of `wp-embed-facebook/templates/default/` to `your-theme/plugins/wp-embed-facebook`
63
  1. Untick "Enqueue Styles" option to use your own css.
64
  1. Access all facebook data retrieved from the url using `print_r($fb_data)` on any template file.
65
  1. Use WP_Embed_FB::like_btn($fb_id,$likes=null,$share=false,$faces=false) to personalize like button.
66
- 1. Use WP_Embed_FB::follow_btn($fb_id); to display de follow button
67
  1. Click the taco ! ;)
68
 
69
  == Changelog ==
70
 
 
 
 
 
 
71
  = 1.4 =
72
  * Support for Video url's
73
  * Support for filter 'wpemfb_category_template'
@@ -76,7 +81,7 @@ In Settings > Embed Facebook.
76
  * New webstie www.wpembedfb.com !
77
 
78
  = 1.3.1 =
79
- * Documentation and demo.
80
 
81
  = 1.3 =
82
  * Shortcode [facebook=url width=600] width is optional
1
  === WP Embed Facebook ===
2
  Contributors: poxtron
3
+ Donate link: http://www.saliuitl.org/en/wp-embed-facebook/donate
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: 3.8.1
7
+ Stable tag: 1.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Embed a Facebook video, page, event, album, photo, profile or post to any Wordpress post or page.
12
 
13
  == Description ==
14
 
15
+ With this plugin you can embed any public facebook video, page, post, profile, photo or event directly into a wordpress post, without having to write a single line of code. Simply put the facebook url on a separate line on the content of any post, and this plugin will try to fetch data associated with that url and display it on publishing, if the data is not public, like “invite only” events or private profiles, it'll return a link.
16
 
17
  = Supported Embeds =
18
+ * Facebook Videos
19
+ * Facebook Albums
20
+ * Facebook Events
21
+ * Facebook Fotos
22
+ * Facebook Fan pages
23
+ * Facebook Community pages
24
+ * Facebook Profiles
25
+ * Facebook Publications
26
 
27
  = Requirements =
28
  * Facebook App id and Secret
30
  = How to use it =
31
  Put on a single and separate line the Facebook URL.
32
  Or you can use a shortcode
33
+ `[facebook=url width=200 raw=true]`
34
+ width and raw are optional, raw only works for videos and photos
35
 
36
  = Options =
37
  In Settings > Embed Facebook.
38
  * Change embed width
39
  * Show like buttons on embedded Facebook pages and photos
40
+ * Show Follow Button
41
  * Remove plugin styles
42
  * Change Theme
43
  * Add fb-root
44
 
45
+ **[Demo](http://www.saliuitl.org/en/wp-embed-facebook)**
46
 
47
  * The information that shown on your post, is from facebook directly, no images or data are stored on your server.
48
 
49
+ = On the next version =
50
+ * Better Responsiveness
 
51
 
52
  == Installation ==
53
 
58
  1. Copy on a single line any facebook url.
59
  1. Enjoy and tell someone !
60
 
61
+ == Customization ==
62
 
63
  1. Copy the contents of `wp-embed-facebook/templates/default/` to `your-theme/plugins/wp-embed-facebook`
64
  1. Untick "Enqueue Styles" option to use your own css.
65
  1. Access all facebook data retrieved from the url using `print_r($fb_data)` on any template file.
66
  1. Use WP_Embed_FB::like_btn($fb_id,$likes=null,$share=false,$faces=false) to personalize like button.
 
67
  1. Click the taco ! ;)
68
 
69
  == Changelog ==
70
 
71
+ = 1.5 =
72
+ * Support for raw videos and photos
73
+ * Support for albums
74
+ * Spanish translations
75
+
76
  = 1.4 =
77
  * Support for Video url's
78
  * Support for filter 'wpemfb_category_template'
81
  * New webstie www.wpembedfb.com !
82
 
83
  = 1.3.1 =
84
+ * Documentation and screenshots.
85
 
86
  = 1.3 =
87
  * Shortcode [facebook=url width=600] width is optional
templates/classic/album.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ?>
7
+ <div class="wpemfb-container" >
8
+ <div style="max-width: <?php echo $width ?>px;">
9
+ <div class="wpemfb-info">
10
+ <div class="wpemfb-pic">
11
+ <img src="http://graph.facebook.com/<?php echo $fb_data['from']['id'] ?>/picture" />
12
+ </div>
13
+ <div class="wpemfb-desc">
14
+ <h4 class="wpemfb-title" >
15
+ <a href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
16
+ <?php echo $fb_data['from']['name'] ?>
17
+ </a>
18
+ </h4>
19
+ <?php if(isset($fb_data['from']['category'])) : ?>
20
+ <?php echo $fb_data['from']['category'].'<br>' ?>
21
+ <?php endif; ?>
22
+ <a href="https://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow"><?php echo $fb_data['name'] ?></a>
23
+ </div>
24
+ </div>
25
+ <p style="text-align: center">
26
+ <?php
27
+ foreach ($fb_data['photos']['data'] as $pic) {
28
+ ?>
29
+ <a class="wpemfb-link" href="<?php echo $pic['source'] ?>" data-lightbox="roadtrip" data-title="<?php echo $pic['name'] ?>" >
30
+ <img class="wpemfb-thmb" src="<?php echo $pic['picture'] ?>" />
31
+ </a>
32
+ <?php
33
+ }
34
+ ?>
35
+ </p>
36
+ </div>
37
+ </div>
templates/classic/event.php CHANGED
@@ -30,7 +30,7 @@
30
  echo $fb_data['location'];
31
  } ?>
32
  <br>
33
- <?php echo __('Creator: ', 'wp-embed-fb').'<a href="http://www.facebook.com/'.$fb_data['owner']['id'].'" target="_blank">'.$fb_data['owner']['name'].'</a>' ?>
34
  </div>
35
  </div>
36
  </div>
30
  echo $fb_data['location'];
31
  } ?>
32
  <br>
33
+ <?php echo __('Creator: ', 'wp-embed-facebook').'<a href="http://www.facebook.com/'.$fb_data['owner']['id'].'" target="_blank">'.$fb_data['owner']['name'].'</a>' ?>
34
  </div>
35
  </div>
36
  </div>
templates/classic/photo.php CHANGED
@@ -3,24 +3,10 @@
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 class="wpemfb-container">
8
- <div class="wpemfb-info">
9
- <div class="wpemfb-pic">
10
- <img src="http://graph.facebook.com/<?php echo $fb_data['from']['id'] ?>/picture" />
11
- </div>
12
- <div class="wpemfb-desc">
13
- <h4 class="wpemfb-title" >
14
- <a href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
15
- <?php echo $fb_data['from']['name'] ?>
16
- </a>
17
- </h4>
18
- <?php if(isset($fb_data['from']['category'])) : ?>
19
- <?php WP_Embed_FB::fb_categories($fb_data['from']['category']) ?><br>
20
- <?php endif; ?>
21
- <?php WP_Embed_FB::like_btn($fb_data['id']) ?><br>
22
- </div>
23
- </div>
24
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
25
  <img src="<?php echo $fb_data['source'] ?>" width="<?php echo $width ?>" height="auto" />
26
  </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 - 20;
7
+ $height = $width * $prop;
8
  ?>
9
  <div class="wpemfb-container">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
11
  <img src="<?php echo $fb_data['source'] ?>" width="<?php echo $width ?>" height="auto" />
12
  </a>
templates/classic/posts.php CHANGED
@@ -1,7 +1,2 @@
1
- <?php if(!isset($fb_data['link'])) : ?>
2
- <div class="fb-post" data-href="https://www.facebook.com/<?php echo $fb_data['user'] ?>/posts/<?php echo $fb_data['is_post'] ?>" data-width="<?php echo $width ?>">
3
- </div>
4
- <?php else : ?>
5
- <div class="fb-post" data-href="<?php echo $fb_data['link'] ?>" data-width="<?php echo $width ?>">
6
  </div>
7
- <?php endif; ?>
1
+ <div class="fb-post" data-href="https://www.facebook.com/<?php echo $fb_data['link'] ?>" data-width="<?php echo $width ?>">
 
 
 
 
2
  </div>
 
templates/classic/video.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
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
+ ?>
7
+ <iframe src="https://www.facebook.com/video/embed?video_id=<?php echo $fb_data['v_id'] ?>" width="<?php echo $width ?>" height="280px"></iframe>
templates/classic/wpemfb.css CHANGED
@@ -5,11 +5,12 @@
5
  box-shadow: 2px 2px 3px #1A3151;
6
  display: inline-table;
7
  height: auto;
8
- margin-left: auto ;
9
- margin-right: auto ;
10
  }
11
  .wpemfb-pagebk{
12
  background-size: 100%;
 
13
  }
14
  .wpemfb-info a {
15
  color: #23487E;
@@ -34,4 +35,13 @@
34
  display: table-cell;
35
  vertical-align: middle;
36
  }
37
-
 
 
 
 
 
 
 
 
 
5
  box-shadow: 2px 2px 3px #1A3151;
6
  display: inline-table;
7
  height: auto;
8
+ margin-left: auto ;
9
+ margin-right: auto ;
10
  }
11
  .wpemfb-pagebk{
12
  background-size: 100%;
13
+ cursor: pointer;
14
  }
15
  .wpemfb-info a {
16
  color: #23487E;
35
  display: table-cell;
36
  vertical-align: middle;
37
  }
38
+ .wpemfb-thmb {
39
+ border: 1px solid #808080;
40
+ height: 60px !important;
41
+ margin: 1px;
42
+ padding: 2px;
43
+ width: 60px !important;
44
+ }
45
+ .wpemfb-link{
46
+ text-decoration: none !important;
47
+ }
templates/default/album.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = $width - 20;
7
+ ?>
8
+ <div class="wpemfb-container" >
9
+ <div style="max-width: <?php echo $width ?>px;">
10
+ <div class="wpemfb-info">
11
+ <div class="wpemfb-pic">
12
+ <img src="http://graph.facebook.com/<?php echo $fb_data['from']['id'] ?>/picture" />
13
+ </div>
14
+ <div class="wpemfb-desc">
15
+ <h4 class="wpemfb-title" >
16
+ <a href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
17
+ <?php echo $fb_data['from']['name'] ?>
18
+ </a>
19
+ </h4>
20
+ <?php if(isset($fb_data['from']['category'])) : ?>
21
+ <?php echo $fb_data['from']['category'].'<br>' ?>
22
+ <?php endif; ?>
23
+ <a href="https://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow"><?php echo $fb_data['name'] ?></a>
24
+ </div>
25
+ </div>
26
+ <p style="text-align: center">
27
+ <?php
28
+ foreach ($fb_data['photos']['data'] as $pic) {
29
+ ?>
30
+ <a class="wpemfb-link" href="<?php echo $pic['source'] ?>" data-lightbox="roadtrip" data-title="<?php echo $pic['name'] ?>" >
31
+ <img class="wpemfb-thmb" src="<?php echo $pic['picture'] ?>" />
32
+ </a>
33
+ <?php
34
+ }
35
+ ?>
36
+ </p>
37
+ </div>
38
+ </div>
templates/default/event.php CHANGED
@@ -25,15 +25,18 @@
25
  <?php echo $fb_data['name'] ?>
26
  </a>
27
  </h4>
28
- <?php echo strftime($start_time_format, $start_time ) ?><br>
29
- <?php
 
 
30
  if(isset($fb_data['venue']['id'])){
31
  echo '<a href="http://www.facebook.com/'.$fb_data['venue']['id'].'" target="_blank">'.$fb_data['location'].'</a>';
32
  } else {
33
  echo $fb_data['location'];
34
- } ?>
35
- <br>
36
- <?php echo __('Creator: ', 'wp-embed-fb').'<a href="http://www.facebook.com/'.$fb_data['owner']['id'].'" target="_blank">'.$fb_data['owner']['name'].'</a>' ?>
 
37
  </div>
38
  </div>
39
  </div>
25
  <?php echo $fb_data['name'] ?>
26
  </a>
27
  </h4>
28
+ <?php echo strftime($start_time_format, $start_time ) ?>
29
+ <br>
30
+ <?php
31
+ echo __('@ ', 'wp-embed-facebook');
32
  if(isset($fb_data['venue']['id'])){
33
  echo '<a href="http://www.facebook.com/'.$fb_data['venue']['id'].'" target="_blank">'.$fb_data['location'].'</a>';
34
  } else {
35
  echo $fb_data['location'];
36
+ }
37
+ ?>
38
+ <br>
39
+ <?php echo __('Creator: ', 'wp-embed-facebook').'<a href="http://www.facebook.com/'.$fb_data['owner']['id'].'" target="_blank">'.$fb_data['owner']['name'].'</a>' ?>
40
  </div>
41
  </div>
42
  </div>
templates/default/photo.php CHANGED
@@ -7,22 +7,6 @@
7
  $height = $width * $prop;
8
  ?>
9
  <div class="wpemfb-container">
10
- <div class="wpemfb-info">
11
- <div class="wpemfb-pic">
12
- <img src="http://graph.facebook.com/<?php echo $fb_data['from']['id'] ?>/picture" />
13
- </div>
14
- <div class="wpemfb-desc">
15
- <h4 class="wpemfb-title" >
16
- <a href="https://facebook.com/<?php echo $fb_data['from']['id'] ?>" target="_blank" rel="nofollow">
17
- <?php echo $fb_data['from']['name'] ?>
18
- </a>
19
- </h4>
20
- <?php if(isset($fb_data['from']['category'])) : ?>
21
- <?php WP_Embed_FB::fb_categories($fb_data['from']['category']) ?><br>
22
- <?php endif; ?>
23
- <?php WP_Embed_FB::like_btn($fb_data['id']) ?><br>
24
- </div>
25
- </div>
26
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
27
  <img src="<?php echo $fb_data['source'] ?>" width="<?php echo $width ?>" height="auto" />
28
  </a>
7
  $height = $width * $prop;
8
  ?>
9
  <div class="wpemfb-container">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
11
  <img src="<?php echo $fb_data['source'] ?>" width="<?php echo $width ?>" height="auto" />
12
  </a>
templates/default/posts.php CHANGED
@@ -1,8 +1,2 @@
1
- <?php if(!isset($fb_data['link'])) : ?>
2
- <div class="fb-post" data-href="https://www.facebook.com/<?php echo $fb_data['user'] ?>/posts/<?php echo $fb_data['is_post'] ?>" data-width="<?php echo $width ?>">
3
- </div>
4
- <?php else : //print_r($fb_data);?>
5
  <div class="fb-post" data-href="https://www.facebook.com/<?php echo $fb_data['link'] ?>" data-width="<?php echo $width ?>">
6
  </div>
7
- <?php endif;
8
- ?>
 
 
 
 
1
  <div class="fb-post" data-href="https://www.facebook.com/<?php echo $fb_data['link'] ?>" data-width="<?php echo $width ?>">
2
  </div>
 
 
templates/default/video.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
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
+ ?>
7
+ <iframe src="https://www.facebook.com/video/embed?video_id=<?php echo $fb_data['v_id'] ?>" width="<?php echo $width ?>" height="280px"></iframe>
templates/default/wpemfb.css CHANGED
@@ -38,3 +38,14 @@
38
  .fb-btns {
39
  float: right;
40
  }
 
 
 
 
 
 
 
 
 
 
 
38
  .fb-btns {
39
  float: right;
40
  }
41
+ .wpemfb-thmb {
42
+ border: 1px solid #808080;
43
+ border-radius: 2px;
44
+ height: 60px !important;
45
+ margin: 1px;
46
+ padding: 2px;
47
+ width: 60px !important;
48
+ }
49
+ .wpemfb-link{
50
+ text-decoration: none !important;
51
+ }
wp-embed-fb.php CHANGED
@@ -1,21 +1,25 @@
1
  <?php
2
  /**
3
  * @package WP_Embed_Facebook
4
- * @version 1.4
5
  */
6
  /*
7
  Plugin Name: WP Embed Facebook
8
  Plugin URI: http://www.wpembedfb.com
9
- Description: Embed a Facebook page, post, event, photo, album or profile to any Wordpress post or page. Copy any fb url to a single line on your post, or use shortcode [facebook='url' width='' ]
10
  Author: Miguel Sirvent
11
- Version: 1.4
12
  Author URI: http://profiles.wordpress.org/poxtron/
13
  */
14
 
15
  /*
16
- * Global definitions and core include.
17
  */
18
  define('WPEMFBDIR',dirname(__FILE__));
 
 
 
 
19
  require_once WPEMFBDIR.'/lib/core.php';
20
 
21
  /*
@@ -23,11 +27,13 @@ require_once WPEMFBDIR.'/lib/core.php';
23
  */
24
  register_activation_hook(__FILE__, array('WP_Embed_FB', 'install') );
25
  register_uninstall_hook(__FILE__, array('WP_Embed_FB', 'uninstall') );
26
- add_action('init',array('WP_Embed_FB','init'));
27
  add_action('wp_enqueue_scripts', array('WP_Embed_FB', 'wp_enqueue_scripts') );
28
  add_filter('the_content', array('WP_Embed_FB','fb_scripts'),10,1);
29
  add_filter('the_content', array('WP_Embed_FB','the_content'),10,2);
30
  add_shortcode('facebook', array('WP_Embed_FB','shortcode') );
 
 
31
  if(is_admin()){
32
  require_once WPEMFBDIR.'/lib/admin.php';
33
  add_action('admin_menu', array('EmbFbAdmin','add_page'));
1
  <?php
2
  /**
3
  * @package WP_Embed_Facebook
4
+ * @version 1.5
5
  */
6
  /*
7
  Plugin Name: WP Embed Facebook
8
  Plugin URI: http://www.wpembedfb.com
9
+ 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 @ <a href="http://www.wpembedfb.com" title="plugin website">www.wpembedfb.com</a>
10
  Author: Miguel Sirvent
11
+ Version: 1.5
12
  Author URI: http://profiles.wordpress.org/poxtron/
13
  */
14
 
15
  /*
16
+ * Constant definitions
17
  */
18
  define('WPEMFBDIR',dirname(__FILE__));
19
+ define('WPEMFBDIRFULL',dirname(plugin_basename(__FILE__)));
20
+
21
+
22
+ // core include
23
  require_once WPEMFBDIR.'/lib/core.php';
24
 
25
  /*
27
  */
28
  register_activation_hook(__FILE__, array('WP_Embed_FB', 'install') );
29
  register_uninstall_hook(__FILE__, array('WP_Embed_FB', 'uninstall') );
30
+ add_action('init',array('WP_Embed_FB','init'),1);
31
  add_action('wp_enqueue_scripts', array('WP_Embed_FB', 'wp_enqueue_scripts') );
32
  add_filter('the_content', array('WP_Embed_FB','fb_scripts'),10,1);
33
  add_filter('the_content', array('WP_Embed_FB','the_content'),10,2);
34
  add_shortcode('facebook', array('WP_Embed_FB','shortcode') );
35
+
36
+ // wp-admin functions
37
  if(is_admin()){
38
  require_once WPEMFBDIR.'/lib/admin.php';
39
  add_action('admin_menu', array('EmbFbAdmin','add_page'));