Blog2Social: Social Media Auto Post & Scheduler - Version 5.0.0

Version Description

Content Curation with links, WooCommerce compatibility, gutenberg editor compatibility

Download this release

Release Info

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

Code changes from version 4.9.2 to 5.0.0

assets/css/b2s/calendar.css CHANGED
@@ -283,4 +283,12 @@ body .fc-day-grid-event .fc-content{
283
284
.b2s-post-approve-info{
285
display: none;
286
}
283
284
.b2s-post-approve-info{
285
display: none;
286
+ }
287
+
288
+ #b2s-btn-select-blog-post, #b2s-btn-select-content-curation{
289
+ margin-top:10px;
290
+ }
291
+
292
+ .img-width-150{
293
+ width: 150px;
294
}
assets/css/b2s/curation.css ADDED
@@ -0,0 +1,90 @@
1
+ .b2s-curation-input-area-info-header-text{
2
+ margin: 15px 0 10px !important;
3
+ font-style: normal;
4
+ font-weight: normal;
5
+ font-size: 16px;
6
+ color: #5d5d5d;
7
+ }
8
+
9
+ .b2s-color-text-red{
10
+ color: #f14242 !important;
11
+ }
12
+
13
+ .b2s-btn-curation-continue{
14
+ font-weight: 600 !important;
15
+ letter-spacing: .1em;
16
+ text-transform: uppercase;
17
+ font-size: 12px !important;
18
+ }
19
+
20
+ .b2s-curation-input-area-btn{
21
+ margin: 25px 0 0;
22
+ }
23
+
24
+ #b2s-curation-input-url-help, .b2s-curation-result-area{
25
+ display: none;
26
+ }
27
+
28
+ .b2s-loading-area {
29
+ width: 100% !important;
30
+ }
31
+
32
+ .b2s-btn-change-url-preview{
33
+ cursor: pointer;
34
+ }
35
+ #b2s-curation-no-review-info, #b2s-curation-no-auth-info, .b2s-post-curation-ship-date-area, #b2s-curation-no-data-info{
36
+ display: none;
37
+ }
38
+
39
+ .b2s-post-item-details-preview-url{
40
+ word-wrap: break-word;
41
+ }
42
+
43
+ .b2s-post-item-details-preview-title{
44
+ font-weight: 600;
45
+ font-size: 14px;
46
+ }
47
+ .b2s-post-item-details-preview-desc{
48
+ font-size: 12px;
49
+ }
50
+
51
+ #b2s-post-curation-twitter-select option:disabled {
52
+ color: #d54e21;
53
+ opacity: 0.2;
54
+ }
55
+
56
+
57
+ .b2s-post-item-area {
58
+ width: 100%;
59
+ }
60
+
61
+ .b2s-post-item-thumb {
62
+ width: 5%;
63
+ margin-right: 8px;
64
+ }
65
+ .b2s-post-item-details, .b2s-post-item-thumb {
66
+ float: left;
67
+ }
68
+ .b2s-post-item-details {
69
+ width: 93%;
70
+ }
71
+
72
+ .b2s-post-item-thumb img {
73
+ border-radius: 50%;
74
+ width: 48px;
75
+ }
76
+
77
+ .b2s-post-item-details h4 {
78
+ font-size: 16px;
79
+ font-weight: 600;
80
+ text-transform: uppercase;
81
+ margin: 3px 3px 3px 0px;
82
+ }
83
+
84
+ .b2s-post-item-details p {
85
+ font-size: 12px;
86
+ }
87
+
88
+ .b2s-post-item-details-message-result {
89
+ margin-top: 2px;
90
+ }
assets/images/b2s/blog-post-icon.png ADDED
Binary file
assets/images/b2s/content-curation-icon.png ADDED
Binary file
assets/images/b2s/product-icon.png ADDED
Binary file
assets/js/b2s/calendar.js CHANGED
@@ -15,10 +15,14 @@ jQuery(document).ready(function () {
15
show = true;
16
$header = jQuery("<div>").addClass("b2s-calendar-header").attr('data-b2s-id', event.b2s_id);
17
$isRelayPost = '';
18
if (event.relay_primary_post_id > 0) {
19
$isRelayPost = ' (Retweet)';
20
}
21
- $network_name = jQuery("<span>").text(event.author + $isRelayPost).addClass("network-name").css("display", "block");
22
element.find(".fc-time").after($network_name);
23
element.html(element.html());
24
$parent = element.parent();
@@ -157,7 +161,7 @@ function showEditSchedCalendarPost(b2s_id, post_id, network_auth_id, network_typ
157
jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
158
jQuery('.b2s-post-approve-info[data-network-auth-id="' + network_auth_id + '"]').hide();
159
}
160
-
161
162
} else {
163
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
@@ -170,6 +174,22 @@ function showEditSchedCalendarPost(b2s_id, post_id, network_auth_id, network_typ
170
jQuery('.b2s-post-approve-info[data-network-auth-id="' + network_auth_id + '"]').show();
171
}
172
}
173
}
174
175
jQuery("#b2sPostId").val(post_id);
@@ -317,17 +337,26 @@ jQuery(document).on('click', '.b2s-calendar-sched-new-post-btn', function () {
317
jQuery('#b2s-sched-post-modal').modal('show');
318
return false;
319
}
320
- jQuery('#b2s-show-post-all-modal').modal('show');
321
var selSchedDate = jQuery(this).parent('td').attr('data-date');
322
if (!jQuery('#b2sSelSchedDate').length > 0) {
323
- jQuery('.b2sSortForm input:first').after('<input value="' + selSchedDate + '" id="b2sSelSchedDate" name="b2sSelSchedDate" type="hidden">');
324
- } else {
325
- jQuery('#b2sSelSchedDate').val(selSchedDate);
326
}
327
b2sSortFormSubmit();
328
return false;
329
});
330
331
332
function showFilter(typ) {
333
if (typ == 'show') {
@@ -342,7 +371,6 @@ function showFilter(typ) {
342
}
343
344
//b2sSortForm
345
-
346
function b2sSortFormSubmit() {
347
jQuery(".b2s-loading-area").show();
348
jQuery('.b2s-sort-result-item-area').html('');
15
show = true;
16
$header = jQuery("<div>").addClass("b2s-calendar-header").attr('data-b2s-id', event.b2s_id);
17
$isRelayPost = '';
18
+ $isCuratedPost = '';
19
+ if(event.post_type == 'b2s_ex_post'){
20
+ $isCuratedPost = ' (Curated Post)';
21
+ }
22
if (event.relay_primary_post_id > 0) {
23
$isRelayPost = ' (Retweet)';
24
}
25
+ $network_name = jQuery("<span>").text(event.author + $isRelayPost + $isCuratedPost).addClass("network-name").css("display", "block");
26
element.find(".fc-time").after($network_name);
27
element.html(element.html());
28
$parent = element.parent();
161
jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
162
jQuery('.b2s-post-approve-info[data-network-auth-id="' + network_auth_id + '"]').hide();
163
}
164
+
165
166
} else {
167
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
174
jQuery('.b2s-post-approve-info[data-network-auth-id="' + network_auth_id + '"]').show();
175
}
176
}
177
+
178
+ //Content Curation
179
+ if (jQuery('.b2s-post-ship-item-post-format[data-network-auth-id="' + network_auth_id + '"]').attr('data-post-wp-type') == 'ex') {
180
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
181
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
182
+ jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
183
+ jQuery('.b2s-load-info-meta-tag-modal[data-network-auth-id="' + network_auth_id + '"]').attr("style", "display:none !important");
184
+ if (jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + network_auth_id + '"]').val() == 0) {
185
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + network_auth_id + '"]').hide();
186
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + network_auth_id + '"]').hide();
187
+ } else {
188
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + network_auth_id + '"]').show();
189
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + network_auth_id + '"]').show();
190
+ }
191
+ }
192
+
193
}
194
195
jQuery("#b2sPostId").val(post_id);
337
jQuery('#b2s-sched-post-modal').modal('show');
338
return false;
339
}
340
+ jQuery('#b2s-show-post-type-modal').modal('show');
341
var selSchedDate = jQuery(this).parent('td').attr('data-date');
342
+ jQuery('#b2sSelSchedDate').val(selSchedDate);
343
+ return false;
344
+ });
345
+
346
+ jQuery(document).on('click', '#b2s-btn-select-blog-post', function () {
347
+ jQuery('#b2s-show-post-type-modal').modal('hide');
348
+ jQuery('#b2s-show-post-all-modal').modal('show');
349
if (!jQuery('#b2sSelSchedDate').length > 0) {
350
+ jQuery('.b2sSortForm input:first').after('<input value="' + jQuery('#b2sSelSchedDate').val() + '" id="b2sSelSchedDate" name="b2sSelSchedDate" type="hidden">');
351
}
352
b2sSortFormSubmit();
353
return false;
354
});
355
356
+ jQuery(document).on('click', '#b2s-btn-select-content-curation', function () {
357
+ window.location.href = jQuery('#b2sRedirectUrlContentCuration').val() + '&schedDate=' + jQuery('#b2sSelSchedDate').val();
358
+ return false;
359
+ });
360
361
function showFilter(typ) {
362
if (typ == 'show') {
371
}
372
373
//b2sSortForm
374
function b2sSortFormSubmit() {
375
jQuery(".b2s-loading-area").show();
376
jQuery('.b2s-sort-result-item-area').html('');
assets/js/b2s/curation.js ADDED
@@ -0,0 +1,339 @@
1
+ jQuery.noConflict();
2
+
3
+ if (typeof wp.heartbeat !== "undefined") {
4
+ jQuery(document).on('heartbeat-send', function (e, data) {
5
+ data['b2s_heartbeat'] = 'b2s_listener';
6
+ });
7
+ wp.heartbeat.connectNow();
8
+ }
9
+
10
+ jQuery(document).on('click', '.b2s-btn-curation-continue', function () {
11
+ jQuery('#b2s-curation-input-url-help').hide();
12
+ var re = new RegExp(/^(https?:\/\/)+[a-zA-Z0-99ÄÖÜöäü-]+(?:\.[a-zA-Z0-99ÄÖÜöäü-]+)+[\w\-\._~:/?#[\]@!\amp;'\(\)\*\+,;=%.]+#x2F;);
13
+ var url = jQuery('#b2s-curation-input-url').val();
14
+ if (re.test(url)) {
15
+ jQuery('#b2s-curation-input-url').removeClass('error');
16
+ jQuery('.b2s-loading-area').show();
17
+ jQuery('.b2s-curation-result-area').show();
18
+ scrapeDetails(url);
19
+ } else {
20
+ jQuery('#b2s-curation-input-url').addClass('error');
21
+ jQuery('#b2s-curation-input-url-help').show();
22
+ }
23
+ return false;
24
+ });
25
+
26
+ jQuery(document).on("keyup", "#b2s-curation-input-url", function () {
27
+ var url = jQuery(this).val();
28
+ jQuery(this).removeClass("error");
29
+ jQuery('#b2s-curation-input-url-help').hide();
30
+ if (url.length != "0") {
31
+ if (url.indexOf("http://") == -1 && url.indexOf("https://") == -1) {
32
+ url = "https://" + url;
33
+ jQuery(this).val(url);
34
+ }
35
+ }
36
+ return false;
37
+ });
38
+
39
+ jQuery(document).on('click', '.b2s-btn-change-url-preview', function () {
40
+ jQuery('.b2s-curation-input-area').show();
41
+ jQuery('.b2s-btn-curation-continue').prop("disabled", false);
42
+ jQuery('.b2s-curation-settings-area').hide();
43
+ jQuery('.b2s-curation-preview-area').hide();
44
+ jQuery('.b2s-server-connection-fail').hide();
45
+ jQuery('#b2s-curation-no-auth-info').hide();
46
+ jQuery('#b2s-curation-no-review-info').hide();
47
+ jQuery('#b2s-curation-no-data-info').hide();
48
+ return false;
49
+ });
50
+
51
+ jQuery(document).on('change', '#b2s-post-curation-ship-type', function () {
52
+ if (jQuery(this).val() == 1) {
53
+ if (jQuery(this).attr('data-user-version') == 0) {
54
+ jQuery('#b2s-sched-post-modal').modal('show');
55
+ jQuery(this).val('0');
56
+ return false;
57
+ }
58
+ }
59
+
60
+ if (jQuery(this).val() == 1) {
61
+ jQuery('.b2s-post-curation-ship-date-area').show();
62
+ jQuery('#b2s-post-curation-ship-date').prop("disabled", false);
63
+
64
+ var today = new Date();
65
+
66
+ if (jQuery('#b2sSelSchedDate').val() != "") {
67
+ today.setTime(jQuery('#b2sSelSchedDate').val());
68
+ }
69
+ if (today.getMinutes() >= 30) {
70
+ today.setHours(today.getHours() + 1);
71
+ today.setMinutes(0);
72
+ } else {
73
+ today.setMinutes(30);
74
+ }
75
+
76
+ var setTodayDate = today.getFullYear() + '-' + (padDate(today.getMonth() + 1)) + '-' + padDate(today.getDate()) + ' ' + formatAMPM(today);
77
+ if (jQuery('#b2s-post-curation-ship-date').attr('data-language') == 'de') {
78
+ setTodayDate = padDate(today.getDate()) + '.' + (padDate(today.getMonth() + 1)) + '.' + today.getFullYear() + ' ' + padDate(today.getHours()) + ':' + padDate(today.getMinutes());
79
+ }
80
+
81
+ jQuery('#b2s-post-curation-ship-date').val(setTodayDate);
82
+ jQuery('#b2s-post-curation-ship-date').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today, 'position': 'top left'});
83
+
84
+ } else {
85
+ jQuery('.b2s-post-curation-ship-date-area').hide();
86
+ jQuery('#b2s-post-curation-ship-date').prop("disabled", true);
87
+ }
88
+ });
89
+
90
+ function scrapeDetails(url) {
91
+ var loadSettings = true;
92
+ if (!jQuery('.b2s-curation-settings-area').is(':empty')) {
93
+ loadSettings = false;
94
+ }
95
+ jQuery('.b2s-curation-input-area').hide();
96
+ jQuery('.b2s-curation-settings-area').hide();
97
+ jQuery('.b2s-curation-preview-area').hide();
98
+ jQuery('.b2s-server-connection-fail').hide();
99
+ jQuery('#b2s-curation-no-auth-info').hide();
100
+ jQuery('#b2s-curation-no-review-info').hide();
101
+ jQuery('#b2s-curation-no-data-info').hide();
102
+
103
+
104
+ jQuery.ajax({
105
+ url: ajaxurl,
106
+ type: "POST",
107
+ dataType: "json",
108
+ async: true,
109
+ cache: true,
110
+ data: {
111
+ 'url': url,
112
+ 'action': 'b2s_scrape_url',
113
+ 'loadSettings': loadSettings,
114
+ },
115
+ error: function () {
116
+ jQuery('.b2s-server-connection-fail').show();
117
+ jQuery('.b2s-loading-area').hide();
118
+ jQuery('.b2s-curation-settings-area').hide();
119
+ jQuery('.b2s-curation-preview-area').hide();
120
+ jQuery('#b2s-btn-curation-customize').prop("disabled", true);
121
+ jQuery('#b2s-btn-curation-share').prop("disabled", true);
122
+ return false;
123
+ },
124
+ success: function (data) {
125
+ jQuery('.b2s-loading-area').hide();
126
+ if (data.result == true) {
127
+ if (loadSettings) {
128
+ jQuery('.b2s-curation-settings-area').html(data.settings);
129
+ jQuery('#b2s-post-curation-profile-select [value="0"]').prop('selected', true).trigger('change');
130
+ }
131
+ jQuery('.b2s-curation-settings-area').show();
132
+ jQuery('.b2s-curation-preview-area').html(data.preview);
133
+ jQuery('.b2s-curation-preview-area').show();
134
+ jQuery('#b2s-btn-curation-customize').prop("disabled", false);
135
+ jQuery('#b2s-btn-curation-share').prop("disabled", false);
136
+
137
+ //set date + select schedulding
138
+ if (jQuery('#b2sSelSchedDate').val() != "") {
139
+ jQuery('#b2s-post-curation-ship-type').val('1').trigger('change');
140
+ }
141
+
142
+
143
+ } else {
144
+ if (data.preview != "") {
145
+ jQuery('.b2s-curation-preview-area').html(data.preview);
146
+ jQuery('.b2s-curation-preview-area').show();
147
+ }
148
+ if (data.error == "NO_PREVIEW") {
149
+ jQuery('.b2s-curation-input-area').show();
150
+ jQuery('.b2s-curation-settings-area').hide();
151
+ jQuery('.b2s-curation-preview-area').hide();
152
+ jQuery('#b2s-curation-no-review-info').show();
153
+ jQuery('#b2s-curation-no-auth-info').hide();
154
+ jQuery('#b2s-curation-no-data-info').hide();
155
+ }
156
+ if (data.error == "NO_AUTH") {
157
+ jQuery('.b2s-curation-input-area').show();
158
+ jQuery('.b2s-curation-settings-area').hide();
159
+ jQuery('.b2s-curation-preview-area').hide();
160
+ jQuery('#b2s-curation-no-auth-info').show();
161
+ jQuery('#b2s-curation-no-review-info').hide();
162
+ jQuery('#b2s-curation-no-data-info').hide();
163
+ }
164
+ jQuery('#b2s-btn-curation-customize').prop("disabled", true);
165
+ jQuery('#b2s-btn-curation-share').prop("disabled", true);
166
+ }
167
+ }
168
+ });
169
+ return false;
170
+
171
+ }
172
+
173
+ jQuery(document).on("keyup", "#b2s-post-curation-comment", function () {
174
+ jQuery(this).removeClass('error');
175
+ if (jQuery(this).val().length === 0) {
176
+ jQuery(this).addClass('error');
177
+ }
178
+ return false;
179
+ });
180
+
181
+ jQuery(document).on('click', '#b2s-btn-curation-share', function () {
182
+ jQuery('#b2s-post-curation-action').val('b2s_curation_share');
183
+ jQuery('#b2s-curation-no-data-info').hide();
184
+ jQuery('#b2s-curation-no-auth-info').hide();
185
+
186
+ if (jQuery('#b2s-post-curation-comment').val().length === 0) {
187
+ jQuery('#b2s-post-curation-comment').addClass('error');
188
+ return false;
189
+ }
190
+ jQuery('.b2s-curation-post-list-area').html("").hide();
191
+ jQuery('.b2s-loading-area').show();
192
+ jQuery('.b2s-curation-settings-area').hide();
193
+ jQuery('.b2s-curation-preview-area').hide();
194
+
195
+ jQuery.ajax({
196
+ processData: false,
197
+ url: ajaxurl,
198
+ type: "POST",
199
+ dataType: "json",
200
+ cache: false,
201
+ data: jQuery("#b2s-curation-post-form").serialize(),
202
+ error: function () {
203
+ jQuery('.b2s-server-connection-fail').show();
204
+ return false;
205
+ },
206
+ success: function (data) {
207
+ if (data.result == true) {
208
+ jQuery('.b2s-loading-area').hide();
209
+ jQuery('.b2s-curation-post-list-area').show();
210
+ jQuery('.b2s-curation-post-list-area').html(data.content);
211
+ } else {
212
+ jQuery('.b2s-loading-area').hide();
213
+ jQuery('.b2s-curation-post-list-area').hide();
214
+ jQuery('.b2s-curation-settings-area').show();
215
+ jQuery('.b2s-curation-preview-area').show();
216
+
217
+ if (data.error == 'NO_AUTH') {
218
+ jQuery('#b2s-curation-no-auth-info').show();
219
+ } else {
220
+ jQuery('#b2s-curation-no-data-info').show();
221
+ }
222
+ }
223
+ wp.heartbeat.connectNow();
224
+ }
225
+ });
226
+ return false;
227
+ });
228
+
229
+ window.addEventListener('message', function (e) {
230
+ if (e.origin == jQuery('#b2sServerUrl').val()) {
231
+ var data = JSON.parse(e.data);
232
+ if (typeof data.action !== typeof undefined && data.action == 'approve') {
233
+ jQuery('.b2s-post-item-details-message-result[data-network-auth-id="' + data.networkAuthId + '"]').html("<br><span class=\"text-success\"><i class=\"glyphicon glyphicon-ok-circle\"></i> " + jQuery("#b2sJsTextPublish").val() + " </span>");
234
+ jQuery.ajax({
235
+ url: ajaxurl,
236
+ type: "POST",
237
+ cache: false,
238
+ async: false,
239
+ data: {
240
+ 'action': 'b2s_update_approve_post',
241
+ 'post_id': data.post_id,
242
+ 'publish_link': data.publish_link,
243
+ 'publish_error_code': data.publish_error_code,
244
+ },
245
+ success: function (data) {
246
+ }
247
+ });
248
+ }
249
+ }
250
+ });
251
+
252
+ function wopApprove(url, name) {
253
+ var location = encodeURI(window.location.protocol + '//' + window.location.hostname);
254
+ window.open(url + '&location=' + location, name, "width=650,height=900,scrollbars=yes,toolbar=no,status=no,resizable=no,menubar=no,location=no,directories=no,top=20,left=20");
255
+ }
256
+
257
+
258
+ jQuery(document).on('click', '#b2s-btn-curation-customize', function () {
259
+ jQuery('#b2s-curation-no-data-info').hide();
260
+ jQuery('#b2s-curation-no-auth-info').hide();
261
+ jQuery('#b2s-post-curation-action').val('b2s_curation_customize');
262
+ jQuery('.b2s-loading-area').show();
263
+ jQuery('.b2s-curation-settings-area').hide();
264
+ jQuery('.b2s-curation-preview-area').hide();
265
+ jQuery.ajax({
266
+ processData: false,
267
+ url: ajaxurl,
268
+ type: "POST",
269
+ dataType: "json",
270
+ cache: false,
271
+ data: jQuery("#b2s-curation-post-form").serialize(),
272
+ error: function () {
273
+ jQuery('.b2s-server-connection-fail').show();
274
+ return false;
275
+ },
276
+ success: function (data) {
277
+ if (data.result == true) {
278
+ window.location.href = data.redirect;
279
+ return false;
280
+ } else {
281
+ jQuery('.b2s-loading-area').hide();
282
+ jQuery('#b2s-curation-no-data-info').show();
283
+ jQuery('.b2s-curation-settings-area').show();
284
+ jQuery('.b2s-curation-preview-area').show();
285
+ }
286
+
287
+ }
288
+ });
289
+ return false;
290
+ });
291
+
292
+ jQuery(document).on('change', '#b2s-post-curation-profile-select', function () {
293
+ var tos = false;
294
+ if (jQuery('#b2s-post-curation-profile-data' + jQuery(this).val()).val() == "") {
295
+ jQuery('#b2s-curation-no-auth-info').show();
296
+ tos = true;
297
+ } else {
298
+ jQuery('#b2s-curation-no-auth-info').hide();
299
+ //TOS Twitter Check
300
+ var len = jQuery('#b2s-post-curation-twitter-select').children('option[data-mandant-id="' + jQuery(this).val() + '"]').length;
301
+ if (len >= 1) {
302
+ jQuery('.b2s-curation-twitter-area').show();
303
+ jQuery('#b2s-post-curation-twitter-select').prop('disabled', false);
304
+ jQuery('#b2s-post-curation-twitter-select').show();
305
+ jQuery('#b2s-post-curation-twitter-select option').attr("disabled", "disabled");
306
+ jQuery('#b2s-post-curation-twitter-select option[data-mandant-id="' + jQuery(this).val() + '"]').attr("disabled", false);
307
+ jQuery('#b2s-post-curation-twitter-select option[data-mandant-id="' + jQuery(this).val() + '"]:first').attr("selected", "selected");
308
+ } else {
309
+ tos = true;
310
+ }
311
+
312
+ }
313
+ //TOS Twitter 032018
314
+ if (tos) {
315
+ jQuery('.b2s-curation-twitter-area').hide();
316
+ jQuery('#b2s-post-curation-twitter-select').prop('disabled', 'disabled');
317
+ jQuery('#b2s-post-curation-twitter-select').hide();
318
+ }
319
+ });
320
+
321
+
322
+
323
+ function padDate(n) {
324
+ return ("0" + n).slice(-2);
325
+ }
326
+
327
+
328
+ function formatAMPM(date) {
329
+ var hours = date.getHours();
330
+ var minutes = date.getMinutes();
331
+ var ampm = hours >= 12 ? 'pm' : 'am';
332
+ hours = hours % 12;
333
+ hours = hours ? hours : 12; // the hour '0' should be '12'
334
+ minutes = minutes < 10 ? '0' + minutes : minutes;
335
+ var strTime = hours + ':' + minutes + ' ' + ampm;
336
+ return strTime;
337
+ }
338
+
339
+
assets/js/b2s/post.js CHANGED
@@ -582,6 +582,22 @@ function showEditSchedPost(b2s_id, post_id, network_auth_id, network_type, netwo
582
jQuery('.b2s-post-approve-info[data-network-auth-id="' + network_auth_id + '"]').show();
583
}
584
}
585
}
586
587
jQuery("#b2sPostId").val(post_id);
582
jQuery('.b2s-post-approve-info[data-network-auth-id="' + network_auth_id + '"]').show();
583
}
584
}
585
+
586
+ //Content Curation
587
+ if (jQuery('.b2s-post-ship-item-post-format[data-network-auth-id="' + network_auth_id + '"]').attr('data-post-wp-type') == 'ex') {
588
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
589
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
590
+ jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
591
+ jQuery('.b2s-load-info-meta-tag-modal[data-network-auth-id="' + network_auth_id + '"]').attr("style", "display:none !important");
592
+ if (jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + network_auth_id + '"]').val() == 0) {
593
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + network_auth_id + '"]').hide();
594
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + network_auth_id + '"]').hide();
595
+ } else {
596
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + network_auth_id + '"]').show();
597
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + network_auth_id + '"]').show();
598
+ }
599
+ }
600
+
601
}
602
603
jQuery("#b2sPostId").val(post_id);
assets/js/b2s/ship.js CHANGED
@@ -126,10 +126,14 @@ jQuery(document).on('click', '.b2s-toogle-calendar-btn', function () {
126
show = true;
127
$header = jQuery("<div>").addClass("b2s-calendar-header");
128
$isRelayPost = '';
129
if (event.relay_primary_post_id > 0) {
130
$isRelayPost = ' (Retweet)';
131
}
132
- $network_name = jQuery("<span>").text(event.author + $isRelayPost).addClass("network-name").css("display", "block");
133
element.find(".fc-time").after($network_name);
134
element.html(element.html());
135
$parent = element.parent();
@@ -284,6 +288,21 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function ()
284
});
285
return false;
286
});
287
jQuery(document).on('click', '.b2s-sidbar-network-auth-btn', function () {
288
jQuery('#b2s-network-list-modal').modal('show');
289
return false;
@@ -291,34 +310,34 @@ jQuery(document).on('click', '.b2s-sidbar-network-auth-btn', function () {
291
jQuery(document).on('click', '.change-meta-tag', function () {
292
var attr = jQuery(this).attr('readonly');
293
if (typeof attr !== typeof undefined && attr !== false) {
294
- jQuery('.meta-text').hide();
295
var networkAuthId = jQuery(this).attr("data-network-auth-id");
296
- var postFormat = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').val();
297
- var networkId = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').attr("data-network-id");
298
- var isMetaChecked = false;
299
- if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
300
- isMetaChecked = true;
301
- }
302
- if (networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
303
- isMetaChecked = true;
304
- }
305
-
306
- var showDefault = true;
307
- if (postFormat == "0" && !isMetaChecked) { //isLinkPost
308
- showDefault = false;
309
- if (networkId == "1") {
310
- jQuery('.isOgMetaChecked').show();
311
- } else {
312
- jQuery('.isCardMetaChecked').show();
313
}
314
-
315
- }
316
- if (showDefault) {
317
- jQuery('.isLinkPost').show();
318
}
319
-
320
-
321
- jQuery('#b2s-info-change-meta-tag-modal').modal('show');
322
}
323
return false;
324
});
@@ -495,6 +514,7 @@ jQuery(document).on("click", ".b2s-user-network-settings-post-format", function
495
var postFormat = jQuery(this).val();
496
var networkAuthId = jQuery(this).attr("data-network-auth-id");
497
var postFormatType = jQuery(this).attr("data-post-format-type");
498
jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
499
//PostFormat
500
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
@@ -563,6 +583,24 @@ jQuery(document).on("click", ".b2s-user-network-settings-post-format", function
563
}
564
565
}
566
567
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
568
jQuery(this).addClass('b2s-settings-checked');
@@ -693,6 +731,25 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
693
jQuery('.b2s-post-approve-info[data-network-auth-id="' + networkAuthId + '"]').hide();
694
}
695
}
696
}
697
698
//Twitter TOS 032018 - protected multiple accounts with same content to same time
@@ -733,7 +790,8 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
733
'userLang': jQuery('#b2sUserLang').val(),
734
'postId': jQuery('#b2sPostId').val(),
735
'relayCount': jQuery('#b2sRelayCount').val(),
736
- 'selSchedDate': jQuery('#selSchedDate').val()
737
},
738
beforeSend: function (jqXHR) { // before jQuery send the request we will push it to our array
739
jQuery.xhrPool.push(jqXHR);
@@ -803,7 +861,7 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
803
appendWidgetTo: 'body',
804
showSeconds: false,
805
showMeridian: showMeridian,
806
- defaultTime: 'current',
807
snapToStep: true
808
});
809
jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
@@ -921,6 +979,26 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
921
jQuery('#b2sTwitterOrginalPost').val(jQuery('.tw-textarea-input[data-network-auth-id="' + data.networkAuthId + '"]').val());
922
}
923
}
924
}
925
}
926
}
@@ -983,6 +1061,7 @@ jQuery(document).on('click', '.b2s-post-ship-item-post-format', function () {
983
jQuery('.b2s-post-format-settings-info[data-network-id="' + jQuery(this).attr('data-network-id') + '"]').show();
984
jQuery('#b2s-post-ship-item-post-format-modal').modal('show');
985
jQuery('.b2s-user-network-settings-post-format').attr('data-network-auth-id', jQuery(this).attr('data-network-auth-id'));
986
} else {
987
jQuery('#b2sInfoFormatModal').modal('show');
988
}
@@ -1221,7 +1300,7 @@ jQuery(document).on('click', '.scroll-to-bottom', function () {
1221
return false;
1222
});
1223
jQuery(document).on('click', '.b2s-post-item-details-preview-url-reload', function () {
1224
- var re = new RegExp(/^(https?:\/\/)?[a-zA-Z0-99ÄÖÜöäü-]+([\-\.]{1}[a-zA-Z0-99ÄÖÜöäü-]+)*\.[a-zA-Z0-9-]{2,20}(:[0-9]{1,5})?(\/.*)?#x2F;);
1225
var networkAuthId = jQuery(this).attr('data-network-auth-id');
1226
var url = jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + networkAuthId + '"]').val();
1227
if (re.test(url)) {
@@ -1599,7 +1678,7 @@ jQuery.validator.addMethod("checkUrl", function (value, element, regexp) {
1599
return this.optional(element) || re.test(value);
1600
}, "Invalid Url");
1601
jQuery.validator.addClassRules("b2s-post-item-details-item-url-input", {
1602
- checkUrl: /^(https?:\/\/)?[a-zA-Z0-99ÄÖÜöäü-]+([\-\.]{1}[a-zA-Z0-99ÄÖÜöäü-]+)*\.[a-zA-Z0-9-]{2,20}(:[0-9]{1,5})?(\/.*)?#x2F;
1603
});
1604
//Twitter TOS 032018 - protected multiple accounts with same content to same time ( by all connections)
1605
jQuery.validator.addMethod("unique", function (value, element, params) {
@@ -1990,6 +2069,11 @@ function init(firstrun) {
1990
jQuery('.b2s-post-item-details-release-input-date-select').each(function () {
1991
releaseChoose(jQuery(this).val(), jQuery(this).attr('data-network-auth-id'), 0);
1992
});
1993
hideDuplicateAuths();
1994
chooseMandant();
1995
}
@@ -2145,7 +2229,7 @@ function checkNetworkSelected() {
2145
}
2146
2147
function checkPostSchedOnBlog() {
2148
- if (jQuery('#b2sBlogPostSchedDate').length > 0) {
2149
if (jQuery('#b2sSchedPostInfoIgnore').val() == "0") {
2150
if (jQuery('.b2s-post-item-details-release-input-date-select option[value="0"]:selected').length > 0) {
2151
jQuery('#b2s-network-sched-post-info').modal("show");
126
show = true;
127
$header = jQuery("<div>").addClass("b2s-calendar-header");
128
$isRelayPost = '';
129
+ $isCuratedPost = '';
130
+ if (event.post_type == 'b2s_ex_post') {
131
+ $isCuratedPost = ' (Curated Post)';
132
+ }
133
if (event.relay_primary_post_id > 0) {
134
$isRelayPost = ' (Retweet)';
135
}
136
+ $network_name = jQuery("<span>").text(event.author + $isRelayPost + $isCuratedPost).addClass("network-name").css("display", "block");
137
element.find(".fc-time").after($network_name);
138
element.html(element.html());
139
$parent = element.parent();
288
});
289
return false;
290
});
291
+
292
+
293
+ function formatAMPM(date) {
294
+ var hours = date.getHours();
295
+ var minutes = date.getMinutes();
296
+ var ampm = hours >= 12 ? 'pm' : 'am';
297
+ hours = hours % 12;
298
+ hours = hours ? hours : 12; // the hour '0' should be '12'
299
+ minutes = minutes < 10 ? '0' + minutes : minutes;
300
+ var strTime = hours + ':' + minutes + ' ' + ampm;
301
+ return strTime;
302
+ }
303
+
304
+
305
+
306
jQuery(document).on('click', '.b2s-sidbar-network-auth-btn', function () {
307
jQuery('#b2s-network-list-modal').modal('show');
308
return false;
310
jQuery(document).on('click', '.change-meta-tag', function () {
311
var attr = jQuery(this).attr('readonly');
312
if (typeof attr !== typeof undefined && attr !== false) {
313
var networkAuthId = jQuery(this).attr("data-network-auth-id");
314
+ //Content cuation
315
+ var postType = jQuery('.b2s-post-ship-item-post-format[data-network-auth-id=' + networkAuthId + ']').attr('data-post-wp-type');
316
+ if (postType != "ex") {
317
+ jQuery('.meta-text').hide();
318
+ var postFormat = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').val();
319
+ var networkId = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').attr("data-network-id");
320
+ var isMetaChecked = false;
321
+ if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
322
+ isMetaChecked = true;
323
}
324
+ if (networkId == "2" && jQuery('#isCardMetaChecked').val() == "1") {
325
+ isMetaChecked = true;
326
+ }
327
+ var showDefault = true;
328
+ if (postFormat == "0" && !isMetaChecked) { //isLinkPost
329
+ showDefault = false;
330
+ if (networkId == "1") {
331
+ jQuery('.isOgMetaChecked').show();
332
+ } else {
333
+ jQuery('.isCardMetaChecked').show();
334
+ }
335
+ }
336
+ if (showDefault) {
337
+ jQuery('.isLinkPost').show();
338
+ }
339
+ jQuery('#b2s-info-change-meta-tag-modal').modal('show');
340
}
341
}
342
return false;
343
});
514
var postFormat = jQuery(this).val();
515
var networkAuthId = jQuery(this).attr("data-network-auth-id");
516
var postFormatType = jQuery(this).attr("data-post-format-type");
517
+ var postType = jQuery(this).attr("data-post-wp-type");
518
jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
519
//PostFormat
520
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
583
}
584
585
}
586
+ //Content Curation V5.0.0
587
+ if (postType == "ex") {
588
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
589
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
590
+ jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
591
+ jQuery('.b2s-load-info-meta-tag-modal[data-network-auth-id="' + networkAuthId + '"]').attr("style", "display:none !important");
592
+ if (postFormat == '0') {
593
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + networkAuthId + '"]').hide();
594
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').hide();
595
+ } else {
596
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + networkAuthId + '"]').show();
597
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').show();
598
+ }
599
+ if (jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + networkAuthId + '"]').val() == 1) {
600
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + networkAuthId + '"][data-network-count="-1"]').hide();
601
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"][data-network-count="-1"]').hide();
602
+ }
603
+ }
604
605
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
606
jQuery(this).addClass('b2s-settings-checked');
731
jQuery('.b2s-post-approve-info[data-network-auth-id="' + networkAuthId + '"]').hide();
732
}
733
}
734
+
735
+ //Content Curation
736
+ if (jQuery('.b2s-post-ship-item-post-format[data-network-auth-id="' + networkAuthId + '"]').attr('data-post-wp-type') == 'ex') {
737
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
738
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
739
+ jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
740
+ jQuery('.b2s-load-info-meta-tag-modal[data-network-auth-id="' + networkAuthId + '"]').attr("style", "display:none !important");
741
+ if (jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val() == 0) {
742
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + networkAuthId + '"]').hide();
743
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').hide();
744
+ } else {
745
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + networkAuthId + '"]').show();
746
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').show();
747
+ }
748
+ if (jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + networkAuthId + '"]').val() == 1) {
749
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + networkAuthId + '"][data-network-count="-1"]').hide();
750
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"][data-network-count="-1"]').hide();
751
+ }
752
+ }
753
}
754
755
//Twitter TOS 032018 - protected multiple accounts with same content to same time
790
'userLang': jQuery('#b2sUserLang').val(),
791
'postId': jQuery('#b2sPostId').val(),
792
'relayCount': jQuery('#b2sRelayCount').val(),
793
+ 'selSchedDate': jQuery('#selSchedDate').val(),
794
+ 'b2sPostType': jQuery('#b2sPostType').val()
795
},
796
beforeSend: function (jqXHR) { // before jQuery send the request we will push it to our array
797
jQuery.xhrPool.push(jqXHR);
861
appendWidgetTo: 'body',
862
showSeconds: false,
863
showMeridian: showMeridian,
864
+ defaultTime: today, //'current',
865
snapToStep: true
866
});
867
jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
979
jQuery('#b2sTwitterOrginalPost').val(jQuery('.tw-textarea-input[data-network-auth-id="' + data.networkAuthId + '"]').val());
980
}
981
}
982
+
983
+ //Content Curation
984
+ if (jQuery('.b2s-post-ship-item-post-format[data-network-auth-id="' + data.networkAuthId + '"]').attr('data-post-wp-type') == 'ex') {
985
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
986
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
987
+ jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
988
+ jQuery('.b2s-load-info-meta-tag-modal[data-network-auth-id="' + data.networkAuthId + '"]').attr("style", "display:none !important");
989
+ if (jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + data.networkAuthId + '"]').val() == 0) {
990
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + data.networkAuthId + '"]').hide();
991
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + data.networkAuthId + '"]').hide();
992
+ } else {
993
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + data.networkAuthId + '"]').show();
994
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + data.networkAuthId + '"]').show();
995
+ }
996
+ if (jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + data.networkAuthId + '"]').val() == 1) {
997
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + data.networkAuthId + '"][data-network-count="-1"]').hide();
998
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + data.networkAuthId + '"][data-network-count="-1"]').hide();
999
+ }
1000
+ }
1001
+
1002
}
1003
}
1004
}
1061
jQuery('.b2s-post-format-settings-info[data-network-id="' + jQuery(this).attr('data-network-id') + '"]').show();
1062
jQuery('#b2s-post-ship-item-post-format-modal').modal('show');
1063
jQuery('.b2s-user-network-settings-post-format').attr('data-network-auth-id', jQuery(this).attr('data-network-auth-id'));
1064
+ jQuery('.b2s-user-network-settings-post-format').attr('data-post-wp-type', jQuery(this).attr('data-post-wp-type'));
1065
} else {
1066
jQuery('#b2sInfoFormatModal').modal('show');
1067
}
1300
return false;
1301
});
1302
jQuery(document).on('click', '.b2s-post-item-details-preview-url-reload', function () {
1303
+ var re = new RegExp(/^(https?:\/\/)+[a-zA-Z0-99ÄÖÜöäü-]+(?:\.[a-zA-Z0-99ÄÖÜöäü-]+)+[\w\-\._~:/?#[\]@!\amp;'\(\)\*\+,;=%.]+#x2F;);
1304
var networkAuthId = jQuery(this).attr('data-network-auth-id');
1305
var url = jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + networkAuthId + '"]').val();
1306
if (re.test(url)) {
1678
return this.optional(element) || re.test(value);
1679
}, "Invalid Url");
1680
jQuery.validator.addClassRules("b2s-post-item-details-item-url-input", {
1681
+ checkUrl: /^(https?:\/\/)+[a-zA-Z0-99ÄÖÜöäü-]+(?:\.[a-zA-Z0-99ÄÖÜöäü-]+)+[\w\-\._~:/?#[\]@!\amp;'\(\)\*\+,;=%.]+#x2F;
1682
});
1683
//Twitter TOS 032018 - protected multiple accounts with same content to same time ( by all connections)
1684
jQuery.validator.addMethod("unique", function (value, element, params) {
2069
jQuery('.b2s-post-item-details-release-input-date-select').each(function () {
2070
releaseChoose(jQuery(this).val(), jQuery(this).attr('data-network-auth-id'), 0);
2071
});
2072
+
2073
+ //V5.0.0 Content Curation set selected Profile
2074
+ if (jQuery(".b2s-network-details-mandant-select option[value='" + jQuery('#selProfile').val() + "']").length > 0) {
2075
+ jQuery('.b2s-network-details-mandant-select').val(jQuery('#selProfile').val());
2076
+ }
2077
hideDuplicateAuths();
2078
chooseMandant();
2079
}
2229
}
2230
2231
function checkPostSchedOnBlog() {
2232
+ if (jQuery('#b2sBlogPostSchedDate').length > 0 && jQuery('#b2sPostType').val() == "") {
2233
if (jQuery('#b2sSchedPostInfoIgnore').val() == "0") {
2234
if (jQuery('.b2s-post-item-details-release-input-date-select option[value="0"]:selected').length > 0) {
2235
jQuery('#b2s-network-sched-post-info').modal("show");
assets/js/b2s/start.js CHANGED
@@ -13,10 +13,14 @@ jQuery(document).ready(function () {
13
show = true;
14
$header = jQuery("<div>").addClass("b2s-calendar-header");
15
$isRelayPost = '';
16
if (event.relay_primary_post_id > 0) {
17
$isRelayPost = ' (Retweet)';
18
}
19
- $network_name = jQuery("<span>").text(event.author + $isRelayPost).addClass("network-name").css("display", "block");
20
element.find(".fc-time").after($network_name);
21
element.html(element.html());
22
$parent = element.parent();
13
show = true;
14
$header = jQuery("<div>").addClass("b2s-calendar-header");
15
$isRelayPost = '';
16
+ $isCuratedPost = '';
17
+ if (event.post_type == 'b2s_ex_post') {
18
+ $isCuratedPost = ' (Curated Post)';
19
+ }
20
if (event.relay_primary_post_id > 0) {
21
$isRelayPost = ' (Retweet)';
22
}
23
+ $network_name = jQuery("<span>").text(event.author + $isRelayPost + $isCuratedPost).addClass("network-name").css("display", "block");
24
element.find(".fc-time").after($network_name);
25
element.html(element.html());
26
$parent = element.parent();
assets/js/b2s/wp/post-box.js CHANGED
@@ -4,6 +4,9 @@ jQuery(document).on('heartbeat-send', function (e, data) {
4
});
5
6
jQuery(window).on("load", function () {
7
jQuery('#b2s-post-box-calendar-header').addClass('closed');
8
jQuery('#b2s-post-box-calendar-header').hide();
9
if (typeof wp.heartbeat == "undefined") {
@@ -56,7 +59,7 @@ jQuery(window).on("load", function () {
56
setTodayDate = padDate(today.getDate()) + '.' + (padDate(today.getMonth() + 1)) + '.' + today.getFullYear() + ' ' + padDate(today.getHours()) + ':' + padDate(today.getMinutes());
57
}
58
jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
59
- jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today});
60
jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
61
62
} else {
@@ -74,8 +77,8 @@ jQuery(window).on("load", function () {
74
});
75
76
77
- jQuery(document).on('click', '.handlediv', function () {
78
- var id = jQuery(this).parent().attr('id');
79
if (id == 'b2s-post-box-calendar-header') {
80
if (!jQuery('#' + id).hasClass('closed')) {
81
if (jQuery('.b2s-post-box-calendar-content').is(':empty')) {
@@ -86,17 +89,40 @@ jQuery(document).on('click', '.handlediv', function () {
86
return true;
87
});
88
89
-
90
jQuery(document).on('click', '#b2s-meta-box-btn-customize', function () {
91
var postStatus = jQuery('#b2s-post-status').val();
92
if (postStatus != 'publish' && postStatus != 'future') {
93
- jQuery('#b2s-post-meta-box-state-no-publish-future-customize').show();
94
} else {
95
jQuery('#b2s-post-meta-box-state-no-publish-future-customize').hide();
96
- window.location.href = jQuery('#b2s-redirect-url-customize').val();
97
}
98
});
99
100
jQuery(document).on('click', '#b2s-post-box-calendar-btn', function () {
101
jQuery('#b2s-post-box-calendar-header').show();
102
jQuery('#b2s-post-box-calendar-header').removeClass('closed');
@@ -114,10 +140,14 @@ jQuery(document).on('click', '#b2s-post-box-calendar-btn', function () {
114
show = true;
115
$header = jQuery("<div>").addClass("b2s-calendar-header");
116
$isRelayPost = '';
117
if (event.relay_primary_post_id > 0) {
118
$isRelayPost = ' (Retweet)';
119
}
120
- $network_name = jQuery("<span>").text(event.author + $isRelayPost).addClass("network-name").css("display", "block");
121
element.find(".fc-time").after($network_name);
122
element.html(element.html());
123
$parent = element.parent();
@@ -192,7 +222,7 @@ jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', functio
192
setTodayDate = padDate(today.getDate()) + '.' + (padDate(today.getMonth() + 1)) + '.' + today.getFullYear() + ' ' + padDate(today.getHours()) + ':' + padDate(today.getMinutes());
193
}
194
jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
195
- jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today});
196
jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
197
198
} else {
4
});
5
6
jQuery(window).on("load", function () {
7
+ //Gutenberg V5.0.0
8
+ jQuery('#b2s-post-meta-box-auto').removeClass('hide-if-js');
9
+ //--
10
jQuery('#b2s-post-box-calendar-header').addClass('closed');
11
jQuery('#b2s-post-box-calendar-header').hide();
12
if (typeof wp.heartbeat == "undefined") {
59
setTodayDate = padDate(today.getDate()) + '.' + (padDate(today.getMonth() + 1)) + '.' + today.getFullYear() + ' ' + padDate(today.getHours()) + ':' + padDate(today.getMinutes());
60
}
61
jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
62
+ jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today, 'position': 'top left'});
63
jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
64
65
} else {
77
});
78
79
80
+ jQuery(document).on('click', '.postbox-container', function () {
81
+ var id = jQuery(this).children().find('#b2s-post-box-calendar-header').attr('id');
82
if (id == 'b2s-post-box-calendar-header') {
83
if (!jQuery('#' + id).hasClass('closed')) {
84
if (jQuery('.b2s-post-box-calendar-content').is(':empty')) {
89
return true;
90
});
91
92
+ //V5.0.0 compability gutenberg editor
93
jQuery(document).on('click', '#b2s-meta-box-btn-customize', function () {
94
var postStatus = jQuery('#b2s-post-status').val();
95
if (postStatus != 'publish' && postStatus != 'future') {
96
+ jQuery.ajax({
97
+ url: ajaxurl,
98
+ type: "GET",
99
+ dataType: "json",
100
+ cache: false,
101
+ data: {
102
+ 'action': 'b2s_get_blog_post_status',
103
+ 'post_id': jQuery('#post_ID').val()
104
+ },
105
+ error: function () {
106
+ jQuery('#b2s-post-meta-box-state-no-publish-future-customize').show();
107
+ return false;
108
+ },
109
+ success: function (data) {
110
+ if (data != 'publish' && data != 'future') {
111
+ jQuery('#b2s-post-meta-box-state-no-publish-future-customize').show();
112
+ } else {
113
+ jQuery('#b2s-post-meta-box-state-no-publish-future-customize').hide();
114
+ window.location.href = jQuery('#b2s-redirect-url-customize').val()+jQuery('#post_ID').val();
115
+ }
116
+ }
117
+ });
118
} else {
119
jQuery('#b2s-post-meta-box-state-no-publish-future-customize').hide();
120
+ window.location.href = jQuery('#b2s-redirect-url-customize').val()+jQuery('#post_ID').val();
121
}
122
});
123
124
+
125
+
126
jQuery(document).on('click', '#b2s-post-box-calendar-btn', function () {
127
jQuery('#b2s-post-box-calendar-header').show();
128
jQuery('#b2s-post-box-calendar-header').removeClass('closed');
140
show = true;
141
$header = jQuery("<div>").addClass("b2s-calendar-header");
142
$isRelayPost = '';
143
+ $isCuratedPost = '';
144
+ if (event.post_type == 'b2s_ex_post') {
145
+ $isCuratedPost = ' (Curated Post)';
146
+ }
147
if (event.relay_primary_post_id > 0) {
148
$isRelayPost = ' (Retweet)';
149
}
150
+ $network_name = jQuery("<span>").text(event.author + $isRelayPost + $isCuratedPost).addClass("network-name").css("display", "block");
151
element.find(".fc-time").after($network_name);
152
element.html(element.html());
153
$parent = element.parent();
222
setTodayDate = padDate(today.getDate()) + '.' + (padDate(today.getMonth() + 1)) + '.' + today.getFullYear() + ' ' + padDate(today.getHours()) + ':' + padDate(today.getMinutes());
223
}
224
jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
225
+ jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today, 'position': 'top left'});
226
jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
227
228
} else {
blog2social.php CHANGED
@@ -7,12 +7,12 @@
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
- * Version: 4.9.2
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
- define('B2S_PLUGIN_VERSION', '492');
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: 5.0.0
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
+ define('B2S_PLUGIN_VERSION', '500');
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
@@ -21,6 +21,7 @@ class Ajax_Get {
21
add_action('wp_ajax_b2s_approve_post_data', array($this, 'getApprovePostData'));
22
add_action('wp_ajax_b2s_ship_navbar_item', array($this, 'getNavbarItem'));
23
add_action('wp_ajax_b2s_post_meta_box', array($this, 'getPostMetaBox'));
24
add_action('wp_ajax_b2s_get_settings_sched_time_default', array($this, 'getSettingsSchedTimeDefault'));
25
add_action('wp_ajax_b2s_get_settings_sched_time_user', array($this, 'getSettingsSchedTimeUser'));
26
add_action('wp_ajax_b2s_ship_item_full_text', array($this, 'getShipItemFullText'));
@@ -32,6 +33,40 @@ class Ajax_Get {
32
add_action('wp_ajax_b2s_get_image_modal', array($this, 'getImageModal'));
33
add_action('wp_ajax_b2s_get_multi_widget_content', array($this, 'getMultiWidgetContent'));
34
add_action('wp_ajax_b2s_get_stats', array($this, 'getStats'));
35
}
36
37
public function getSortData() {
@@ -126,7 +161,8 @@ class Ajax_Get {
126
'network_display_name' => strip_tags(stripslashes($_POST['networkDisplayName'])),
127
'networkType' => (int) $_POST['networkType']);
128
$selSchedDate = (isset($_POST['selSchedDate']) && !empty($_POST['selSchedDate'])) ? $_POST['selSchedDate'] : ""; //routing from calendar
129
- $item = new B2S_Ship_Item((int) $_POST['postId'], $userLang, $selSchedDate,$relayCount);
130
echo json_encode(array('result' => true, 'networkAuthId' => (int) $_POST['networkAuthId'], 'networkType' => (int) $_POST['networkType'], 'networkId' => (int) $_POST['networkId'], 'content' => $item->getItemHtml((object) $itemData)));
131
} else {
132
echo json_encode(array('result' => false));
@@ -141,7 +177,7 @@ class Ajax_Get {
141
$postData = new B2S_Post_Item();
142
$showByDate = isset($_POST['showByDate']) ? trim($_POST['showByDate']) : '';
143
$type = (isset($_POST['type']) && in_array($_POST['type'], array('publish', 'notice'))) ? $_POST['type'] : 'publish';
144
- $result = $postData->getPublishPostDataHtml((int) $_POST['postId'],$type, $showByDate);
145
if ($result !== false) {
146
echo json_encode(array('result' => true, 'postId' => (int) $_POST['postId'], 'content' => $result));
147
wp_die();
@@ -150,8 +186,8 @@ class Ajax_Get {
150
echo json_encode(array('result' => false));
151
wp_die();
152
}
153
-
154
- public function getApprovePostData() {
155
if ((int) $_POST['postId']) {
156
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
157
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
@@ -166,7 +202,6 @@ class Ajax_Get {
166
echo json_encode(array('result' => false));
167
wp_die();
168
}
169
-
170
171
public function getSchedPostsByUserAuth() {
172
if ((int) $_POST['networkAuthId']) {
@@ -279,15 +314,15 @@ class Ajax_Get {
279
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
280
281
//Filter Network
282
- $network_id = (isset($_GET['filter_network']) && (int) $_GET['filter_network'] >= 1) ? (int) $_GET['filter_network'] : 0; // 0=all
283
//Filter Network Details
284
- $network_details_id = (isset($_GET['filter_network_auth']) && (int) $_GET['filter_network_auth'] >= 1) ? (int) $_GET['filter_network_auth'] : 0; // 0=all
285
286
if (isset($_GET['start'])) {
287
$calendar = B2S_Calendar_Filter::getByTimespam($_GET['start'] . " 00:00:00", $_GET['end'] . " 23:59:59", $network_id, $network_details_id);
288
} else {
289
$calendar = B2S_Calendar_Filter::getAll($network_id, $network_details_id);
290
- }
291
echo json_encode($calendar->asCalendarArray());
292
wp_die();
293
}
21
add_action('wp_ajax_b2s_approve_post_data', array($this, 'getApprovePostData'));
22
add_action('wp_ajax_b2s_ship_navbar_item', array($this, 'getNavbarItem'));
23
add_action('wp_ajax_b2s_post_meta_box', array($this, 'getPostMetaBox'));
24
+ add_action('wp_ajax_b2s_scrape_url', array($this, 'scrapeUrl'));
25
add_action('wp_ajax_b2s_get_settings_sched_time_default', array($this, 'getSettingsSchedTimeDefault'));
26
add_action('wp_ajax_b2s_get_settings_sched_time_user', array($this, 'getSettingsSchedTimeUser'));
27
add_action('wp_ajax_b2s_ship_item_full_text', array($this, 'getShipItemFullText'));
33
add_action('wp_ajax_b2s_get_image_modal', array($this, 'getImageModal'));
34
add_action('wp_ajax_b2s_get_multi_widget_content', array($this, 'getMultiWidgetContent'));
35
add_action('wp_ajax_b2s_get_stats', array($this, 'getStats'));
36
+ add_action('wp_ajax_b2s_get_blog_post_status', array($this, 'getBlogPostStatus'));
37
+ }
38
+
39
+ public function getBlogPostStatus() {
40
+ $status = ($_GET['post_id'] > 0) ? get_post_status($_GET['post_id']) : '';
41
+ echo json_encode($status);
42
+ wp_die();
43
+ }
44
+
45
+ public function scrapeUrl() {
46
+ if (isset($_POST['url']) && !empty($_POST['url'])) {
47
+ $data = B2S_Util::scrapeUrl($_POST['url']);
48
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
49
+ $curation = new B2S_Curation_View();
50
+ $preview = $curation->getCurationPreviewHtml($_POST['url'], $data);
51
+ if (!empty($preview) && $data !== false) {
52
+ if (isset($_POST['loadSettings']) && filter_var($_POST['loadSettings'], FILTER_VALIDATE_BOOLEAN)) {
53
+ $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
54
+ 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)) {
55
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
56
+ $curation = new B2S_Curation_View();
57
+ echo json_encode(array('result' => true, 'preview' => $preview, 'settings' => $curation->getShippingDetails($result->data->mandant, $result->data->auth)));
58
+ wp_die();
59
+ }
60
+ echo json_encode(array('result' => false, 'preview' => $preview, 'error' => 'NO_AUTH'));
61
+ wp_die();
62
+ } else {
63
+ echo json_encode(array('result' => true, 'preview' => $preview));
64
+ wp_die();
65
+ }
66
+ }
67
+ }
68
+ echo json_encode(array('result' => false, 'preview' => '', 'error' => 'NO_PREVIEW'));
69
+ wp_die();
70
}
71
72
public function getSortData() {
161
'network_display_name' => strip_tags(stripslashes($_POST['networkDisplayName'])),
162
'networkType' => (int) $_POST['networkType']);
163
$selSchedDate = (isset($_POST['selSchedDate']) && !empty($_POST['selSchedDate'])) ? $_POST['selSchedDate'] : ""; //routing from calendar
164
+ $b2sPostType = (isset($_POST['b2sPostType']) && $_POST['b2sPostType'] == 'ex') ? 'ex' : ""; //Content Curation
165
+ $item = new B2S_Ship_Item((int) $_POST['postId'], $userLang, $selSchedDate, $b2sPostType, $relayCount);
166
echo json_encode(array('result' => true, 'networkAuthId' => (int) $_POST['networkAuthId'], 'networkType' => (int) $_POST['networkType'], 'networkId' => (int) $_POST['networkId'], 'content' => $item->getItemHtml((object) $itemData)));
167
} else {
168
echo json_encode(array('result' => false));
177
$postData = new B2S_Post_Item();
178
$showByDate = isset($_POST['showByDate']) ? trim($_POST['showByDate']) : '';
179
$type = (isset($_POST['type']) && in_array($_POST['type'], array('publish', 'notice'))) ? $_POST['type'] : 'publish';
180
+ $result = $postData->getPublishPostDataHtml((int) $_POST['postId'], $type, $showByDate);
181
if ($result !== false) {
182
echo json_encode(array('result' => true, 'postId' => (int) $_POST['postId'], 'content' => $result));
183
wp_die();
186
echo json_encode(array('result' => false));
187
wp_die();
188
}
189
+
190
+ public function getApprovePostData() {
191
if ((int) $_POST['postId']) {
192
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
193
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
202
echo json_encode(array('result' => false));
203
wp_die();
204
}
205
206
public function getSchedPostsByUserAuth() {
207
if ((int) $_POST['networkAuthId']) {
314
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
315
316
//Filter Network
317
+ $network_id = (isset($_GET['filter_network']) && (int) $_GET['filter_network'] >= 1) ? (int) $_GET['filter_network'] : 0; // 0=all
318
//Filter Network Details
319
+ $network_details_id = (isset($_GET['filter_network_auth']) && (int) $_GET['filter_network_auth'] >= 1) ? (int) $_GET['filter_network_auth'] : 0; // 0=all
320
321
if (isset($_GET['start'])) {
322
$calendar = B2S_Calendar_Filter::getByTimespam($_GET['start'] . " 00:00:00", $_GET['end'] . " 23:59:59", $network_id, $network_details_id);
323
} else {
324
$calendar = B2S_Calendar_Filter::getAll($network_id, $network_details_id);
325
+ }
326
echo json_encode($calendar->asCalendarArray());
327
wp_die();
328
}
includes/Ajax/Post.php CHANGED
@@ -46,6 +46,142 @@ class Ajax_Post {
46
add_action("wp_ajax_b2s_hide_trail_message", array($this, 'hideTrailMessage'));
47
add_action("wp_ajax_b2s_hide_trail_ended_message", array($this, 'hideTrailEndedMessage'));
48
add_action("wp_ajax_b2s_plugin_deactivate_delete_sched_post", array($this, 'b2sPluginDeactivate'));
49
}
50
51
public function b2sPluginDeactivate() {
@@ -71,7 +207,7 @@ class Ajax_Post {
71
$result = json_decode(trim(PRG_Api_Post::post(B2S_PLUGIN_PRG_API_ENDPOINT . 'post.php', $dataPost)));
72
73
if (is_object($result) && !empty($result) && isset($result->result) && (int) $result->result == 1 && isset($result->create) && (int) $result->create == 1) {
74
- //Contact
75
global $wpdb;
76
$sqlCheckUser = $wpdb->prepare("SELECT `id` FROM `b2s_user_contact` WHERE `blog_user_id` = %d", $_POST['blog_user_id']);
77
$userEntry = $wpdb->get_var($sqlCheckUser);
@@ -163,6 +299,7 @@ class Ajax_Post {
163
$metaOg = false;
164
$metaCard = false;
165
166
if (!isset($post['b2s']) || !is_array($post['b2s'])) {
167
echo json_encode(array('result' => false));
168
wp_die();
@@ -173,13 +310,14 @@ class Ajax_Post {
173
delete_option('B2S_PLUGIN_POST_META_TAGES_TWITTER_' . (int) $post['post_id']);
174
delete_option('B2S_PLUGIN_POST_META_TAGES_OG_' . (int) $post['post_id']);
175
176
- //since V4.9.1 Instant Share Approve - Facebook Profile
177
$shareApproveNetworkData = unserialize(B2S_PLUGIN_NETWORK_SHARE_APPROVE);
178
179
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
180
$optionNoCache = $options->_getOption('link_no_cache');
181
182
$content = array();
183
$defaultPostData = array('token' => B2S_PLUGIN_TOKEN,
184
'blog_user_id' => B2S_PLUGIN_BLOG_USER_ID,
185
'post_id' => (int) $post['post_id'],
@@ -192,7 +330,7 @@ class Ajax_Post {
192
continue;
193
}
194
195
- //Change/Set MetaTags
196
if ((int) $data['network_id'] == 1 && $metaOg == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_og_meta']) && (int) $post['change_og_meta'] == 1) { //LinkPost
197
$metaOg = true;
198
$meta = B2S_Meta::getInstance();
@@ -209,7 +347,7 @@ class Ajax_Post {
209
$meta->updateMeta((int) $post['post_id']);
210
}
211
212
- //Change/Set MetaTags
213
if ((int) $data['network_id'] == 2 && $metaCard == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_card_meta']) && (int) $post['change_card_meta'] == 1) { //LinkPost
214
$metaCard = true;
215
$meta = B2S_Meta::getInstance();
@@ -243,17 +381,17 @@ class Ajax_Post {
243
);
244
245
246
- //since V4.8.0 Check Relay and prepare Data
247
$relayData = array();
248
if ((int) $data['network_id'] == 2 && isset($data['post_relay_account'][0]) && !empty($data['post_relay_account'][0]) && isset($data['post_relay_delay'][0]) && !empty($data['post_relay_delay'][0])) {
249
$relayData = array('auth' => $data['post_relay_account'], 'delay' => $data['post_relay_delay']);
250
}
251
252
- //mode: share now
253
$schedData = array();
254
if (isset($data['releaseSelect']) && (int) $data['releaseSelect'] == 0) {
255
$b2sShipSend->savePublishDetails(array_merge($defaultPostData, $sendData), $relayData, $shareApproveNetworkData);
256
- //mode: schedule custom once times
257
} else if (isset($data['releaseSelect']) && (int) $data['releaseSelect'] == 1 && isset($data['date'][0]) && isset($data['time'][0])) {
258
$schedData = array(
259
'date' => isset($data['date']) ? $data['date'] : array(),
@@ -265,7 +403,7 @@ class Ajax_Post {
265
'saveSetting' => isset($data['saveSchedSetting']) ? true : false);
266
$schedResult [] = $b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData, $relayData, $shareApproveNetworkData);
267
$content = array_merge($content, $schedResult);
268
- //mode: recurrently schedule
269
} else {
270
$schedData = array(
271
'interval_select' => isset($data['intervalSelect']) ? $data['intervalSelect'] : array(),
@@ -333,7 +471,7 @@ class Ajax_Post {
333
$result['webdados'] = $meta->is_webdados_active();
334
}
335
336
- //Customize per user premium function
337
/* if (isset($_POST['version']) && (int) $_POST['version'] >= 1 && isset($_POST['b2s_og_article_author']) && isset($_POST['b2s_card_twitter_creator'])) {
338
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
339
$og_article_author = (isset($_POST['b2s_og_article_author']) && !empty($_POST['b2s_og_article_author'])) ? trim($_POST['b2s_og_article_author']) : "";
@@ -418,7 +556,7 @@ class Ajax_Post {
418
419
$options->_setOption('post_format', $post_format);
420
421
- //Option no_cache
422
if ((int) $_POST['network_id'] == 1) {
423
$noCache = isset($_POST['no_cache']) ? (int) $_POST['no_cache'] : 0;
424
$options->_setOption('link_no_cache', $noCache);
@@ -726,7 +864,7 @@ class Ajax_Post {
726
}
727
728
public function updateApprovePost() {
729
- //post_id
730
if (is_numeric($_POST['post_id']) && (int) $_POST['post_id'] > 0) {
731
global $wpdb;
732
require_once (B2S_PLUGIN_DIR . '/includes/Options.php');
@@ -755,7 +893,7 @@ class Ajax_Post {
755
global $wpdb;
756
if (is_numeric($_POST['b2s_id']) && is_string($_POST['sched_date'])) {
757
758
- //since V4.9.1 Instant Share Approve - Facebook Profile
759
$shareApprove = (isset($_POST['post_for_approve']) && (int) $_POST['post_for_approve'] == 1) ? 1 : 0;
760
$sql = "UPDATE b2s_posts "
761
. "SET sched_date = '" . date('Y-m-d H:i:s', strtotime($_POST['sched_date'])) . "', "
@@ -767,7 +905,7 @@ class Ajax_Post {
767
768
$wpdb->query($sql);
769
770
- //is post for relay?
771
if (isset($_POST['post_for_relay']) && (int) $_POST['post_for_relay'] == 1) {
772
$res = $this->getAllRelayByPrimaryPostId($_POST['b2s_id']);
773
if (is_array($res) && !empty($res)) {
@@ -814,7 +952,7 @@ class Ajax_Post {
814
if (isset($row->id) && (int) $row->id == (int) $_POST['b2s_id']) {
815
$hookAction = (isset($row->post_for_approve) && (int) $row->post_for_approve == 0) ? 3 : 0; //since 4.9.1 Facebook Instant Sharing
816
$wpdb->update('b2s_posts', array('hook_action' => $hookAction, 'hide' => 1), array('id' => (int) $_POST['b2s_id']));
817
- //is post for relay
818
if ((int) $row->post_for_relay == 1) {
819
$res = B2S_Post_Tools::getAllRelayByPrimaryPostId($row->id);
820
if (is_array($res) && !empty($res)) {
@@ -878,7 +1016,7 @@ class Ajax_Post {
878
'lang' => trim(strtolower(substr(B2S_LANGUAGE, 0, 2))));
879
880
881
- //is relay post?
882
if (isset($post['relay_primary_post_id']) && (int) $post['relay_primary_post_id'] > 0 && (int) $b2s_id > 0) {
883
if (isset($post['relay_primary_sched_date']) && !empty($post['relay_primary_sched_date']) && isset($post['network_auth_id']) && (int) $post['network_auth_id'] > 0) {
884
if (isset($post['b2s'][$post['network_auth_id']]['post_relay_delay'][0]) && (int) $post['b2s'][$post['network_auth_id']]['post_relay_delay'][0] > 0) {
@@ -900,7 +1038,7 @@ class Ajax_Post {
900
if (!isset($data['url']) || !isset($data['content']) || !isset($data['network_id'])) {
901
continue;
902
}
903
- //Change/Set MetaTags
904
if ((int) $data['network_id'] == 1 && $metaOg == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_og_meta']) && (int) $post['change_og_meta'] == 1) { //LinkPost
905
$metaOg = true;
906
$meta = B2S_Meta::getInstance();
@@ -917,7 +1055,7 @@ class Ajax_Post {
917
$meta->updateMeta((int) $post['post_id']);
918
}
919
920
- //Change/Set MetaTags
921
if ((int) $data['network_id'] == 2 && $metaCard == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_card_meta']) && (int) $post['change_card_meta'] == 1) { //LinkPost
922
$metaCard = true;
923
$meta = B2S_Meta::getInstance();
@@ -964,8 +1102,8 @@ class Ajax_Post {
964
965
$b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData, array());
966
967
- //is post for relay ?
968
- //get all relays in primary post id by b2s id & change sched_date + utc
969
if (isset($post['post_for_relay']) && (int) $post['post_for_relay'] == 1 && isset($data['date'][0]) && isset($data['time'][0]) && (int) $b2s_id > 0) {
970
$res = $this->getAllRelayByPrimaryPostId($b2s_id);
971
if (is_array($res) && !empty($res)) {
46
add_action("wp_ajax_b2s_hide_trail_message", array($this, 'hideTrailMessage'));
47
add_action("wp_ajax_b2s_hide_trail_ended_message", array($this, 'hideTrailEndedMessage'));
48
add_action("wp_ajax_b2s_plugin_deactivate_delete_sched_post", array($this, 'b2sPluginDeactivate'));
49
+ add_action("wp_ajax_b2s_curation_share", array($this, 'curationShare'));
50
+ add_action("wp_ajax_b2s_curation_customize", array($this, 'curationCustomize'));
51
+ }
52
+
53
+ public function curationShare() {
54
+ //save as blog post
55
+ if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
56
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/Save.php');
57
+ $data = array('title' => $_POST['title'], 'url' => $_POST['url'], 'content' => (isset($_POST['comment']) ? $_POST['comment'] : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
58
+ $curation = new B2S_Curation_Save($data);
59
+ $postId = $curation->insertContent();
60
+ if ($postId !== false) {
61
+ //check Data
62
+ if (isset($_POST['profile_select'])) {
63
+ $profilId = (int) $_POST['profile_select'];
64
+ if (isset($_POST['profile_data_' . $profilId]) && !empty($_POST['profile_data_' . $profilId])) {
65
+ $networkData = unserialize(stripslashes(base64_decode($_POST['profile_data_' . $profilId])));
66
+ if ($networkData !== false && is_array($networkData) && !empty($networkData)) {
67
+ $notAllowNetwork = array(4, 11, 14, 16, 18);
68
+ $allowNetworkOnlyImage = array(6, 7, 12);
69
+ //TOS Twitter 032018 - none multiple Accounts - User select once
70
+ $selectedTwitterProfile = (isset($_POST['twitter_select']) && !empty($_POST['twitter_select'])) ? (int) $_POST['twitter_select'] : '';
71
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/QuickPost.php');
72
+ $quickPost = new B2S_QuickPost($_POST['comment'], $_POST['title']);
73
+ $defaultShareData = array('default_titel' => strip_tags($_POST['title']),
74
+ 'image_url' => (!empty($_POST['image_url'])) ? trim(urldecode($_POST['image_url'])) : '',
75
+ 'lang' => trim(strtolower(substr(B2S_LANGUAGE, 0, 2))),
76
+ 'board' => '',
77
+ 'group' => '',
78
+ 'post_id' => $postId,
79
+ 'blog_user_id' => B2S_PLUGIN_BLOG_USER_ID,
80
+ 'tags' => array(),
81
+ 'url' => $_POST['url'],
82
+ 'no_cache' => 0,
83
+ 'token' => B2S_PLUGIN_TOKEN,
84
+ 'user_timezone' => (isset($_POST['b2s_user_timezone']) ? $_POST['b2s_user_timezone'] : 0 ),
85
+ 'publish_date' => isset($_POST['publish_date']) ? date('Y-m-d H:i:s', strtotime($_POST['publish_date'])) : date('Y-m-d H:i:s', current_time('timestamp')));
86
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Ship/Save.php');
87
+ $b2sShipSend = new B2S_Ship_Save();
88
+ //since V4.9.1 Instant Share Approve - Facebook Profile
89
+ $shareApproveNetworkData = unserialize(B2S_PLUGIN_NETWORK_SHARE_APPROVE);
90
+ $content = array();
91
+ foreach ($networkData as $k => $value) {
92
+ if (isset($value->networkAuthId) && (int) $value->networkAuthId > 0 && isset($value->networkId) && (int) $value->networkId > 0 && isset($value->networkType)) {
93
+ //TOS Twitter 032018 - none multiple Accounts - User select once
94
+ if ((int) $value->networkId != 2 || ((int) $value->networkId == 2 && (empty($selectedTwitterProfile) || ((int) $selectedTwitterProfile == (int) $value->networkAuthId)))) {
95
+ //Filter: image network
96
+ if (in_array($value->networkId, $allowNetworkOnlyImage) && (!isset($_POST['image_url']) || empty($_POST['image_url']))) {
97
+ $content = array_merge($content, array('networkDisplayName' => $value->networkUserName, 'networkAuthId' => $value->networkAuthId, 'networkId' => $value->networkId, 'networkType' => $value->networkType, 'html' => $b2sShipSend->getItemHtml($value->networkId, 'IMAGE_FOR_CURATION')));
98
+ continue;
99
+ }
100
+ //Filter: Blog network
101
+ if (in_array($value->networkId, $notAllowNetwork)) {
102
+ continue;
103
+ }
104
+ $shareData = $quickPost->prepareShareData($value->networkAuthId, $value->networkId, $value->networkType);
105
+ if ($shareData !== false) {
106
+ $shareData['network_id'] = $value->networkId;
107
+ $shareData['network_type'] = $value->networkType;
108
+ $shareData['network_display_name'] = $value->networkUserName;
109
+ $shareData['network_auth_id'] = $value->networkAuthId;
110
+ $shareData = array_merge($shareData, $defaultShareData);
111
+ //Type schedule
112
+ if (isset($_POST['ship_type']) && (int) $_POST['ship_type'] == 1 && isset($_POST['ship_date']) && !empty($_POST['ship_date']) && strtotime($_POST['ship_date']) !== false) {
113
+ $shipDateTime = array('date' => array(date('Y-m-d', strtotime($_POST['ship_date']))), 'time' => array(date('H:i', strtotime($_POST['ship_date']))));
114
+ $schedData = array(
115
+ 'date' => $shipDateTime['date'],
116
+ 'time' => $shipDateTime['time'],
117
+ 'releaseSelect' => 1,
118
+ 'user_timezone' => (isset($_POST['b2s_user_timezone']) ? $_POST['b2s_user_timezone'] : 0 ),
119
+ 'saveSetting' => false);
120
+ $schedRes = $b2sShipSend->saveSchedDetails($shareData, $schedData, array(), $shareApproveNetworkData);
121
+ $schedResult = array_merge($schedRes, array('networkDisplayName' => $value->networkUserName, 'networkId' => $value->networkId, 'networkType' => $value->networkType));
122
+ $content = array_merge($content, array($schedResult));
123
+ } else {
124
+ //TYPE direct share
125
+ $b2sShipSend->savePublishDetails($shareData, array(), $shareApproveNetworkData, true);
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ if (!empty($b2sShipSend->postDataApprove)) {
132
+ $sendResult = $b2sShipSend->getShareApproveDetails(true);
133
+ $content = array_merge($content, $sendResult);
134
+ }
135
+ if (!empty($b2sShipSend->postData)) {
136
+ $sendResult = $b2sShipSend->postPublish(true);
137
+ $content = array_merge($content, $sendResult);
138
+ }
139
+ //Render Ouput
140
+ if (is_array($content) && !empty($content)) {
141
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
142
+ $view = new B2S_Curation_View();
143
+ echo json_encode(array('result' => true, 'content' => $view->getResultListHtml($content)));
144
+ wp_die();
145
+ }
146
+ }
147
+ echo json_encode(array('result' => false, 'error' => 'NO_AUTH'));
148
+ wp_die();
149
+ }
150
+ echo json_encode(array('result' => false, 'error' => 'NO_AUTH'));
151
+ wp_die();
152
+ }
153
+ }
154
+ }
155
+ echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
156
+ wp_die();
157
+ }
158
+
159
+ public function curationCustomize() {
160
+ if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['url']) && !empty($_POST['url'])) {
161
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/Save.php');
162
+ $data = array('title' => $_POST['title'], 'url' => $_POST['url'], 'content' => (isset($_POST['comment']) ? $_POST['comment'] : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
163
+ $curation = new B2S_Curation_Save($data);
164
+ $postId = $curation->insertContent();
165
+ if ($postId !== false) {
166
+ $redirect_url = get_option('siteurl') . ((substr(get_option('siteurl'), -1, 1) == '/') ? '' : '/') . 'wp-admin/admin.php?page=blog2social-ship&b2sPostType=ex&postId=' . $postId;
167
+ if (isset($_POST['ship_type']) && (int) $_POST['ship_type'] == 1 && isset($_POST['ship_date']) && !empty($_POST['ship_date'])) {
168
+ $sched_date_time = date('Y-m-d H:i:s', strtotime($_POST['ship_date']));
169
+ if ($sched_date_time !== false) {
170
+ $redirect_url.='&schedDateTime=' . $sched_date_time;
171
+ }
172
+ }
173
+ if (isset($_POST['profile_select']) && (int) $_POST['profile_select'] > 0) {
174
+ $redirect_url.='&profile=' . $_POST['profile_select'];
175
+ }
176
+ if (isset($_POST['image_url']) && !empty($_POST['image_url'])) {
177
+ $redirect_url.='&img=' . base64_encode($_POST['image_url']);
178
+ }
179
+ echo json_encode(array('result' => true, 'redirect' => $redirect_url));
180
+ wp_die();
181
+ }
182
+ }
183
+ echo json_encode(array('result' => false));
184
+ wp_die();
185
}
186
187
public function b2sPluginDeactivate() {
207
$result = json_decode(trim(PRG_Api_Post::post(B2S_PLUGIN_PRG_API_ENDPOINT . 'post.php', $dataPost)));
208
209
if (is_object($result) && !empty($result) && isset($result->result) && (int) $result->result == 1 && isset($result->create) && (int) $result->create == 1) {
210
+ //Contact
211
global $wpdb;
212
$sqlCheckUser = $wpdb->prepare("SELECT `id` FROM `b2s_user_contact` WHERE `blog_user_id` = %d", $_POST['blog_user_id']);
213
$userEntry = $wpdb->get_var($sqlCheckUser);
299
$metaOg = false;
300
$metaCard = false;
301
302
+
303
if (!isset($post['b2s']) || !is_array($post['b2s'])) {
304
echo json_encode(array('result' => false));
305
wp_die();
310
delete_option('B2S_PLUGIN_POST_META_TAGES_TWITTER_' . (int) $post['post_id']);
311
delete_option('B2S_PLUGIN_POST_META_TAGES_OG_' . (int) $post['post_id']);
312
313
+ //since V4.9.1 Instant Share Approve - Facebook Profile
314
$shareApproveNetworkData = unserialize(B2S_PLUGIN_NETWORK_SHARE_APPROVE);
315
316
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
317
$optionNoCache = $options->_getOption('link_no_cache');
318
319
$content = array();
320
+ $schedResult = array();
321
$defaultPostData = array('token' => B2S_PLUGIN_TOKEN,
322
'blog_user_id' => B2S_PLUGIN_BLOG_USER_ID,
323
'post_id' => (int) $post['post_id'],
330
continue;
331
}
332
333
+ //Change/Set MetaTags
334
if ((int) $data['network_id'] == 1 && $metaOg == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_og_meta']) && (int) $post['change_og_meta'] == 1) { //LinkPost
335
$metaOg = true;
336
$meta = B2S_Meta::getInstance();
347
$meta->updateMeta((int) $post['post_id']);
348
}
349
350
+ //Change/Set MetaTags
351
if ((int) $data['network_id'] == 2 && $metaCard == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_card_meta']) && (int) $post['change_card_meta'] == 1) { //LinkPost
352
$metaCard = true;
353
$meta = B2S_Meta::getInstance();
381
);
382
383
384
+ //since V4.8.0 Check Relay and prepare Data
385
$relayData = array();
386
if ((int) $data['network_id'] == 2 && isset($data['post_relay_account'][0]) && !empty($data['post_relay_account'][0]) && isset($data['post_relay_delay'][0]) && !empty($data['post_relay_delay'][0])) {
387
$relayData = array('auth' => $data['post_relay_account'], 'delay' => $data['post_relay_delay']);
388
}
389
390
+ //mode: share now
391
$schedData = array();
392
if (isset($data['releaseSelect']) && (int) $data['releaseSelect'] == 0) {
393
$b2sShipSend->savePublishDetails(array_merge($defaultPostData, $sendData), $relayData, $shareApproveNetworkData);
394
+ //mode: schedule custom once times
395
} else if (isset($data['releaseSelect']) && (int) $data['releaseSelect'] == 1 && isset($data['date'][0]) && isset($data['time'][0])) {
396
$schedData = array(
397
'date' => isset($data['date']) ? $data['date'] : array(),
403
'saveSetting' => isset($data['saveSchedSetting']) ? true : false);
404
$schedResult [] = $b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData, $relayData, $shareApproveNetworkData);
405
$content = array_merge($content, $schedResult);
406
+ //mode: recurrently schedule
407
} else {
408
$schedData = array(
409
'interval_select' => isset($data['intervalSelect']) ? $data['intervalSelect'] : array(),
471
$result['webdados'] = $meta->is_webdados_active();
472
}
473
474
+ //Customize per user premium function
475
/* if (isset($_POST['version']) && (int) $_POST['version'] >= 1 && isset($_POST['b2s_og_article_author']) && isset($_POST['b2s_card_twitter_creator'])) {
476
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
477
$og_article_author = (isset($_POST['b2s_og_article_author']) && !empty($_POST['b2s_og_article_author'])) ? trim($_POST['b2s_og_article_author']) : "";
556
557
$options->_setOption('post_format', $post_format);
558
559
+ //Option no_cache
560
if ((int) $_POST['network_id'] == 1) {
561
$noCache = isset($_POST['no_cache']) ? (int) $_POST['no_cache'] : 0;
562
$options->_setOption('link_no_cache', $noCache);
864
}
865
866
public function updateApprovePost() {
867
+ //post_id
868
if (is_numeric($_POST['post_id']) && (int) $_POST['post_id'] > 0) {
869
global $wpdb;
870
require_once (B2S_PLUGIN_DIR . '/includes/Options.php');
893
global $wpdb;
894
if (is_numeric($_POST['b2s_id']) && is_string($_POST['sched_date'])) {
895
896
+ //since V4.9.1 Instant Share Approve - Facebook Profile
897
$shareApprove = (isset($_POST['post_for_approve']) && (int) $_POST['post_for_approve'] == 1) ? 1 : 0;
898
$sql = "UPDATE b2s_posts "
899
. "SET sched_date = '" . date('Y-m-d H:i:s', strtotime($_POST['sched_date'])) . "', "
905
906
$wpdb->query($sql);
907
908
+ //is post for relay?
909
if (isset($_POST['post_for_relay']) && (int) $_POST['post_for_relay'] == 1) {
910
$res = $this->getAllRelayByPrimaryPostId($_POST['b2s_id']);
911
if (is_array($res) && !empty($res)) {
952
if (isset($row->id) && (int) $row->id == (int) $_POST['b2s_id']) {
953
$hookAction = (isset($row->post_for_approve) && (int) $row->post_for_approve == 0) ? 3 : 0; //since 4.9.1 Facebook Instant Sharing
954
$wpdb->update('b2s_posts', array('hook_action' => $hookAction, 'hide' => 1), array('id' => (int) $_POST['b2s_id']));
955
+ //is post for relay
956
if ((int) $row->post_for_relay == 1) {
957
$res = B2S_Post_Tools::getAllRelayByPrimaryPostId($row->id);
958
if (is_array($res) && !empty($res)) {
1016
'lang' => trim(strtolower(substr(B2S_LANGUAGE, 0, 2))));
1017
1018
1019
+ //is relay post?
1020
if (isset($post['relay_primary_post_id']) && (int) $post['relay_primary_post_id'] > 0 && (int) $b2s_id > 0) {
1021
if (isset($post['relay_primary_sched_date']) && !empty($post['relay_primary_sched_date']) && isset($post['network_auth_id']) && (int) $post['network_auth_id'] > 0) {
1022
if (isset($post['b2s'][$post['network_auth_id']]['post_relay_delay'][0]) && (int) $post['b2s'][$post['network_auth_id']]['post_relay_delay'][0] > 0) {
1038
if (!isset($data['url']) || !isset($data['content']) || !isset($data['network_id'])) {
1039
continue;
1040
}
1041
+ //Change/Set MetaTags
1042
if ((int) $data['network_id'] == 1 && $metaOg == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_og_meta']) && (int) $post['change_og_meta'] == 1) { //LinkPost
1043
$metaOg = true;
1044
$meta = B2S_Meta::getInstance();
1055
$meta->updateMeta((int) $post['post_id']);
1056
}
1057
1058
+ //Change/Set MetaTags
1059
if ((int) $data['network_id'] == 2 && $metaCard == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_card_meta']) && (int) $post['change_card_meta'] == 1) { //LinkPost
1060
$metaCard = true;
1061
$meta = B2S_Meta::getInstance();
1102
1103
$b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData, array());
1104
1105
+ //is post for relay ?
1106
+ //get all relays in primary post id by b2s id & change sched_date + utc
1107
if (isset($post['post_for_relay']) && (int) $post['post_for_relay'] == 1 && isset($data['date'][0]) && isset($data['time'][0]) && (int) $b2s_id > 0) {
1108
$res = $this->getAllRelayByPrimaryPostId($b2s_id);
1109
if (is_array($res) && !empty($res)) {
includes/B2S/Calendar/Filter.php CHANGED
@@ -86,6 +86,7 @@ class B2S_Calendar_Filter {
86
. "b2s_posts_network_details.network_display_name, "
87
. "b2s_posts_network_details.network_auth_id, "
88
. "post.post_title, "
89
. "b2s_posts_sched_details.sched_data, "
90
. "b2s_posts_sched_details.image_url, "
91
. "b2s_posts.sched_details_id "
@@ -158,6 +159,7 @@ class B2S_Calendar_Filter {
158
. "b2s_posts_network_details.network_display_name, "
159
. "b2s_posts_network_details.network_auth_id, "
160
. "post.post_title, "
161
. "b2s_posts_sched_details.sched_data, "
162
. "b2s_posts_sched_details.image_url, "
163
. "b2s_posts.sched_details_id "
@@ -200,6 +202,7 @@ class B2S_Calendar_Filter {
200
. "b2s_posts_network_details.network_display_name, "
201
. "b2s_posts_network_details.network_auth_id, "
202
. "post.post_title, "
203
. "b2s_posts_sched_details.sched_data, "
204
. "b2s_posts_sched_details.image_url, "
205
. "b2s_posts.sched_details_id "
@@ -244,6 +247,7 @@ class B2S_Calendar_Filter {
244
. "b2s_posts_network_details.network_display_name, "
245
. "b2s_posts_network_details.network_auth_id, "
246
. "post.post_title, "
247
. "b2s_posts_sched_details.sched_data, "
248
. "b2s_posts_sched_details.image_url, "
249
. "b2s_posts.sched_details_id "
86
. "b2s_posts_network_details.network_display_name, "
87
. "b2s_posts_network_details.network_auth_id, "
88
. "post.post_title, "
89
+ . "post.post_type, "
90
. "b2s_posts_sched_details.sched_data, "
91
. "b2s_posts_sched_details.image_url, "
92
. "b2s_posts.sched_details_id "
159
. "b2s_posts_network_details.network_display_name, "
160
. "b2s_posts_network_details.network_auth_id, "
161
. "post.post_title, "
162
+ . "post.post_type, "
163
. "b2s_posts_sched_details.sched_data, "
164
. "b2s_posts_sched_details.image_url, "
165
. "b2s_posts.sched_details_id "
202
. "b2s_posts_network_details.network_display_name, "
203
. "b2s_posts_network_details.network_auth_id, "
204
. "post.post_title, "
205
+ . "post.post_type, "
206
. "b2s_posts_sched_details.sched_data, "
207
. "b2s_posts_sched_details.image_url, "
208
. "b2s_posts.sched_details_id "
247
. "b2s_posts_network_details.network_display_name, "
248
. "b2s_posts_network_details.network_auth_id, "
249
. "post.post_title, "
250
+ . "post.post_type, "
251
. "b2s_posts_sched_details.sched_data, "
252
. "b2s_posts_sched_details.image_url, "
253
. "b2s_posts.sched_details_id "
includes/B2S/Calendar/Item.php CHANGED
@@ -8,6 +8,7 @@ class B2S_Calendar_Item {
8
private $sched_date = null;
9
private $network_id = null;
10
private $post_title = null;
11
private $blog_user_id = null;
12
private $network_display_name = null;
13
private $b2s_id = null;
@@ -32,6 +33,7 @@ class B2S_Calendar_Item {
32
->setSchedDate($data->sched_date)
33
->setNetworkId($data->network_id)
34
->setPostTitle($data->post_title)
35
->setBlogUserId($data->blog_user_id)
36
->setNetworkDisplayName($data->network_display_name)
37
->setUserTimezone($data->user_timezone)
@@ -276,6 +278,14 @@ class B2S_Calendar_Item {
276
return $this;
277
}
278
279
/**
280
* @return string
281
*/
@@ -283,6 +293,13 @@ class B2S_Calendar_Item {
283
return $this->post_title;
284
}
285
286
/**
287
* @param integer $value
288
* @return $this
@@ -434,6 +451,7 @@ class B2S_Calendar_Item {
434
*/
435
public function asCalendarArray() {
436
return ["title" => $this->getPostTitle(),
437
"avatar" => $this->getAvatar(),
438
"author" => $this->getAuthor(),
439
"start" => date("Y-m-d H:i:s", $this->getSchedDate()),
8
private $sched_date = null;
9
private $network_id = null;
10
private $post_title = null;
11
+ private $post_type = null;
12
private $blog_user_id = null;
13
private $network_display_name = null;
14
private $b2s_id = null;
33
->setSchedDate($data->sched_date)
34
->setNetworkId($data->network_id)
35
->setPostTitle($data->post_title)
36
+ ->setPostType($data->post_type)
37
->setBlogUserId($data->blog_user_id)
38
->setNetworkDisplayName($data->network_display_name)
39
->setUserTimezone($data->user_timezone)
278
return $this;
279
}
280
281
+ public function setPostType($value) {
282
+ if (is_string($value)) {
283
+ $this->post_type = $value;
284
+ }
285
+
286
+ return $this;
287
+ }
288
+
289
/**
290
* @return string
291
*/
293
return $this->post_title;
294
}
295
296
+ /**
297
+ * @return string
298
+ */
299
+ public function getPostType() {
300
+ return $this->post_type;
301
+ }
302
+
303
/**
304
* @param integer $value
305
* @return $this
451
*/
452
public function asCalendarArray() {
453
return ["title" => $this->getPostTitle(),
454
+ "post_type" => $this->getPostType(),
455
"avatar" => $this->getAvatar(),
456
"author" => $this->getAuthor(),
457
"start" => date("Y-m-d H:i:s", $this->getSchedDate()),
includes/B2S/Curation/Save.php ADDED
@@ -0,0 +1,25 @@
1
+ <?php
2
+
3
+ class B2S_Curation_Save {
4
+
5
+ public $data = null;
6
+
7
+ public function __construct($data = array()) {
8
+ $this->data = $data;
9
+ }
10
+
11
+ public function insertContent() {
12
+ $post = array(
13
+ 'post_title' => wp_strip_all_tags($this->data['title']),
14
+ 'post_content' => $this->data['content'],
15
+ 'guid' => $this->data['url'],
16
+ 'post_status' => 'private',
17
+ 'post_author' => $this->data['author_id'],
18
+ 'post_type' => 'b2s_ex_post',
19
+ 'post_category' => array(0)
20
+ );
21
+ $res = wp_insert_post($post, true);
22
+ return ($res > 0) ? (int) $res : false;
23
+ }
24
+
25
+ }
includes/B2S/Curation/View.php ADDED
@@ -0,0 +1,142 @@
1
+ <?php
2
+
3
+ class B2S_Curation_View {
4
+
5
+ public function __construct() {
6
+
7
+ }
8
+
9
+ public function getCurationPreviewHtml($url = '', $data = array()) {
10
+
11
+ $image = plugins_url('/assets/images/no-image.png', B2S_PLUGIN_FILE);
12
+ $externalImage = false;
13
+ if (isset($data['og_image'])) {
14
+ $image = $data['og_image'];
15
+ $externalImage = true;
16
+ }
17
+ $title = isset($data['og_title']) ? $data['og_title'] : (isset($data['default_title']) ? $data['default_title'] : '');
18
+ $desc = isset($data['og_description']) ? $data['og_description'] : (isset($data['default_description']) ? $data['default_description'] : '');
19
+
20
+ $html = '';
21
+ $html .='<div class="row">';
22
+ $html .='<textarea class="form-control col-xs-12" placeholder="' . __('Write something...', 'blog2social') . '" id="b2s-post-curation-comment" name="comment">'.$desc.'</textarea>';
23
+ $html .='</div>';
24
+ $html .='</br>';
25
+ $html .='<div class="row">';
26
+ $html .='<div class="panel panel-default">';
27
+ $html .='<div class="panel-body">';
28
+ $html .='<div class="col-xs-12 col-sm-5 col-lg-3">';
29
+ $html .='<img src="' . $image . '" class="b2s-post-item-details-url-image center-block img-responsive" style="display: block;">';
30
+ $html .='<input type="hidden" id="b2s-post-curation-image-url" name="image_url" value="' . ($externalImage ? $image : "") . '">';
31
+ $html .='<div class="clearfix"></div>';
32
+ $html .='</div>';
33
+ $html .='<div class="col-xs-12 b2s-post-original-area col-sm-7 col-lg-9">';
34
+ $html .='<p class="b2s-post-item-details-preview-title">' . $title . '</p>';
35
+ $html .='<input type="hidden" id="b2s-post-curation-preview-title" name="title" value="' . addslashes($title) . '">';
36
+ $html .='<span class="b2s-post-item-details-preview-desc">' . $desc . '</span>';
37
+ $html .='<br>';
38
+ $html .='<span class="b2s-post-item-details-preview-url"><a href="' . $url . '" target="_blank" class="btn btn-link del-padding-left">' . $url . '</a></span>';
39
+ $html .='<input type="hidden" id="b2s-post-curation-url" name="url" value="' . $url . '">';
40
+ $html .='<span class="glyphicon glyphicon-pencil b2s-btn-change-url-preview"></span>';
41
+ $html .='</div>';
42
+ $html .='</div>';
43
+ $html .='</div>';
44
+ $html .='</div>';
45
+ $html .='</div>';
46
+ return $html;
47
+ }
48
+
49
+ public function getShippingDetails($mandant = array(), $auth = array()) {
50
+ //Opt: CustomDatePicker
51
+ $dateFormat = (substr(B2S_LANGUAGE, 0, 2) == 'de') ? 'dd.mm.yyyy' : 'yyyy-mm-dd';
52
+ $timeFormat = (substr(B2S_LANGUAGE, 0, 2) == 'de') ? 'hh:ii' : 'hh:ii aa';
53
+ $isPremium = (B2S_PLUGIN_USER_VERSION == 0) ? ' [' . __("PREMIUM", "blog2social") . ']' : '';
54
+
55
+ $authContent = '';
56
+ $content = '<br>';
57
+ $content .='<div class="row">';
58
+ $content .='<div class="col-xs-12 col-sm-5 col-lg-3">';
59
+ $content .='<label for="b2s-curation-ship-type">' . __('Share your post', 'blog2social') . '</label>';
60
+ $content .='<select style="width:100%;" id="b2s-post-curation-ship-type" class="b2s-select" data-user-version="' . B2S_PLUGIN_USER_VERSION . '" name="ship_type">';
61
+ $content .='<option value="0">' . __('immediately', 'blog2social') . '</option>';
62
+ $content .='<option value="1">' . __('at scheduled times', 'blog2social') . ' ' . $isPremium . '</option>';
63
+ $content .= '</select>';
64
+ $content .='</div>';
65
+ $content .='<div class="col-xs-12 col-sm-5 col-lg-3 b2s-post-curation-ship-date-area">';
66
+ $content .='<label for="b2s-post-curation-ship-date">' . __('Date', 'blog2social') . '</label>';
67
+ $content .='<input type = "text" placeholder = "' . __('Date', 'blog2social') . '" name = "ship_date" id="b2s-post-curation-ship-date" class = "b2s-post-curation-ship-date form-control b2s-input" disabled = "disabled" readonly data-timepicker="true" data-language="' . substr(B2S_LANGUAGE, 0, 2) . '" data-time-format="' . $timeFormat . '" data-date-format="' . $dateFormat . '">';
68
+ $content .='</div>';
69
+ $content .='<div class="col-xs-12 col-sm-5 col-lg-3">';
70
+ $content .='<label for="b2s-curation-profile-select">' . __('Select profile:', 'blog2social') . '</label>';
71
+ $content .='<select style="width:100%;" id="b2s-post-curation-profile-select" class="b2s-select" name="profile_select">';
72
+ foreach ($mandant as $k => $m) {
73
+ $content .= '<option value="' . $m->id . '">' . $m->name . '</option>';
74
+ $profilData = (isset($auth->{$m->id}) && isset($auth->{$m->id}[0]) && !empty($auth->{$m->id}[0])) ? serialize($auth->{$m->id}) : '';
75
+ $authContent .= "<input type='hidden' id='b2s-post-curation-profile-data-" . $m->id . "' name='profile_data_" . $m->id . "' value='" . base64_encode($profilData) . "'/>";
76
+ }
77
+ $content .= '</select>';
78
+ $content .='</div>';
79
+ $content .= $authContent;
80
+
81
+ //TOS Twitter 032018 - none multiple Accounts - User select once
82
+ $twitterContent = '';
83
+ foreach ($mandant as $k => $m) {
84
+ if ((isset($auth->{$m->id}) && isset($auth->{$m->id}[0]) && !empty($auth->{$m->id}[0]))) {
85
+ foreach ($auth->{$m->id} as $key => $value) {
86
+ if ($value->networkId == 2) {
87
+ $twitterContent .= '<option data-mandant-id="' . $m->id . '" value="' . $value->networkAuthId . '">' . $value->networkUserName . '</option>';
88
+ }
89
+ }
90
+ }
91
+ }
92
+ if (!empty($twitterContent)) {
93
+ $content .='<div class="col-xs-12 col-sm-5 col-lg-3 b2s-curation-twitter-area">';
94
+ $content .='<label for="b2s-curation-twitter-select">' . __('Select Twitter profile:', 'blog2social') . '</label>';
95
+ $content .='<select style="width:100%;" id="b2s-post-curation-twitter-select" class="b2s-select" name="twitter_select">';
96
+ $content .=$twitterContent;
97
+ $content .= '</select>';
98
+ $content .='</div>';
99
+ }
100
+ $content .='</div>';
101
+ $content .= '<br>';
102
+ $content .='<hr>';
103
+ $content .='<input type="hidden" id="b2s-post-curation-action" name="action" value="b2s_curation_share">';
104
+ $content .='<div class="row">';
105
+ $content .='<div class="col-xs-12 col-sm-6 col-lg-6">';
106
+ $content .= '<button class="btn btn-primary pull-left" type="submit" id="b2s-btn-curation-customize">' . __('Customize & Schedule', 'blog2social') . '</button>';
107
+ $content .='</div>';
108
+ $content .='<div class="col-xs-12 col-sm-6 col-lg-6">';
109
+ $content .= '<button class="btn btn-success pull-right" type="submit" id="b2s-btn-curation-share">' . __('Share', 'blog2social') . '</button>';
110
+ $content .='</div>';
111
+ $content .='</div>';
112
+
113
+ return $content;
114
+ }
115
+
116
+ public function getResultListHtml($data = array()) {
117
+ $networkName = unserialize(B2S_PLUGIN_NETWORK);
118
+ $networkTypeName = unserialize(B2S_PLUGIN_NETWORK_TYPE);
119
+ $html = '';
120
+ foreach ($data as $k => $v) {
121
+ $html.='<div class="b2s-post-item">
122
+ <div class="panel panel-group">
123
+ <div class="panel-body">
124
+ <div class="b2s-post-item-area">
125
+ <div class="b2s-post-item-thumb hidden-xs">
126
+ <img alt="" class="img-responsive b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/' . $v['networkId'] . '_flat.png', B2S_PLUGIN_FILE) . '">
127
+ </div>
128
+ <div class="b2s-post-item-details">
129
+ <h4 class="pull-left b2s-post-item-details-network-display-name">' . $v['networkDisplayName'] . '</h4>
130
+ <div class="clearfix"></div>
131
+ <p class="pull-left">' . $networkTypeName[$v['networkType']] . ' | ' . $networkName[$v['networkId']] . '</p>
132
+ <div class="b2s-post-item-details-message-result" data-network-auth-id="' . $v['networkAuthId'] . '">' . $v['html'] . '</div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>';
138
+ }
139
+ return $html;
140
+ }
141
+
142
+ }
includes/B2S/Post/Filter.php CHANGED
@@ -108,6 +108,10 @@ class B2S_Post_Filter {
108
$type = '<div class="form-group"><select id="b2sSortPostType" name="b2sSortPostType" class="form-control b2s-select"><option value="">' . __('all post types', 'blog2social') . '</option>';
109
$post_types = get_post_types(array('public' => true));
110
if (is_array($post_types) && !empty($post_types)) {
111
foreach ($post_types as $k => $v) {
112
if ($v != 'attachment' && $v != 'nav_menu_item' && $v != 'revision') {
113
$selected = (!empty($this->searchPostType) && $v == $this->searchPostType) ? 'selected' : '';
@@ -115,7 +119,7 @@ class B2S_Post_Filter {
115
if (function_exists('mb_strlen') && function_exists('mb_substr')) {
116
$v = mb_strlen($v, 'UTF-8') > 27 ? mb_substr($v, 0, 27, 'UTF-8') . '...' : $v;
117
}
118
- $type .= '<option ' . $selected . ' value="' . $v . '">' . ucfirst($v) . '</option>';
119
}
120
}
121
}
108
$type = '<div class="form-group"><select id="b2sSortPostType" name="b2sSortPostType" class="form-control b2s-select"><option value="">' . __('all post types', 'blog2social') . '</option>';
109
$post_types = get_post_types(array('public' => true));
110
if (is_array($post_types) && !empty($post_types)) {
111
+ //V5.0.0 Add Content Curation manuelly because is not public
112
+ if ($this->type != 'all') {
113
+ $post_types['Content Curation'] = 'b2s_ex_post';
114
+ }
115
foreach ($post_types as $k => $v) {
116
if ($v != 'attachment' && $v != 'nav_menu_item' && $v != 'revision') {
117
$selected = (!empty($this->searchPostType) && $v == $this->searchPostType) ? 'selected' : '';
119
if (function_exists('mb_strlen') && function_exists('mb_substr')) {
120
$v = mb_strlen($v, 'UTF-8') > 27 ? mb_substr($v, 0, 27, 'UTF-8') . '...' : $v;
121
}
122
+ $type .= '<option ' . $selected . ' value="' . $v . '">' . ucfirst($k) . '</option>';
123
}
124
}
125
}
includes/B2S/Post/Item.php CHANGED
@@ -45,6 +45,7 @@ class B2S_Post_Item {
45
46
$addSearchAuthorId = '';
47
$addSearchPostTitle = '';
48
$order = 'post_date';
49
$sortType = 'DESC';
50
$leftJoin = "";
@@ -73,10 +74,13 @@ class B2S_Post_Item {
73
$leftJoinWhere = "AND $wpdb->term_taxonomy.`term_id` = " . $this->searchPostCat;
74
}
75
76
if (!empty($this->searchPostStatus)) {
77
$addSearchType = $wpdb->prepare(' posts.`post_status` = %s', $this->searchPostStatus);
78
} else {
79
- $addSearchType = " (posts.`post_status` = 'publish' OR posts.`post_status` = 'pending' OR posts.`post_status` = 'future') ";
80
}
81
82
$postTypes = " ";
@@ -85,6 +89,10 @@ class B2S_Post_Item {
85
} else {
86
$post_types = get_post_types(array('public' => true));
87
if (is_array($post_types) && !empty($post_types)) {
88
$postTypes .= " posts.`post_type` IN("; // AND
89
foreach ($post_types as $k => $v) {
90
if ($v != 'attachment' && $v != 'nav_menu_item' && $v != 'revision') {
@@ -94,7 +102,7 @@ class B2S_Post_Item {
94
$postTypes = rtrim($postTypes, ',');
95
$postTypes .= " ) ";
96
} else {
97
- $postTypes .= " (posts.`post_type` LIKE '%product%' OR posts.`post_type` LIKE '%book%' OR posts.`post_type` LIKE '%article%' OR posts.`post_type` LIKE '%job%' OR posts.`post_type` LIKE '%event%' OR posts.`post_type` = 'post' OR posts.`post_type` = 'page') ";
98
}
99
}
100
@@ -212,13 +220,18 @@ class B2S_Post_Item {
212
if (strpos(strtolower($var->post_type), 'job') !== false) {
213
$postType = 'job';
214
}
215
-
216
//Plugin: qTranslate
217
$postTitle = B2S_Util::getTitleByLanguage($var->post_title, $this->userLang);
218
if (function_exists('mb_strlen') && function_exists('mb_substr')) {
219
$postTitle = (mb_strlen(trim($postTitle), 'UTF-8') > 80 ? mb_substr($postTitle, 0, 77, 'UTF-8') . '...' : $postTitle);
220
}
221
222
if ($this->type == 'all') {
223
$userInfo = get_user_meta($var->post_author);
224
$lastPublish = $this->getLastPublish($var->ID);
@@ -247,7 +260,7 @@ class B2S_Post_Item {
247
<img class="post-img-10 pull-left hidden-xs" src="' . plugins_url('/assets/images/b2s/' . $postType . '-icon.png', B2S_PLUGIN_FILE) . '" alt="posttype">
248
<div class="media-body">
249
<div class="pull-left media-nav">
250
- <strong><a target="_blank" href="' . get_permalink($var->ID) . '">' . $postTitle . '</a></strong>
251
<span class="pull-right">
252
<a class="btn btn-success hidden-xs btn-sm" href="admin.php?page=blog2social-ship&postId=' . $var->ID . '">' . __('Re-share this post', 'blog2social') . '</a>
253
<button type="button" class="btn btn-primary btn-sm b2sDetailsPublishPostBtn" data-search-date="' . $this->searchShowByDate . '" data-post-id="' . $var->ID . '"><i class="glyphicon glyphicon-chevron-down"></i> ' . __('Details', 'blog2social') . '</button>
@@ -272,7 +285,7 @@ class B2S_Post_Item {
272
<img class="post-img-10 pull-left hidden-xs" src="' . plugins_url('/assets/images/b2s/' . $postType . '-icon.png', B2S_PLUGIN_FILE) . '" alt="posttype">
273
<div class="media-body">
274
<div class="pull-left media-head">
275
- <strong><a target="_blank" href="' . get_permalink($var->ID) . '">' . $postTitle . '</a></strong>
276
<span class="pull-right">
277
<button type="button" class="btn btn-primary btn-sm b2sDetailsSchedPostBtn" data-search-date="' . $this->searchShowByDate . '" data-post-id="' . $var->ID . '"><i class="glyphicon glyphicon-chevron-down"></i> ' . __('Details', 'blog2social') . '</button>
278
</span>
@@ -488,7 +501,7 @@ class B2S_Post_Item {
488
$content .='<li class="list-group-item"><label class="checkbox-inline checkbox-all-label"><input class="checkbox-all" data-blog-post-id="' . $post_id . '" name="selected-checkbox-all" value="" type="checkbox"> ' . __('select all', 'blog2social') . '</label></li>';
489
foreach ($result as $var) {
490
$approveDate = ($var->sched_date == "0000-00-00 00:00:00") ? B2S_Util::getCustomDateFormat($var->publish_date, substr(B2S_LANGUAGE, 0, 2)) : B2S_Util::getCustomDateFormat($var->sched_date, substr(B2S_LANGUAGE, 0, 2));
491
- $approveText = __('is waiting to shared by', 'blog2social');
492
$userInfo = get_user_meta($var->blog_user_id);
493
$content .= ' <li class="list-group-item b2s-post-approve-area-li" data-post-id="' . $var->id . '">
494
<div class="media">';
@@ -540,7 +553,7 @@ class B2S_Post_Item {
540
$addNotAdminPosts = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND `b2s_posts`.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
541
$addSearchShowByDate = (!empty($showByDate)) ? " AND DATE_FORMAT(`b2s_posts`.`sched_date`,'%%Y-%%m-%%d') = '" . $showByDate . "' " : '';
542
$addSearchUserAuthId = ($userAuthId != 0) ? " AND `b2s_posts_network_details`.`network_auth_id` =" . $userAuthId . " " : '';
543
- $sqlData = $wpdb->prepare("SELECT `b2s_posts`.`id`, `b2s_posts`.`post_id`,`blog_user_id`,`last_edit_blog_user_id`,`v2_id`, `sched_date`,`sched_type`, `relay_primary_post_id`, `b2s_posts_network_details`.`network_id`,`b2s_posts_network_details`.`network_auth_id`,`b2s_posts_network_details`.`network_type`,`b2s_posts_network_details`.`network_display_name` FROM `b2s_posts` LEFT JOIN `b2s_posts_network_details` ON `b2s_posts`.`network_details_id` = `b2s_posts_network_details`.`id` WHERE `b2s_posts`.`hide` = 0 AND ((`b2s_posts`.`sched_date_utc` != '0000-00-00 00:00:00' AND `b2s_posts`.`post_for_approve` = 0) OR (`b2s_posts`.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND `b2s_posts`.`post_for_approve` = 1)) AND `b2s_posts`.`sched_type` != 3 AND `b2s_posts`.`publish_date` = '0000-00-00 00:00:00' $addNotAdminPosts $addSearchShowByDate $addSearchUserAuthId AND `b2s_posts`.`post_id` = %d ORDER BY `b2s_posts`.`sched_date` ASC ", $post_id);
544
$result = $wpdb->get_results($sqlData);
545
$specialPostingData = array(4 => __('Retweet', 'blog2social'));
546
if (!empty($result) && is_array($result)) {
@@ -559,13 +572,15 @@ class B2S_Post_Item {
559
$userInfoLastEdit = ((int) $var->last_edit_blog_user_id > 0 && (int) $var->last_edit_blog_user_id != (int) $var->blog_user_id) ? get_user_meta($var->last_edit_blog_user_id) : '';
560
$lastEdit = (!empty($userInfoLastEdit)) ? ' | ' . __('last modified by', 'blog2social') . ' <a href="' . get_author_posts_url($var->last_edit_blog_user_id) . '">' . (isset($userInfoLastEdit['nickname'][0]) ? $userInfoLastEdit['nickname'][0] : '-') . '</a> | ' : '';
561
562
$content .='<img class="pull-left hidden-xs" src="' . plugins_url('/assets/images/portale/' . $var->network_id . '_flat.png', B2S_PLUGIN_FILE) . '" alt="posttype">
563
<div class="media-body">
564
- <strong>' . $networkName[$var->network_id] . '</strong>
565
- <p class="info">' . $networkType[$var->network_type] . (!empty($var->network_display_name) ? (': ' . $var->network_display_name) : '' ) . ' | ' . __('scheduled by', 'blog2social') . ' <a href="' . get_author_posts_url($var->blog_user_id) . '">' . (isset($userInfo['nickname'][0]) ? $userInfo['nickname'][0] : '-') . '</a> <span class="b2s-post-sched-area-sched-time" data-post-id="' . $var->id . '">' .$lastEdit. B2S_Util::getCustomDateFormat($var->sched_date, substr(B2S_LANGUAGE, 0, 2)) . '</span> ' . $specialPosting . '</p>
566
<p class="info">';
567
568
- if ((int) $var->v2_id == 0) {
569
//data-blog-sched-date="' . $blogPostDate . '" data-b2s-sched-date="' . strtotime($var->sched_date) . '000"
570
$content .= (B2S_PLUGIN_USER_VERSION > 0) ? ' <a href="#" class="b2s-post-edit-sched-btn" data-network-auth-id="' . $var->network_auth_id . '" data-network-type="' . $var->network_type . '" data-network-id="' . $var->network_id . '" data-post-id="' . $var->post_id . '" data-b2s-id="' . $var->id . '" data-relay-primary-post-id="' . $var->relay_primary_post_id . '" >' : ' <a href="#" data-toggle="modal" data-title="' . __('You want to edit your scheduled post?', 'blog2social') . '" data-target="#b2sPreFeatureModal">';
571
$content .= __('edit', 'blog2social') . '</a> ';
45
46
$addSearchAuthorId = '';
47
$addSearchPostTitle = '';
48
+ $addSearchTypeContentCuration = '';
49
$order = 'post_date';
50
$sortType = 'DESC';
51
$leftJoin = "";
74
$leftJoinWhere = "AND $wpdb->term_taxonomy.`term_id` = " . $this->searchPostCat;
75
}
76
77
+
78
+
79
if (!empty($this->searchPostStatus)) {
80
$addSearchType = $wpdb->prepare(' posts.`post_status` = %s', $this->searchPostStatus);
81
} else {
82
+ //V5.0.0 include Content Curation (post_status = private)
83
+ $addSearchType = " (posts.`post_status` = 'publish' OR posts.`post_status` = 'pending' OR posts.`post_status` = 'future' " . (($this->type != 'all') ? " OR posts.`post_status` = 'private'" : "") . ") ";
84
}
85
86
$postTypes = " ";
89
} else {
90
$post_types = get_post_types(array('public' => true));
91
if (is_array($post_types) && !empty($post_types)) {
92
+ //V5.0.0 Add Content Curation manuelly because is not public
93
+ if ($this->type != 'all') {
94
+ $post_types['Content Curation'] = 'b2s_ex_post';
95
+ }
96
$postTypes .= " posts.`post_type` IN("; // AND
97
foreach ($post_types as $k => $v) {
98
if ($v != 'attachment' && $v != 'nav_menu_item' && $v != 'revision') {
102
$postTypes = rtrim($postTypes, ',');
103
$postTypes .= " ) ";
104
} else {
105
+ $postTypes .= " (posts.`post_type` LIKE '%product%' OR posts.`post_type` LIKE '%book%' OR posts.`post_type` LIKE '%article%' OR posts.`post_type` LIKE '%job%' OR posts.`post_type` LIKE '%event%' OR posts.`post_type` = 'post' OR posts.`post_type` = 'page' OR posts.`post_type` = 'b2s_ex_post') ";
106
}
107
}
108
220
if (strpos(strtolower($var->post_type), 'job') !== false) {
221
$postType = 'job';
222
}
223
+ if (strpos(strtolower($var->post_type), 'product') !== false) {
224
+ $postType = 'product';
225
+ }
226
//Plugin: qTranslate
227
$postTitle = B2S_Util::getTitleByLanguage($var->post_title, $this->userLang);
228
if (function_exists('mb_strlen') && function_exists('mb_substr')) {
229
$postTitle = (mb_strlen(trim($postTitle), 'UTF-8') > 80 ? mb_substr($postTitle, 0, 77, 'UTF-8') . '...' : $postTitle);
230
}
231
232
+ //Content Curation
233
+ $curated = (strtolower($var->post_type) == 'b2s_ex_post') ? ' - <strong>' . __('curated post', 'blog2social') . '</strong>' : '';
234
+
235
if ($this->type == 'all') {
236
$userInfo = get_user_meta($var->post_author);
237
$lastPublish = $this->getLastPublish($var->ID);
260
<img class="post-img-10 pull-left hidden-xs" src="' . plugins_url('/assets/images/b2s/' . $postType . '-icon.png', B2S_PLUGIN_FILE) . '" alt="posttype">
261
<div class="media-body">
262
<div class="pull-left media-nav">
263
+ <strong><a target="_blank" href="' . get_permalink($var->ID) . '">' . $postTitle . '</a></strong>' . $curated . '
264
<span class="pull-right">
265
<a class="btn btn-success hidden-xs btn-sm" href="admin.php?page=blog2social-ship&postId=' . $var->ID . '">' . __('Re-share this post', 'blog2social') . '</a>
266
<button type="button" class="btn btn-primary btn-sm b2sDetailsPublishPostBtn" data-search-date="' . $this->searchShowByDate . '" data-post-id="' . $var->ID . '"><i class="glyphicon glyphicon-chevron-down"></i> ' . __('Details', 'blog2social') . '</button>
285
<img class="post-img-10 pull-left hidden-xs" src="' . plugins_url('/assets/images/b2s/' . $postType . '-icon.png', B2S_PLUGIN_FILE) . '" alt="posttype">
286
<div class="media-body">
287
<div class="pull-left media-head">
288
+ <strong><a target="_blank" href="' . get_permalink($var->ID) . '">' . $postTitle . '</a></strong>' . $curated . '
289
<span class="pull-right">
290
<button type="button" class="btn btn-primary btn-sm b2sDetailsSchedPostBtn" data-search-date="' . $this->searchShowByDate . '" data-post-id="' . $var->ID . '"><i class="glyphicon glyphicon-chevron-down"></i> ' . __('Details', 'blog2social') . '</button>
291
</span>
501
$content .='<li class="list-group-item"><label class="checkbox-inline checkbox-all-label"><input class="checkbox-all" data-blog-post-id="' . $post_id . '" name="selected-checkbox-all" value="" type="checkbox"> ' . __('select all', 'blog2social') . '</label></li>';
502
foreach ($result as $var) {
503
$approveDate = ($var->sched_date == "0000-00-00 00:00:00") ? B2S_Util::getCustomDateFormat($var->publish_date, substr(B2S_LANGUAGE, 0, 2)) : B2S_Util::getCustomDateFormat($var->sched_date, substr(B2S_LANGUAGE, 0, 2));
504
+ $approveText = __('is waiting to shared by', 'blog2social');
505
$userInfo = get_user_meta($var->blog_user_id);
506
$content .= ' <li class="list-group-item b2s-post-approve-area-li" data-post-id="' . $var->id . '">
507
<div class="media">';
553
$addNotAdminPosts = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND `b2s_posts`.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
554
$addSearchShowByDate = (!empty($showByDate)) ? " AND DATE_FORMAT(`b2s_posts`.`sched_date`,'%%Y-%%m-%%d') = '" . $showByDate . "' " : '';
555
$addSearchUserAuthId = ($userAuthId != 0) ? " AND `b2s_posts_network_details`.`network_auth_id` =" . $userAuthId . " " : '';
556
+ $sqlData = $wpdb->prepare("SELECT `b2s_posts`.`id`, `b2s_posts`.`post_id`,`blog_user_id`,`last_edit_blog_user_id`,`v2_id`, `sched_date`, `sched_date_utc`, `sched_type`, `relay_primary_post_id`, `b2s_posts_network_details`.`network_id`,`b2s_posts_network_details`.`network_auth_id`,`b2s_posts_network_details`.`network_type`,`b2s_posts_network_details`.`network_display_name` FROM `b2s_posts` LEFT JOIN `b2s_posts_network_details` ON `b2s_posts`.`network_details_id` = `b2s_posts_network_details`.`id` WHERE `b2s_posts`.`hide` = 0 AND ((`b2s_posts`.`sched_date_utc` != '0000-00-00 00:00:00' AND `b2s_posts`.`post_for_approve` = 0) OR (`b2s_posts`.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND `b2s_posts`.`post_for_approve` = 1)) AND `b2s_posts`.`sched_type` != 3 AND `b2s_posts`.`publish_date` = '0000-00-00 00:00:00' $addNotAdminPosts $addSearchShowByDate $addSearchUserAuthId AND `b2s_posts`.`post_id` = %d ORDER BY `b2s_posts`.`sched_date` ASC ", $post_id);
557
$result = $wpdb->get_results($sqlData);
558 <