WP Facebook Auto Publish - Version 1.1

Version Description

= Facebook Auto Publish 1.0.1 = If you had issues with default image used for auto publishing, you may apply this upgrade.

= Facebook Auto Publish 1.0 = First official launch.

Download this release

Release Info

Developer f1logic
Plugin Icon 128x128 WP Facebook Auto Publish
Version 1.1
Comparing to
See all releases

Code changes from version 1.0.2 to 1.1

admin/about.php CHANGED
@@ -66,9 +66,9 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
66
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
67
  </td>
68
  </tr>
69
- <!-- Posting Options -->
70
  <tr>
71
- <td rowspan="15"><h4>Posting Options</h4></td>
72
  <td>Publish to facebook profile/pages</td>
73
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
74
  </td>
@@ -85,7 +85,7 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
85
  </tr>
86
 
87
  <tr>
88
- <td>Publish to linkedin profile</td>
89
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
90
  </td>
91
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
@@ -107,16 +107,25 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
107
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
108
  </td>
109
  </tr>
 
110
  <tr>
111
- <td>Publish images along with post content</td>
 
 
112
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
113
  </td>
 
 
 
 
 
 
114
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
115
  </td>
116
  </tr>
117
 
118
  <tr>
119
- <td>Option to republish existing posts</td>
120
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
121
  </td>
122
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
@@ -124,31 +133,70 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
124
  </tr>
125
 
126
  <tr>
127
- <td>Filter posts to publish based on categories</td>
 
 
 
 
 
 
 
 
128
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
129
  </td>
130
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
131
  </td>
132
  </tr>
133
 
 
 
134
  <tr>
135
- <td>Filter posts to publish based on custom post types</td>
 
136
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
137
  </td>
138
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
139
  </td>
140
  </tr>
141
 
 
142
  <tr>
143
- <td>Publish to multiple social media accounts</td>
144
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
145
  </td>
146
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
147
  </td>
148
  </tr>
149
 
 
 
 
 
 
 
 
 
 
 
150
  <tr>
151
- <td>Seperate message formats for publishing to multiple social media accounts</td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
153
  </td>
154
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
@@ -156,20 +204,25 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
156
  </tr>
157
 
158
  <tr>
159
- <td>Seperate image url for publishing to multiple social media accounts</td>
160
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
161
  </td>
162
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
163
  </td>
164
  </tr>
165
 
 
 
 
166
  <tr>
 
167
  <td>Instantaneous post publishing</td>
168
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
169
  </td>
170
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
171
  </td>
172
  </tr>
 
173
  <tr>
174
  <td>Scheduled post publishing using cron</td>
175
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
@@ -188,9 +241,11 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
188
  </tr>
189
 
190
 
 
 
191
  <!-- Publishing History -->
192
  <tr>
193
- <td rowspan="2"><h4>Publishing History</h4></td>
194
  <td>View auto publish history</td>
195
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
196
  </td>
@@ -205,6 +260,21 @@ Facebook Auto Publish automatically publishes posts from your blog to your Face
205
  </td>
206
  </tr>
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  <!-- Installation and Support -->
209
  <tr>
210
  <td rowspan="2"><h4>Installation and Support</h4></td>
66
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
67
  </td>
68
  </tr>
69
+ <!-- Posting Options -->
70
  <tr>
71
+ <td rowspan="10"><h4>Posting Options</h4></td>
72
  <td>Publish to facebook profile/pages</td>
73
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
74
  </td>
85
  </tr>
86
 
87
  <tr>
88
+ <td>Publish to linkedin profile/company pages/groups</td>
89
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
90
  </td>
91
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
107
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
108
  </td>
109
  </tr>
110
+
111
  <tr>
112
+ <td>Option to republish existing posts</td>
113
+ <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
114
+ </td>
115
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
116
  </td>
117
+ </tr>
118
+
119
+ <tr>
120
+ <td>Publish to multiple social media accounts</td>
121
+ <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
122
+ </td>
123
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
124
  </td>
125
  </tr>
126
 
127
  <tr>
128
+ <td>Seperate message formats for publishing to multiple social media accounts</td>
129
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
130
  </td>
131
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
133
  </tr>
134
 
135
  <tr>
136
+ <td>Hash Tags support for Facebook, Twitter, Pinterest and Google plus</td>
137
+ <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
138
+ </td>
139
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
140
+ </td>
141
+ </tr>
142
+
143
+ <tr>
144
+ <td>Enable/Disable SSL peer verification</td>
145
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
146
  </td>
147
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
148
  </td>
149
  </tr>
150
 
151
+ <!-- Image Options -->
152
+
153
  <tr>
154
+ <td rowspan="3"><h4>Image Options</h4></td>
155
+ <td>Publish images along with post content</td>
156
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
157
  </td>
158
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
159
  </td>
160
  </tr>
161
 
162
+
163
  <tr>
164
+ <td>Seperate image url for publishing to multiple social media accounts</td>
165
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
166
  </td>
167
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
168
  </td>
169
  </tr>
170
 
171
+ <tr>
172
+ <td>Option to specify preference from featured image, post content, post meta and open graph tags</td>
173
+ <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
174
+ </td>
175
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
176
+ </td>
177
+ </tr>
178
+
179
+ <!-- Filter Options -->
180
+
181
  <tr>
182
+ <td rowspan="4"><h4>Filter Options</h4></td>
183
+ <td>Filter posts to publish based on categories</td>
184
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
185
+ </td>
186
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
187
+ </td>
188
+ </tr>
189
+
190
+ <tr>
191
+ <td>Filter posts to publish based on custom post types</td>
192
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
193
+ </td>
194
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
195
+ </td>
196
+ </tr>
197
+
198
+ <tr>
199
+ <td>Category filter for individual accounts</td>
200
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
201
  </td>
202
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
204
  </tr>
205
 
206
  <tr>
207
+ <td>Custom post type filter for individual accounts</td>
208
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
209
  </td>
210
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
211
  </td>
212
  </tr>
213
 
214
+
215
+ <!-- Scheduling -->
216
+
217
  <tr>
218
+ <td rowspan="3"><h4>Scheduling</h4></td>
219
  <td>Instantaneous post publishing</td>
220
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
221
  </td>
222
  <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
223
  </td>
224
  </tr>
225
+
226
  <tr>
227
  <td>Scheduled post publishing using cron</td>
228
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
241
  </tr>
242
 
243
 
244
+
245
+
246
  <!-- Publishing History -->
247
  <tr>
248
+ <td rowspan="4"><h4>Publishing History</h4></td>
249
  <td>View auto publish history</td>
250
  <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
251
  </td>
260
  </td>
261
  </tr>
262
 
263
+ <tr>
264
+ <td>Option to republish post</td>
265
+ <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
266
+ </td>
267
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
268
+ </td>
269
+ </tr>
270
+
271
+ <tr>
272
+ <td>Option to reschedule publishing</td>
273
+ <td><img src="<?php echo plugins_url("images/cross.png",__FILE__);?>">
274
+ </td>
275
+ <td><img src="<?php echo plugins_url("images/tick.png",__FILE__);?>">
276
+ </td>
277
+ </tr>
278
  <!-- Installation and Support -->
279
  <tr>
280
  <td rowspan="2"><h4>Installation and Support</h4></td>
admin/authorization.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  $app_id = get_option('xyz_fbap_application_id');
4
  $app_secret = get_option('xyz_fbap_application_secret');
5
  $redirecturl=admin_url('admin.php?page=facebook-auto-publish-settings&auth=1');
@@ -49,9 +48,15 @@ if(isset($_COOKIE['xyz_fbap_session_state']) && isset($_REQUEST['state']) && ($_
49
  update_option('xyz_fbap_fb_token',$access_token);
50
  update_option('xyz_fbap_af',0);
51
  }
 
 
 
 
 
52
  }
53
  else {
54
- //echo("The state does not match. You may be a victim of CSRF.");
 
55
  }
56
 
57
 
1
  <?php
 
2
  $app_id = get_option('xyz_fbap_application_id');
3
  $app_secret = get_option('xyz_fbap_application_secret');
4
  $redirecturl=admin_url('admin.php?page=facebook-auto-publish-settings&auth=1');
48
  update_option('xyz_fbap_fb_token',$access_token);
49
  update_option('xyz_fbap_af',0);
50
  }
51
+ else
52
+ {
53
+ header("Location:".admin_url('admin.php?page=facebook-auto-publish-settings&msg=3'));
54
+ exit();
55
+ }
56
  }
57
  else {
58
+ //header("Location:".admin_url('admin.php?page=facebook-auto-publish-settings&msg=2'));
59
+ //exit();
60
  }
61
 
62
 
admin/destruction.php CHANGED
@@ -44,6 +44,9 @@ function fbap_free_destroy()
44
  delete_option('xyz_fbap_include_pages');
45
  delete_option('xyz_fbap_include_categories');
46
  delete_option('xyz_fbap_include_customposttypes');
 
 
 
47
 
48
  }
49
 
44
  delete_option('xyz_fbap_include_pages');
45
  delete_option('xyz_fbap_include_categories');
46
  delete_option('xyz_fbap_include_customposttypes');
47
+ delete_option('xyz_fbap_peer_verification');
48
+ delete_option('xyz_fbap_post_logs');
49
+ delete_option('xyz_twap_premium_version_ads');
50
 
51
  }
52
 
admin/footer.php CHANGED
@@ -1,4 +1,4 @@
1
-
2
  <div id="xyz-wp-fbap-premium">
3
 
4
  <div style="float: left; padding: 0 5px">
@@ -20,7 +20,7 @@
20
  </h2>
21
  </div>
22
  </div>
23
-
24
 
25
  <div style="clear: both;"></div>
26
 
@@ -37,7 +37,7 @@
37
  <a target="_blank" href="http://xyzscripts.com/support/" class="xyz_suggest">Suggestions</a> ★
38
  <a target="_blank" href="http://facebook.com/xyzscripts" class="xyz_fbook">Like us on facebook</a> ★
39
  <a target="_blank" href="http://twitter.com/xyzscripts" class="xyz_twitt">Follow us on twitter</a> ★
40
- <a target="_blank" href="https://plus.google.com/101215320403235276710/" class="xyz_gplus">+1 us on Google+</a>
41
 
42
 
43
  </div>
@@ -113,7 +113,7 @@ function verify_fields()
113
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
114
 
115
  Name :
116
- <input style="border: 1px solid #3fafe3; margin-right:10px;" type="text" name="field1" value="<?php
117
  if ($current_user->user_firstname != "" || $current_user->user_lastname != "")
118
  {
119
  echo $current_user->user_firstname . " " . $current_user->user_lastname;
@@ -129,7 +129,7 @@ else if (strcasecmp($current_user->user_login ,"admin")!=0 && strcasecmp($curren
129
  ?>" >
130
 
131
  Email Address :
132
- <input style="border: 1px solid #3fafe3;" name="email"
133
  type="text" value="<?php echo $current_user->user_email; ?>" /><span style="color:#FF0000">*</span>
134
 
135
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@@ -146,16 +146,21 @@ type="text" value="<?php echo $current_user->user_email; ?>" /><span style="col
146
  <p></p>
147
 
148
  <div style="padding-top: ;" class="xyz_plugins">
149
- See Also :
150
 
151
- <a target="_blank" href="http://wordpress.org/extend/plugins/lightbox-pop/">Lightbox Pop</a> ★
152
- <a target="_blank" href="http://wordpress.org/extend/plugins/full-screen-popup/">Full Screen Popup</a> ★
153
- <a target="_blank" href="http://wordpress.org/extend/plugins/popup-dialog-box/">Popup Dialog Box</a> ★
154
- <a target="_blank" href="http://wordpress.org/extend/plugins/quick-bar/">Quick Bar</a> ★
155
- <a target="_blank" href="http://wordpress.org/extend/plugins/quick-box-popup/">Quick Box Popup</a> ★
156
- <a target="_blank" href="http://wordpress.org/extend/plugins/insert-html-snippet/">Insert HTML Snippet</a> ★
157
- <a target="_blank" href="http://wordpress.org/extend/plugins/newsletter-manager/">Newsletter Manager</a>★
158
- <a target="_blank" href="http://wordpress.org/extend/plugins/contact-form-manager/">Contact Form Manager</a>
 
 
 
 
 
159
  </div>
160
 
161
  <div style="padding-top: 10px;text-align: center;">
1
+ <?php if(get_option('xyz_fbap_premium_version_ads')==1){?>
2
  <div id="xyz-wp-fbap-premium">
3
 
4
  <div style="float: left; padding: 0 5px">
20
  </h2>
21
  </div>
22
  </div>
23
+ <?php }?>
24
 
25
  <div style="clear: both;"></div>
26
 
37
  <a target="_blank" href="http://xyzscripts.com/support/" class="xyz_suggest">Suggestions</a> ★
38
  <a target="_blank" href="http://facebook.com/xyzscripts" class="xyz_fbook">Like us on facebook</a> ★
39
  <a target="_blank" href="http://twitter.com/xyzscripts" class="xyz_twitt">Follow us on twitter</a> ★
40
+ <a target="_blank" href="https://plus.google.com/+Xyzscripts" class="xyz_gplus">+1 us on Google+</a>
41
 
42
 
43
  </div>
113
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
114
 
115
  Name :
116
+ <input style="border: 1px solid #3fafe3; margin-right:10px;padding:5px;" type="text" name="field1" value="<?php
117
  if ($current_user->user_firstname != "" || $current_user->user_lastname != "")
118
  {
119
  echo $current_user->user_firstname . " " . $current_user->user_lastname;
129
  ?>" >
130
 
131
  Email Address :
132
+ <input style="border: 1px solid #3fafe3;padding:5px;" name="email"
133
  type="text" value="<?php echo $current_user->user_email; ?>" /><span style="color:#FF0000">*</span>
134
 
135
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
146
  <p></p>
147
 
148
  <div style="padding-top: ;" class="xyz_plugins">
149
+ Our Plugins :
150
 
151
+ <a target="_blank" href="http://wordpress.org/plugins/contact-form-manager/">Contact Form Manager</a> ★
152
+ <a target="_blank" href="http://wordpress.org/plugins/facebook-auto-publish/">Facebook Auto Publish</a> ★
153
+ <a target="_blank" href="http://wordpress.org/plugins/full-screen-popup/">Full Screen Popup</a> ★
154
+ <a target="_blank" href="http://wordpress.org/plugins/insert-html-snippet/">Insert HTML Snippet</a> ★
155
+ <a target="_blank" href="http://wordpress.org/plugins/insert-php-code-snippet/">Insert PHP Code Snippet</a> ★
156
+ <a target="_blank" href="http://wordpress.org/plugins/lightbox-pop/">Lightbox Pop</a> ★
157
+ <a target="_blank" href="http://wordpress.org/plugins/linkedin-auto-publish/">LinkedIn Auto Publish</a> ★
158
+ <a target="_blank" href="http://wordpress.org/plugins/newsletter-manager/">Newsletter Manager</a>★
159
+ <a target="_blank" href="http://wordpress.org/plugins/popup-dialog-box/">Popup Dialog Box</a> ★
160
+ <a target="_blank" href="http://wordpress.org/plugins/quick-bar/">Quick Bar</a> ★
161
+ <a target="_blank" href="http://wordpress.org/plugins/quick-box-popup/">Quick Box Popup</a> ★
162
+ <a target="_blank" href="http://wordpress.org/plugins/social-media-auto-publish/">Social Media Auto Publish</a> ★
163
+ <a target="_blank" href="http://wordpress.org/plugins/twitter-auto-publish/">Twitter Auto Publish</a>
164
  </div>
165
 
166
  <div style="padding-top: 10px;text-align: center;">
admin/header.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div id="xyz-wp-fbap-premium">
2
 
3
  <div style="float: left; padding: 0 5px">
@@ -19,7 +20,7 @@
19
  </h2>
20
  </div>
21
  </div>
22
-
23
 
24
  <?php
25
  if($_POST && isset($_POST['xyz_credit_link']))
1
+ <?php if(get_option('xyz_fbap_premium_version_ads')==1){?>
2
  <div id="xyz-wp-fbap-premium">
3
 
4
  <div style="float: left; padding: 0 5px">
20
  </h2>
21
  </div>
22
  </div>
23
+ <?php }?>
24
 
25
  <?php
26
  if($_POST && isset($_POST['xyz_credit_link']))
admin/install.php CHANGED
@@ -21,6 +21,10 @@ function fbap_free_network_install($networkwide) {
21
 
22
  function fbap_install_free()
23
  {
 
 
 
 
24
 
25
  global $current_user;
26
  get_currentuserinfo();
@@ -48,6 +52,10 @@ function fbap_install_free()
48
  add_option('xyz_fbap_include_pages', '0');
49
  add_option('xyz_fbap_include_categories', 'All');
50
  add_option('xyz_fbap_include_customposttypes', '');
 
 
 
 
51
 
52
  }
53
 
21
 
22
  function fbap_install_free()
23
  {
24
+ /*$pluginName = 'xyz-wp-smap/xyz-wp-smap.php';
25
+ if (is_plugin_active($pluginName)) {
26
+ wp_die( "The plugin Facebook Auto Publish cannot be activated unless the premium version of this plugin is deactivated. Back to <a href='".admin_url()."plugins.php'>Plugin Installation</a>." );
27
+ }*/
28
 
29
  global $current_user;
30
  get_currentuserinfo();
52
  add_option('xyz_fbap_include_pages', '0');
53
  add_option('xyz_fbap_include_categories', 'All');
54
  add_option('xyz_fbap_include_customposttypes', '');
55
+
56
+ add_option('xyz_fbap_peer_verification', '1');
57
+ add_option('xyz_fbap_post_logs', '');
58
+ add_option('xyz_fbap_premium_version_ads', '1');
59
 
60
  }
61
 
admin/logs.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ ?>
3
+ <div >
4
+
5
+
6
+ <form method="post" name="xyz_smap_logs_form">
7
+ <fieldset
8
+ style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;">
9
+
10
+
11
+
12
+ <div style="text-align: left;padding-left: 7px;"><h3>Auto Publish Logs</h3></div>
13
+
14
+ <table class="widefat" style="width: 99%; margin: 0 auto; border-bottom:none;">
15
+ <thead>
16
+ <tr class="xyz_smap_log_tr">
17
+ <th scope="col" width="1%">&nbsp;</th>
18
+ <th scope="col" width="12%">Post Id</th>
19
+ <th scope="col" width="18%">Published On</th>
20
+ <th scope="col" width="15%">Status</th>
21
+ </tr>
22
+ </thead>
23
+ <?php
24
+
25
+ $post_fb_logs = get_option('xyz_fbap_post_logs' );
26
+
27
+ if($post_fb_logs!=""){
28
+
29
+ $postid=$post_fb_logs['postid'];
30
+ $publishtime=$post_fb_logs['publishtime'];
31
+ if($publishtime!="")
32
+ $publishtime=xyz_fbap_local_date_time('Y/m/d g:i:s A',$publishtime);
33
+ $status=$post_fb_logs['status'];
34
+
35
+
36
+
37
+
38
+ ?>
39
+ <tr>
40
+ <td>&nbsp;</td>
41
+ <td style="vertical-align: middle !important;padding: 5px;">
42
+ <?php echo $postid; ?>
43
+ </td>
44
+
45
+ <td style="vertical-align: middle !important;padding: 5px;">
46
+ <?php echo $publishtime;?>
47
+ </td>
48
+
49
+ <td style="vertical-align: middle !important;padding: 5px;">
50
+ <?php
51
+
52
+
53
+ if($status=="1")
54
+ echo "<span style=\"color:green\">Success</span>";
55
+ else if($status=="0")
56
+ echo '';
57
+ else
58
+ {
59
+ $arrval=unserialize($status);
60
+ foreach ($arrval as $a=>$b)
61
+ echo "<span style=\"color:red\">".$a." : ".$b."</span><br>";
62
+
63
+ }
64
+
65
+ ?>
66
+ </td>
67
+ </tr>
68
+ <?php }else{?>
69
+ <tr><td colspan="4" style="padding: 5px;">No logs Found</td></tr>
70
+ <?php }?>
71
+
72
+ </table>
73
+
74
+ </fieldset>
75
+
76
+ </form>
77
+
78
+ </div>
79
+
admin/menu.php CHANGED
@@ -20,6 +20,7 @@ function xyz_fbap_menu()
20
  {
21
  add_menu_page('Facebook Auto Publish - Manage settings', 'Facebook Auto Publish', 'manage_options', 'facebook-auto-publish-settings', 'xyz_fbap_settings');
22
  $page=add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - Manage settings', ' Settings', 'manage_options', 'facebook-auto-publish-settings' ,'xyz_fbap_settings'); // 8 for admin
 
23
  add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - About', 'About', 'manage_options', 'facebook-auto-publish-about' ,'xyz_fbap_about'); // 8 for admin
24
  }
25
 
@@ -45,4 +46,17 @@ function xyz_fbap_about()
45
  require( dirname( __FILE__ ) . '/footer.php' );
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  ?>
20
  {
21
  add_menu_page('Facebook Auto Publish - Manage settings', 'Facebook Auto Publish', 'manage_options', 'facebook-auto-publish-settings', 'xyz_fbap_settings');
22
  $page=add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - Manage settings', ' Settings', 'manage_options', 'facebook-auto-publish-settings' ,'xyz_fbap_settings'); // 8 for admin
23
+ add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - Logs', 'Logs', 'manage_options', 'facebook-auto-publish-log' ,'xyz_fbap_logs');
24
  add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - About', 'About', 'manage_options', 'facebook-auto-publish-about' ,'xyz_fbap_about'); // 8 for admin
25
  }
26
 
46
  require( dirname( __FILE__ ) . '/footer.php' );
47
  }
48
 
49
+
50
+ function xyz_fbap_logs()
51
+ {
52
+ $_POST = stripslashes_deep($_POST);
53
+ $_GET = stripslashes_deep($_GET);
54
+ $_POST = xyz_trim_deep($_POST);
55
+ $_GET = xyz_trim_deep($_GET);
56
+
57
+ require( dirname( __FILE__ ) . '/header.php' );
58
+ require( dirname( __FILE__ ) . '/logs.php' );
59
+ require( dirname( __FILE__ ) . '/footer.php' );
60
+ }
61
+
62
  ?>
admin/metabox.php CHANGED
@@ -9,6 +9,11 @@ function xyz_fbap_add_custom_box()
9
  if(isset($_GET['action']) && $_GET['action']=="edit")
10
  {
11
  $postid=$_GET['post'];
 
 
 
 
 
12
  $get_post_meta=get_post_meta($postid,"xyz_fbap",true);
13
  if($get_post_meta==1)
14
  return ;
@@ -47,7 +52,15 @@ if(isset($_GET['action']) && $_GET['action']=="edit")
47
  if(get_option('xyz_fbap_af')==0 && get_option('xyz_fbap_fb_token')!="")
48
  add_meta_box( "xyz_fbap", '<strong>Facebook Auto Publish - Post Options</strong>', 'xyz_fbap_addpostmetatags') ;
49
  }
50
-
 
 
 
 
 
 
 
 
51
  function xyz_fbap_addpostmetatags()
52
  {
53
  $imgpath= plugins_url()."/facebook-auto-publish/admin/images/";
@@ -87,10 +100,23 @@ function dethide_fbap(id)
87
 
88
 
89
  </script>
90
- <table>
 
 
 
 
 
 
 
 
 
 
91
 
 
 
 
92
  <tr valign="top">
93
- <td>Enable auto publish post to my facebook account
94
  </td>
95
  <td><select id="xyz_fbap_post_permission" name="xyz_fbap_post_permission"
96
  onchange="displaycheck_fbap()"><option value="0"
@@ -102,7 +128,7 @@ function dethide_fbap(id)
102
  </td>
103
  </tr>
104
  <tr valign="top" id="fpabpmd">
105
- <td>Posting method
106
  </td>
107
  <td><select id="xyz_fbap_po_method" name="xyz_fbap_po_method">
108
  <option value="3"
@@ -127,7 +153,7 @@ function dethide_fbap(id)
127
  </td>
128
  </tr>
129
  <tr valign="top" id="fpabpmf">
130
- <td>Message format for posting <img src="<?php echo $heimg?>"
131
  onmouseover="detdisplay_fbap('xyz_fbap')" onmouseout="dethide_fbap('xyz_fbap')">
132
  <div id="xyz_fbap" class="informationdiv" style="display: none;">
133
  {POST_TITLE} - Insert the title of your post.<br />{PERMALINK} -
@@ -138,14 +164,40 @@ function dethide_fbap(id)
138
  of the author.
139
  </div>
140
  </td>
141
- <td>
142
- <textarea id="xyz_fbap_message" name="xyz_fbap_message"><?php echo esc_textarea(get_option('xyz_fbap_message'));?></textarea>
143
- </td>
144
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
145
 
146
  </table>
147
  <script type="text/javascript">
148
  displaycheck_fbap();
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  </script>
150
  <?php
151
  }
9
  if(isset($_GET['action']) && $_GET['action']=="edit")
10
  {
11
  $postid=$_GET['post'];
12
+
13
+ $postpp= get_post($postid);
14
+ if($postpp->post_status=="publish")
15
+ add_meta_box("xyz_fbap1", ' ', 'xyz_fbap_addpostmetatags1') ;
16
+
17
  $get_post_meta=get_post_meta($postid,"xyz_fbap",true);
18
  if($get_post_meta==1)
19
  return ;
52
  if(get_option('xyz_fbap_af')==0 && get_option('xyz_fbap_fb_token')!="")
53
  add_meta_box( "xyz_fbap", '<strong>Facebook Auto Publish - Post Options</strong>', 'xyz_fbap_addpostmetatags') ;
54
  }
55
+ function xyz_fbap_addpostmetatags1()
56
+ {
57
+ ?>
58
+ <input type="hidden" name="xyz_fbap_hidden_meta" value="1" >
59
+ <script type="text/javascript">
60
+ jQuery('#xyz_fbap1').hide();
61
+ </script>
62
+ <?php
63
+ }
64
  function xyz_fbap_addpostmetatags()
65
  {
66
  $imgpath= plugins_url()."/facebook-auto-publish/admin/images/";
100
 
101
 
102
  </script>
103
+ <table class="xyz_fbap_metalist_table">
104
+
105
+ <tr><td colspan="2" >
106
+
107
+ <table class="xyz_fbap_meta_acclist_table"><!-- FB META -->
108
+
109
+
110
+ <tr>
111
+ <td colspan="2" class="xyz_fbap_pleft15 xyz_fbap_meta_acclist_table_td"><strong>Facebook</strong>
112
+ </td>
113
+ </tr>
114
 
115
+ <tr><td colspan="2" valign="top">&nbsp;</td></tr>
116
+
117
+
118
  <tr valign="top">
119
+ <td class="xyz_fbap_pleft15">Enable auto publish post to my facebook account
120
  </td>
121
  <td><select id="xyz_fbap_post_permission" name="xyz_fbap_post_permission"
122
  onchange="displaycheck_fbap()"><option value="0"
128
  </td>
129
  </tr>
130
  <tr valign="top" id="fpabpmd">
131
+ <td class="xyz_fbap_pleft15">Posting method
132
  </td>
133
  <td><select id="xyz_fbap_po_method" name="xyz_fbap_po_method">
134
  <option value="3"
153
  </td>
154
  </tr>
155
  <tr valign="top" id="fpabpmf">
156
+ <td class="xyz_fbap_pleft15">Message format for posting <img src="<?php echo $heimg?>"
157
  onmouseover="detdisplay_fbap('xyz_fbap')" onmouseout="dethide_fbap('xyz_fbap')">
158
  <div id="xyz_fbap" class="informationdiv" style="display: none;">
159
  {POST_TITLE} - Insert the title of your post.<br />{PERMALINK} -
164
  of the author.
165
  </div>
166
  </td>
167
+ <td>
168
+ <select name="xyz_fbap_info" id="xyz_fbap_info" onchange="xyz_fbap_info_insert(this)">
169
+ <option value ="0" selected="selected">--Select--</option>
170
+ <option value ="1">{POST_TITLE} </option>
171
+ <option value ="2">{PERMALINK} </option>
172
+ <option value ="3">{POST_EXCERPT} </option>
173
+ <option value ="4">{POST_CONTENT} </option>
174
+ <option value ="5">{BLOG_TITLE} </option>
175
+ <option value ="6">{USER_NICENAME} </option>
176
+ </select> </td></tr><tr><td>&nbsp;</td><td>
177
+ <textarea id="xyz_fbap_message" name="xyz_fbap_message" style="height:80px !important;" ><?php echo esc_textarea(get_option('xyz_fbap_message'));?></textarea>
178
+ </td></tr>
179
+
180
+ </table>
181
+
182
+ </td></tr>
183
+
184
 
185
  </table>
186
  <script type="text/javascript">
187
  displaycheck_fbap();
188
+
189
+ function xyz_fbap_info_insert(inf){
190
+
191
+ var e = document.getElementById("xyz_fbap_info");
192
+ var ins_opt = e.options[e.selectedIndex].text;
193
+ if(ins_opt=="0")
194
+ ins_opt="";
195
+ var str=jQuery("textarea#xyz_fbap_message").val()+ins_opt;
196
+ jQuery("textarea#xyz_fbap_message").val(str);
197
+ jQuery('#xyz_fbap_info :eq(0)').prop('selected', true);
198
+ jQuery("textarea#xyz_fbap_message").focus();
199
+
200
+ }
201
  </script>
202
  <?php
203
  }
admin/publish.php CHANGED
@@ -12,47 +12,10 @@ foreach ($carr as $cstyps ) {
12
 
13
  }
14
 
15
-
16
- function xyz_fbap_string_limit($string, $limit) {
17
-
18
- $space=" ";$appendstr=" ...";
19
- if(mb_strlen($string) <= $limit) return $string;
20
- if(mb_strlen($appendstr) >= $limit) return '';
21
- $string = mb_substr($string, 0, $limit-mb_strlen($appendstr));
22
- $rpos = mb_strripos($string, $space);
23
- if ($rpos===false)
24
- return $string.$appendstr;
25
- else
26
- return mb_substr($string, 0, $rpos).$appendstr;
27
- }
28
-
29
- function xyz_fbap_getimage($post_ID,$description_org)
30
- {
31
- $attachmenturl="";
32
- $post_thumbnail_id = get_post_thumbnail_id( $post_ID );
33
- if($post_thumbnail_id!="")
34
- {
35
- $attachmenturl=wp_get_attachment_url($post_thumbnail_id);
36
- $attachmentimage=wp_get_attachment_image_src( $post_thumbnail_id, full );
37
-
38
- }
39
- else {
40
- preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/is', $description_org, $matches);
41
- if(isset($matches[1][0]))
42
- $attachmenturl = $matches[1][0];
43
- else {
44
- apply_filters('the_content', $description_org);
45
- preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/is', $description_org, $matches);
46
- if(isset($matches[1][0]))
47
- $attachmenturl = $matches[1][0];
48
- }
49
-
50
-
51
- }
52
- return $attachmenturl;
53
- }
54
  function xyz_fbap_link_publish($post_ID) {
55
 
 
 
56
 
57
  $get_post_meta=get_post_meta($post_ID,"xyz_fbap",true);
58
  if($get_post_meta!=1)
@@ -84,8 +47,6 @@ function xyz_fbap_link_publish($post_ID) {
84
 
85
  $af=get_option('xyz_fbap_af');
86
 
87
- //////////////////////////////
88
-
89
  $postpp= get_post($post_ID);global $wpdb;
90
  $entries0 = $wpdb->get_results( 'SELECT user_nicename FROM '.$wpdb->prefix.'users WHERE ID='.$postpp->post_author);
91
 
@@ -95,6 +56,7 @@ function xyz_fbap_link_publish($post_ID) {
95
  if ($postpp->post_status == 'publish')
96
  {
97
  $posttype=$postpp->post_type;
 
98
 
99
  if ($posttype=="page")
100
  {
@@ -171,10 +133,8 @@ function xyz_fbap_link_publish($post_ID) {
171
  $description=strip_shortcodes($description);
172
 
173
  $description=str_replace("&nbsp;","",$description);
174
- //$description=str_replace(array("\r\n","\r","\n"), '', $description);
175
 
176
  $excerpt=str_replace("&nbsp;","",$excerpt);
177
- //$excerpt=str_replace(array("\r\n","\r","\n"), '', $excerpt);
178
 
179
  if($useracces_token!="" && $appsecret!="" && $appid!="" && $post_permissin==1)
180
  {
@@ -210,7 +170,6 @@ function xyz_fbap_link_publish($post_ID) {
210
  $message5=str_replace('{USER_NICENAME}', $user_nicename, $message5);
211
 
212
  $message5=str_replace("&nbsp;","",$message5);
213
- //$message5=str_replace(array("\r\n","\r","\n"), '', $message5);
214
 
215
  $disp_type="feed";
216
  if($posting_method==1) //attach
@@ -242,9 +201,6 @@ function xyz_fbap_link_publish($post_ID) {
242
  }
243
  else if($posting_method==3) //simple text message
244
  {
245
- //$message6=xyz_fbap_string_limit($message5, 900);
246
- //$description_li=xyz_fbap_string_limit($description, 900);
247
-
248
  $attachment = array('message' => $message5,
249
  'access_token' => $acces_token
250
 
@@ -253,8 +209,6 @@ function xyz_fbap_link_publish($post_ID) {
253
  }
254
  else if($posting_method==4 || $posting_method==5) //text message with image 4 - app album, 5-timeline
255
  {
256
- //$message6=xyz_fbap_string_limit($message5, 900);
257
- //$description_li=xyz_fbap_string_limit($description, 900);
258
  if($attachmenturl!="")
259
  {
260
 
@@ -265,7 +219,7 @@ function xyz_fbap_link_publish($post_ID) {
265
  }
266
  catch(Exception $e)
267
  {
268
- //echo $e->getmessage();
269
  }
270
  foreach ($albums["data"] as $album) {
271
  if ($album["type"] == "wall") {
@@ -296,12 +250,25 @@ function xyz_fbap_link_publish($post_ID) {
296
  $result = $fb->api('/'.$page_id.'/'.$disp_type.'/', 'post', $attachment);}
297
  catch(Exception $e)
298
  {
299
- //echo $e->getmessage();
300
  }
301
 
302
  }
303
 
304
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
 
306
  }
307
 
12
 
13
  }
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  function xyz_fbap_link_publish($post_ID) {
16
 
17
+ if(isset($_POST['xyz_fbap_hidden_meta']) && $_POST['xyz_fbap_hidden_meta']==1)
18
+ return ;
19
 
20
  $get_post_meta=get_post_meta($post_ID,"xyz_fbap",true);
21
  if($get_post_meta!=1)
47
 
48
  $af=get_option('xyz_fbap_af');
49
 
 
 
50
  $postpp= get_post($post_ID);global $wpdb;
51
  $entries0 = $wpdb->get_results( 'SELECT user_nicename FROM '.$wpdb->prefix.'users WHERE ID='.$postpp->post_author);
52
 
56
  if ($postpp->post_status == 'publish')
57
  {
58
  $posttype=$postpp->post_type;
59
+ $fb_publish_status=array();
60
 
61
  if ($posttype=="page")
62
  {
133
  $description=strip_shortcodes($description);
134
 
135
  $description=str_replace("&nbsp;","",$description);
 
136
 
137
  $excerpt=str_replace("&nbsp;","",$excerpt);
 
138
 
139
  if($useracces_token!="" && $appsecret!="" && $appid!="" && $post_permissin==1)
140
  {
170
  $message5=str_replace('{USER_NICENAME}', $user_nicename, $message5);
171
 
172
  $message5=str_replace("&nbsp;","",$message5);
 
173
 
174
  $disp_type="feed";
175
  if($posting_method==1) //attach
201
  }
202
  else if($posting_method==3) //simple text message
203
  {
 
 
 
204
  $attachment = array('message' => $message5,
205
  'access_token' => $acces_token
206
 
209
  }
210
  else if($posting_method==4 || $posting_method==5) //text message with image 4 - app album, 5-timeline
211
  {
 
 
212
  if($attachmenturl!="")
213
  {
214
 
219
  }
220
  catch(Exception $e)
221
  {
222
+ $fb_publish_status[$page_id."/albums"]=$e->getMessage();
223
  }
224
  foreach ($albums["data"] as $album) {
225
  if ($album["type"] == "wall") {
250
  $result = $fb->api('/'.$page_id.'/'.$disp_type.'/', 'post', $attachment);}
251
  catch(Exception $e)
252
  {
253
+ $fb_publish_status[$page_id."/".$disp_type]=$e->getMessage();
254
  }
255
 
256
  }
257
 
258
 
259
+ if(count($fb_publish_status)>0)
260
+ $fb_publish_status_insert=serialize($fb_publish_status);
261
+ else
262
+ $fb_publish_status_insert=1;
263
+
264
+ $time=time();
265
+ $post_fb_options=array(
266
+ 'postid' => $post_ID,
267
+ 'acc_type' => "Facebook",
268
+ 'publishtime' => $time,
269
+ 'status' => $fb_publish_status_insert
270
+ );
271
+ update_option('xyz_fbap_post_logs', $post_fb_options);
272
 
273
  }
274
 
admin/settings.php CHANGED
@@ -121,15 +121,25 @@ if(isset($_POST['fb']) && $erf==0)
121
  id="system_notice_area_dismiss">Dismiss</span>
122
  </div>
123
  <?php }
124
- if(isset($_GET['msg']) && $_GET['msg']==1)
125
  {
126
  ?>
127
  <div class="system_notice_area_style0" id="system_notice_area">
128
- Unable to authorize the linkedin application. Please check the details. &nbsp;&nbsp;&nbsp;<span
129
  id="system_notice_area_dismiss">Dismiss</span>
130
  </div>
131
  <?php
132
  }
 
 
 
 
 
 
 
 
 
 
133
  if(isset($_POST['fb']) && $erf==1)
134
  {
135
  ?>
@@ -178,6 +188,16 @@ function dethide(id)
178
 
179
  </form>
180
  <?php }
 
 
 
 
 
 
 
 
 
 
181
 
182
 
183
  if(isset($_GET['auth']) && $_GET['auth']==1 && get_option("xyz_fbap_fb_token")!="")
@@ -218,7 +238,7 @@ function dethide(id)
218
 
219
 
220
  <div style="font-weight: bold;padding: 3px;">All fields given below are mandatory</div>
221
- <table class="widefat" style="width: 99%">
222
  <tr valign="top">
223
  <td width="50%">Application id
224
  </td>
@@ -255,10 +275,22 @@ function dethide(id)
255
  of your blog.<br />{USER_NICENAME} - Insert the nicename
256
  of the author.
257
  </div></td>
258
- <td><textarea id="xyz_fbap_message" name="xyz_fbap_message"><?php if($ms4==""){
 
 
 
 
 
 
 
 
 
 
259
  echo esc_textarea(get_option('xyz_fbap_message'));}?></textarea>
260
- </td>
261
- </tr>
 
 
262
  <tr valign="top">
263
  <td>Posting method
264
  </td>
@@ -347,7 +379,7 @@ function dethide(id)
347
  <tr valign="top">
348
  <td>Select facebook pages for auto publish
349
  </td>
350
- <td><select name="fbap_pages_list[]" multiple="multiple">
351
  <option value="-1"
352
  <?php if(in_array(-1, $fbap_pages_ids)) echo "selected" ?>>Profile Page</option>
353
  <?php
@@ -402,7 +434,9 @@ function dethide(id)
402
  if(isset($_POST['post_types']))
403
  $xyz_customtypes=$_POST['post_types'];
404
 
405
-
 
 
406
  $fbap_customtype_ids="";
407
 
408
  if($xyz_customtypes!="")
@@ -419,6 +453,8 @@ function dethide(id)
419
  update_option('xyz_fbap_include_pages',$xyz_fbap_include_pages);
420
  update_option('xyz_fbap_include_categories',$fbap_category_ids);
421
  update_option('xyz_fbap_include_customposttypes',$fbap_customtype_ids);
 
 
422
 
423
  }
424
 
@@ -426,7 +462,9 @@ function dethide(id)
426
  $xyz_fbap_include_pages=get_option('xyz_fbap_include_pages');
427
  $xyz_fbap_include_categories=get_option('xyz_fbap_include_categories');
428
  $xyz_fbap_include_customposttypes=get_option('xyz_fbap_include_customposttypes');
429
-
 
 
430
 
431
  ?>
432
  <h2>Basic Settings</h2>
@@ -434,7 +472,7 @@ function dethide(id)
434
 
435
  <form method="post">
436
 
437
- <table class="widefat" style="width: 99%">
438
 
439
  <tr valign="top">
440
 
@@ -491,7 +529,7 @@ function dethide(id)
491
  'hide_if_empty' => false );
492
 
493
  if(count(get_categories($args))>0)
494
- echo str_replace( "<select", "<select multiple onClick=setcat(this) style='width:200px;height:100px;border:1px solid #cccccc;'", wp_dropdown_categories($args));
495
  else
496
  echo "NIL";
497
 
@@ -534,9 +572,19 @@ function dethide(id)
534
  </td>
535
  </tr>
536
 
 
 
 
 
 
 
 
 
 
 
537
 
538
 
539
- <tr valign="top" id="xyz_fbap">
540
 
541
  <td colspan="1">Enable credit link to author
542
  </td>
@@ -551,6 +599,23 @@ function dethide(id)
551
  </select>
552
  </td>
553
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
 
555
 
556
  <tr>
@@ -619,6 +684,19 @@ function rd_cat_chn(val,act)
619
  jQuery("#cat_dropdown_span").show();
620
  }
621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  }
623
  </script>
624
  <?php
121
  id="system_notice_area_dismiss">Dismiss</span>
122
  </div>
123
  <?php }
124
+ if(isset($_GET['msg']) && $_GET['msg']==2)
125
  {
126
  ?>
127
  <div class="system_notice_area_style0" id="system_notice_area">
128
+ The state does not match. You may be a victim of CSRF. &nbsp;&nbsp;&nbsp;<span
129
  id="system_notice_area_dismiss">Dismiss</span>
130
  </div>
131
  <?php
132
  }
133
+ if(isset($_GET['msg']) && $_GET['msg']==3)
134
+ {
135
+ ?>
136
+ <div class="system_notice_area_style0" id="system_notice_area">
137
+ Unable to authorize the facebook application. Please check your curl/fopen and firewall settings. &nbsp;&nbsp;&nbsp;<span
138
+ id="system_notice_area_dismiss">Dismiss</span>
139
+ </div>
140
+ <?php
141
+ }
142
+
143
  if(isset($_POST['fb']) && $erf==1)
144
  {
145
  ?>
188
 
189
  </form>
190
  <?php }
191
+ else if($af==0 && $appid!="" && $appsecret!="" && $fbid!="")
192
+ {
193
+ ?>
194
+ <form method="post">
195
+
196
+ <input type="submit" class="submit_fbap_new" name="fb_auth"
197
+ value="Reauthorize" title="Reauthorize the account" /><br><br>
198
+
199
+ </form>
200
+ <?php }
201
 
202
 
203
  if(isset($_GET['auth']) && $_GET['auth']==1 && get_option("xyz_fbap_fb_token")!="")
238
 
239
 
240
  <div style="font-weight: bold;padding: 3px;">All fields given below are mandatory</div>
241
+ <table class="widefat xyz_fbap_widefat_table" style="width: 99%">
242
  <tr valign="top">
243
  <td width="50%">Application id
244
  </td>
275
  of your blog.<br />{USER_NICENAME} - Insert the nicename
276
  of the author.
277
  </div></td>
278
+ <td>
279
+ <select name="xyz_fbap_info" id="xyz_fbap_info" onchange="xyz_fbap_info_insert(this)">
280
+ <option value ="0" selected="selected">--Select--</option>
281
+ <option value ="1">{POST_TITLE} </option>
282
+ <option value ="2">{PERMALINK} </option>
283
+ <option value ="3">{POST_EXCERPT} </option>
284
+ <option value ="4">{POST_CONTENT} </option>
285
+ <option value ="5">{BLOG_TITLE} </option>
286
+ <option value ="6">{USER_NICENAME} </option>
287
+ </select> </td></tr><tr><td>&nbsp;</td><td>
288
+ <textarea id="xyz_fbap_message" name="xyz_fbap_message" style="height:80px !important;" ><?php if($ms4==""){
289
  echo esc_textarea(get_option('xyz_fbap_message'));}?></textarea>
290
+ </td></tr>
291
+
292
+
293
+
294
  <tr valign="top">
295
  <td>Posting method
296
  </td>
379
  <tr valign="top">
380
  <td>Select facebook pages for auto publish
381
  </td>
382
+ <td><select name="fbap_pages_list[]" multiple="multiple" style="height:auto !important;">
383
  <option value="-1"
384
  <?php if(in_array(-1, $fbap_pages_ids)) echo "selected" ?>>Profile Page</option>
385
  <?php
434
  if(isset($_POST['post_types']))
435
  $xyz_customtypes=$_POST['post_types'];
436
 
437
+ $xyz_fbap_peer_verification=$_POST['xyz_fbap_peer_verification'];
438
+ $xyz_fbap_premium_version_ads=$_POST['xyz_fbap_premium_version_ads'];
439
+
440
  $fbap_customtype_ids="";
441
 
442
  if($xyz_customtypes!="")
453
  update_option('xyz_fbap_include_pages',$xyz_fbap_include_pages);
454
  update_option('xyz_fbap_include_categories',$fbap_category_ids);
455
  update_option('xyz_fbap_include_customposttypes',$fbap_customtype_ids);
456
+ update_option('xyz_fbap_peer_verification',$xyz_fbap_peer_verification);
457
+ update_option('xyz_fbap_premium_version_ads',$xyz_fbap_premium_version_ads);
458
 
459
  }
460
 
462
  $xyz_fbap_include_pages=get_option('xyz_fbap_include_pages');
463
  $xyz_fbap_include_categories=get_option('xyz_fbap_include_categories');
464
  $xyz_fbap_include_customposttypes=get_option('xyz_fbap_include_customposttypes');
465
+ $xyz_fbap_peer_verification=esc_html(get_option('xyz_fbap_peer_verification'));
466
+ $xyz_fbap_premium_version_ads=esc_html(get_option('xyz_fbap_premium_version_ads'));
467
+
468
 
469
  ?>
470
  <h2>Basic Settings</h2>
472
 
473
  <form method="post">
474
 
475
+ <table class="widefat xyz_fbap_widefat_table" style="width: 99%">
476
 
477
  <tr valign="top">
478
 
529
  'hide_if_empty' => false );
530
 
531
  if(count(get_categories($args))>0)
532
+ echo str_replace( "<select", "<select multiple onClick=setcat(this) style='width:200px;height:auto !important;border:1px solid #cccccc;'", wp_dropdown_categories($args));
533
  else
534
  echo "NIL";
535
 
572
  </td>
573
  </tr>
574
 
575
+ <tr valign="top">
576
+
577
+ <td scope="row" colspan="1" width="50%">SSL peer verification </td><td><select name="xyz_fbap_peer_verification" >
578
+
579
+ <option value ="1" <?php if($xyz_fbap_peer_verification=='1') echo 'selected'; ?> >Enable </option>
580
+
581
+ <option value ="0" <?php if($xyz_fbap_peer_verification=='0') echo 'selected'; ?> >Disable </option>
582
+ </select>
583
+ </td></tr>
584
+
585
 
586
 
587
+ <tr valign="top">
588
 
589
  <td colspan="1">Enable credit link to author
590
  </td>
599
  </select>
600
  </td>
601
  </tr>
602
+
603
+ <tr valign="top">
604
+
605
+ <td colspan="1">Enable premium version ads
606
+ </td>
607
+ <td><select name="xyz_fbap_premium_version_ads" id="xyz_fbap_premium_version_ads">
608
+
609
+ <option value="1"
610
+ <?php if($xyz_fbap_premium_version_ads=='1') echo 'selected'; ?>>Yes</option>
611
+
612
+ <option
613
+ value="0"
614
+ <?php if($xyz_fbap_premium_version_ads=='0') echo 'selected'; ?>>No</option>
615
+ </select>
616
+ </td>
617
+ </tr>
618
+
619
 
620
 
621
  <tr>
684
  jQuery("#cat_dropdown_span").show();
685
  }
686
 
687
+ }
688
+
689
+ function xyz_fbap_info_insert(inf){
690
+
691
+ var e = document.getElementById("xyz_fbap_info");
692
+ var ins_opt = e.options[e.selectedIndex].text;
693
+ if(ins_opt=="0")
694
+ ins_opt="";
695
+ var str=jQuery("textarea#xyz_fbap_message").val()+ins_opt;
696
+ jQuery("textarea#xyz_fbap_message").val(str);
697
+ jQuery('#xyz_fbap_info :eq(0)').prop('selected', true);
698
+ jQuery("textarea#xyz_fbap_message").focus();
699
+
700
  }
701
  </script>
702
  <?php
admin/style.css CHANGED
@@ -3,7 +3,7 @@
3
  margin-bottom:40px;
4
  left:25%;
5
  width:50%;
6
- height:20px;
7
  border-radius:5px;
8
  -moz-border-radius:5px;
9
  -webkit-border-radius:5px;
@@ -14,6 +14,7 @@
14
  text-align: center;
15
  top: 0px;
16
  z-index: 100000;
 
17
 
18
 
19
  }
@@ -23,7 +24,7 @@
23
  height:16px;
24
  background-repeat: no-repeat;
25
  background-position: left center;
26
- padding-left: 15px;
27
  text-decoration: none;
28
 
29
  vertical-align: middle;
@@ -83,18 +84,14 @@ margin-left: 3px;
83
  box-shadow: 0 8px 6px -6px black;
84
 
85
  }
86
- #facebook-auto-publish{
87
- background: #a9e8f5; /* Old browsers */
88
 
89
- background: -moz-linear-gradient(top, #ffffff 0%, #a9e8f5 100%); /* FF3.6+ */
90
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#a9e8f5)); /* Chrome,Safari4+ */
91
- background: -webkit-linear-gradient(top, #ffffff 0%,#a9e8f5 100%); /* Chrome10+,Safari5.1+ */
92
- background: -o-linear-gradient(top, #ffffff 0%,#a9e8f5 100%); /* Opera 11.10+ */
93
- background: -ms-linear-gradient(top, #ffffff 0%,#a9e8f5 100%); /* IE10+ */
94
- background: linear-gradient(top, #ffffff 0%,#a9e8f5 100%); /* W3C */
95
 
96
 
97
  }
 
98
  #facebook-auto-publish .plugin-version-author-uri a,
99
  #facebook-auto-publish .plugin-version-author-uri a:link,
100
  #facebook-auto-publish .plugin-version-author-uri a:hover,
@@ -112,7 +109,7 @@ color:#cc811a;
112
  }
113
  #facebook-auto-publish .plugin-title{
114
 
115
- background-image: url('images/xyz_logo.png');
116
  background-repeat: no-repeat;
117
  background-position: left bottom;
118
 
@@ -168,12 +165,13 @@ cursor: pointer;
168
  background:-ms-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
169
  background:linear-gradient(top,#25A6E1 0%,#188BC0 100%);
170
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#25A6E1",endColorstr="#188BC0",GradientType=0);
171
- padding:1px 13px;
172
  color:#ffffff !important;
173
  border-radius: 4px !important; border: 1px solid #1A87B9 !important;
174
  font-family:"Helvetica Neue",sans-serif;
175
  font-size:13px;
176
- cursor:pointer;height: 25px;
 
 
177
  }
178
 
179
  .informationdiv {
@@ -187,14 +185,16 @@ cursor: pointer;
187
  z-index: 1200;
188
  }
189
  .xyz_feedback{
190
- background: #CEEAF7; /* Old browsers */
191
- border: 1px solid #64cfe8;
192
- border-radius:3px;
193
- width: 98%;
194
- height:28px;
195
- padding:5px 5px;
 
 
196
  font-weight: bold;
197
- line-height: 20px;
198
 
199
  }
200
 
@@ -205,11 +205,14 @@ height:28px;
205
 
206
  .xyz_subscribe{
207
  background: #bae598; /* Old browsers */
208
- border: 1px solid #4d8a1d;
209
- border-radius:3px;
210
- width: 98%;
211
- padding:5px 5px;
212
- height:28px;
 
 
 
213
 
214
  }
215
  .xyz_subscribe td{
@@ -217,13 +220,16 @@ height:28px;
217
  }
218
 
219
  .xyz_plugins{
220
- background: #EDEDED; /* Old browsers */
221
- border: 1px solid #cccccc;
222
- border-radius:3px;
223
- width: 98%;
224
- padding:5px 5px;
225
- height:28px;
226
- line-height: 25px;
 
 
 
227
 
228
  }
229
 
@@ -237,13 +243,14 @@ line-height: 25px;
237
  background:-ms-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
238
  background:linear-gradient(top,#25A6E1 0%,#188BC0 100%);
239
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#25A6E1",endColorstr="#188BC0",GradientType=0);
240
- padding:1px 13px;
241
  color:#ffffff;
242
  font-family:"Helvetica Neue",sans-serif;
243
  font-size:13px;
244
  cursor:pointer;
245
  color:#FFFFFF !important;border-radius:4px !important;
246
- border:1px solid #1A87B9;height: 25px;
 
 
247
  }
248
  #xyz-wp-fbap-premium {
249
  border: 1px solid #FCC328;
@@ -257,3 +264,30 @@ line-height: 25px;
257
  }
258
  a.xyz_fbap_link:hover{text-decoration:underline;}
259
  .xyz_fbap_link{text-decoration:none;font-weight: bold;margin-left:8px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  margin-bottom:40px;
4
  left:25%;
5
  width:50%;
6
+ height:30px;
7
  border-radius:5px;
8
  -moz-border-radius:5px;
9
  -webkit-border-radius:5px;
14
  text-align: center;
15
  top: 0px;
16
  z-index: 100000;
17
+ padding-top: 10px;
18
 
19
 
20
  }
24
  height:16px;
25
  background-repeat: no-repeat;
26
  background-position: left center;
27
+ padding-left: 18px;
28
  text-decoration: none;
29
 
30
  vertical-align: middle;
84
  box-shadow: 0 8px 6px -6px black;
85
 
86
  }
 
 
87
 
88
+ #facebook-auto-publish th,#facebook-auto-publish td{
89
+ background: #a9e8f5; /* Old browsers */
90
+ background: linear-gradient( #ffffff,#a9e8f5 ); /* W3C */
 
 
 
91
 
92
 
93
  }
94
+
95
  #facebook-auto-publish .plugin-version-author-uri a,
96
  #facebook-auto-publish .plugin-version-author-uri a:link,
97
  #facebook-auto-publish .plugin-version-author-uri a:hover,
109
  }
110
  #facebook-auto-publish .plugin-title{
111
 
112
+ background: url('images/xyz_logo.png'),linear-gradient( #ffffff,#a9e8f5 );
113
  background-repeat: no-repeat;
114
  background-position: left bottom;
115
 
165
  background:-ms-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
166
  background:linear-gradient(top,#25A6E1 0%,#188BC0 100%);
167
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#25A6E1",endColorstr="#188BC0",GradientType=0);
 
168
  color:#ffffff !important;
169
  border-radius: 4px !important; border: 1px solid #1A87B9 !important;
170
  font-family:"Helvetica Neue",sans-serif;
171
  font-size:13px;
172
+ cursor:pointer;height: 30px;
173
+ padding-left: 15px;
174
+ padding-right: 15px;
175
  }
176
 
177
  .informationdiv {
185
  z-index: 1200;
186
  }
187
  .xyz_feedback{
188
+ background: #CEEAF7; /* Old browsers */
189
+ border: 1px solid #64cfe8;
190
+ border-radius:3px;
191
+ width: 98%;
192
+ min-height:40px;
193
+ height:auto;
194
+ padding-left: 10px;
195
+ padding-top: 10px;
196
  font-weight: bold;
197
+ line-height: 20px;
198
 
199
  }
200
 
205
 
206
  .xyz_subscribe{
207
  background: #bae598; /* Old browsers */
208
+ border: 1px solid #4d8a1d;
209
+ border-radius:3px;
210
+ width: 98%;
211
+ line-height:20px;
212
+ min-height:45px;
213
+ height:auto;
214
+ padding-left: 10px;
215
+ padding-top: 10px;
216
 
217
  }
218
  .xyz_subscribe td{
220
  }
221
 
222
  .xyz_plugins{
223
+ background: #F2F2F2; /* Old browsers */
224
+ border: 1px solid #DFDFDF;
225
+ border-radius:3px;
226
+ width: 98%;
227
+ padding-left: 10px;
228
+ padding-top:10px;
229
+ min-height:50px;
230
+ height:auto;
231
+ margin-top:13px;
232
+ line-height: 20px;
233
 
234
  }
235
 
243
  background:-ms-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
244
  background:linear-gradient(top,#25A6E1 0%,#188BC0 100%);
245
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#25A6E1",endColorstr="#188BC0",GradientType=0);
 
246
  color:#ffffff;
247
  font-family:"Helvetica Neue",sans-serif;
248
  font-size:13px;
249
  cursor:pointer;
250
  color:#FFFFFF !important;border-radius:4px !important;
251
+ border:1px solid #1A87B9;height: 30px;
252
+ padding-left: 15px;
253
+ padding-right: 15px;
254
  }
255
  #xyz-wp-fbap-premium {
256
  border: 1px solid #FCC328;
264
  }
265
  a.xyz_fbap_link:hover{text-decoration:underline;}
266
  .xyz_fbap_link{text-decoration:none;font-weight: bold;margin-left:8px;}
267
+
268
+ .xyz_fbap_widefat_table input[type="text"], .xyz_fbap_widefat_table input[type="password"], .xyz_fbap_widefat_table input[type="email"], .xyz_fbap_widefat_table input[type="number"], .xyz_fbap_widefat_table input[type="search"], .xyz_fbap_widefat_table input[type="tel"], .xyz_fbap_widefat_table input[type="url"], .xyz_fbap_widefat_table select {
269
+ width: 200px;padding: 5px !important;height: 2.35em !important;
270
+ }
271
+ .xyz_fbap_widefat_table textarea
272
+ {
273
+ width: 200px;padding: 5px !important;height: 80px !important;
274
+ }
275
+
276
+ .xyz_fbap_metalist_table{
277
+ width: 100%;
278
+ }
279
+
280
+ .xyz_fbap_pleft15{
281
+ padding-left: 15px;
282
+ }
283
+
284
+ .xyz_fbap_meta_acclist_table{
285
+ width: 100%;border: 1px solid #DFDFDF;border-radius:3px; margin-top: 8px;padding-bottom: 5px;
286
+ }
287
+ .xyz_fbap_meta_acclist_table_td{
288
+ background: linear-gradient(to top, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;border-bottom: 1px solid #DFDFDF;height: 25px;
289
+ }
290
+
291
+ a {
292
+ text-decoration: none;
293
+ }
api/base_facebook.php CHANGED
@@ -936,7 +936,7 @@ abstract class FBAPBaseFacebook
936
  } else {
937
  $opts[CURLOPT_HTTPHEADER] = array('Expect:');
938
  }
939
-
940
  curl_setopt_array($ch, $opts);
941
  $result = curl_exec($ch);
942
 
936
  } else {
937
  $opts[CURLOPT_HTTPHEADER] = array('Expect:');
938
  }
939
+ $opts[CURLOPT_SSL_VERIFYPEER]=(get_option('xyz_fbap_peer_verification')=='1') ? TRUE : FALSE;
940
  curl_setopt_array($ch, $opts);
941
  $result = curl_exec($ch);
942
 
facebook-auto-publish.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Facebook Auto Publish
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/facebook-auto-publish/
5
  Description: Publish posts automatically from your blog to Facebook social media. You can publish your posts to Facebook as simple text message, text message with image or as attached link to your blog. The plugin supports filtering posts by custom post-types and categories.
6
- Version: 1.0.2
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  License: GPLv2 or later
3
  Plugin Name: Facebook Auto Publish
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/facebook-auto-publish/
5
  Description: Publish posts automatically from your blog to Facebook social media. You can publish your posts to Facebook as simple text message, text message with image or as attached link to your blog. The plugin supports filtering posts by custom post-types and categories.
6
+ Version: 1.1
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  License: GPLv2 or later
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: f1logic
3
  Donate link: http://xyzscripts.com/donate/
4
  Tags: facebook, facebook auto publish, publish post to facebook, add link to facebook, facebook publishing, post to facebook, post to fb, social media auto publish, social media publishing, social network auto publish, social media, social network
5
  Requires at least: 2.8
6
- Tested up to: 3.8
7
- Stable tag: 1.0.2
8
  License: GPLv2 or later
9
 
10
  Publish posts automatically to Facebook page or profile.
@@ -107,6 +107,11 @@ When you create your own applications, it ensures that the posts to Facebook are
107
  You may use post title, content, excerpt, permalink, site title and user nicename for auto publishing.
108
 
109
 
 
 
 
 
 
110
  More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScripts Support") and we shall get back to you with the answers.
111
 
112
 
@@ -117,8 +122,13 @@ More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScript
117
 
118
  == Changelog ==
119
 
 
 
 
 
 
120
  = Facebook Auto Publish 1.0.2 =
121
- * Bug fixed for &amp;nbsp; in post.
122
 
123
  = Facebook Auto Publish 1.0.1 =
124
  * Default image fetch logic for auto publish updated.
3
  Donate link: http://xyzscripts.com/donate/
4
  Tags: facebook, facebook auto publish, publish post to facebook, add link to facebook, facebook publishing, post to facebook, post to fb, social media auto publish, social media publishing, social network auto publish, social media, social network
5
  Requires at least: 2.8
6
+ Tested up to: 3.8.1
7
+ Stable tag: 1.1
8
  License: GPLv2 or later
9
 
10
  Publish posts automatically to Facebook page or profile.
107
  You may use post title, content, excerpt, permalink, site title and user nicename for auto publishing.
108
 
109
 
110
+ = 6. Why do I see SSL related errors in logs ? =
111
+
112
+ SSL peer verification may not be functioning in your server. Please turn off SSL peer verification in settings of plugin and try again.
113
+
114
+
115
  More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScripts Support") and we shall get back to you with the answers.
116
 
117
 
122
 
123
  == Changelog ==
124
 
125
+ = Facebook Auto Publish 1.1 =
126
+ * View logs for last published post
127
+ * Option to enable/disable SSL peer verification
128
+ * Option to reauthorize the application
129
+
130
  = Facebook Auto Publish 1.0.2 =
131
+ * Bug fixed for &amp;nbsp; in post
132
 
133
  = Facebook Auto Publish 1.0.1 =
134
  * Default image fetch logic for auto publish updated.
xyz-functions.php CHANGED
@@ -48,14 +48,70 @@ if(!function_exists('xyz_fbap_links')){
48
  $base = plugin_basename(XYZ_FBAP_PLUGIN_FILE);
49
  if ($file == $base) {
50
 
 
 
51
  $links[] = '<a href="http://xyzscripts.com/support/" class="xyz_support" title="Support"></a>';
52
  $links[] = '<a href="http://twitter.com/xyzscripts" class="xyz_twitt" title="Follow us on twitter"></a>';
53
  $links[] = '<a href="https://www.facebook.com/xyzscripts" class="xyz_fbook" title="Facebook"></a>';
54
- $links[] = '<a href="https://plus.google.com/101215320403235276710/" class="xyz_gplus" title="+1"></a>';
55
  }
56
  return $links;
57
  }
58
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  add_filter( 'plugin_row_meta','xyz_fbap_links',10,2);
60
 
61
  ?>
48
  $base = plugin_basename(XYZ_FBAP_PLUGIN_FILE);
49
  if ($file == $base) {
50
 
51
+ $links[] = '<a href="http://kb.xyzscripts.com/wordpress-plugins/facebook-auto-publish/" title="FAQ">FAQ</a>';
52
+ $links[] = '<a href="http://docs.xyzscripts.com/wordpress-plugins/facebook-auto-publish/" title="Read Me">README</a>';
53
  $links[] = '<a href="http://xyzscripts.com/support/" class="xyz_support" title="Support"></a>';
54
  $links[] = '<a href="http://twitter.com/xyzscripts" class="xyz_twitt" title="Follow us on twitter"></a>';
55
  $links[] = '<a href="https://www.facebook.com/xyzscripts" class="xyz_fbook" title="Facebook"></a>';
56
+ $links[] = '<a href="https://plus.google.com/+Xyzscripts" class="xyz_gplus" title="+1"></a>';
57
  }
58
  return $links;
59
  }
60
  }
61
+
62
+
63
+ if(!function_exists('xyz_fbap_string_limit')){
64
+ function xyz_fbap_string_limit($string, $limit) {
65
+
66
+ $space=" ";$appendstr=" ...";
67
+ if(mb_strlen($string) <= $limit) return $string;
68
+ if(mb_strlen($appendstr) >= $limit) return '';
69
+ $string = mb_substr($string, 0, $limit-mb_strlen($appendstr));
70
+ $rpos = mb_strripos($string, $space);
71
+ if ($rpos===false)
72
+ return $string.$appendstr;
73
+ else
74
+ return mb_substr($string, 0, $rpos).$appendstr;
75
+ }
76
+
77
+ }
78
+
79
+ if(!function_exists('xyz_fbap_getimage')){
80
+ function xyz_fbap_getimage($post_ID,$description_org)
81
+ {
82
+ $attachmenturl="";
83
+ $post_thumbnail_id = get_post_thumbnail_id( $post_ID );
84
+ if($post_thumbnail_id!="")
85
+ {
86
+ $attachmenturl=wp_get_attachment_url($post_thumbnail_id);
87
+ $attachmentimage=wp_get_attachment_image_src( $post_thumbnail_id, full );
88
+
89
+ }
90
+ else {
91
+ preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/is', $description_org, $matches);
92
+ if(isset($matches[1][0]))
93
+ $attachmenturl = $matches[1][0];
94
+ else {
95
+ apply_filters('the_content', $description_org);
96
+ preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/is', $description_org, $matches);
97
+ if(isset($matches[1][0]))
98
+ $attachmenturl = $matches[1][0];
99
+ }
100
+
101
+
102
+ }
103
+ return $attachmenturl;
104
+ }
105
+
106
+ }
107
+
108
+ /* Local time formating */
109
+ if(!function_exists('xyz_fbap_local_date_time')){
110
+ function xyz_fbap_local_date_time($format,$timestamp){
111
+ return date($format, $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ));
112
+ }
113
+ }
114
+
115
  add_filter( 'plugin_row_meta','xyz_fbap_links',10,2);
116
 
117
  ?>