Blog2Social: Social Media Auto Post & Scheduler - Version 4.3.3

Version Description

Bugfix: Calendar date time function

Download this release

Release Info

Developer Blog2Social
Plugin Icon 128x128 Blog2Social: Social Media Auto Post & Scheduler
Version 4.3.3
Comparing to
See all releases

Code changes from version 4.3.2 to 4.3.3

assets/css/b2s/wp/{post-meta-box.css → post-box.css} RENAMED
@@ -127,7 +127,7 @@
127
  }
128
 
129
  .b2s-btn-success, .b2s-label-success {
130
- background-color: #79b232 !important;
131
  }
132
  .b2s-center-block {
133
  display: block !important;
@@ -135,8 +135,8 @@
135
  margin-right: auto;
136
  }
137
  .b2s-btn-success {
138
- background-color: #5cb85c !important;
139
- border-color: #4cae4c !important;
140
  color: #fff !important;
141
  }
142
 
127
  }
128
 
129
  .b2s-btn-success, .b2s-label-success {
130
+ background-color: #79B232 !important;
131
  }
132
  .b2s-center-block {
133
  display: block !important;
135
  margin-right: auto;
136
  }
137
  .b2s-btn-success {
138
+ background-color: #79B232 !important;
139
+ border-color: #398439 !important;
140
  color: #fff !important;
141
  }
142
 
assets/js/b2s/calendar.js CHANGED
@@ -1,360 +1,367 @@
1
- jQuery.noConflict();
2
-
3
- jQuery(document).ready(function () {
4
-
5
- jQuery('#b2s_calendar').fullCalendar({
6
- editable: b2s_has_premium,
7
- locale: b2s_calendar_locale,
8
- eventLimit: 2,
9
- timeFormat: 'H:mm',
10
- events: ajaxurl + '?action=b2s_get_calendar_events',
11
- eventRender: function (event, element) {
12
- $header = jQuery("<div>").addClass("b2s-calendar-header");
13
- $network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
14
- element.find(".fc-time").after($network_name);
15
- element.html(element.html());
16
- $parent = element.parent();
17
- $header.append(element.find(".fc-content"));
18
- element.append($header);
19
- $body = jQuery("<div>").addClass("b2s-calendar-body");
20
- $body.append(event.avatar);
21
- $body.append(element.find(".fc-title"));
22
- $body.append(jQuery("<br>"));
23
- var $em = jQuery("<em>").css("padding-top", "5px").css("display", "block");
24
- $em.append("<img src='" + b2s_plugin_url + "assets/images/portale/" + event.network_id + "_flat.png' style='height: 16px;width: 16px;display: inline-block;padding-right: 2px;padding-left: 2px;' />")
25
- $em.append(event.network_name);
26
- $em.append(jQuery("<span>").text(": " + event.profile));
27
- $body.append($em);
28
-
29
- element.append($body);
30
- },
31
- eventDrop: function (event, delta, revertFunc) {
32
- jQuery.ajax({
33
- url: ajaxurl,
34
- type: "POST",
35
- dataType: "json",
36
- cache: false,
37
- data: {
38
- 'action': 'b2s_calendar_move_post',
39
- 'b2s_id': event.b2s_id,
40
- 'user_timezone': event.user_timezone,
41
- 'sched_date': event.start.format(),
42
- },
43
- success: function (data) {
44
- wp.heartbeat.connectNow();
45
- }
46
- });
47
- },
48
- eventAllow: function (dropLocation, draggedEvent) {
49
- return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
50
- },
51
- eventClick: function (calEvent, jsEvent, view) {
52
-
53
- if (jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).length == 1)
54
- {
55
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).remove();
56
- }
57
- b2s_current_post_id = calEvent.post_id;
58
- var $modal = jQuery("<div>");
59
-
60
- jQuery.ajax({
61
- url: ajaxurl,
62
- type: "POST",
63
- cache: false,
64
- async: false,
65
- data: {
66
- 'action': 'b2s_get_calendar_edit_modal',
67
- 'id': calEvent.b2s_id
68
- },
69
- success: function (data) {
70
- $modal = $modal.html(data);
71
- }
72
- });
73
- jQuery("body").append($modal);
74
-
75
- jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
76
-
77
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).modal('show');
78
- activatePortal(calEvent.network_auth_id);
79
- initSceditor(calEvent.network_auth_id);
80
- networkCount(calEvent.network_auth_id);
81
-
82
- if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').length > 0) {
83
- var postFormatText = b2s_calendar_formats;
84
-
85
- var isSetPostFormat = false;
86
- //is set post format => override current condidtions by user settings for this post
87
- if (calEvent.post_format !== null) {
88
- jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val(calEvent.post_format);
89
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[calEvent.post_format]);
90
- jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(calEvent.post_format);
91
-
92
- //edit modal select post format
93
- jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').removeClass('b2s-settings-checked');
94
- jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"][data-post-format="' + calEvent.post_format + '"]').addClass('b2s-settings-checked');
95
-
96
- } else {
97
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val()]);
98
- jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val());
99
- }
100
-
101
- //if linkpost then show btn meta tags
102
- if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val() == "0") {
103
- jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
104
- jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
105
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').hide();
106
-
107
- var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').attr("data-meta-type");
108
- if (dataMetaType == "og") {
109
- jQuery('#b2sChangeOgMeta').val("1");
110
- } else {
111
- jQuery('#b2sChangeCardMeta').val("1");
112
- }
113
-
114
- } else {
115
- jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
116
- jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
117
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').show();
118
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').trigger("click");
119
- }
120
-
121
-
122
- }
123
-
124
- jQuery("#b2sPostId").val(calEvent.post_id);
125
-
126
- var today = new Date();
127
- var dateFormat = "yyyy-mm-dd";
128
- var language = "en";
129
- var showMeridian = true;
130
- if (jQuery('#b2sUserLang').val() == "de") {
131
- dateFormat = "dd.mm.yyyy";
132
- language = "de";
133
- showMeridian = false;
134
- printDateFormat(calEvent.network_auth_id);
135
- }
136
-
137
- jQuery(".b2s-post-item-details-release-input-date").datepicker({
138
- format: dateFormat,
139
- language: language,
140
- maxViewMode: 2,
141
- todayHighlight: true,
142
- startDate: today,
143
- calendarWeeks: true,
144
- autoclose: true
145
- });
146
-
147
- jQuery('.b2s-post-item-details-release-input-time').timepicker({
148
- minuteStep: 15,
149
- appendWidgetTo: 'body',
150
- showSeconds: false,
151
- showMeridian: showMeridian,
152
- defaultTime: 'current',
153
- snapToStep: true
154
- });
155
-
156
-
157
- jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
158
- checkSchedDateTime(calEvent.network_auth_id);
159
- });
160
- jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
161
- checkSchedDateTime(calEvent.network_auth_id);
162
-
163
- });
164
-
165
- init();
166
-
167
- if (!b2s_has_premium)
168
- {
169
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).find("input, textarea, button").each(function () {
170
- if (!jQuery(this).hasClass('b2s-modal-close')) {
171
- jQuery(this).prop("disabled", true);
172
- }
173
- });
174
- }
175
- }
176
-
177
- });
178
-
179
- jQuery(".b2s-loading-area").hide();
180
-
181
- jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
182
- jQuery('.b2s-network-select-image-content').html("");
183
- jQuery.ajax({
184
- url: ajaxurl,
185
- type: "POST",
186
- cache: false,
187
- async: false,
188
- data: {
189
- 'action': 'b2s_get_image_modal',
190
- 'id': jQuery(this).data('post-id'),
191
- 'image_url': jQuery(this).data('image-url')
192
- },
193
- success: function (data) {
194
- jQuery(".b2s-network-select-image-content").html(data);
195
- }
196
- });
197
-
198
- var authId = jQuery(this).data('network-auth-id');
199
- jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
200
- jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
201
-
202
- var content = "<img class='b2s-post-item-network-image-selected-account' height='22px' src='" + jQuery('.b2s-post-item-network-image[data-network-auth-id="' + authId + '"]').attr('src') + "' /> " + jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + authId + '"]').html();
203
- jQuery('.b2s-selected-network-for-image-info').html(content);
204
- jQuery('#b2sInsertImageType').val("0");
205
-
206
- jQuery('.networkImage').each(function () {
207
- var width = this.naturalWidth;
208
- var height = this.naturalHeight;
209
- jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
210
- });
211
- jQuery('#b2s-network-select-image').modal('show');
212
- return false;
213
- });
214
-
215
- jQuery(document).on("click", ".b2s-calendar-delete", function () {
216
- var id = jQuery(this).data("b2s-id");
217
- var post_id = jQuery(this).data("post-id");
218
- jQuery.ajax({
219
- url: ajaxurl,
220
- type: "POST",
221
- dataType: "json",
222
- cache: false,
223
- data: {
224
- 'action': 'b2s_calendar_delete',
225
- 'b2s_id': id,
226
- 'post_id': post_id
227
- },
228
- success: function (data) {
229
- jQuery('#b2s-edit-event-modal-' + id).modal('hide');
230
-
231
- refreshCalender();
232
- wp.heartbeat.connectNow();
233
- }
234
- });
235
- });
236
-
237
- jQuery(document).on("click", ".b2s-calendar-save-all", function (e) {
238
- jQuery('#save_method').val("apply-all");
239
- e.preventDefault();
240
- var id = jQuery(this).data("b2s-id");
241
- jQuery.ajax({
242
- url: ajaxurl,
243
- type: "POST",
244
- dataType: "json",
245
- cache: false,
246
- data: jQuery(this).closest("form").serialize(),
247
- success: function (data) {
248
- jQuery('#b2s-edit-event-modal-' + id).modal('hide');
249
-
250
- refreshCalender();
251
- jQuery('#b2s-edit-event-modal-' + id).remove();
252
- wp.heartbeat.connectNow();
253
- }
254
- });
255
- });
256
-
257
- jQuery(document).on("click", ".b2s-calendar-save-this", function (e) {
258
- e.preventDefault();
259
- jQuery('#save_method').val("apply-this");
260
- var id = jQuery(this).data("b2s-id");
261
- jQuery.ajax({
262
- url: ajaxurl,
263
- type: "POST",
264
- dataType: "json",
265
- cache: false,
266
- data: jQuery(this).closest("form").serialize(),
267
- success: function (data) {
268
- jQuery('#b2s-edit-event-modal-' + id).modal('hide');
269
- refreshCalender();
270
- jQuery('#b2s-edit-event-modal-' + id).remove();
271
- wp.heartbeat.connectNow();
272
- }
273
- });
274
- });
275
-
276
- jQuery(document).on("click", ".release_locks", function () {
277
- jQuery.ajax({
278
- url: ajaxurl,
279
- type: "POST",
280
- cache: false,
281
- async: false,
282
- data: {
283
- 'action': 'b2s_get_calendar_release_locks',
284
- 'post_id': jQuery('#post_id').val()
285
- },
286
- success: function (data) {
287
- wp.heartbeat.connectNow();
288
- }
289
- });
290
- });
291
- });
292
-
293
- function refreshCalender() {
294
- jQuery('#b2s_calendar').fullCalendar('refetchEvents');
295
- }
296
-
297
- jQuery('#b2s-info-meta-tag-modal').on('hidden.bs.modal', function (e) {
298
- jQuery('body').addClass('modal-open');
299
- });
300
-
301
- jQuery('#b2s-network-select-image').on('hidden.bs.modal', function (e) {
302
- jQuery('body').addClass('modal-open');
303
- });
304
-
305
- jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function (e) {
306
- jQuery('body').addClass('modal-open');
307
- });
308
-
309
-
310
- //jQuery(this).attr('data-network-auth-id')
311
- function checkSchedDateTime(dataNetworkAuthId) {
312
- var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
313
- var timeElement = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + dataNetworkAuthId + '"]';
314
- var dateStr = jQuery(dateElement).val();
315
- var minStr = jQuery(timeElement).val();
316
-
317
- var timeZone = parseInt(jQuery('#user_timezone').val()) * (-1);
318
-
319
- if (jQuery('#b2sUserLang').val() == 'de') {
320
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
321
- } else {
322
- var minParts = minStr.split(' ');
323
- var minParts2 = minParts[0].split(':');
324
- if (minParts[1] == 'PM') {
325
- minParts2[0] = parseInt(minParts2[0]) + 12;
326
- }
327
- minStr = minParts2[0] + ':' + minParts2[1];
328
- }
329
-
330
- var minParts3 = minStr.split(':');
331
- if (minParts3[0] < 10) {
332
- minParts3[0] = '0' + minParts3[0];
333
- }
334
- var dateParts = dateStr.split('-');
335
-
336
- //utc current time
337
- var now = new Date();
338
- //offset between utc und user
339
- var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
340
- //enter hour to user time
341
- var hour = parseInt(minParts3[0]) + timeZone + offset;
342
- //calculate datetime in utc
343
- var enter = new Date(dateParts[0], dateParts[1] - 1, dateParts[2], hour, minParts3[1]);
344
- //compare enter date time with allowed user time
345
- if (enter.getTime() < now.getTime()) {
346
- //enter set on next 15 minutes and calculate on user timezone
347
- enter.setTime(now.getTime() + (900000 - (now.getTime() % 900000)) - (3600000 * (timeZone + offset)));
348
- jQuery(dateElement).datepicker('update', enter);
349
- jQuery(timeElement).timepicker('setTime', enter);
350
- }
351
- }
352
-
353
-
354
- function printDateFormat(dataNetworkAuthId) {
355
- var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
356
- var dateStr = jQuery(dateElement).val();
357
- dateStr = dateStr.substring(8, 10) + '.' + dateStr.substring(5, 7) + '.' + dateStr.substring(0, 4);
358
- jQuery(dateElement).val(dateStr);
359
- }
360
-
 
 
 
 
 
 
 
1
+ jQuery.noConflict();
2
+
3
+ jQuery(document).ready(function () {
4
+
5
+ jQuery('#b2s_calendar').fullCalendar({
6
+ editable: b2s_has_premium,
7
+ locale: b2s_calendar_locale,
8
+ eventLimit: 2,
9
+ timeFormat: 'H:mm',
10
+ events: ajaxurl + '?action=b2s_get_calendar_events',
11
+ eventRender: function (event, element) {
12
+ $header = jQuery("<div>").addClass("b2s-calendar-header");
13
+ $network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
14
+ element.find(".fc-time").after($network_name);
15
+ element.html(element.html());
16
+ $parent = element.parent();
17
+ $header.append(element.find(".fc-content"));
18
+ element.append($header);
19
+ $body = jQuery("<div>").addClass("b2s-calendar-body");
20
+ $body.append(event.avatar);
21
+ $body.append(element.find(".fc-title"));
22
+ $body.append(jQuery("<br>"));
23
+ var $em = jQuery("<em>").css("padding-top", "5px").css("display", "block");
24
+ $em.append("<img src='" + b2s_plugin_url + "assets/images/portale/" + event.network_id + "_flat.png' style='height: 16px;width: 16px;display: inline-block;padding-right: 2px;padding-left: 2px;' />")
25
+ $em.append(event.network_name);
26
+ $em.append(jQuery("<span>").text(": " + event.profile));
27
+ $body.append($em);
28
+
29
+ element.append($body);
30
+ },
31
+ eventDrop: function (event, delta, revertFunc) {
32
+ jQuery.ajax({
33
+ url: ajaxurl,
34
+ type: "POST",
35
+ dataType: "json",
36
+ cache: false,
37
+ data: {
38
+ 'action': 'b2s_calendar_move_post',
39
+ 'b2s_id': event.b2s_id,
40
+ 'user_timezone': event.user_timezone,
41
+ 'sched_date': event.start.format(),
42
+ },
43
+ success: function (data) {
44
+ wp.heartbeat.connectNow();
45
+ }
46
+ });
47
+ },
48
+ eventAllow: function (dropLocation, draggedEvent) {
49
+ return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
50
+ },
51
+ eventClick: function (calEvent, jsEvent, view) {
52
+
53
+ if (jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).length == 1)
54
+ {
55
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).remove();
56
+ }
57
+ b2s_current_post_id = calEvent.post_id;
58
+ var $modal = jQuery("<div>");
59
+
60
+ jQuery.ajax({
61
+ url: ajaxurl,
62
+ type: "POST",
63
+ cache: false,
64
+ async: false,
65
+ data: {
66
+ 'action': 'b2s_get_calendar_edit_modal',
67
+ 'id': calEvent.b2s_id
68
+ },
69
+ success: function (data) {
70
+ $modal = $modal.html(data);
71
+ }
72
+ });
73
+ jQuery("body").append($modal);
74
+
75
+ jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
76
+
77
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).modal('show');
78
+ activatePortal(calEvent.network_auth_id);
79
+ initSceditor(calEvent.network_auth_id);
80
+ networkCount(calEvent.network_auth_id);
81
+
82
+ if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').length > 0) {
83
+ var postFormatText = b2s_calendar_formats;
84
+
85
+ var isSetPostFormat = false;
86
+ //is set post format => override current condidtions by user settings for this post
87
+ if (calEvent.post_format !== null) {
88
+ jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val(calEvent.post_format);
89
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[calEvent.post_format]);
90
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(calEvent.post_format);
91
+
92
+ //edit modal select post format
93
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').removeClass('b2s-settings-checked');
94
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"][data-post-format="' + calEvent.post_format + '"]').addClass('b2s-settings-checked');
95
+
96
+ } else {
97
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val()]);
98
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val());
99
+ }
100
+
101
+ //if linkpost then show btn meta tags
102
+ var isMetaChecked = false;
103
+ if (calEvent.network_id == "1" && jQuery('#isOgMetaChecked').val() == "1") {
104
+ isMetaChecked = true;
105
+ }
106
+ if (calEvent.network_id == "2" && jQuery('#isCardMetaChecked').val() == "1") {
107
+ isMetaChecked = true;
108
+ }
109
+ if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val() == "0") {
110
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
111
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
112
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').hide();
113
+
114
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').attr("data-meta-type");
115
+ if (dataMetaType == "og") {
116
+ jQuery('#b2sChangeOgMeta').val("1");
117
+ } else {
118
+ jQuery('#b2sChangeCardMeta').val("1");
119
+ }
120
+
121
+ } else {
122
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
123
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
124
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').show();
125
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').trigger("click");
126
+ }
127
+
128
+
129
+ }
130
+
131
+ jQuery("#b2sPostId").val(calEvent.post_id);
132
+
133
+ var today = new Date();
134
+ var dateFormat = "yyyy-mm-dd";
135
+ var language = "en";
136
+ var showMeridian = true;
137
+ if (jQuery('#b2sUserLang').val() == "de") {
138
+ dateFormat = "dd.mm.yyyy";
139
+ language = "de";
140
+ showMeridian = false;
141
+ //printDateFormat(calEvent.network_auth_id);
142
+ }
143
+
144
+ jQuery(".b2s-post-item-details-release-input-date").datepicker({
145
+ format: dateFormat,
146
+ language: language,
147
+ maxViewMode: 2,
148
+ todayHighlight: true,
149
+ startDate: today,
150
+ calendarWeeks: true,
151
+ autoclose: true
152
+ });
153
+
154
+ jQuery('.b2s-post-item-details-release-input-time').timepicker({
155
+ minuteStep: 15,
156
+ appendWidgetTo: 'body',
157
+ showSeconds: false,
158
+ showMeridian: showMeridian,
159
+ defaultTime: 'current',
160
+ snapToStep: true
161
+ });
162
+
163
+
164
+ jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
165
+ checkSchedDateTime(calEvent.network_auth_id);
166
+ });
167
+ jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
168
+ checkSchedDateTime(calEvent.network_auth_id);
169
+
170
+ });
171
+
172
+ init();
173
+
174
+ if (!b2s_has_premium)
175
+ {
176
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).find("input, textarea, button").each(function () {
177
+ if (!jQuery(this).hasClass('b2s-modal-close')) {
178
+ jQuery(this).prop("disabled", true);
179
+ }
180
+ });
181
+ }
182
+ }
183
+
184
+ });
185
+
186
+ jQuery(".b2s-loading-area").hide();
187
+
188
+ jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
189
+ jQuery('.b2s-network-select-image-content').html("");
190
+ jQuery.ajax({
191
+ url: ajaxurl,
192
+ type: "POST",
193
+ cache: false,
194
+ async: false,
195
+ data: {
196
+ 'action': 'b2s_get_image_modal',
197
+ 'id': jQuery(this).data('post-id'),
198
+ 'image_url': jQuery(this).data('image-url')
199
+ },
200
+ success: function (data) {
201
+ jQuery(".b2s-network-select-image-content").html(data);
202
+ }
203
+ });
204
+
205
+ var authId = jQuery(this).data('network-auth-id');
206
+ jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
207
+ jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
208
+
209
+ var content = "<img class='b2s-post-item-network-image-selected-account' height='22px' src='" + jQuery('.b2s-post-item-network-image[data-network-auth-id="' + authId + '"]').attr('src') + "' /> " + jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + authId + '"]').html();
210
+ jQuery('.b2s-selected-network-for-image-info').html(content);
211
+ jQuery('#b2sInsertImageType').val("0");
212
+
213
+ jQuery('.networkImage').each(function () {
214
+ var width = this.naturalWidth;
215
+ var height = this.naturalHeight;
216
+ jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
217
+ });
218
+ jQuery('#b2s-network-select-image').modal('show');
219
+ return false;
220
+ });
221
+
222
+ jQuery(document).on("click", ".b2s-calendar-delete", function () {
223
+ var id = jQuery(this).data("b2s-id");
224
+ var post_id = jQuery(this).data("post-id");
225
+ jQuery.ajax({
226
+ url: ajaxurl,
227
+ type: "POST",
228
+ dataType: "json",
229
+ cache: false,
230
+ data: {
231
+ 'action': 'b2s_calendar_delete',
232
+ 'b2s_id': id,
233
+ 'post_id': post_id
234
+ },
235
+ success: function (data) {
236
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
237
+
238
+ refreshCalender();
239
+ wp.heartbeat.connectNow();
240
+ }
241
+ });
242
+ });
243
+
244
+ jQuery(document).on("click", ".b2s-calendar-save-all", function (e) {
245
+ jQuery('#save_method').val("apply-all");
246
+ e.preventDefault();
247
+ var id = jQuery(this).data("b2s-id");
248
+ jQuery.ajax({
249
+ url: ajaxurl,
250
+ type: "POST",
251
+ dataType: "json",
252
+ cache: false,
253
+ data: jQuery(this).closest("form").serialize(),
254
+ success: function (data) {
255
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
256
+
257
+ refreshCalender();
258
+ jQuery('#b2s-edit-event-modal-' + id).remove();
259
+ wp.heartbeat.connectNow();
260
+ }
261
+ });
262
+ });
263
+
264
+ jQuery(document).on("click", ".b2s-calendar-save-this", function (e) {
265
+ e.preventDefault();
266
+ jQuery('#save_method').val("apply-this");
267
+ var id = jQuery(this).data("b2s-id");
268
+ jQuery.ajax({
269
+ url: ajaxurl,
270
+ type: "POST",
271
+ dataType: "json",
272
+ cache: false,
273
+ data: jQuery(this).closest("form").serialize(),
274
+ success: function (data) {
275
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
276
+ refreshCalender();
277
+ jQuery('#b2s-edit-event-modal-' + id).remove();
278
+ wp.heartbeat.connectNow();
279
+ }
280
+ });
281
+ });
282
+
283
+ jQuery(document).on("click", ".release_locks", function () {
284
+ jQuery.ajax({
285
+ url: ajaxurl,
286
+ type: "POST",
287
+ cache: false,
288
+ async: false,
289
+ data: {
290
+ 'action': 'b2s_get_calendar_release_locks',
291
+ 'post_id': jQuery('#post_id').val()
292
+ },
293
+ success: function (data) {
294
+ wp.heartbeat.connectNow();
295
+ }
296
+ });
297
+ });
298
+ });
299
+
300
+ function refreshCalender() {
301
+ jQuery('#b2s_calendar').fullCalendar('refetchEvents');
302
+ }
303
+
304
+ jQuery('#b2s-info-meta-tag-modal').on('hidden.bs.modal', function (e) {
305
+ jQuery('body').addClass('modal-open');
306
+ });
307
+
308
+ jQuery('#b2s-network-select-image').on('hidden.bs.modal', function (e) {
309
+ jQuery('body').addClass('modal-open');
310
+ });
311
+
312
+ jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function (e) {
313
+ jQuery('body').addClass('modal-open');
314
+ });
315
+
316
+
317
+ //jQuery(this).attr('data-network-auth-id')
318
+ function checkSchedDateTime(dataNetworkAuthId) {
319
+ var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
320
+ var timeElement = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + dataNetworkAuthId + '"]';
321
+ var dateStr = jQuery(dateElement).val();
322
+ var minStr = jQuery(timeElement).val();
323
+
324
+ var timeZone = parseInt(jQuery('#user_timezone').val()) * (-1);
325
+
326
+ if (jQuery('#b2sUserLang').val() == 'de') {
327
+ dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
328
+ } else {
329
+ var minParts = minStr.split(' ');
330
+ var minParts2 = minParts[0].split(':');
331
+ if (minParts[1] == 'PM') {
332
+ minParts2[0] = parseInt(minParts2[0]) + 12;
333
+ }
334
+ minStr = minParts2[0] + ':' + minParts2[1];
335
+ }
336
+
337
+ var minParts3 = minStr.split(':');
338
+ if (minParts3[0] < 10) {
339
+ minParts3[0] = '0' + minParts3[0];
340
+ }
341
+ var dateParts = dateStr.split('-');
342
+
343
+ //utc current time
344
+ var now = new Date();
345
+ //offset between utc und user
346
+ var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
347
+ //enter hour to user time
348
+ var hour = parseInt(minParts3[0]) + timeZone + offset;
349
+ //calculate datetime in utc
350
+ var enter = new Date(dateParts[0], dateParts[1] - 1, dateParts[2], hour, minParts3[1]);
351
+ //compare enter date time with allowed user time
352
+ if (enter.getTime() < now.getTime()) {
353
+ //enter set on next 15 minutes and calculate on user timezone
354
+ enter.setTime(now.getTime() + (900000 - (now.getTime() % 900000)) - (3600000 * (timeZone + offset)));
355
+ jQuery(dateElement).datepicker('update', enter);
356
+ jQuery(timeElement).timepicker('setTime', enter);
357
+ }
358
+ }
359
+
360
+
361
+ function printDateFormat(dataNetworkAuthId) {
362
+ var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
363
+ var dateStr = jQuery(dateElement).val();
364
+ dateStr = dateStr.substring(8, 10) + '.' + dateStr.substring(5, 7) + '.' + dateStr.substring(0, 4);
365
+ jQuery(dateElement).val(dateStr);
366
+ }
367
+
assets/js/b2s/ship.js CHANGED
@@ -142,8 +142,11 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function ()
142
  jQuery('.b2s-post-item-details-release-input-time[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(network_type_time);
143
  var hours = network_type_time.substring(0, 2);
144
  if (lang == "de") {
145
- var timeparts = network_type_time.split(' ');
146
- hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
 
 
 
147
  }
148
  if (hours < today.getHours()) {
149
  jQuery('.b2s-post-item-details-release-input-date[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(dateTomorrow);
@@ -170,6 +173,34 @@ jQuery(document).on('click', '.b2s-sidbar-network-auth-btn', function () {
170
  jQuery(document).on('click', '.change-meta-tag', function () {
171
  var attr = jQuery(this).attr('readonly');
172
  if (typeof attr !== typeof undefined && attr !== false) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  jQuery('#b2s-info-change-meta-tag-modal').modal('show');
174
  }
175
  return false;
@@ -245,7 +276,9 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-user', function () {
245
  var hours = network_type_time.substring(0, 2);
246
  if (lang == "de") {
247
  var timeparts = network_type_time.split(' ');
248
- hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
 
 
249
  }
250
 
251
  if (hours < today.getHours()) {
@@ -353,7 +386,14 @@ jQuery(document).on("click", ".b2s-user-network-settings-post-format", function
353
  }
354
 
355
  //Edit Meta Tags
356
- if (postFormat == '0' && jQuery('#user_version').val() > 0) { //If linkpost
 
 
 
 
 
 
 
357
  jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
358
  jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
359
  var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').attr("data-meta-type");
@@ -469,12 +509,15 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
469
  jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + networkAuthId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
470
  jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
471
 
472
- /*
473
- jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
474
- jQuery('.b2s-post-item-details-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
475
- */
476
- //if linkpost then show btn meta tags
477
- if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val() == "0" && jQuery('#user_version').val() > 0) {
 
 
 
478
  jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
479
  jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
480
 
@@ -716,7 +759,17 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
716
  */
717
 
718
  //if linkpost then show btn meta tags
719
- if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val() == "0") {
 
 
 
 
 
 
 
 
 
 
720
  jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", false);
721
  jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", false);
722
  var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').attr("data-meta-type");
@@ -778,7 +831,33 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
778
  });
779
 
780
  jQuery(document).on('click', '.b2s-post-item-details-url-image', function () {
781
- if (jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').is(":visible")) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
782
  jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').trigger('click');
783
  }
784
  return false;
@@ -1037,6 +1116,32 @@ jQuery(document).on('click', '.b2s-post-item-details-preview-url-reload', functi
1037
  jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
1038
  var metaType = jQuery(this).attr('data-meta-type');
1039
  var authId = jQuery(this).attr('data-network-auth-id');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1040
  jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
1041
  jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
1042
  var content = "<img class='b2s-post-item-network-image-selected-account' height='22px' src='" + jQuery('.b2s-post-item-network-image[data-network-auth-id="' + authId + '"]').attr('src') + "' /> " + jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + authId + '"]').html();
142
  jQuery('.b2s-post-item-details-release-input-time[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(network_type_time);
143
  var hours = network_type_time.substring(0, 2);
144
  if (lang == "de") {
145
+ var timeparts = network_type_time.split(' ');
146
+ if(timeparts[1] == 'AM'){
147
+ hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
148
+ }
149
+
150
  }
151
  if (hours < today.getHours()) {
152
  jQuery('.b2s-post-item-details-release-input-date[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(dateTomorrow);
173
  jQuery(document).on('click', '.change-meta-tag', function () {
174
  var attr = jQuery(this).attr('readonly');
175
  if (typeof attr !== typeof undefined && attr !== false) {
176
+ jQuery('.meta-text').hide();
177
+ var networkAuthId = jQuery(this).attr("data-network-auth-id");
178
+ var postFormat = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').val();
179
+ var networkId = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').attr("data-network-id");
180
+
181
+ var isMetaChecked = false;
182
+ if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
183
+ isMetaChecked = true;
184
+ }
185
+ if (networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
186
+ isMetaChecked = true;
187
+ }
188
+
189
+ var showDefault = true;
190
+ if (postFormat == "0" && !isMetaChecked) { //isLinkPost
191
+ showDefault = false;
192
+ if (networkId == "1") {
193
+ jQuery('.isOgMetaChecked').show();
194
+ } else {
195
+ jQuery('.isCardMetaChecked').show();
196
+ }
197
+
198
+ }
199
+ if (showDefault) {
200
+ jQuery('.isLinkPost').show();
201
+ }
202
+
203
+
204
  jQuery('#b2s-info-change-meta-tag-modal').modal('show');
205
  }
206
  return false;
276
  var hours = network_type_time.substring(0, 2);
277
  if (lang == "de") {
278
  var timeparts = network_type_time.split(' ');
279
+ if(timeparts[1] == 'AM'){
280
+ hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
281
+ }
282
  }
283
 
284
  if (hours < today.getHours()) {
386
  }
387
 
388
  //Edit Meta Tags
389
+ var isMetaChecked = false;
390
+ if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
391
+ isMetaChecked = true;
392
+ }
393
+ if (networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
394
+ isMetaChecked = true;
395
+ }
396
+ if (isMetaChecked && postFormat == '0' && jQuery('#user_version').val() > 0) { //If linkpost
397
  jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
398
  jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
399
  var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').attr("data-meta-type");
509
  jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + networkAuthId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
510
  jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
511
 
512
+ //if linkpost then show btn meta tags
513
+ var isMetaChecked = false;
514
+ if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
515
+ isMetaChecked = true;
516
+ }
517
+ if (networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
518
+ isMetaChecked = true;
519
+ }
520
+ if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val() == "0" && jQuery('#user_version').val() > 0) {
521
  jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
522
  jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
523
 
759
  */
760
 
761
  //if linkpost then show btn meta tags
762
+
763
+
764
+ var isMetaChecked = false;
765
+ if (data.networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
766
+ isMetaChecked = true;
767
+ }
768
+ if (data.networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
769
+ isMetaChecked = true;
770
+ }
771
+
772
+ if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val() == "0") {
773
  jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", false);
774
  jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", false);
775
  var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').attr("data-meta-type");
831
  });
832
 
833
  jQuery(document).on('click', '.b2s-post-item-details-url-image', function () {
834
+ var networkAuthId = jQuery(this).attr("data-network-auth-id");
835
+ if (jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + networkAuthId + '"]').is(":visible")) {
836
+
837
+ var postFormat = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').val();
838
+ var networkId = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').attr("data-network-id");
839
+
840
+ var isMetaChecked = false;
841
+ if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
842
+ isMetaChecked = true;
843
+ }
844
+ if (networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
845
+ isMetaChecked = true;
846
+ }
847
+
848
+ if (postFormat == "0") { //isLinkPost
849
+ jQuery('.meta-text').hide();
850
+ if (!isMetaChecked) {
851
+ if (networkId == "1") {
852
+ jQuery('.isOgMetaChecked').show();
853
+ } else {
854
+ jQuery('.isCardMetaChecked').show();
855
+ }
856
+ jQuery('#b2s-info-change-meta-tag-modal').modal('show');
857
+ return false;
858
+ }
859
+ }
860
+
861
  jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').trigger('click');
862
  }
863
  return false;
1116
  jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
1117
  var metaType = jQuery(this).attr('data-meta-type');
1118
  var authId = jQuery(this).attr('data-network-auth-id');
1119
+
1120
+
1121
+ var postFormat = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + authId + ']').val();
1122
+ var networkId = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + authId + ']').attr("data-network-id");
1123
+
1124
+ var isMetaChecked = false;
1125
+ if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
1126
+ isMetaChecked = true;
1127
+ }
1128
+ if (networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
1129
+ isMetaChecked = true;
1130
+ }
1131
+
1132
+ if (postFormat == "0") { //isLinkPost
1133
+ jQuery('.meta-text').hide();
1134
+ if (!isMetaChecked) {
1135
+ if (networkId == "1") {
1136
+ jQuery('.isOgMetaChecked').show();
1137
+ } else {
1138
+ jQuery('.isCardMetaChecked').show();
1139
+ }
1140
+ jQuery('#b2s-info-change-meta-tag-modal').modal('show');
1141
+ return false;
1142
+ }
1143
+ }
1144
+
1145
  jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
1146
  jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
1147
  var content = "<img class='b2s-post-item-network-image-selected-account' height='22px' src='" + jQuery('.b2s-post-item-network-image[data-network-auth-id="' + authId + '"]').attr('src') + "' /> " + jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + authId + '"]').html();
assets/js/b2s/wp/{post-meta-box-auto.js → post-box.js} RENAMED
@@ -67,6 +67,17 @@ jQuery(window).on("load", function () {
67
  }
68
  });
69
 
 
 
 
 
 
 
 
 
 
 
 
70
  jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', function () {
71
  if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
72
  jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
@@ -122,11 +133,11 @@ jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', functio
122
 
123
  jQuery(document).on('change', '.b2s-post-meta-box-sched-select', function () {
124
  if (jQuery(this).val() == '1') {
125
- if(jQuery('#b2s-post-meta-box-version').val() > 1){
126
- jQuery('.b2s-post-meta-box-sched-once').show();
127
- }else{
128
- jQuery(this).val('0');
129
- jQuery('#b2s-post-meta-box-note-premium').show();
130
  }
131
  } else {
132
  jQuery('.b2s-post-meta-box-sched-once').hide();
67
  }
68
  });
69
 
70
+ jQuery(document).on('click', '#b2s-meta-box-btn-customize', function () {
71
+ var postStatus = jQuery('#b2s-post-status').val();
72
+ if (postStatus != 'publish' && postStatus != 'future') {
73
+ jQuery('#b2s-post-meta-box-state-no-publish-future-customize').show();
74
+ } else {
75
+ jQuery('#b2s-post-meta-box-state-no-publish-future-customize').hide();
76
+ window.location.href = jQuery('#b2s-redirect-url-customize').val();
77
+ }
78
+ });
79
+
80
+
81
  jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', function () {
82
  if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
83
  jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
133
 
134
  jQuery(document).on('change', '.b2s-post-meta-box-sched-select', function () {
135
  if (jQuery(this).val() == '1') {
136
+ if (jQuery('#b2s-post-meta-box-version').val() > 1) {
137
+ jQuery('.b2s-post-meta-box-sched-once').show();
138
+ } else {
139
+ jQuery(this).val('0');
140
+ jQuery('#b2s-post-meta-box-note-premium').show();
141
  }
142
  } else {
143
  jQuery('.b2s-post-meta-box-sched-once').hide();
assets/js/b2s/wp/post-meta-box-customize.js DELETED
@@ -1,9 +0,0 @@
1
- jQuery(document).on('click', '#b2s-meta-box-btn-customize', function () {
2
- var postStatus = jQuery('#b2s-post-status-customize').val();
3
- if (postStatus != 'publish' && postStatus != 'future') {
4
- jQuery('#b2s-post-meta-box-state-no-publish-future-customize').show();
5
- } else {
6
- jQuery('#b2s-post-meta-box-state-no-publish-future-customize').hide();
7
- window.location.href = jQuery('#b2s-redirect-url-customize').val();
8
- }
9
- });
 
 
 
 
 
 
 
 
 
blog2social.php CHANGED
@@ -7,12 +7,12 @@
7
  * Author: Blog2Social, Adenion
8
  * Text Domain: blog2social
9
  * Domain Path: /languages
10
- * Version: 4.3.2
11
  * Author URI: https://www.blog2social.com
12
  * License: GPL2+
13
  */
14
  //B2SDefine
15
- define('B2S_PLUGIN_VERSION', '432');
16
  define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
17
  define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
18
  define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
7
  * Author: Blog2Social, Adenion
8
  * Text Domain: blog2social
9
  * Domain Path: /languages
10
+ * Version: 4.3.3
11
  * Author URI: https://www.blog2social.com
12
  * License: GPL2+
13
  */
14
  //B2SDefine
15
+ define('B2S_PLUGIN_VERSION', '433');
16
  define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
17
  define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
18
  define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
includes/Ajax/Get.php CHANGED
@@ -67,8 +67,8 @@ class Ajax_Get {
67
  public function getPostMetaBox() {
68
  $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
69
  if (isset($result->result) && (int) $result->result == 1 && isset($result->data) && !empty($result->data) && isset($result->data->mandant) && isset($result->data->auth) && !empty($result->data->mandant) && !empty($result->data->auth)) {
70
- $metaBox = new B2S_MetaBox();
71
- echo json_encode(array('result' => true, 'content' => $metaBox->getMetaBoxHtml($result->data->mandant, $result->data->auth)));
72
  wp_die();
73
  }
74
  echo json_encode(array('result' => false, 'content' => ''));
67
  public function getPostMetaBox() {
68
  $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
69
  if (isset($result->result) && (int) $result->result == 1 && isset($result->data) && !empty($result->data) && isset($result->data->mandant) && isset($result->data->auth) && !empty($result->data->mandant) && !empty($result->data->auth)) {
70
+ $metaBox = new B2S_PostBox();
71
+ echo json_encode(array('result' => true, 'content' => $metaBox->getPostBoxAutoHtml($result->data->mandant, $result->data->auth)));
72
  wp_die();
73
  }
74
  echo json_encode(array('result' => false, 'content' => ''));
includes/{MetaBox.php → B2S/PostBox.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class B2S_MetaBox {
4
 
5
  private $b2sSiteUrl;
6
  private $postLang;
@@ -10,29 +10,7 @@ class B2S_MetaBox {
10
  $this->postLang = strtolower(substr(get_locale(), 0, 2));
11
  }
12
 
13
- public function getMetaBoxCustomizeHtml($postId = 0, $postStatus = '') {
14
- $content = '<input type="hidden" id="b2s-redirect-url-customize" name="b2s-redirect-url-customize" value="' . $this->b2sSiteUrl . 'wp-admin/admin.php?page=blog2social-ship&postId=' . $postId . '"/>';
15
- $content .='<input type="hidden" id="b2s-post-status-customize" name="b2s-post-status-customize" value="' . trim(strtolower($postStatus)) . '"/>';
16
- $content .= '<div class="b2s-post-meta-box">';
17
- $content .= '<a class="b2s-info-btn pull-right" data-modal-target="b2sInfoMetaBoxModalSched" href="#">' . __('Info', 'blog2social') . '</a><br>';
18
- $content .='<div id="b2s-post-meta-box-state-no-publish-future-customize" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-post-meta-box-state-no-publish-future-customize" title="close notice"></button>' . __('Your post is still on draft or pending status. Please make sure that your post is published or scheduled to be published on this blog. You can then auto-post or schedule and customize your social media posts with Blog2Social.', 'blog2social') . '</div>';
19
- $content .= '<a id="b2s-meta-box-btn-customize" class="b2s-btn b2s-btn-primary b2s-btn-sm b2s-center-block b2s-margin-top-5" href="#">' . __('Customize & Schedule Social Media Posts', 'blog2social') . '</a>';
20
- $content .= '</div>';
21
- $content .=' <div class="b2s-meta-box-modal" id="b2sInfoMetaBoxModalSched" aria-hidden="true" style="display:none;">
22
- <div class="b2s-meta-box-modal-dialog">
23
- <div class="b2s-meta-box-modal-header">
24
- <a href="#" class="b2s-meta-box-modal-btn-close" data-modal-target="b2sInfoMetaBoxModalSched" aria-hidden="true">×</a>
25
- <h4 class="b2s-meta-box-modal-title">' . __('Blog2Social: Customize & Schedule Social Media Posts', 'blog2social') . '</h4>
26
- </div>
27
- <div class="b2s-meta-box-modal-body">
28
- <p>' . __('Customize and schedule your social media posts on the one page preview for all your selected networks: tailor your posts with individual comments, #hashtags or @handles and schedule your posts for the best times to post, for multiple times or re-share recurrently for more visibility and engagement with your community.', 'blog2social') . '</p>
29
- </div>
30
- </div>
31
- </div>';
32
- return $content;
33
- }
34
-
35
- public function getMetaBoxAutoHtml($postId = 0, $postType = 'post', $postStatus = '') {
36
 
37
  $isChecked = "";
38
  $lastPost = "";
@@ -44,7 +22,8 @@ class B2S_MetaBox {
44
  $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
45
  $selectedProfileID = get_option('B2S_PLUGIN_SAVE_META_BOX_AUTO_SHARE_PROFILE_USER_' . B2S_PLUGIN_BLOG_USER_ID);
46
  $b2sHeartbeatFaqLink = '<a target="_blank" href="' . ((substr(B2S_LANGUAGE, 0, 2) == 'de' || (isset($_GET['lang']) && $_GET['lang'] == 'de')) ? 'https://www.blog2social.com/de/faq/content/1/63/de/systemvoraussetzungen-fuer-die-installation-von-blog2social.html' : 'https://www.blog2social.com/en/faq/content/1/58/en/system-requirements-for-installing-blog2social.html') . '">' . __('Please see FAQ', 'blog2social') . '</a>';
47
-
 
48
  if (B2S_PLUGIN_USER_VERSION > 0) {
49
  if ($postId > 0) {
50
  global $wpdb;
@@ -65,13 +44,13 @@ class B2S_MetaBox {
65
  }
66
 
67
  $content = '<div class="b2s-post-meta-box">
68
- <a class="b2s-info-btn pull-right b2s-info-btn-premium" data-modal-target="b2sInfoMetaBoxModalAutoPost" href="#">' . __('Info', 'blog2social') . '</a><br>
69
  <div id="b2s-server-connection-fail" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-server-connection-fail" title="close notice"></button>' . __('The connection to the server failed. Try again!', 'blog2social') . '</div>
70
  <div id="b2s-heartbeat-fail" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-heartbeat-fail" title="close notice"></button>' . __('WordPress uses heartbeats by default, Blog2Social as well. Please enable heartbeats for using Blog2Social!', 'blog2social') . $b2sHeartbeatFaqLink . ' </div>
 
71
  <div id="b2s-post-meta-box-state-no-auth" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-post-meta-box-state-no-auth" title="close notice"></button>' . __('There are no authorizations for your selected profile. Please, authorize with a social network or select a other profile.', 'blog2social') . '<a href="' . $this->b2sSiteUrl . 'wp-admin/admin.php?page=blog2social-network' . '" target="_bank">' . __('Network settings', 'blog2social') . '</a></div>
72
  <div id="b2s-post-meta-box-state-no-publish-future" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-post-meta-box-state-no-publish-future" title="close notice"></button>' . __('Your post is still on draft or pending status. Please make sure that your post is published or scheduled to be published on this blog. You can then auto-post or schedule and customize your social media posts with Blog2Social.', 'blog2social') . '</div>
73
  <div id="b2s-url-valid-warning" class="b2s-info-warning"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-url-valid-warning" title="close notice"></button>' . __('Notice: Please make sure, that your website address is reachable. The Social Networks do not allow postings from local installations.', 'blog2social') . '</div>
74
-
75
  <input type="hidden" id="b2s-user-last-selected-profile-id" name="b2s-user-last-selected-profile-id" value="' . ($selectedProfileID !== false ? (int) $selectedProfileID : 0) . '" />
76
  <input type="hidden" id="b2s-home-url" name="b2s-home-url" value="' . get_option('home') . '"/>
77
  <input type="hidden" id="b2sLang" name="b2s-user-lang" value="' . strtolower(substr(get_locale(), 0, 2)) . '">
@@ -80,13 +59,19 @@ class B2S_MetaBox {
80
  <input type="hidden" id="b2s-user-timezone" name="b2s-user-timezone" value="' . $userTimeZoneOffset . '"/>
81
  <input type="hidden" id="b2s-post-status" name="b2s-post-status" value="' . trim(strtolower($postStatus)) . '"/>
82
  <input type="hidden" name="b2s-post-meta-box-version" id="b2s-post-meta-box-version" value="' . B2S_PLUGIN_USER_VERSION . '"/>
 
 
 
 
 
 
 
83
  ' . $lastPost . '
84
- <div class="b2s-margin-top-5"></div>
85
  <input id="b2s-post-meta-box-time-dropdown-publish" class="post-format" ' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'disabled' : '') . ' name="b2s-post-meta-box-time-dropdown" value="publish" type="checkbox" ' . $isChecked . '>
86
- <label for="b2s-post-meta-box-time-dropdown-publish" class="post-format-icon">' . __('enable Auto-Posting', 'blog2social') . '</label>
87
- ';
88
  if (B2S_PLUGIN_USER_VERSION <= 1) {
89
- $content .= '<span class="b2s-label b2s-label-success"><a href="#" class="b2s-btn-label-premium b2s-info-btn" data-modal-target="b2sInfoMetaBoxModalAutoPost">' . __("PREMIUM", "blog2social") . '</a></span>';
90
  }
91
 
92
  $content .='<div class="b2s-loading-area" style="display:none">
@@ -97,6 +82,18 @@ class B2S_MetaBox {
97
  </div>
98
  </div>';
99
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  $content .= '<div class="b2s-meta-box-modal" id="b2sInfoMetaBoxModalAutoPost" aria-hidden="true" style="display:none;">
101
  <div class="b2s-meta-box-modal-dialog">
102
  <div class="b2s-meta-box-modal-header">
@@ -141,7 +138,7 @@ class B2S_MetaBox {
141
  return $content;
142
  }
143
 
144
- public function getMetaBoxHtml($mandant = array(), $auth = array()) {
145
  $authContent = '';
146
  $content = '<br><div class="b2s-meta-box-auto-post-area"><label for="b2s-post-meta-box-profil-dropdown">' . __('Select profile:', 'blog2social') . ' <div style="float:right;"><a href="' . $this->b2sSiteUrl . 'wp-admin/admin.php?page=blog2social-network' . '" target="_blank">' . __('Network settings', 'blog2social') . '</a></div></label>
147
  <select style="width:100%;" id="b2s-post-meta-box-profil-dropdown" name="b2s-post-meta-box-profil-dropdown">';
1
  <?php
2
 
3
+ class B2S_PostBox {
4
 
5
  private $b2sSiteUrl;
6
  private $postLang;
10
  $this->postLang = strtolower(substr(get_locale(), 0, 2));
11
  }
12
 
13
+ public function getPostBox($postId = 0, $postType = 'post', $postStatus = '') {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  $isChecked = "";
16
  $lastPost = "";
22
  $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
23
  $selectedProfileID = get_option('B2S_PLUGIN_SAVE_META_BOX_AUTO_SHARE_PROFILE_USER_' . B2S_PLUGIN_BLOG_USER_ID);
24
  $b2sHeartbeatFaqLink = '<a target="_blank" href="' . ((substr(B2S_LANGUAGE, 0, 2) == 'de' || (isset($_GET['lang']) && $_GET['lang'] == 'de')) ? 'https://www.blog2social.com/de/faq/content/1/63/de/systemvoraussetzungen-fuer-die-installation-von-blog2social.html' : 'https://www.blog2social.com/en/faq/content/1/58/en/system-requirements-for-installing-blog2social.html') . '">' . __('Please see FAQ', 'blog2social') . '</a>';
25
+ $metaSettings = get_option('B2S_PLUGIN_GENERAL_OPTIONS');
26
+
27
  if (B2S_PLUGIN_USER_VERSION > 0) {
28
  if ($postId > 0) {
29
  global $wpdb;
44
  }
45
 
46
  $content = '<div class="b2s-post-meta-box">
 
47
  <div id="b2s-server-connection-fail" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-server-connection-fail" title="close notice"></button>' . __('The connection to the server failed. Try again!', 'blog2social') . '</div>
48
  <div id="b2s-heartbeat-fail" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-heartbeat-fail" title="close notice"></button>' . __('WordPress uses heartbeats by default, Blog2Social as well. Please enable heartbeats for using Blog2Social!', 'blog2social') . $b2sHeartbeatFaqLink . ' </div>
49
+ <div id="b2s-post-meta-box-state-no-publish-future-customize" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-post-meta-box-state-no-publish-future-customize" title="close notice"></button>' . __('Your post is still on draft or pending status. Please make sure that your post is published or scheduled to be published on this blog. You can then auto-post or schedule and customize your social media posts with Blog2Social.', 'blog2social') . '</div>
50
  <div id="b2s-post-meta-box-state-no-auth" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-post-meta-box-state-no-auth" title="close notice"></button>' . __('There are no authorizations for your selected profile. Please, authorize with a social network or select a other profile.', 'blog2social') . '<a href="' . $this->b2sSiteUrl . 'wp-admin/admin.php?page=blog2social-network' . '" target="_bank">' . __('Network settings', 'blog2social') . '</a></div>
51
  <div id="b2s-post-meta-box-state-no-publish-future" class="b2s-info-error"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-post-meta-box-state-no-publish-future" title="close notice"></button>' . __('Your post is still on draft or pending status. Please make sure that your post is published or scheduled to be published on this blog. You can then auto-post or schedule and customize your social media posts with Blog2Social.', 'blog2social') . '</div>
52
  <div id="b2s-url-valid-warning" class="b2s-info-warning"><button class="b2s-btn-close-meta-box b2s-close-icon" data-area-id="b2s-url-valid-warning" title="close notice"></button>' . __('Notice: Please make sure, that your website address is reachable. The Social Networks do not allow postings from local installations.', 'blog2social') . '</div>
53
+ <input type="hidden" id="b2s-redirect-url-customize" name="b2s-redirect-url-customize" value="' . $this->b2sSiteUrl . 'wp-admin/admin.php?page=blog2social-ship&postId=' . $postId . '"/>
54
  <input type="hidden" id="b2s-user-last-selected-profile-id" name="b2s-user-last-selected-profile-id" value="' . ($selectedProfileID !== false ? (int) $selectedProfileID : 0) . '" />
55
  <input type="hidden" id="b2s-home-url" name="b2s-home-url" value="' . get_option('home') . '"/>
56
  <input type="hidden" id="b2sLang" name="b2s-user-lang" value="' . strtolower(substr(get_locale(), 0, 2)) . '">
59
  <input type="hidden" id="b2s-user-timezone" name="b2s-user-timezone" value="' . $userTimeZoneOffset . '"/>
60
  <input type="hidden" id="b2s-post-status" name="b2s-post-status" value="' . trim(strtolower($postStatus)) . '"/>
61
  <input type="hidden" name="b2s-post-meta-box-version" id="b2s-post-meta-box-version" value="' . B2S_PLUGIN_USER_VERSION . '"/>
62
+ <input type="hidden" id="isOgMetaChecked" name="isOgMetaChecked" value="'.(isset($metaSettings['og_active']) ? (int) $metaSettings['og_active'] : 0).'">
63
+ <input type="hidden" id="isCardMetaChecked" name="isCardMetaChecked" value="'.(isset($metaSettings['card_active']) ? (int) $metaSettings['card_active'] : 0).'">
64
+
65
+ <h3 class="b2s-meta-box-headline">' . __('Custom Sharing & Scheduling', 'blog2social') . ' <a class="b2s-info-btn" data-modal-target="b2sInfoMetaBoxModalSched" href="#">' . __('Info', 'blog2social') . '</a></h3>
66
+ <a id="b2s-meta-box-btn-customize" class="b2s-btn b2s-btn-success b2s-btn-sm b2s-center-block b2s-btn-margin-bottom-15" href="#">' . __('Customize & Schedule Social Media Posts', 'blog2social') . '</a>
67
+ <hr>
68
+ <h3 class="b2s-meta-box-headline">' . __('Social Media Auto-Posting', 'blog2social') . ' <a class="b2s-info-btn" data-modal-target="b2sInfoMetaBoxModalAutoPost" href="#">' . __('Info', 'blog2social') . '</a></h3>
69
  ' . $lastPost . '
 
70
  <input id="b2s-post-meta-box-time-dropdown-publish" class="post-format" ' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'disabled' : '') . ' name="b2s-post-meta-box-time-dropdown" value="publish" type="checkbox" ' . $isChecked . '>
71
+ <label for="b2s-post-meta-box-time-dropdown-publish" class="post-format-icon">' . __('enable Auto-Posting', 'blog2social') . '</label>';
72
+
73
  if (B2S_PLUGIN_USER_VERSION <= 1) {
74
+ $content .= ' <span class="b2s-label b2s-label-success"><a href="#" class="b2s-btn-label-premium b2s-info-btn" data-modal-target="b2sInfoMetaBoxModalAutoPost">' . __("PREMIUM", "blog2social") . '</a></span>';
75
  }
76
 
77
  $content .='<div class="b2s-loading-area" style="display:none">
82
  </div>
83
  </div>';
84
 
85
+ $content .=' <div class="b2s-meta-box-modal" id="b2sInfoMetaBoxModalSched" aria-hidden="true" style="display:none;">
86
+ <div class="b2s-meta-box-modal-dialog">
87
+ <div class="b2s-meta-box-modal-header">
88
+ <a href="#" class="b2s-meta-box-modal-btn-close" data-modal-target="b2sInfoMetaBoxModalSched" aria-hidden="true">×</a>
89
+ <h4 class="b2s-meta-box-modal-title">' . __('Blog2Social: Customize & Schedule Social Media Posts', 'blog2social') . '</h4>
90
+ </div>
91
+ <div class="b2s-meta-box-modal-body">
92
+ <p>' . __('Customize and schedule your social media posts on the one page preview for all your selected networks: tailor your posts with individual comments, #hashtags or @handles and schedule your posts for the best times to post, for multiple times or re-share recurrently for more visibility and engagement with your community.', 'blog2social') . '</p>
93
+ </div>
94
+ </div>
95
+ </div>';
96
+
97
  $content .= '<div class="b2s-meta-box-modal" id="b2sInfoMetaBoxModalAutoPost" aria-hidden="true" style="display:none;">
98
  <div class="b2s-meta-box-modal-dialog">
99
  <div class="b2s-meta-box-modal-header">
138
  return $content;
139
  }
140
 
141
+ public function getPostBoxAutoHtml($mandant = array(), $auth = array()) {
142
  $authContent = '';
143
  $content = '<br><div class="b2s-meta-box-auto-post-area"><label for="b2s-post-meta-box-profil-dropdown">' . __('Select profile:', 'blog2social') . ' <div style="float:right;"><a href="' . $this->b2sSiteUrl . 'wp-admin/admin.php?page=blog2social-network' . '" target="_blank">' . __('Network settings', 'blog2social') . '</a></div></label>
144
  <select style="width:100%;" id="b2s-post-meta-box-profil-dropdown" name="b2s-post-meta-box-profil-dropdown">';
includes/B2S/Settings/Item.php CHANGED
@@ -133,8 +133,8 @@ class B2S_Settings_Item {
133
  $card_isChecked = ($card !== false && $card == 1) ? 0 : 1;
134
 
135
  $content = '<div class="col-md-12">';
136
- if(B2S_PLUGIN_ADMIN){
137
- $content .= '<a href="#" class="pull-right btn btn-primary btn-xs b2sClearSocialMetaTags">'.__('Reset all page and post meta data', 'blog2social').'</a>';
138
  }
139
  $content .='<strong>' . __('This is a global feature for your blog, which can only be edited by users with admin rights.', 'blog2social') . '</strong>';
140
  $content .= '<br>';
@@ -144,8 +144,8 @@ class B2S_Settings_Item {
144
  $content .= '<input type="checkbox" value="' . $card_isChecked . '" name="b2s_card_active" id="b2s_card_active" ' . (($card_isChecked == 0) ? 'checked="checked"' : '') . ' /><label for="b2s_card_active"> ' . __('Add Twitter Card meta tags to your shared posts or pages, required by Twitter to display your post or page image, title and description correctly.', 'blog2social', 'blog2social') . ' <a href="#" class="b2s-load-info-meta-tag-modal b2s-info-btn del-padding-left" data-meta-type="card" data-meta-origin="settings">' . __('Info', 'Blog2Social') . '</a></label>';
145
  $content .='<br><br><hr>';
146
  $content .='<h4>' . __('Frontpage Settings', 'blog2social') . '</h4>';
147
- $content .='<div><img alt="" class="b2s-post-item-network-image" src="'.plugins_url('/assets/images/portale/1_flat.png', B2S_PLUGIN_FILE).'"> <b>Facebook</b></div>';
148
- $content .= '<p>'. __('Add the default Open Graph parameters for title, description and image you want Facebook to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
149
  $content .='<br>';
150
  $content .='<div class="col-md-8">';
151
  $content .='<div class="form-group"><label for="b2s_og_default_title"><strong>' . __("Title", "blog2social") . ':</strong></label><input type="text" value="' . ( ($this->generalOptions->_getOption('og_default_title') !== false) ? $this->generalOptions->_getOption('og_default_title') : get_bloginfo('name') ) . '" name="b2s_og_default_title" class="form-control" id="b2s_og_default_title"></div>';
@@ -156,7 +156,7 @@ class B2S_Settings_Item {
156
  $content .='</div>';
157
  $content .='<div class="clearfix"></div>';
158
  $content .='<br>';
159
- $content .='<div><img alt="" class="b2s-post-item-network-image" src="'.plugins_url('/assets/images/portale/2_flat.png', B2S_PLUGIN_FILE).'"> <b>Twitter</b></div>';
160
  $content .='<p>' . __('Add the default Twitter Card parameters for title, description and image you want Twitter to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
161
  $content .='<br>';
162
  $content .='<div class="col-md-8">';
@@ -178,7 +178,7 @@ class B2S_Settings_Item {
178
  if (B2S_PLUGIN_USER_VERSION < 2) {
179
  $content .='<div class="alert alert-default">';
180
  $content .= '<b>' . __('Did you know?', 'blog2social') . '</b><br>';
181
- $content .= __('Beginning with Premium Pro, you can change the custom post format photo post or link post for each individual social media post and channel (profile, page, group), deviate from the default settings.', 'blog2social') . ' <a target="_blank" href="' . B2S_Tools::getSupportLink('affiliate') . '">' . __('Upgrade to Premium Pro now.', 'blog2social') . '</a>';
182
  $content .='<hr></div>';
183
  }
184
 
@@ -186,8 +186,11 @@ class B2S_Settings_Item {
186
  $type = ($networkId == 1) ? array(0, 1, 2) : array(0);
187
  foreach ($type as $t => $typeId) { //Profile,Page,Group
188
  $networkName = ($networkId == 1) ? 'Facebook' : 'Twitter';
 
 
 
189
 
190
- $linkPost = ((isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && ((isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 0) || (isset($optionPostFormat[$networkId][$typeId]) && (int) $optionPostFormat[$networkId][$typeId] == 0)) ) ? 'b2s-settings-checked' : (!isset($optionPostFormat[$networkId]) ? 'b2s-settings-checked' : '' ));
191
  $photoPost = empty($linkPost) ? 'b2s-settings-checked' : '';
192
 
193
  $content .='<div class="b2s-user-network-settings-post-format-area col-md-12" data-network-type="' . $typeId . '" data-network-id="' . $networkId . '" data-network-title="' . $networkName . '" style="display:none;" >';
@@ -224,6 +227,10 @@ class B2S_Settings_Item {
224
  $this->options->_setOption('post_format', $post_format);
225
  }
226
 
 
 
 
 
227
  $disabledInputType = (B2S_PLUGIN_USER_VERSION < 2) ? 'disabled' : '';
228
  $disabledInputAll = (B2S_PLUGIN_USER_VERSION == 0) ? 'disabled' : '';
229
  $disabledTextType = (B2S_PLUGIN_USER_VERSION < 2) ? 'font-gray' : '';
@@ -238,12 +245,12 @@ class B2S_Settings_Item {
238
  $content .='<div class="padding-left-15">';
239
 
240
  if ((B2S_PLUGIN_USER_VERSION < 2 && $networkId == 1) || $networkId == 2) {
241
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right b2s-input-margin-bottom-5"><input type="radio" ' . $disabledInputAll . ' id="all-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 0) ? 'checked' : ((!isset($optionPostFormat[$networkId])) ? 'checked' : '' )) . ' name="all" value="0"><label class="' . $disabledTextAll . '" for="all-' . $networkId . '-1">' . $textAll . '</label></div><div class="clearfix"></div>';
242
  }
243
  if ($networkId == 1) {
244
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[0]-' . $networkId . '-1" ' . ((isset($optionPostFormat[$networkId][0]) && (int) $optionPostFormat[$networkId][0] == 0) ? 'checked' : ( isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[0]" value="0"><label class="' . $disabledTextType . '" for="type[0]-' . $networkId . '-1">' . __('Profile', 'blog2social') . '</label></div><div class="clearfix"></div>';
245
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[1]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][1]) && (int) $optionPostFormat[$networkId][1] == 0) ? 'checked' : ( isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[1]" value="0"><label class="' . $disabledTextType . '" for="type[1]-' . $networkId . '-1">' . __('Page', 'blog2social') . '</label></div><div class="clearfix"></div>';
246
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[2]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][2]) && (int) $optionPostFormat[$networkId][2] == 0) ? 'checked' : ( isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[2]" value="0"><label class="' . $disabledTextType . '" for="type[2]-' . $networkId . '-1">' . __('Group', 'blog2social') . '</label></div><div class="clearfix"></div>';
247
  }
248
  $content .='</div>';
249
  $content .='</div>';
@@ -255,12 +262,12 @@ class B2S_Settings_Item {
255
  $content .='<div class="padding-left-15">';
256
 
257
  if ((B2S_PLUGIN_USER_VERSION < 2 && $networkId == 1) || $networkId == 2) {
258
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right b2s-input-margin-bottom-5"><input type="radio" ' . $disabledInputAll . ' id="all-' . $networkId . '-2" ' . ((isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 1) ? 'checked' : '') . ' name="all" value="1"><label class="' . $disabledTextAll . '" for="all-' . $networkId . '-2">' . $textAll . '</label></div><div class="clearfix"></div>';
259
  }
260
  if ($networkId == 1) {
261
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[0]-' . $networkId . '-2" ' . ( (isset($optionPostFormat[$networkId][0]) && (int) $optionPostFormat[$networkId][0] == 1) ? 'checked' : ( isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 1 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[0]" value="1"><label class="' . $disabledTextType . '" for="type[0]-' . $networkId . '-2">' . __('Profile', 'blog2social') . '</label></div><div class="clearfix"></div>';
262
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[1]-' . $networkId . '-2" ' . ( (isset($optionPostFormat[$networkId][1]) && (int) $optionPostFormat[$networkId][1] == 1) ? 'checked' : ( isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 1 && !isset($optionPostFormat[$networkId][1])) ? 'checked' : '') . ' name="type-format[1]" value="1"><label class="' . $disabledTextType . '" for="type[1]-' . $networkId . '-2">' . __('Page', 'blog2social') . '</label></div><div class="clearfix"></div>';
263
- $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[2]-' . $networkId . '-2" ' . ( (isset($optionPostFormat[$networkId][2]) && (int) $optionPostFormat[$networkId][2] == 1) ? 'checked' : ( isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 1 && !isset($optionPostFormat[$networkId][1])) ? 'checked' : '') . ' name="type-format[2]" value="1"><label class="' . $disabledTextType . '" for="type[2]-' . $networkId . '-2">' . __('Group', 'blog2social') . '</label></div><div class="clearfix"></div>';
264
  }
265
  $content .='</div>';
266
  $content .='</div>';
@@ -283,7 +290,10 @@ class B2S_Settings_Item {
283
  }
284
 
285
  $type = ($networkId == 1) ? array(0, 1, 2) : array(0);
286
- foreach ($type as $t => $typeId) { //Profile,Page,Group
 
 
 
287
  $value = ((isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && ((isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 0) || (isset($optionPostFormat[$networkId][$typeId]) && (int) $optionPostFormat[$networkId][$typeId] == 0)) ) ? 0 : (!isset($optionPostFormat[$networkId]) ? 0 : 1 ));
288
  $content .= "<input type='hidden' class='b2sNetworkSettingsPostFormatCurrent' data-network-id='" . $networkId . "' data-network-type='" . $typeId . "' value='" . (int) $value . "' />";
289
  }
133
  $card_isChecked = ($card !== false && $card == 1) ? 0 : 1;
134
 
135
  $content = '<div class="col-md-12">';
136
+ if (B2S_PLUGIN_ADMIN) {
137
+ $content .= '<a href="#" class="pull-right btn btn-primary btn-xs b2sClearSocialMetaTags">' . __('Reset all page and post meta data', 'blog2social') . '</a>';
138
  }
139
  $content .='<strong>' . __('This is a global feature for your blog, which can only be edited by users with admin rights.', 'blog2social') . '</strong>';
140
  $content .= '<br>';
144
  $content .= '<input type="checkbox" value="' . $card_isChecked . '" name="b2s_card_active" id="b2s_card_active" ' . (($card_isChecked == 0) ? 'checked="checked"' : '') . ' /><label for="b2s_card_active"> ' . __('Add Twitter Card meta tags to your shared posts or pages, required by Twitter to display your post or page image, title and description correctly.', 'blog2social', 'blog2social') . ' <a href="#" class="b2s-load-info-meta-tag-modal b2s-info-btn del-padding-left" data-meta-type="card" data-meta-origin="settings">' . __('Info', 'Blog2Social') . '</a></label>';
145
  $content .='<br><br><hr>';
146
  $content .='<h4>' . __('Frontpage Settings', 'blog2social') . '</h4>';
147
+ $content .='<div><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/1_flat.png', B2S_PLUGIN_FILE) . '"> <b>Facebook</b></div>';
148
+ $content .= '<p>' . __('Add the default Open Graph parameters for title, description and image you want Facebook to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
149
  $content .='<br>';
150
  $content .='<div class="col-md-8">';
151
  $content .='<div class="form-group"><label for="b2s_og_default_title"><strong>' . __("Title", "blog2social") . ':</strong></label><input type="text" value="' . ( ($this->generalOptions->_getOption('og_default_title') !== false) ? $this->generalOptions->_getOption('og_default_title') : get_bloginfo('name') ) . '" name="b2s_og_default_title" class="form-control" id="b2s_og_default_title"></div>';
156
  $content .='</div>';
157
  $content .='<div class="clearfix"></div>';
158
  $content .='<br>';
159
+ $content .='<div><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/2_flat.png', B2S_PLUGIN_FILE) . '"> <b>Twitter</b></div>';
160
  $content .='<p>' . __('Add the default Twitter Card parameters for title, description and image you want Twitter to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
161
  $content .='<br>';
162
  $content .='<div class="col-md-8">';
178
  if (B2S_PLUGIN_USER_VERSION < 2) {
179
  $content .='<div class="alert alert-default">';
180
  $content .= '<b>' . __('Did you know?', 'blog2social') . '</b><br>';
181
+ $content .= __('With Premium Pro, you can change the custom post format photo post or link post for each individual social media post and channel (profile, page, group).', 'blog2social') . ' <a target="_blank" href="' . B2S_Tools::getSupportLink('affiliate') . '">' . __('Upgrade to Premium Pro now.', 'blog2social') . '</a>';
182
  $content .='<hr></div>';
183
  }
184
 
186
  $type = ($networkId == 1) ? array(0, 1, 2) : array(0);
187
  foreach ($type as $t => $typeId) { //Profile,Page,Group
188
  $networkName = ($networkId == 1) ? 'Facebook' : 'Twitter';
189
+ if (!isset($optionPostFormat[$networkId]['all'])){
190
+ $optionPostFormat[$networkId]['all'] = 0;
191
+ }
192
 
193
+ $linkPost = ((isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && (((int) $optionPostFormat[$networkId]['all'] == 0) || (isset($optionPostFormat[$networkId][$typeId]) && (int) $optionPostFormat[$networkId][$typeId] == 0)) ) ? 'b2s-settings-checked' : (!isset($optionPostFormat[$networkId]) ? 'b2s-settings-checked' : '' ));
194
  $photoPost = empty($linkPost) ? 'b2s-settings-checked' : '';
195
 
196
  $content .='<div class="b2s-user-network-settings-post-format-area col-md-12" data-network-type="' . $typeId . '" data-network-id="' . $networkId . '" data-network-title="' . $networkName . '" style="display:none;" >';
227
  $this->options->_setOption('post_format', $post_format);
228
  }
229
 
230
+ if (!isset($optionPostFormat[$networkId]['all'])) {
231
+ $optionPostFormat[$networkId]['all'] = 0;
232
+ }
233
+
234
  $disabledInputType = (B2S_PLUGIN_USER_VERSION < 2) ? 'disabled' : '';
235
  $disabledInputAll = (B2S_PLUGIN_USER_VERSION == 0) ? 'disabled' : '';
236
  $disabledTextType = (B2S_PLUGIN_USER_VERSION < 2) ? 'font-gray' : '';
245
  $content .='<div class="padding-left-15">';
246
 
247
  if ((B2S_PLUGIN_USER_VERSION < 2 && $networkId == 1) || $networkId == 2) {
248
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right b2s-input-margin-bottom-5"><input type="radio" ' . $disabledInputAll . ' id="all-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && (int) $optionPostFormat[$networkId]['all'] == 0) ? 'checked' : ((!isset($optionPostFormat[$networkId])) ? 'checked' : '' )) . ' name="all" value="0"><label class="' . $disabledTextAll . '" for="all-' . $networkId . '-1">' . $textAll . '</label></div><div class="clearfix"></div>';
249
  }
250
  if ($networkId == 1) {
251
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[0]-' . $networkId . '-1" ' . ((isset($optionPostFormat[$networkId][0]) && (int) $optionPostFormat[$networkId][0] == 0) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[0]" value="0"><label class="' . $disabledTextType . '" for="type[0]-' . $networkId . '-1">' . __('Profile', 'blog2social') . '</label></div><div class="clearfix"></div>';
252
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[1]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][1]) && (int) $optionPostFormat[$networkId][1] == 0) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[1]" value="0"><label class="' . $disabledTextType . '" for="type[1]-' . $networkId . '-1">' . __('Page', 'blog2social') . '</label></div><div class="clearfix"></div>';
253
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[2]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][2]) && (int) $optionPostFormat[$networkId][2] == 0) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[2]" value="0"><label class="' . $disabledTextType . '" for="type[2]-' . $networkId . '-1">' . __('Group', 'blog2social') . '</label></div><div class="clearfix"></div>';
254
  }
255
  $content .='</div>';
256
  $content .='</div>';
262
  $content .='<div class="padding-left-15">';
263
 
264
  if ((B2S_PLUGIN_USER_VERSION < 2 && $networkId == 1) || $networkId == 2) {
265
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right b2s-input-margin-bottom-5"><input type="radio" ' . $disabledInputAll . ' id="all-' . $networkId . '-2" ' . ((isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && (int) $optionPostFormat[$networkId]['all'] == 1) ? 'checked' : '') . ' name="all" value="1"><label class="' . $disabledTextAll . '" for="all-' . $networkId . '-2">' . $textAll . '</label></div><div class="clearfix"></div>';
266
  }
267
  if ($networkId == 1) {
268
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[0]-' . $networkId . '-2" ' . ( (isset($optionPostFormat[$networkId][0]) && (int) $optionPostFormat[$networkId][0] == 1) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 1 && !isset($optionPostFormat[$networkId][0])) ? 'checked' : '') . ' name="type-format[0]" value="1"><label class="' . $disabledTextType . '" for="type[0]-' . $networkId . '-2">' . __('Profile', 'blog2social') . '</label></div><div class="clearfix"></div>';
269
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[1]-' . $networkId . '-2" ' . ( (isset($optionPostFormat[$networkId][1]) && (int) $optionPostFormat[$networkId][1] == 1) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 1 && !isset($optionPostFormat[$networkId][1])) ? 'checked' : '') . ' name="type-format[1]" value="1"><label class="' . $disabledTextType . '" for="type[1]-' . $networkId . '-2">' . __('Page', 'blog2social') . '</label></div><div class="clearfix"></div>';
270
+ $content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[2]-' . $networkId . '-2" ' . ( (isset($optionPostFormat[$networkId][2]) && (int) $optionPostFormat[$networkId][2] == 1) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 1 && !isset($optionPostFormat[$networkId][1])) ? 'checked' : '') . ' name="type-format[2]" value="1"><label class="' . $disabledTextType . '" for="type[2]-' . $networkId . '-2">' . __('Group', 'blog2social') . '</label></div><div class="clearfix"></div>';
271
  }
272
  $content .='</div>';
273
  $content .='</div>';
290
  }
291
 
292
  $type = ($networkId == 1) ? array(0, 1, 2) : array(0);
293
+ foreach ($type as $t => $typeId) { //Profile,Page,Group
294
+ if (!isset($optionPostFormat[$networkId]['all']) && !isset($optionPostFormat[$networkId][$typeId])) { //DEFAULT
295
+ $optionPostFormat[$networkId]['all'] = 0;
296
+ }
297
  $value = ((isset($optionPostFormat[$networkId]) && is_array($optionPostFormat[$networkId]) && ((isset($optionPostFormat[$networkId]['all']) && (int) $optionPostFormat[$networkId]['all'] == 0) || (isset($optionPostFormat[$networkId][$typeId]) && (int) $optionPostFormat[$networkId][$typeId] == 0)) ) ? 0 : (!isset($optionPostFormat[$networkId]) ? 0 : 1 ));
298
  $content .= "<input type='hidden' class='b2sNetworkSettingsPostFormatCurrent' data-network-id='" . $networkId . "' data-network-type='" . $typeId . "' value='" . (int) $value . "' />";
299
  }
includes/B2S/Ship/Item.php CHANGED
@@ -262,7 +262,6 @@ class B2S_Ship_Item {
262
  } else {
263
  $meta = array('title' => B2S_Util::getExcerpt(B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang), 50) . ' - ' . $this->websiteName, 'description' => B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, false, (in_array($networkId, $this->allowNoEmoji) ? false : true), $this->userLang), 150));
264
  }
265
-
266
  //EDIT Function - Calendar
267
  $meta = $this->hook_meta($meta);
268
  $imageUrl = $imageUrl ? $imageUrl : (isset($meta['image']) ? $meta['image'] : null);
262
  } else {
263
  $meta = array('title' => B2S_Util::getExcerpt(B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang), 50) . ' - ' . $this->websiteName, 'description' => B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, false, (in_array($networkId, $this->allowNoEmoji) ? false : true), $this->userLang), 150));
264
  }
 
265
  //EDIT Function - Calendar
266
  $meta = $this->hook_meta($meta);
267
  $imageUrl = $imageUrl ? $imageUrl : (isset($meta['image']) ? $meta['image'] : null);
includes/Loader.php CHANGED
@@ -24,13 +24,12 @@ class B2S_Loader {
24
  require_once(B2S_PLUGIN_DIR . 'includes/B2S/Api/Post.php');
25
  add_filter('heartbeat_received', array(B2S_Heartbeat::getInstance(), 'init'), 10, 2);
26
  add_action('wp_logout', array($this, 'releaseLocks'));
27
- //add_action('transition_post_status', array($this, 'b2s_auto_post_publish'), 10, 3); //for Auto-Posting
28
  }
29
 
30
  public function call_admin_hooks() {
31
 
32
  require_once(B2S_PLUGIN_DIR . 'includes/Meta.php');
33
- require_once(B2S_PLUGIN_DIR . 'includes/MetaBox.php');
34
  require_once(B2S_PLUGIN_DIR . 'includes/Notice.php');
35
  require_once(B2S_PLUGIN_DIR . 'includes/Tools.php');
36
  require_once(B2S_PLUGIN_DIR . 'includes/PRG/Api/Post.php');
@@ -44,8 +43,8 @@ class B2S_Loader {
44
  define('B2S_PLUGIN_POSTPERPAGE', '15');
45
  define('B2S_PLUGIN_VERSION_TYPE', serialize(array(0 => 'Free', 1 => 'Smart', 2 => 'Pro', 3 => 'Business', 4 => 'Premium')));
46
  define('B2S_PLUGIN_NETWORK', serialize(array(1 => 'Facebook', 2 => 'Twitter', 3 => 'Linkedin', 4 => 'Tumblr', 5 => 'Storify', 6 => 'Pinterest', 7 => 'Flickr', 8 => 'Xing', 9 => 'Diigo', 10 => 'Google+', 11 => 'Medium', 12 => 'Instagram', 13 => 'Delicious', 14 => 'Torial', 15 => 'Reddit', 16 => 'Bloglovin')));
47
- define('B2S_PLUGIN_SCHED_DEFAULT_TIMES', serialize(array(1 => array(18, 22), 2 => array(8, 10), 3 => array(8, 10), 4 => array(16, 22), 5 => array(), 6 => array(19, 22), 7 => array(7, 9), 8 => array(7, 10), 9 => array(16, 19), 10 => array(7, 10), 11 => array(16, 19), 12 => array(19, 22), 13 => array(11, 13), 14 => array(18, 22), 15 => array(8, 11), 16 => array(16,19))));
48
- define('B2S_PLUGIN_SCHED_DEFAULT_TIMES_INFO', serialize(array(1 => array(0 => array(13, 16), 1 => array(18, 22)), 2 => array(0 => array(8, 10), 1 => array(11, 13), 2 => array(16, 19)), 3 => array(0 => array(8, 10), 1 => array(16, 18)), 4 => array(), 5 => array(), 6 => array(0 => array(12, 14), 1 => array(19, 22)), 7 => array(0 => array(7, 9), 1 => array(17, 19)), 8 => array(0 => array(7, 10), 1 => array(17, 18)), 9 => array(0 => array(8, 10), 1 => array(11, 13), 2 => array(16, 19)), 10 => array(0 => array(7, 10), 1 => array(14, 15)), 11 => array(), 12 => array(0 => array(12, 14), 1 => array(19, 22)), 13 => array(0 => array(8, 10), 1 => array(11, 13), 2 => array(16, 19)), 14 => array(), 15 => array(0 => array(8, 11)), 16 => array(0 => array(16,19)))));
49
  define('B2S_PLUGIN_NETWORK_ALLOW_PROFILE', serialize(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)));
50
  define('B2S_PLUGIN_NETWORK_ALLOW_PAGE', serialize(array(1, 3, 8, 10)));
51
  define('B2S_PLUGIN_NETWORK_ALLOW_GROUP', serialize(array(1, 8, 10)));
@@ -55,17 +54,16 @@ class B2S_Loader {
55
 
56
  $this->blogUserData = get_userdata(B2S_PLUGIN_BLOG_USER_ID);
57
 
58
- $this->update_db_check();
59
  //add_action('plugins_loaded', array($this, 'update_db_check'));
 
60
  add_action('admin_init', array($this, 'registerAssets'));
61
  add_action('admin_enqueue_scripts', array($this, 'addBootAssets'));
62
  add_action('admin_menu', array($this, 'createMenu'));
63
  add_action('admin_bar_menu', array($this, 'createToolbarMenu'), 94);
64
  add_action('admin_notices', array('B2S_Notice', 'getProVersionNotice'));
65
  add_action('admin_notices', array($this, 'b2s_save_post_alert_meta_box'));
66
- add_action('add_meta_boxes', array($this, 'b2s_load_meta_box_customize'));
67
- add_action('add_meta_boxes', array($this, 'b2s_load_meta_box_auto'));
68
- add_action('save_post', array($this, 'b2s_save_meta_box'));
69
  add_action('trash_post', array($this, 'b2s_delete_sched_post'), 10);
70
  add_filter('plugin_action_links_' . B2S_PLUGIN_BASENAME, array($this, 'plugin_activate_sublink'));
71
 
@@ -89,13 +87,6 @@ class B2S_Loader {
89
  B2S_Meta::getInstance()->_run();
90
  }
91
 
92
- /* public function b2s_auto_post_publish($new_status, $old_status, $post) {
93
- //by publish
94
- if ($old_status != 'publish' && $old_status != 'trash' && $new_status == 'publish') {
95
- update_option('_test_auto_post' . $post->ID, $post->ID.''.$post->post_type);
96
- }
97
- } */
98
-
99
  public function update_db_check() {
100
  $this->lastVersion = get_option('b2s_plugin_version');
101
  if ($this->lastVersion == false || (int) $this->lastVersion < B2S_PLUGIN_VERSION) {
@@ -110,7 +101,7 @@ class B2S_Loader {
110
  global $wpdb;
111
  //Heartbeat => b2s_delete_sched_post
112
  $sql = "SELECT id FROM b2s_posts WHERE post_id = %s AND hook_action <= %s AND hide = %s AND sched_date_utc != %s AND publish_date = %s";
113
- $deleteData = $wpdb->get_results($wpdb->prepare($sql, $post_id, 2, 0, "0000-00 00:00:00", "0000-00 00:00:00", ARRAY_A));
114
  if (isset($deleteData[0])) {
115
  foreach ($deleteData as $k => $value) {
116
  $data = array('hook_action' => '3', 'hide' => 1);
@@ -129,50 +120,78 @@ class B2S_Loader {
129
  }
130
  }
131
 
132
- public function b2s_load_meta_box_customize() {
133
- $post_types = get_post_types(array('public' => true));
134
- if (is_array($post_types) && !empty($post_types)) {
135
- foreach ($post_types as $post_type) {
136
- add_meta_box('b2s-post-meta-box-customize', '<span style="padding: 10px 0 10px 25px; background: url(\'' . plugins_url('/assets/images/b2s_icon.png', B2S_PLUGIN_FILE) . '\') no-repeat left center;"></span>' . __('Manually share on Social Media', 'blog2social'), array($this, 'b2s_view_meta_box_customize'), $post_type, 'side', 'high');
137
- }
138
- }
139
- }
140
-
141
- public function b2s_load_meta_box_auto() {
142
  $post_types = get_post_types(array('public' => true));
143
  if (is_array($post_types) && !empty($post_types)) {
144
  foreach ($post_types as $post_type) {
145
- add_meta_box('b2s-post-meta-box-auto', '<span style="padding: 10px 0 10px 25px; background: url(\'' . plugins_url('/assets/images/b2s_icon.png', B2S_PLUGIN_FILE) . '\') no-repeat left center;"></span>' . __('Auto-Post on Social Media', 'blog2social'), array($this, 'b2s_view_meta_box_auto'), $post_type, 'side', 'high');
146
  }
147
  }
148
  }
149
 
150
- public function b2s_view_meta_box_customize() {
151
- wp_enqueue_style('B2SMETABOXCSS');
152
- wp_enqueue_script('B2SMETABOXCUSTOMIZEJS');
153
- $postId = (isset($_GET['post']) && (int) $_GET['post'] > 0) ? (int) $_GET['post'] : 0;
154
- $postStatus = ($postId != 0) ? get_post_status($postId) : '';
155
- $metaBox = new B2S_MetaBox();
156
- echo $metaBox->getMetaBoxCustomizeHtml($postId, $postStatus);
157
- }
158
-
159
- public function b2s_view_meta_box_auto() {
160
  wp_enqueue_style('B2SAIRDATEPICKERCSS');
161
- wp_enqueue_style('B2SMETABOXCSS');
162
  wp_enqueue_script('B2SAIRDATEPICKERJS');
163
  wp_enqueue_script('B2SAIRDATEPICKERDEJS');
164
  wp_enqueue_script('B2SAIRDATEPICKERENJS');
165
- wp_enqueue_script('B2SMETABOXAUTOJS');
166
 
167
  wp_nonce_field("b2s-meta-box-nonce-post-area", "b2s-meta-box-nonce");
168
  $postId = (isset($_GET['post']) && (int) $_GET['post'] > 0) ? (int) $_GET['post'] : 0;
169
  $postType = (isset($_GET['post_type']) && !empty($_GET['post_type'])) ? $_GET['post_type'] : 'post'; //default
170
  $postStatus = ($postId != 0) ? get_post_status($postId) : '';
171
- $metaBox = new B2S_MetaBox();
172
- echo $metaBox->getMetaBoxAutoHtml($postId, $postType, $postStatus);
173
  }
174
 
175
- public function b2s_save_meta_box() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
 
177
  if (isset($_POST['post_ID']) && isset($_POST['user_ID']) && (int) $_POST['post_ID'] > 0 && (int) $_POST['user_ID'] > 0 && !defined("B2S_SAVE_META_BOX_AUTO_SHARE") && !wp_is_post_autosave($_POST['post_ID']) && isset($_POST['b2s-meta-box-nonce']) && wp_verify_nonce($_POST['b2s-meta-box-nonce'], 'b2s-meta-box-nonce-post-area') && isset($_POST['post_status']) && isset($_POST['b2s-post-meta-box-time-dropdown'])) {
178
  if (strtolower($_POST['b2s-post-meta-box-time-dropdown']) == 'publish') {
@@ -234,7 +253,6 @@ class B2S_Loader {
234
  }
235
 
236
  delete_option('B2S_PLUGIN_POST_CONTENT_' . (int) $_POST['post_ID']);
237
- $b2sPostLang = (isset($_POST['b2s-user-lang']) && !empty($_POST['b2s-user-lang'])) ? $_POST['b2s-user-lang'] : 'en';
238
  $image_url = wp_get_attachment_url(get_post_thumbnail_id((int) $_POST['post_ID']));
239
  $keywords = get_the_tags((int) $_POST['post_ID']);
240
  $url = get_permalink($_POST['post_ID']);
@@ -650,7 +668,7 @@ class B2S_Loader {
650
  }
651
  wp_enqueue_script('B2SSHIPJS');
652
  wp_enqueue_script("B2SCALENDARJS");
653
-
654
  require_once( B2S_PLUGIN_DIR . 'views/b2s/post.calendar.php');
655
  } else {
656
  require_once( B2S_PLUGIN_DIR . 'views/notice.php');
@@ -710,7 +728,7 @@ class B2S_Loader {
710
  wp_register_style('B2STIMEPICKERCSS', plugins_url('assets/lib/timepicker/timepicker.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
711
  wp_register_style('PRGPOSTCSS', plugins_url('assets/css/prg/post.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
712
  wp_register_style('B2SWYSIWYGCSS', plugins_url('assets/lib/wysiwyg/square.min.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
713
- wp_register_style('B2SMETABOXCSS', plugins_url('assets/css/b2s/wp/post-meta-box.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
714
  wp_register_style('B2SNOTICECSS', plugins_url('assets/css/notice.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
715
  wp_register_style('B2SFULLCALLENDARCSS', plugins_url('assets/lib/fullcalendar/fullcalendar.min.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
716
  wp_register_style('B2SCALENDARCSS', plugins_url('assets/css/b2s/calendar.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
@@ -739,8 +757,7 @@ class B2S_Loader {
739
  wp_register_script('B2SWYSIWYGJS', plugins_url('assets/lib/wysiwyg/jquery.sceditor.xhtml.min.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
740
  wp_register_script('B2SWYSIWYGLANGDEJS', plugins_url('assets/lib/wysiwyg/languages/de.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
741
  wp_register_script('B2SWYSIWYGLANGENJS', plugins_url('assets/lib/wysiwyg/languages/en.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
742
- wp_register_script('B2SMETABOXAUTOJS', plugins_url('assets/js/b2s/wp/post-meta-box-auto.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
743
- wp_register_script('B2SMETABOXCUSTOMIZEJS', plugins_url('assets/js/b2s/wp/post-meta-box-customize.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
744
  wp_register_script('B2SPOSTSCHEDHEARTBEATJS', plugins_url('assets/js/b2s/wp/post-sched-heartbeat.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
745
  wp_register_script('B2SCALENDARJS', plugins_url('assets/js/b2s/calendar.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
746
  wp_register_script('B2SFULLCALENDARMOMENTJS', plugins_url('assets/lib/fullcalendar/lib/moment.min.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
@@ -925,15 +942,14 @@ class B2S_Loader {
925
  $wpdb->query($sqlDelete);
926
  }
927
 
928
- public function releaseLocks(){
929
  require_once(B2S_PLUGIN_DIR . 'includes/Options.php');
930
  $options = new B2S_Options(get_current_user_id());
931
  $lock = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
932
 
933
- if($lock)
934
- {
935
- delete_option("B2S_PLUGIN_CALENDAR_BLOCKED_".$lock);
936
- $options->_setOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED",false);
937
  }
938
  }
939
 
24
  require_once(B2S_PLUGIN_DIR . 'includes/B2S/Api/Post.php');
25
  add_filter('heartbeat_received', array(B2S_Heartbeat::getInstance(), 'init'), 10, 2);
26
  add_action('wp_logout', array($this, 'releaseLocks'));
 
27
  }
28
 
29
  public function call_admin_hooks() {
30
 
31
  require_once(B2S_PLUGIN_DIR . 'includes/Meta.php');
32
+ require_once(B2S_PLUGIN_DIR . 'includes/B2S/PostBox.php');
33
  require_once(B2S_PLUGIN_DIR . 'includes/Notice.php');
34
  require_once(B2S_PLUGIN_DIR . 'includes/Tools.php');
35
  require_once(B2S_PLUGIN_DIR . 'includes/PRG/Api/Post.php');
43
  define('B2S_PLUGIN_POSTPERPAGE', '15');
44
  define('B2S_PLUGIN_VERSION_TYPE', serialize(array(0 => 'Free', 1 => 'Smart', 2 => 'Pro', 3 => 'Business', 4 => 'Premium')));
45
  define('B2S_PLUGIN_NETWORK', serialize(array(1 => 'Facebook', 2 => 'Twitter', 3 => 'Linkedin', 4 => 'Tumblr', 5 => 'Storify', 6 => 'Pinterest', 7 => 'Flickr', 8 => 'Xing', 9 => 'Diigo', 10 => 'Google+', 11 => 'Medium', 12 => 'Instagram', 13 => 'Delicious', 14 => 'Torial', 15 => 'Reddit', 16 => 'Bloglovin')));
46
+ define('B2S_PLUGIN_SCHED_DEFAULT_TIMES', serialize(array(1 => array(18, 22), 2 => array(8, 10), 3 => array(8, 10), 4 => array(16, 22), 5 => array(), 6 => array(19, 22), 7 => array(7, 9), 8 => array(7, 10), 9 => array(16, 19), 10 => array(7, 10), 11 => array(16, 19), 12 => array(19, 22), 13 => array(11, 13), 14 => array(18, 22), 15 => array(8, 11), 16 => array(16, 19))));
47
+ define('B2S_PLUGIN_SCHED_DEFAULT_TIMES_INFO', serialize(array(1 => array(0 => array(13, 16), 1 => array(18, 22)), 2 => array(0 => array(8, 10), 1 => array(11, 13), 2 => array(16, 19)), 3 => array(0 => array(8, 10), 1 => array(16, 18)), 4 => array(), 5 => array(), 6 => array(0 => array(12, 14), 1 => array(19, 22)), 7 => array(0 => array(7, 9), 1 => array(17, 19)), 8 => array(0 => array(7, 10), 1 => array(17, 18)), 9 => array(0 => array(8, 10), 1 => array(11, 13), 2 => array(16, 19)), 10 => array(0 => array(7, 10), 1 => array(14, 15)), 11 => array(), 12 => array(0 => array(12, 14), 1 => array(19, 22)), 13 => array(0 => array(8, 10), 1 => array(11, 13), 2 => array(16, 19)), 14 => array(), 15 => array(0 => array(8, 11)), 16 => array(0 => array(16, 19)))));
48
  define('B2S_PLUGIN_NETWORK_ALLOW_PROFILE', serialize(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)));
49
  define('B2S_PLUGIN_NETWORK_ALLOW_PAGE', serialize(array(1, 3, 8, 10)));
50
  define('B2S_PLUGIN_NETWORK_ALLOW_GROUP', serialize(array(1, 8, 10)));
54
 
55
  $this->blogUserData = get_userdata(B2S_PLUGIN_BLOG_USER_ID);
56
 
 
57
  //add_action('plugins_loaded', array($this, 'update_db_check'));
58
+ $this->update_db_check();
59
  add_action('admin_init', array($this, 'registerAssets'));
60
  add_action('admin_enqueue_scripts', array($this, 'addBootAssets'));
61
  add_action('admin_menu', array($this, 'createMenu'));
62
  add_action('admin_bar_menu', array($this, 'createToolbarMenu'), 94);
63
  add_action('admin_notices', array('B2S_Notice', 'getProVersionNotice'));
64
  add_action('admin_notices', array($this, 'b2s_save_post_alert_meta_box'));
65
+ add_action('add_meta_boxes', array($this, 'b2s_load_post_box'));
66
+ add_action('save_post', array($this, 'b2s_save_post_box'));
 
67
  add_action('trash_post', array($this, 'b2s_delete_sched_post'), 10);
68
  add_filter('plugin_action_links_' . B2S_PLUGIN_BASENAME, array($this, 'plugin_activate_sublink'));
69
 
87
  B2S_Meta::getInstance()->_run();
88
  }
89
 
 
 
 
 
 
 
 
90
  public function update_db_check() {
91
  $this->lastVersion = get_option('b2s_plugin_version');
92
  if ($this->lastVersion == false || (int) $this->lastVersion < B2S_PLUGIN_VERSION) {
101
  global $wpdb;
102
  //Heartbeat => b2s_delete_sched_post
103
  $sql = "SELECT id FROM b2s_posts WHERE post_id = %s AND hook_action <= %s AND hide = %s AND sched_date_utc != %s AND publish_date = %s";
104
+ $deleteData = $wpdb->get_results($wpdb->prepare($sql, $post_id, 2, 0, "0000-00-00 00:00:00", "0000-00-00 00:00:00", ARRAY_A));
105
  if (isset($deleteData[0])) {
106
  foreach ($deleteData as $k => $value) {
107
  $data = array('hook_action' => '3', 'hide' => 1);
120
  }
121
  }
122
 
123
+ public function b2s_load_post_box() {
 
 
 
 
 
 
 
 
 
124
  $post_types = get_post_types(array('public' => true));
125
  if (is_array($post_types) && !empty($post_types)) {
126
  foreach ($post_types as $post_type) {
127
+ add_meta_box('b2s-post-meta-box-auto', '<span style="padding: 10px 0 10px 25px; background: url(\'' . plugins_url('/assets/images/b2s_icon.png', B2S_PLUGIN_FILE) . '\') no-repeat left center;"></span>' . __('Auto-Post on Social Media', 'blog2social'), array($this, 'b2s_view_post_box'), $post_type, 'side', 'high');
128
  }
129
  }
130
  }
131
 
132
+ public function b2s_view_post_box() {
 
 
 
 
 
 
 
 
 
133
  wp_enqueue_style('B2SAIRDATEPICKERCSS');
134
+ wp_enqueue_style('B2SPOSTBOXCSS');
135
  wp_enqueue_script('B2SAIRDATEPICKERJS');
136
  wp_enqueue_script('B2SAIRDATEPICKERDEJS');
137
  wp_enqueue_script('B2SAIRDATEPICKERENJS');
138
+ wp_enqueue_script('B2SPOSTBOXJS');
139
 
140
  wp_nonce_field("b2s-meta-box-nonce-post-area", "b2s-meta-box-nonce");
141
  $postId = (isset($_GET['post']) && (int) $_GET['post'] > 0) ? (int) $_GET['post'] : 0;
142
  $postType = (isset($_GET['post_type']) && !empty($_GET['post_type'])) ? $_GET['post_type'] : 'post'; //default
143
  $postStatus = ($postId != 0) ? get_post_status($postId) : '';
144
+ $postBox = new B2S_PostBox();
145
+ echo $postBox->getPostBox($postId, $postType, $postStatus);
146
  }
147
 
148
+
149
+ public function b2s_save_post_box() {
150
+
151
+ $b2sPostLang = (isset($_POST['b2s-user-lang']) && !empty($_POST['b2s-user-lang'])) ? $_POST['b2s-user-lang'] : 'en';
152
+
153
+ //OgMeta
154
+ if (isset($_POST['isOgMetaChecked']) && (int) $_POST['isOgMetaChecked'] == 1 && (int) $_POST['post_ID'] > 0 && isset($_POST['content']) && isset($_POST['post_title'])) {
155
+ $meta = B2S_Meta::getInstance();
156
+ $meta->getMeta(((int) $_POST['post_ID']));
157
+
158
+ $title = B2S_Util::getTitleByLanguage(strip_tags($_POST['post_title']), strtolower($b2sPostLang));
159
+
160
+ if (has_excerpt((int) $_POST['post_ID'])) {
161
+ $desc = strip_tags(get_the_excerpt());
162
+ } else {
163
+ $desc = str_replace("\r\n", ' ', substr(strip_tags(strip_shortcodes($_POST['content'])), 0, 160));
164
+ }
165
+
166
+ $image_url = wp_get_attachment_url(get_post_thumbnail_id((int) $_POST['post_ID']));
167
+
168
+ $meta->setMeta('og_title', $title);
169
+ $meta->setMeta('og_desc', $desc);
170
+ $meta->setMeta('og_image', (($image_url !== false) ? trim(urldecode($image_url)) : ''));
171
+ $meta->updateMeta((int) $_POST['post_ID']);
172
+ }
173
+
174
+ //CardMeta
175
+ if (isset($_POST['isCardMetaChecked']) && (int) $_POST['isCardMetaChecked'] == 1 && (int) $_POST['post_ID'] > 0 && isset($_POST['content']) && isset($_POST['post_title'])) {
176
+
177
+ $meta = B2S_Meta::getInstance();
178
+ $meta->getMeta(((int) $_POST['post_ID']));
179
+
180
+ $title = B2S_Util::getTitleByLanguage(strip_tags($_POST['post_title']), strtolower($b2sPostLang));
181
+
182
+ if (has_excerpt((int) $_POST['post_ID'])) {
183
+ $desc = strip_tags(get_the_excerpt());
184
+ } else {
185
+ $desc = str_replace("\r\n", ' ', substr(strip_tags(strip_shortcodes($_POST['content'])), 0, 160));
186
+ }
187
+ $image_url = wp_get_attachment_url(get_post_thumbnail_id((int) $_POST['post_ID']));
188
+
189
+ $meta->setMeta('card_title', $title);
190
+ $meta->setMeta('card_desc', $desc);
191
+ $meta->setMeta('card_image', (($image_url !== false) ? trim(urldecode($image_url)) : ''));
192
+ $meta->updateMeta((int) $_POST['post_ID']);
193
+ }
194
+
195
 
196
  if (isset($_POST['post_ID']) && isset($_POST['user_ID']) && (int) $_POST['post_ID'] > 0 && (int) $_POST['user_ID'] > 0 && !defined("B2S_SAVE_META_BOX_AUTO_SHARE") && !wp_is_post_autosave($_POST['post_ID']) && isset($_POST['b2s-meta-box-nonce']) && wp_verify_nonce($_POST['b2s-meta-box-nonce'], 'b2s-meta-box-nonce-post-area') && isset($_POST['post_status']) && isset($_POST['b2s-post-meta-box-time-dropdown'])) {
197
  if (strtolower($_POST['b2s-post-meta-box-time-dropdown']) == 'publish') {
253
  }
254
 
255
  delete_option('B2S_PLUGIN_POST_CONTENT_' . (int) $_POST['post_ID']);
 
256
  $image_url = wp_get_attachment_url(get_post_thumbnail_id((int) $_POST['post_ID']));
257
  $keywords = get_the_tags((int) $_POST['post_ID']);
258
  $url = get_permalink($_POST['post_ID']);
668
  }
669
  wp_enqueue_script('B2SSHIPJS');
670
  wp_enqueue_script("B2SCALENDARJS");
671
+
672
  require_once( B2S_PLUGIN_DIR . 'views/b2s/post.calendar.php');
673
  } else {
674
  require_once( B2S_PLUGIN_DIR . 'views/notice.php');
728
  wp_register_style('B2STIMEPICKERCSS', plugins_url('assets/lib/timepicker/timepicker.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
729
  wp_register_style('PRGPOSTCSS', plugins_url('assets/css/prg/post.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
730
  wp_register_style('B2SWYSIWYGCSS', plugins_url('assets/lib/wysiwyg/square.min.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
731
+ wp_register_style('B2SPOSTBOXCSS', plugins_url('assets/css/b2s/wp/post-box.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
732
  wp_register_style('B2SNOTICECSS', plugins_url('assets/css/notice.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
733
  wp_register_style('B2SFULLCALLENDARCSS', plugins_url('assets/lib/fullcalendar/fullcalendar.min.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
734
  wp_register_style('B2SCALENDARCSS', plugins_url('assets/css/b2s/calendar.css', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
757
  wp_register_script('B2SWYSIWYGJS', plugins_url('assets/lib/wysiwyg/jquery.sceditor.xhtml.min.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
758
  wp_register_script('B2SWYSIWYGLANGDEJS', plugins_url('assets/lib/wysiwyg/languages/de.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
759
  wp_register_script('B2SWYSIWYGLANGENJS', plugins_url('assets/lib/wysiwyg/languages/en.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
760
+ wp_register_script('B2SPOSTBOXJS', plugins_url('assets/js/b2s/wp/post-box.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
 
761
  wp_register_script('B2SPOSTSCHEDHEARTBEATJS', plugins_url('assets/js/b2s/wp/post-sched-heartbeat.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
762
  wp_register_script('B2SCALENDARJS', plugins_url('assets/js/b2s/calendar.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
763
  wp_register_script('B2SFULLCALENDARMOMENTJS', plugins_url('assets/lib/fullcalendar/lib/moment.min.js', B2S_PLUGIN_FILE), array(), B2S_PLUGIN_VERSION);
942
  $wpdb->query($sqlDelete);
943
  }
944
 
945
+ public function releaseLocks() {
946
  require_once(B2S_PLUGIN_DIR . 'includes/Options.php');
947
  $options = new B2S_Options(get_current_user_id());
948
  $lock = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
949
 
950
+ if ($lock) {
951
+ delete_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $lock);
952
+ $options->_setOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED", false);
 
953
  }
954
  }
955
 
includes/Meta.php CHANGED
@@ -22,11 +22,11 @@ class B2S_Meta {
22
  $this->print = true;
23
  $this->getMeta($this->post->ID);
24
  $this->options = get_option('B2S_PLUGIN_GENERAL_OPTIONS');
25
-
26
  //Check 3rd Plugin Yoast
27
  if (isset($this->options['og_active']) && (int) $this->options['og_active'] == 1) { //on
28
  $yoast = get_option('wpseo_social');
29
- if (is_array($yoast) && isset($yoast['opengraph']) && $yoast['opengraph'] !== false) {
30
  $this->override3rdYoast();
31
  } else {
32
  $this->getOgMeta();
@@ -34,12 +34,18 @@ class B2S_Meta {
34
  }
35
 
36
  if (isset($this->options['card_active']) && (int) $this->options['card_active'] == 1) { //on
37
- if (is_array($yoast) && isset($yoast['opengraph']) && $yoast['twitter'] !== false) {
 
38
  $this->override3rdYoast('card');
39
  } else {
40
  $this->getCardMeta();
41
  }
42
  }
 
 
 
 
 
43
  }
44
 
45
  public function getOgMeta() {
@@ -137,6 +143,13 @@ class B2S_Meta {
137
  }
138
  }
139
 
 
 
 
 
 
 
 
140
  /* private function findImages() {
141
  if (!is_object($this->post)) {
142
  return array();
@@ -160,7 +173,7 @@ class B2S_Meta {
160
  public function getMeta($postId = 0) {
161
  $postId = ((int) $postId > 0) ? $postId : (isset($this->post->ID) && is_object($this->post->ID) ? $this->post->ID : 0);
162
  if ($postId > 0) {
163
- $this->metaData = get_post_meta($postId, self::$meta_prefix, true);
164
  return $this->metaData;
165
  } else {
166
  return false;
22
  $this->print = true;
23
  $this->getMeta($this->post->ID);
24
  $this->options = get_option('B2S_PLUGIN_GENERAL_OPTIONS');
25
+
26
  //Check 3rd Plugin Yoast
27
  if (isset($this->options['og_active']) && (int) $this->options['og_active'] == 1) { //on
28
  $yoast = get_option('wpseo_social');
29
+ if (is_array($yoast) && isset($yoast['opengraph']) && $yoast['opengraph'] !== false && defined('WPSEO_VERSION')) { //plugin with settings is active
30
  $this->override3rdYoast();
31
  } else {
32
  $this->getOgMeta();
34
  }
35
 
36
  if (isset($this->options['card_active']) && (int) $this->options['card_active'] == 1) { //on
37
+ $yoast = get_option('wpseo_social');
38
+ if (is_array($yoast) && isset($yoast['twitter']) && $yoast['twitter'] !== false && defined('WPSEO_VERSION')) {//plugin with settings is active
39
  $this->override3rdYoast('card');
40
  } else {
41
  $this->getCardMeta();
42
  }
43
  }
44
+
45
+ //SEO
46
+ if (!defined('WPSEO_VERSION') && (isset($this->options['og_active']) && (int) $this->options['og_active'] == 1) || isset($this->options['card_active']) && (int) $this->options['card_active'] == 1) {
47
+ $this->getAuthor();
48
+ }
49
  }
50
 
51
  public function getOgMeta() {
143
  }
144
  }
145
 
146
+ public function getAuthor() {
147
+ if ($this->post->post_author > 0 && is_singular()) {
148
+ $author_meta = get_the_author_meta('display_name', $this->post->post_author);
149
+ echo '<meta name="author" content="' . trim(esc_attr($author_meta)) . '"/>' . "\n";
150
+ }
151
+ }
152
+
153
  /* private function findImages() {
154
  if (!is_object($this->post)) {
155
  return array();
173
  public function getMeta($postId = 0) {
174
  $postId = ((int) $postId > 0) ? $postId : (isset($this->post->ID) && is_object($this->post->ID) ? $this->post->ID : 0);
175
  if ($postId > 0) {
176
+ $this->metaData = get_post_meta($postId, self::$meta_prefix, true);
177
  return $this->metaData;
178
  } else {
179
  return false;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Blog2Social, Adenion
3
  Tags: auto-post, social media share, auto-publish, scheduling, social media post, social url share, social network share, share tweet, share links, share this, sharethis, social tools, admin, api, auto share to, autopost, auto-Posting, auto-schedule, auto-schedule social media posts, automatic social sharing plugin, blog marketing, blog2social, blogger, buffer, crossposting, cross-promotion, cross-promoting, bloglovin, bloglovin auto post, facebook, facebook auto post, facebook pages, google auto post, google plus, google plus pages, instagram, instagram auto post, jetpack, jetpack sharing, linkedin, linkedin auto post, medium, medium auto post, multiposting, path, pinterest, re-post, scheduling, scheduling plugin, social media, social media auto publish, social media automation, social media button, social media manager, social media plugin, social media publishing, social media scheduling, social media scheduling tool, social media sharing, social media tool, social network auto publish, social network icon, social network widget, socialmedia, timing, torial, torial auto post, tumblr, twitter, twitter auto post, xing, xing auto post, xing groups, xing gruppen, xing personal profiles, xing company profiles, xing business pages, xing pages, xing seiten, auto post scheduler, repost, social media management, facebook fan page auto post, facebook profile auto post, social auto post, social autoposting, flickr, flickr auto posting, linkedin, linkedin auto posting, linkedin profile, facebook group, facebook gruppen, reddit, reddit auto posting, reddit auto post
4
  Donate link: http://www.blog2social.com
5
  Requires at least: 4.2.2
6
- Tested up to: 4.8.1
7
- Stable tag: 4.3.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -291,6 +291,8 @@ We use the official authentification oAUTH methods to third-party applications p
291
  9. Adjust the best times to schedule in the best time scheduler.
292
 
293
  == Changelog ==
 
 
294
  = 4.3.2 =
295
  Bugfix: Loading process
296
  = 4.3.1 =
@@ -339,6 +341,8 @@ Bug Fix: update method
339
  Re-engineered Post dashboard, new one-page preview features: WYSIWYG editors, simplified network selection, new scheduler features: best-times-scheduler, my-times-scheduler, recurring scheduling, multiple accounts per profile (applies to FREE and PREMIUM)
340
 
341
  == Upgrade Notice ==
 
 
342
  = 4.3.2 =
343
  Bugfix: Loading process
344
  = 4.3.1 =
3
  Tags: auto-post, social media share, auto-publish, scheduling, social media post, social url share, social network share, share tweet, share links, share this, sharethis, social tools, admin, api, auto share to, autopost, auto-Posting, auto-schedule, auto-schedule social media posts, automatic social sharing plugin, blog marketing, blog2social, blogger, buffer, crossposting, cross-promotion, cross-promoting, bloglovin, bloglovin auto post, facebook, facebook auto post, facebook pages, google auto post, google plus, google plus pages, instagram, instagram auto post, jetpack, jetpack sharing, linkedin, linkedin auto post, medium, medium auto post, multiposting, path, pinterest, re-post, scheduling, scheduling plugin, social media, social media auto publish, social media automation, social media button, social media manager, social media plugin, social media publishing, social media scheduling, social media scheduling tool, social media sharing, social media tool, social network auto publish, social network icon, social network widget, socialmedia, timing, torial, torial auto post, tumblr, twitter, twitter auto post, xing, xing auto post, xing groups, xing gruppen, xing personal profiles, xing company profiles, xing business pages, xing pages, xing seiten, auto post scheduler, repost, social media management, facebook fan page auto post, facebook profile auto post, social auto post, social autoposting, flickr, flickr auto posting, linkedin, linkedin auto posting, linkedin profile, facebook group, facebook gruppen, reddit, reddit auto posting, reddit auto post
4
  Donate link: http://www.blog2social.com
5
  Requires at least: 4.2.2
6
+ Tested up to: 4.8.3
7
+ Stable tag: 4.3.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
291
  9. Adjust the best times to schedule in the best time scheduler.
292
 
293
  == Changelog ==
294
+ = 4.3.3 =
295
+ Bugfix: Calendar date time function
296
  = 4.3.2 =
297
  Bugfix: Loading process
298
  = 4.3.1 =
341
  Re-engineered Post dashboard, new one-page preview features: WYSIWYG editors, simplified network selection, new scheduler features: best-times-scheduler, my-times-scheduler, recurring scheduling, multiple accounts per profile (applies to FREE and PREMIUM)
342
 
343
  == Upgrade Notice ==
344
+ = 4.3.3 =
345
+ Bugfix: Usabilitiy and Performance Optimization. Calendar date time function.
346
  = 4.3.2 =
347
  Bugfix: Loading process
348
  = 4.3.1 =
views/b2s/html/footer.phtml CHANGED
@@ -359,11 +359,19 @@
359
  <div class="modal-header">
360
  <button type="button" class="b2s-modal-close close" data-modal-name="#b2s-info-change-meta-tag-modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
361
  <h4 class="modal-title">
362
- <?php _e('Change image, title and description for your post on this network', 'blog2social'); ?>
363
  </h4>
364
  </div>
365
  <div class="modal-body">
366
- <?php _e('You are currently sharing this post as image post. Changes to title and description Meta Tag parameters will only be supported for link post formats. Please change your post format to link post to make individual changes to the title and description for your post preview.','blog2social'); ?>
 
 
 
 
 
 
 
 
367
  </div>
368
  </div>
369
  </div>
359
  <div class="modal-header">
360
  <button type="button" class="b2s-modal-close close" data-modal-name="#b2s-info-change-meta-tag-modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
361
  <h4 class="modal-title">
362
+ <?php _e('Change image, title and description for your post on this network', 'blog2social'); ?>
363
  </h4>
364
  </div>
365
  <div class="modal-body">
366
+ <div class="isLinkPost meta-text" style="display:none;">
367
+ <?php _e('You are currently sharing this post as image post. Changes to title and description Meta Tag parameters will only be supported for link post formats. Please change your post format to link post to make individual changes to the title and description for your post preview.', 'blog2social'); ?>
368
+ </div>
369
+ <div class="isOgMetaChecked meta-text" style="display:none;">
370
+ <?php echo sprintf(__('Your changes will have no effect on your social media posts on Facebook, if you have manually unchecked the Meta Tag options for Facebook in your Blog2Social <a target="_blank" href="%s">settings</a>', 'blog2social'), esc_url('admin.php?page=blog2social-settings')); ?>
371
+ </div>
372
+ <div class="isCardMetaChecked meta-text" style="display:none;">
373
+ <?php echo sprintf(__('Your changes will have no effect on your social media posts on Twitter, if you have manually unchecked the Meta Tag options for Twitter in your Blog2Social <a target="_blank" href="%s">settings</a>', 'blog2social'), esc_url('admin.php?page=blog2social-settings')); ?>
374
+ </div>
375
  </div>
376
  </div>
377
  </div>
views/b2s/html/header.phtml CHANGED
@@ -208,7 +208,7 @@ $showWebdaos = ($meta->is_webdados_active() && $b2sActive) ? 'block' : 'none';
208
  echo '<span class="b2s-version-info pull-right">' . __('Version', 'blog2social') . ' ' . B2S_Util::getVersion($b2sLastVersion) . '</span>';
209
  }
210
  ?>
211
- <a target="_blank" href="http://www.blog2social.com">
212
  <img class="b2s-logo pull-right clear img-responsive" src="<?php echo plugins_url('/assets/images/b2s/b2s_logo.png', B2S_PLUGIN_FILE); ?>" alt="blog2social">
213
  </a>
214
  </div>
208
  echo '<span class="b2s-version-info pull-right">' . __('Version', 'blog2social') . ' ' . B2S_Util::getVersion($b2sLastVersion) . '</span>';
209
  }
210
  ?>
211
+ <a target="_blank" href="https://www.blog2social.com">
212
  <img class="b2s-logo pull-right clear img-responsive" src="<?php echo plugins_url('/assets/images/b2s/b2s_logo.png', B2S_PLUGIN_FILE); ?>" alt="blog2social">
213
  </a>
214
  </div>
views/b2s/post.calendar.php CHANGED
@@ -9,6 +9,7 @@ $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
9
  $optionUserTimeZone = $options->_getOption('user_time_zone');
10
  $userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
11
  $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
 
12
  ?>
13
  <div class="b2s-container">
14
  <div class="b2s-inbox">
@@ -58,6 +59,8 @@ $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Ut
58
  <input type="hidden" id="b2sDefaultNoImage" value="<?php echo plugins_url('/assets/images/no-image.png', B2S_PLUGIN_FILE); ?>">
59
  <input type="hidden" id="b2sPostId" value="">
60
  <input type="hidden" id="b2sInsertImageType" value="0">
 
 
61
 
62
  <div id="b2s-post-ship-item-post-format-modal" class="modal fade" role="dialog" aria-labelledby="b2s-post-ship-item-post-format-modal" aria-hidden="true" data-backdrop="false" style="z-index: 1070">
63
  <div class="modal-dialog modal-lg">
@@ -85,10 +88,10 @@ $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Ut
85
  <div class="text-center">
86
  <br>
87
  <div class="b2s-post-format-settings-info" data-network-id="1" style="display:none;">
88
- <b><?php _e('Define the default settings for the custom post format for all of your Facebook accounts on the Blog2Social settings section.', 'blog2social'); ?></b>
89
  </div>
90
  <div class="b2s-post-format-settings-info" data-network-id="2" style="display:none;">
91
- <b><?php _e('Define the default settings for the custom post format for all of your Twitter accounts on the Blog2Social settings section.', 'blog2social'); ?></b>
92
  </div>
93
  </div>
94
  </div>
9
  $optionUserTimeZone = $options->_getOption('user_time_zone');
10
  $userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
11
  $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
12
+ $metaSettings = get_option('B2S_PLUGIN_GENERAL_OPTIONS');
13
  ?>
14
  <div class="b2s-container">
15
  <div class="b2s-inbox">
59
  <input type="hidden" id="b2sDefaultNoImage" value="<?php echo plugins_url('/assets/images/no-image.png', B2S_PLUGIN_FILE); ?>">
60
  <input type="hidden" id="b2sPostId" value="">
61
  <input type="hidden" id="b2sInsertImageType" value="0">
62
+ <input type="hidden" id="isOgMetaChecked" value="<?php echo (isset($metaSettings['og_active']) ? (int) $metaSettings['og_active'] : 0); ?>">
63
+ <input type="hidden" id="isCardMetaChecked" value="<?php echo (isset($metaSettings['card_active']) ? (int) $metaSettings['card_active'] : 0); ?>">
64
 
65
  <div id="b2s-post-ship-item-post-format-modal" class="modal fade" role="dialog" aria-labelledby="b2s-post-ship-item-post-format-modal" aria-hidden="true" data-backdrop="false" style="z-index: 1070">
66
  <div class="modal-dialog modal-lg">
88
  <div class="text-center">
89
  <br>
90
  <div class="b2s-post-format-settings-info" data-network-id="1" style="display:none;">
91
+ <b><?php _e('Define the default settings for the custom post format for all of your Facebook accounts in the Blog2Social settings.', 'blog2social'); ?></b>
92
  </div>
93
  <div class="b2s-post-format-settings-info" data-network-id="2" style="display:none;">
94
+ <b><?php _e('Define the default settings for the custom post format for all of your Twitter accounts in the Blog2Social settings.', 'blog2social'); ?></b>
95
  </div>
96
  </div>
97
  </div>
views/b2s/ship.php CHANGED
@@ -15,6 +15,7 @@ $optionUserTimeZone = $options->_getOption('user_time_zone');
15
  $userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
16
  $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
17
  $isPremium = (B2S_PLUGIN_USER_VERSION == 0) ? '<span class="label label-success">' . __("PREMIUM", "blog2social") . '</span>' : '';
 
18
  ?>
19
  <div class="b2s-container">
20
  <div class="b2s-inbox">
@@ -376,10 +377,10 @@ $isPremium = (B2S_PLUGIN_USER_VERSION == 0) ? '<span class="label label-success"
376
  <p><?php _e('You want to publish a post on a specific date? No problem! Just enter your desired date and you are ready to go!', 'blog2social') ?></p>
377
  <br>
378
  <b><?php _e('Schedule post recurrently', 'blog2social') ?></b>
379
- <p><?php _e('You have a timeless contribution that everyone must have seen? Plan your publications once as an appointment.', 'blog2social') ?></p>
380
  <br>
381
  <b><?php _e('Best Time Scheduler', 'blog2social') ?></b>
382
- <p><?php _e('You get too few responses in social media? Maybe there was just no one there who could have seen your contribution. Plan the release with the Best Times Manager of Blog2Social at the peak times of social media. Your fanbase is now listening.', 'blog2social') ?></p>
383
  <br>
384
  <?php if (B2S_PLUGIN_USER_VERSION == 0) { ?>
385
  <hr>
@@ -472,10 +473,10 @@ $isPremium = (B2S_PLUGIN_USER_VERSION == 0) ? '<span class="label label-success"
472
  <div class="text-center">
473
  <br>
474
  <div class="b2s-post-format-settings-info" data-network-id="1" style="display:none;">
475
- <b><?php _e('Define the default settings for the custom post format for all of your Facebook accounts on the Blog2Social settings section.', 'blog2social'); ?></b>
476
  </div>
477
  <div class="b2s-post-format-settings-info" data-network-id="2" style="display:none;">
478
- <b><?php _e('Define the default settings for the custom post format for all of your Twitter accounts on the Blog2Social settings section.', 'blog2social'); ?></b>
479
  </div>
480
  </div>
481
  </div>
@@ -496,7 +497,10 @@ $isPremium = (B2S_PLUGIN_USER_VERSION == 0) ? '<span class="label label-success"
496
  <input type="hidden" id="b2sJsTextConnectionFail" value="<?php _e('The connection to the server failed. Try again!', 'blog2social') ?>">
497
  <input type="hidden" id="b2sSelectedNetworkAuthId" value="<?php echo (isset($_GET['network_auth_id']) && (int) $_GET['network_auth_id'] > 0) ? (int) $_GET['network_auth_id'] : ''; ?>">
498
  <input type="hidden" id="b2sDefaultNoImage" value="<?php echo plugins_url('/assets/images/no-image.png', B2S_PLUGIN_FILE); ?>">
499
-
 
 
 
500
  <?php echo $settingsItem->setNetworkSettingsHtml(); ?>
501
  <?php if (trim(strtolower($postData->post_status)) == 'future') { ?>
502
  <input type="hidden" id="b2sBlogPostSchedDate" value="<?php echo strtotime($postData->post_date); ?>000"> <!--for milliseconds-->
15
  $userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
16
  $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
17
  $isPremium = (B2S_PLUGIN_USER_VERSION == 0) ? '<span class="label label-success">' . __("PREMIUM", "blog2social") . '</span>' : '';
18
+ $metaSettings = get_option('B2S_PLUGIN_GENERAL_OPTIONS');
19
  ?>
20
  <div class="b2s-container">
21
  <div class="b2s-inbox">
377
  <p><?php _e('You want to publish a post on a specific date? No problem! Just enter your desired date and you are ready to go!', 'blog2social') ?></p>
378
  <br>
379
  <b><?php _e('Schedule post recurrently', 'blog2social') ?></b>
380
+ <p><?php _e('You have evergreen content you want to re-share from time to time in your timeline? Schedule your evergreen content to be shared once, multiple times or recurringly at specific times.', 'blog2social') ?></p>
381
  <br>
382
  <b><?php _e('Best Time Scheduler', 'blog2social') ?></b>
383
+ <p><?php _e('Whenever you publish a post, only a fraction of your followers will actually see your post. Use the Blog2Social Best Times Scheduler to share your post at the best times for each social network. Get more outreach and extend the lifespan of your posts.', 'blog2social') ?></p>
384
  <br>
385
  <?php if (B2S_PLUGIN_USER_VERSION == 0) { ?>
386
  <hr>
473
  <div class="text-center">
474
  <br>
475
  <div class="b2s-post-format-settings-info" data-network-id="1" style="display:none;">
476
+ <b><?php _e('Define the default settings for the custom post format for all of your Facebook accounts in the Blog2Social settings.', 'blog2social'); ?></b>
477
  </div>
478
  <div class="b2s-post-format-settings-info" data-network-id="2" style="display:none;">
479
+ <b><?php _e('Define the default settings for the custom post format for all of your Twitter accounts in the Blog2Social settings. ', 'blog2social'); ?></b>
480
  </div>
481
  </div>
482
  </div>
497
  <input type="hidden" id="b2sJsTextConnectionFail" value="<?php _e('The connection to the server failed. Try again!', 'blog2social') ?>">
498
  <input type="hidden" id="b2sSelectedNetworkAuthId" value="<?php echo (isset($_GET['network_auth_id']) && (int) $_GET['network_auth_id'] > 0) ? (int) $_GET['network_auth_id'] : ''; ?>">
499
  <input type="hidden" id="b2sDefaultNoImage" value="<?php echo plugins_url('/assets/images/no-image.png', B2S_PLUGIN_FILE); ?>">
500
+ <input type="hidden" id="isMetaChecked" value="<?php echo $postData->ID; ?>">
501
+ <input type="hidden" id="isOgMetaChecked" value="<?php echo (isset($metaSettings['og_active']) ? (int) $metaSettings['og_active'] : 0); ?>">
502
+ <input type="hidden" id="isCardMetaChecked" value="<?php echo (isset($metaSettings['card_active']) ? (int) $metaSettings['card_active'] : 0); ?>">
503
+
504
  <?php echo $settingsItem->setNetworkSettingsHtml(); ?>
505
  <?php if (trim(strtolower($postData->post_status)) == 'future') { ?>
506
  <input type="hidden" id="b2sBlogPostSchedDate" value="<?php echo strtotime($postData->post_date); ?>000"> <!--for milliseconds-->