Blog2Social: Social Media Auto Post & Scheduler - Version 5.5.0

Version Description

Team function

Download this release

Release Info

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

Code changes from version 5.4.1 to 5.5.0

Files changed (44) hide show
  1. assets/css/b2s/network.css +49 -2
  2. assets/css/b2s/premium.css +32 -0
  3. assets/images/features/auto-posting.png +0 -0
  4. assets/images/features/best-times-manager.png +0 -0
  5. assets/images/features/content-curation.png +0 -0
  6. assets/images/features/link-image-post.png +0 -0
  7. assets/images/features/media-library.png +0 -0
  8. assets/images/features/pages-groups.png +0 -0
  9. assets/images/features/rss-feed.png +0 -0
  10. assets/images/features/social-media-calendar.png +0 -0
  11. assets/images/features/tags.png +0 -0
  12. assets/images/no-image.png +0 -0
  13. assets/js/b2s/calendar.js +8 -4
  14. assets/js/b2s/curation.js +47 -0
  15. assets/js/b2s/general.js +11 -2
  16. assets/js/b2s/network.js +312 -36
  17. assets/js/b2s/post.js +8 -3
  18. assets/js/b2s/premium.js +55 -0
  19. assets/js/b2s/wp/post-box.js +8 -1
  20. blog2social.php +2 -2
  21. includes/Ajax/Get.php +84 -24
  22. includes/Ajax/Post.php +154 -22
  23. includes/B2S/Curation/View.php +1 -1
  24. includes/B2S/Network/Item.php +97 -20
  25. includes/B2S/Post/Item.php +1 -1
  26. includes/B2S/PostBox.php +1 -1
  27. includes/B2S/Settings/Item.php +2 -2
  28. includes/B2S/Ship/Item.php +18 -13
  29. includes/B2S/Ship/Navbar.php +2 -1
  30. includes/B2S/Ship/Portale.php +2 -1
  31. includes/Loader.php +46 -20
  32. includes/Meta.php +3 -3
  33. includes/Notice.php +21 -40
  34. includes/Tools.php +72 -22
  35. includes/Util.php +18 -5
  36. languages/blog2social-de_DE.mo +0 -0
  37. languages/blog2social-de_DE.po +352 -188
  38. languages/blog2social.pot +343 -181
  39. readme.txt +117 -256
  40. views/b2s/html/header.phtml +17 -1
  41. views/b2s/network.php +150 -5
  42. views/b2s/partials/post-edit-modal.php +1 -1
  43. views/b2s/premium.php +97 -11
  44. views/b2s/settings.php +1 -1
assets/css/b2s/network.css CHANGED
@@ -62,7 +62,12 @@
62
}
63
64
.b2s-add-padding-network-refresh{
65
- padding: 4px 15px;
66
}
67
68
.b2s-sched-manager-best-time-info{
@@ -111,6 +116,14 @@
111
112
}
113
114
.b2s-network-item-auth-list{
115
padding-top:6px;
116
font-size: 0.80rem !important;
@@ -145,7 +158,7 @@ ul.b2s-network-item-auth-list li:last-child{
145
line-height: 2;
146
}
147
148
- .b2s-modify-board-and-group-network-modal-footer{
149
border: 0px !important;
150
}
151
@@ -214,4 +227,38 @@ ul.b2s-network-item-auth-list li:last-child{
214
215
.b2s-label-success-border-left{
216
border-left: 3px solid #398439;
217
}
62
}
63
64
.b2s-add-padding-network-refresh{
65
+ padding: 4px 7px;
66
+ }
67
+
68
+ .b2s-add-padding-network-team{
69
+ padding: 4px 3px;
70
+ line-height: 2;
71
}
72
73
.b2s-sched-manager-best-time-info{
116
117
}
118
119
+ .b2s-network-approved-from{
120
+ font-size: 12px;
121
+ font-style: italic;
122
+ color: #777;
123
+ font-weight: normal;
124
+
125
+ }
126
+
127
.b2s-network-item-auth-list{
128
padding-top:6px;
129
font-size: 0.80rem !important;
158
line-height: 2;
159
}
160
161
+ .b2s-modify-board-and-group-network-modal-footer, .b2s-manage-auth-team-modal-footer{
162
border: 0px !important;
163
}
164
227
228
.b2s-label-success-border-left{
229
border-left: 3px solid #398439;
230
+ }
231
+
232
+ .b2s-margin-top-8 {
233
+ margin-top: 8px;
234
+ }
235
+
236
+ .b2s-margin-bottom-8 {
237
+ margin-bottom: 8px;
238
+ }
239
+
240
+ #b2s-manage-auth-team-modal {
241
+ z-index: 1049;
242
+ }
243
+
244
+ .b2s-add-padding-network-placeholder-btn{
245
+ padding: 4px 14px;
246
+ }
247
+
248
+ .b2s-bold{
249
+ font-weight: 600;
250
+ }
251
+
252
+ #b2s-delete-network-sched-post {
253
+ float: left;
254
+ }
255
+
256
+ .b2s-btn-network-delete-list {
257
+ margin-left: 36px;
258
+ list-style: disc;
259
+ }
260
+
261
+ .b2s-loading-area-manage-auth-team-modal{
262
+ float: left;
263
+ text-align: center;
264
}
assets/css/b2s/premium.css CHANGED
@@ -18,4 +18,36 @@ body .thumbnail{
18
text-align: center;
19
margin-top: 15px;
20
margin-bottom: 15px;
21
}
18
text-align: center;
19
margin-top: 15px;
20
margin-bottom: 15px;
21
+ }
22
+
23
+ .chosen-single {
24
+ box-shadow: none !important;
25
+ background: none !important;
26
+ border-radius: 3px !important;
27
+ height: 30px !important;
28
+ padding-top: 3px !important;
29
+ padding-bottom: 3px !important;
30
+ }
31
+
32
+ .chosen-single div {
33
+ padding-top: 2px !important;
34
+ }
35
+
36
+ #b2s_license_user_select_chosen {
37
+ width: 100% !important;
38
+ }
39
+
40
+ @media(min-width:991px){
41
+ #b2s-license-user-area {
42
+ padding-left: 0px;
43
+ padding-right: 5px;
44
+ padding-bottom: 5px;
45
+ }
46
+ }
47
+ @media(max-width:991px){
48
+ #b2s-license-user-area{
49
+ padding-bottom: 5px;
50
+ padding-right: 0px;
51
+ padding-left: 0px;
52
+ }
53
}
assets/images/features/auto-posting.png ADDED
Binary file
assets/images/features/best-times-manager.png ADDED
Binary file
assets/images/features/content-curation.png ADDED
Binary file
assets/images/features/link-image-post.png ADDED
Binary file
assets/images/features/media-library.png ADDED
Binary file
assets/images/features/pages-groups.png CHANGED
Binary file
assets/images/features/rss-feed.png ADDED
Binary file
assets/images/features/social-media-calendar.png ADDED
Binary file
assets/images/features/tags.png ADDED
Binary file
assets/images/no-image.png CHANGED
Binary file
assets/js/b2s/calendar.js CHANGED
@@ -110,6 +110,7 @@ function showEditSchedCalendarPost(b2s_id, post_id, network_auth_id, network_typ
110
jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
111
}
112
b2s_current_post_id = post_id;
113
var $modal = jQuery("<div>");
114
jQuery.ajax({
115
url: ajaxurl,
@@ -207,8 +208,6 @@ function showEditSchedCalendarPost(b2s_id, post_id, network_auth_id, network_typ
207
}
208
209
}
210
-
211
- jQuery("#b2sPostId").val(post_id);
212
var today = new Date();
213
var dateFormat = "yyyy-mm-dd";
214
var language = "en";
@@ -263,8 +262,6 @@ function showEditSchedCalendarPost(b2s_id, post_id, network_auth_id, network_typ
263
}
264
}
265
266
-
267
-
268
jQuery(document).on('change', '.b2s-calendar-filter-network-btn', function () {
269
var filter_status = jQuery('#b2s-calendar-filter-status').val();
270
newSource[0] = ajaxurl + '?action=b2s_get_calendar_events&filter_network_auth=all&filter_network=' + jQuery(this).val() + '&filter_status=' + filter_status;
@@ -327,6 +324,13 @@ jQuery(document).on('change', '#b2s-calendar-filter-status', function () {
327
});
328
329
330
jQuery(document).on('click', '#b2s-sort-submit-btn', function () {
331
jQuery('#b2sPagination').val("1");
332
b2sSortFormSubmit();
110
jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
111
}
112
b2s_current_post_id = post_id;
113
+ jQuery("#b2sPostId").val(post_id);
114
var $modal = jQuery("<div>");
115
jQuery.ajax({
116
url: ajaxurl,
208
}
209
210
}
211
var today = new Date();
212
var dateFormat = "yyyy-mm-dd";
213
var language = "en";
262
}
263
}
264
265
jQuery(document).on('change', '.b2s-calendar-filter-network-btn', function () {
266
var filter_status = jQuery('#b2s-calendar-filter-status').val();
267
newSource[0] = ajaxurl + '?action=b2s_get_calendar_events&filter_network_auth=all&filter_network=' + jQuery(this).val() + '&filter_status=' + filter_status;
324
});
325
326
327
+ //Modal Edit Post close
328
+ jQuery(document).on('click', '.b2s-modal-close-edit-post', function (e) {
329
+ jQuery(jQuery(this).attr('data-modal-name')).remove();
330
+ return false;
331
+ });
332
+
333
+
334
jQuery(document).on('click', '#b2s-sort-submit-btn', function () {
335
jQuery('#b2sPagination').val("1");
336
b2sSortFormSubmit();
assets/js/b2s/curation.js CHANGED
@@ -153,6 +153,10 @@ function scrapeDetails(url) {
153
if(typeof postId != "undefined" && postId != ""){
154
jQuery('#b2s-draft-id').val(postId);
155
}
156
var comment = url_param.searchParams.get("comment");
157
if(typeof comment != "undefined" && comment != ""){
158
jQuery('#b2s-post-curation-comment').val(comment);
@@ -182,12 +186,22 @@ function scrapeDetails(url) {
182
jQuery('#b2s-btn-curation-customize').prop("disabled", true);
183
jQuery('#b2s-btn-curation-share').prop("disabled", true);
184
}
185
}
186
});
187
return false;
188
189
}
190
191
jQuery(document).on("keyup", "#b2s-post-curation-comment", function () {
192
jQuery(this).removeClass('error');
193
if (jQuery(this).val().length === 0) {
@@ -202,10 +216,19 @@ jQuery(document).on('click', '#b2s-btn-curation-share', function () {
202
jQuery('#b2s-curation-no-auth-info').hide();
203
jQuery('#b2s-curation-saved-draft-info').hide();
204
205
if (jQuery('#b2s-post-curation-comment').val().length === 0) {
206
jQuery('#b2s-post-curation-comment').addClass('error');
207
return false;
208
}
209
jQuery('.b2s-curation-post-list-area').html("").hide();
210
jQuery('.b2s-loading-area').show();
211
jQuery('.b2s-curation-settings-area').hide();
@@ -315,6 +338,18 @@ jQuery(document).on('click', '#b2s-btn-curation-customize', function () {
315
jQuery('#b2s-curation-no-data-info').hide();
316
jQuery('#b2s-curation-no-auth-info').hide();
317
jQuery('#b2s-curation-saved-draft-info').hide();
318
jQuery('#b2s-post-curation-action').val('b2s_curation_customize');
319
jQuery('.b2s-loading-area').show();
320
jQuery('.b2s-curation-settings-area').hide();
@@ -397,6 +432,18 @@ jQuery(document).on('click', '#b2s-btn-curation-draft', function () {
397
jQuery('#b2s-curation-no-data-info').hide();
398
jQuery('#b2s-curation-no-auth-info').hide();
399
jQuery('#b2s-curation-saved-draft-info').hide();
400
jQuery('#b2s-post-curation-action').val('b2s_curation_draft');
401
jQuery('.b2s-loading-area').show();
402
jQuery('.b2s-curation-settings-area').hide();
153
if(typeof postId != "undefined" && postId != ""){
154
jQuery('#b2s-draft-id').val(postId);
155
}
156
+ var title = url_param.searchParams.get("title");
157
+ if(typeof title != "undefined" && title != "" && jQuery('#b2s-post-curation-preview-title').val() == ""){
158
+ jQuery('#b2s-post-curation-preview-title').val(title);
159
+ }
160
var comment = url_param.searchParams.get("comment");
161
if(typeof comment != "undefined" && comment != ""){
162
jQuery('#b2s-post-curation-comment').val(comment);
186
jQuery('#b2s-btn-curation-customize').prop("disabled", true);
187
jQuery('#b2s-btn-curation-share').prop("disabled", true);
188
}
189
+ if(data.scrapeError == true) {
190
+ jQuery('#b2s-post-curation-preview-title').attr('type', 'text');
191
+ }
192
}
193
});
194
return false;
195
196
}
197
198
+ jQuery(document).on("keyup", "#b2s-post-curation-preview-title", function () {
199
+ jQuery(this).removeClass('error');
200
+ if (jQuery(this).val().length === 0) {
201
+ jQuery(this).addClass('error');
202
+ }
203
+ return false;
204
+ });
205
jQuery(document).on("keyup", "#b2s-post-curation-comment", function () {
206
jQuery(this).removeClass('error');
207
if (jQuery(this).val().length === 0) {
216
jQuery('#b2s-curation-no-auth-info').hide();
217
jQuery('#b2s-curation-saved-draft-info').hide();
218
219
+ var noContent = false;
220
+ if (jQuery('#b2s-post-curation-preview-title').val().length === 0) {
221
+ jQuery('#b2s-post-curation-preview-title').addClass('error');
222
+ noContent= true;
223
+ }
224
if (jQuery('#b2s-post-curation-comment').val().length === 0) {
225
jQuery('#b2s-post-curation-comment').addClass('error');
226
+ noContent= true;
227
+ }
228
+ if(noContent){
229
return false;
230
}
231
+
232
jQuery('.b2s-curation-post-list-area').html("").hide();
233
jQuery('.b2s-loading-area').show();
234
jQuery('.b2s-curation-settings-area').hide();
338
jQuery('#b2s-curation-no-data-info').hide();
339
jQuery('#b2s-curation-no-auth-info').hide();
340
jQuery('#b2s-curation-saved-draft-info').hide();
341
+ var noContent = false;
342
+ if (jQuery('#b2s-post-curation-preview-title').val().length === 0) {
343
+ jQuery('#b2s-post-curation-preview-title').addClass('error');
344
+ noContent= true;
345
+ }
346
+ if (jQuery('#b2s-post-curation-comment').val().length === 0) {
347
+ jQuery('#b2s-post-curation-comment').addClass('error');
348
+ noContent= true;
349
+ }
350
+ if(noContent){
351
+ return false;
352
+ }
353
jQuery('#b2s-post-curation-action').val('b2s_curation_customize');
354
jQuery('.b2s-loading-area').show();
355
jQuery('.b2s-curation-settings-area').hide();
432
jQuery('#b2s-curation-no-data-info').hide();
433
jQuery('#b2s-curation-no-auth-info').hide();
434
jQuery('#b2s-curation-saved-draft-info').hide();
435
+ var noContent = false;
436
+ if (jQuery('#b2s-post-curation-preview-title').val().length === 0) {
437
+ jQuery('#b2s-post-curation-preview-title').addClass('error');
438
+ noContent= true;
439
+ }
440
+ if (jQuery('#b2s-post-curation-comment').val().length === 0) {
441
+ jQuery('#b2s-post-curation-comment').addClass('error');
442
+ noContent= true;
443
+ }
444
+ if(noContent){
445
+ return false;
446
+ }
447
jQuery('#b2s-post-curation-action').val('b2s_curation_draft');
448
jQuery('.b2s-loading-area').show();
449
jQuery('.b2s-curation-settings-area').hide();
assets/js/b2s/general.js CHANGED
@@ -71,6 +71,7 @@ jQuery(document).on('click', '.b2s-key-area-btn-submit', function () {
71
jQuery('.b2s-key-area-success').hide();
72
jQuery('.b2s-key-area-fail').hide();
73
jQuery('.b2s-key-area-fail-max-use').hide();
74
75
if (jQuery('.b2s-key-area-input').val() == "") {
76
jQuery('.b2s-key-area-input').addClass('error');
@@ -86,6 +87,7 @@ jQuery(document).on('click', '.b2s-key-area-btn-submit', function () {
86
data: {
87
'action': 'b2s_update_user_version',
88
'key': jQuery('.b2s-key-area-input').val(),
89
},
90
error: function () {
91
jQuery('.b2s-server-connection-fail').show();
@@ -97,11 +99,18 @@ jQuery(document).on('click', '.b2s-key-area-btn-submit', function () {
97
jQuery('.b2s-trail-premium-info-area').hide();
98
if (data.result == true) {
99
jQuery('.b2s-key-area-success').show();
100
- jQuery('.b2s-key-area-key-name').html(data.lizenzName);
101
- jQuery('.b2s-key-name').html(data.lizenzName);
102
} else {
103
if (data.reason != null && data.reason == 1) {
104
jQuery('.b2s-key-area-fail-max-use').show();
105
} else {
106
jQuery('.b2s-key-area-fail').show();
107
}
71
jQuery('.b2s-key-area-success').hide();
72
jQuery('.b2s-key-area-fail').hide();
73
jQuery('.b2s-key-area-fail-max-use').hide();
74
+ jQuery('.b2s-key-area-fail-no-token').hide();
75
76
if (jQuery('.b2s-key-area-input').val() == "") {
77
jQuery('.b2s-key-area-input').addClass('error');
87
data: {
88
'action': 'b2s_update_user_version',
89
'key': jQuery('.b2s-key-area-input').val(),
90
+ 'user_id': jQuery('#b2s-license-user').val(),
91
},
92
error: function () {
93
jQuery('.b2s-server-connection-fail').show();
99
jQuery('.b2s-trail-premium-info-area').hide();
100
if (data.result == true) {
101
jQuery('.b2s-key-area-success').show();
102
+ if(data.licenseName != false) {
103
+ jQuery('.b2s-key-area-key-name').html(data.licenseName);
104
+ jQuery('.b2s-key-name').html(data.licenseName);
105
+ }
106
+ jQuery('#b2s-license-user-select').empty();
107
+ jQuery('#b2s-license-user-select').append(jQuery('<option value="0"></option>'));
108
+ jQuery('#b2s-license-user-select').trigger("chosen:updated");
109
} else {
110
if (data.reason != null && data.reason == 1) {
111
jQuery('.b2s-key-area-fail-max-use').show();
112
+ } else if (data.reason != null && data.reason == 2) {
113
+ jQuery('.b2s-key-area-fail-no-token').show();
114
} else {
115
jQuery('.b2s-key-area-fail').show();
116
}
assets/js/b2s/network.js CHANGED
@@ -34,12 +34,6 @@ function init() {
34
jQuery('.b2s-settings-sched-item-input-time[data-network-auth-id="' + networkAuthId + '"]').val(e.time.value);
35
saveTimeSettings();
36
});
37
-
38
- //XING(8) - deprecated since 5.2
39
- if (jQuery('.b2s-network-item-auth-list-li.deprecated[data-network-id="8"]').length == 0) {
40
- jQuery('.list-group-item[data-network-id="8"]').hide();
41
- }
42
-
43
}
44
45
var timeoutPlus;
@@ -115,13 +109,6 @@ jQuery(document).on('change', '.b2s-network-mandant-select', function () {
115
}
116
jQuery('.b2s-network-details-container-list').hide();
117
jQuery('.b2s-network-details-container-list[data-mandant-id="' + jQuery(this).val() + '"]').show();
118
-
119
- //XING(8) - deprecated since 5.2
120
- if (jQuery('.b2s-network-item-auth-list-li.deprecated[data-network-mandant-id="' + jQuery(this).val() + '"][data-network-id="8"]').length == 0) {
121
- jQuery('.list-group-item[data-network-id="8"]').hide();
122
- } else {
123
- jQuery('.list-group-item[data-network-id="8"]').show();
124
- }
125
});
126
127
jQuery(document).on('click', '.b2s-network-mandant-btn-delete', function () {
@@ -174,8 +161,278 @@ jQuery(document).on('change', '#b2s-modify-board-and-group-network-selected', fu
174
return true;
175
});
176
177
- jQuery(document).on('click', '.b2s-modify-board-and-group-network-btn', function () {
178
179
jQuery('.b2s-modify-board-and-group-network-loading-area').show();
180
jQuery('.b2s-network-auth-info').hide();
181
jQuery('#b2s-modify-board-and-group-network-modal').modal('show');
@@ -212,11 +469,6 @@ jQuery(document).on('click', '.b2s-modify-board-and-group-network-btn', function
212
jQuery('.b2s-modify-board-and-group-network-loading-area').hide();
213
if (data.result == true) {
214
jQuery('.b2s-modify-board-and-group-network-data').html(data.content);
215
- //set current auth-name
216
- if (networkId == 8) {
217
- name = jQuery('#b2s-modify-board-and-group-network-selected option:selected').closest('optgroup').prop('label');
218
- jQuery('#b2s-modify-board-and-group-name').val(name);
219
- }
220
jQuery('.b2s-modify-board-and-group-network-save-btn').show();
221
} else {
222
jQuery('#b2s-modify-board-and-group-network-no-data').show();
@@ -261,13 +513,6 @@ jQuery(document).on('click', '.b2s-modify-board-and-group-network-save-btn', fun
261
jQuery('.b2s-modify-board-and-group-network-loading-area').hide();
262
if (data.result == true) {
263
jQuery('#b2s-modify-board-and-group-network-save-success').show();
264
-
265
- if (jQuery('#b2s-modify-board-and-group-name').val() != "" && networkId == 8) {
266
- if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]').find("span").hasClass('b2s-network-item-auth-user-name')) {
267
- jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]').find(".b2s-network-item-auth-user-name").html(name);
268
- }
269
- }
270
-
271
} else {
272
jQuery('#b2s-modify-board-and-group-network-save-error').show();
273
}
@@ -294,11 +539,21 @@ jQuery(document).on('click', '.b2s-network-item-auth-list-btn-delete', function
294
jQuery('#b2s-delete-network-auth-id').val(jQuery(this).attr('data-network-auth-id'));
295
jQuery('#b2s-delete-network-id').val(jQuery(this).attr('data-network-id'));
296
jQuery('#b2s-delete-network-type').val(jQuery(this).attr('data-network-type'));
297
jQuery('.b2s-server-connection-fail').hide();
298
jQuery('.b2s-btn-network-delete-auth-show-post-text').hide();
299
jQuery('.b2s-btn-network-delete-auth-show-post-btn').hide();
300
jQuery('.b2s-btn-network-delete-auth-confirm-text').hide();
301
jQuery('.b2s-btn-network-delete-auth-confirm-btn').hide();
302
303
jQuery.ajax({
304
url: ajaxurl,
@@ -307,7 +562,7 @@ jQuery(document).on('click', '.b2s-network-item-auth-list-btn-delete', function
307
cache: false,
308
data: {
309
'action': 'b2s_get_sched_posts_by_user_auth',
310
- 'networkAuthId': jQuery('#b2s-delete-network-auth-id').val()
311
},
312
error: function () {
313
jQuery('.b2s-server-connection-fail').show();
@@ -315,13 +570,29 @@ jQuery(document).on('click', '.b2s-network-item-auth-list-btn-delete', function
315
},
316
success: function (data) {
317
jQuery('.b2s-loading-area').hide();
318
- if (data.result == true && data.count >= 1) {
319
- jQuery('.b2s-btn-network-delete-auth-show-post-text').show();
320
- jQuery('.b2s-btn-network-delete-auth-show-post-btn').show();
321
- jQuery('#b2s-btn-network-delete-auth-show-post-count').text(data.count);
322
- jQuery('.b2s-btn-network-delete-auth-confirm-btn').prop('disabled', true);
323
- } else {
324
jQuery('.b2s-btn-network-delete-auth-confirm-btn').removeAttr('disabled');
325
}
326
jQuery('.b2s-btn-network-delete-auth-confirm-text').show();
327
jQuery('.b2s-btn-network-delete-auth-confirm-btn').show();
@@ -340,6 +611,7 @@ jQuery(document).on('click', '.b2s-btn-network-delete-auth-show-post-btn', funct
340
jQuery(document).on('click', '.b2s-btn-network-delete-auth-confirm-btn', function () {
341
jQuery('.b2s-network-auth-area').hide();
342
jQuery('.b2s-loading-area').show();
343
jQuery('#b2s-network-delete-auth').modal('hide');
344
jQuery('.b2s-server-connection-fail').hide();
345
jQuery.ajax({
@@ -352,7 +624,11 @@ jQuery(document).on('click', '.b2s-btn-network-delete-auth-confirm-btn', functio
352
'networkAuthId': jQuery('#b2s-delete-network-auth-id').val(),
353
'networkId': jQuery('#b2s-delete-network-id').val(),
354
'networkType': jQuery('#b2s-delete-network-type').val(),
355
- 'deleteSchedPost': jQuery('#b2s-delete-network-sched-post').val()
356
},
357
error: function () {
358
jQuery('.b2s-server-connection-fail').show();
@@ -464,7 +740,6 @@ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandan
464
typ = new Array('Profil', 'Seite', 'Gruppe');
465
days = 'Tage';
466
}
467
-
468
//NEW
469
if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"]').length == 0) {
470
var html = "<li class='b2s-network-item-auth-list-li b2s-label-success-border-left' data-network-auth-id='" + networkAuthId + "' data-network-mandant-id='" + mandandId + "' data-network-id='" + networkId + "' data-network-type='" + networkType + "'>";
@@ -530,6 +805,7 @@ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandan
530
html += ' <span class="b2s-network-mandant-name">(' + mandantName + ')</span>';
531
}
532
jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"] div:first').html(html);
533
}
534
}
535
}
@@ -619,4 +895,4 @@ function formatAMPM(date) {
619
620
function padDate(n) {
621
return ("0" + n).slice(-2);
622
- }
34
jQuery('.b2s-settings-sched-item-input-time[data-network-auth-id="' + networkAuthId + '"]').val(e.time.value);
35
saveTimeSettings();
36
});
37
}
38
39
var timeoutPlus;
109
}
110
jQuery('.b2s-network-details-container-list').hide();
111
jQuery('.b2s-network-details-container-list[data-mandant-id="' + jQuery(this).val() + '"]').show();
112
});
113
114
jQuery(document).on('click', '.b2s-network-mandant-btn-delete', function () {
161
return true;
162
});
163
164
+ jQuery(document).on('click', '.b2s-network-item-team-btn-manage', function () {
165
+ jQuery('#b2s-manage-auth-team-modal').modal('show');
166
+
167
+ if (jQuery('#b2sUserVersion').val() < 3) {
168
+ return false;
169
+ }
170
+
171
+ jQuery('.b2s-move-connection').hide();
172
+ jQuery('#b2s-move-connection-failed').hide();
173
+ jQuery('.b2s-connection-assign').hide();
174
+ jQuery('.b2s-assignment-area').hide();
175
+ jQuery('.b2s-connection-owner').hide();
176
+ jQuery('.b2s-assign-error').hide();
177
+ jQuery('#b2s-no-assign-user').hide();
178
+ jQuery('.b2s-loading-area-manage-auth-team-modal').show();
179
+ jQuery('#b2s-assign-info').show();
180
+
181
+
182
+
183
+ jQuery('#b2sUserAuthId').val(jQuery(this).attr('data-network-auth-id'));
184
+ jQuery('#b2sOldMandantId').val(jQuery(this).attr('data-network-mandant-id'));
185
+ jQuery('#b2sNetworkId').val(jQuery(this).attr('data-network-id'));
186
+ jQuery('#b2sNetworkType').val(jQuery(this).attr('data-network-type'));
187
+
188
+ if (jQuery('#b2s-move-connection-select').length) {
189
+ jQuery('#b2s-move-connection-select').html(jQuery('.b2s-network-mandant-select').html());
190
+ jQuery("#b2s-move-connection-select option[value='-1']").remove();
191
+ jQuery("#b2s-move-connection-select option[value='" + jQuery(this).attr('data-network-mandant-id') + "']").remove();
192
+ if (jQuery(this).attr('data-network-mandant-id') <= 0) {
193
+ if (jQuery('#b2s-network-select-more-client').length) {
194
+ var temp_options = jQuery('#b2s-move-connection-select #b2s-network-select-more-client').html();
195
+ jQuery("#b2s-move-connection-select optiongroup").remove();
196
+ jQuery("#b2s-move-connection-select").html(temp_options);
197
+ } else {
198
+ jQuery('#b2s-move-connection-input').hide();
199
+ jQuery('#b2s-move-connection-error').show();
200
+ }
201
+ } else {
202
+ if (!jQuery('#b2s-move-connection-select #b2s-network-select-more-client option').length) {
203
+ var temp_options = jQuery("#b2s-move-connection-select option[value='0']");
204
+ jQuery("#b2s-move-connection-select optiongroup").remove();
205
+ jQuery("#b2s-move-connection-select").html(temp_options);
206
+ }
207
+ }
208
+ }
209
+
210
+ jQuery.ajax({
211
+ url: ajaxurl,
212
+ type: "GET",
213
+ dataType: "json",
214
+ cache: false,
215
+ data: {
216
+ 'action': 'b2s_get_select_mandant_user',
217
+ 'networkAuthId': jQuery(this).attr('data-network-auth-id'),
218
+ 'owner': jQuery(this).attr('data-connection-owner'),
219
+ 'networkId': jQuery('#b2sNetworkId').val(),
220
+ 'networkType': jQuery('#b2sNetworkType').val()
221
+ },
222
+ error: function () {
223
+ jQuery('.b2s-server-connection-fail').show();
224
+ return false;
225
+ },
226
+ success: function (data) {
227
+ if (data.result == true) {
228
+ if (typeof data.ownerName != 'undefined') {
229
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
230
+ jQuery('#b2s-connection-owner-name').text(data.ownerName);
231
+ jQuery('.b2s-move-connection').show();
232
+ jQuery('.b2s-connection-owner').show();
233
+ jQuery('.b2s-assignment-area').show();
234
+ } else if (typeof data.userSelect != 'undefined' && typeof data.assignList != 'undefined') {
235
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
236
+ jQuery('#b2s-connection-assign-select').html(data.userSelect);
237
+ jQuery('.b2s-network-assign-list').html(data.assignList);
238
+ if (jQuery('#b2s-approved-user-list li').length <= 1) {
239
+ jQuery('#b2s-approved-user-list').hide();
240
+ } else {
241
+ jQuery('#b2s-approved-user-list').show();
242
+ }
243
+ if (jQuery('#b2s-select-assign-user').html() == '') {
244
+ jQuery('#b2s-select-assign-user').attr('disabled', true);
245
+ jQuery('#b2s-assign-network-user-auth').attr('disabled', true);
246
+ jQuery('#b2s-assign-info').hide();
247
+ jQuery('#b2s-no-assign-user').show();
248
+ } else {
249
+ jQuery('#b2s-select-assign-user').removeAttr('disabled');
250
+ jQuery('#b2s-assign-network-user-auth').removeAttr('disabled');
251
+ jQuery('#b2s-no-assign-user').hide();
252
+ jQuery('#b2s-assign-info').show();
253
+ }
254
+ jQuery('.b2s-move-connection').show();
255
+ jQuery('.b2s-connection-assign').show();
256
+ jQuery('.b2s-assignment-area').show();
257
+ } else {
258
+ jQuery('.b2s-assign-error[data-error-reason="default"]').show();
259
+ jQuery('.b2s-connection-assign').show();
260
+ jQuery('.b2s-assignment-area').show();
261
+ }
262
+
263
+ } else {
264
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
265
+ jQuery('.b2s-assign-error[data-error-reason="default"]').show();
266
+ jQuery('.b2s-connection-assign').show();
267
+ jQuery('.b2s-assignment-area').show();
268
+ }
269
+ return false;
270
+ }
271
+ });
272
+ return false;
273
+ });
274
+
275
+ jQuery(document).on('click', '#b2s-move-user-auth-to-profile', function () {
276
+ jQuery('.b2s-move-connection').hide();
277
+ jQuery('#b2s-move-connection-failed').hide();
278
+ jQuery('.b2s-connection-assign').hide();
279
+ jQuery('.b2s-assignment-area').hide();
280
+ jQuery('.b2s-assign-error').hide();
281
+ jQuery('.b2s-loading-area-manage-auth-team-modal').show();
282
+
283
+ var authId = jQuery('#b2sUserAuthId').val();
284
+ var mandantId = jQuery('#b2s-move-connection-select').val();
285
+ var oldMandantId = jQuery('#b2sOldMandantId').val();
286
+ var networkId = jQuery('#b2sNetworkId').val();
287
+ jQuery.ajax({
288
+ url: ajaxurl,
289
+ type: "POST",
290
+ dataType: "json",
291
+ cache: false,
292
+ data: {
293
+ 'action': 'b2s_move_user_auth_to_profile',
294
+ 'networkAuthId': authId,
295
+ 'mandantId': mandantId,
296
+ },
297
+ error: function () {
298
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
299
+ jQuery('.b2s-server-connection-fail').show();
300
+ return false;
301
+ },
302
+ success: function (data) {
303
+ if (data.result == true) {
304
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
305
+ jQuery('#b2s-manage-auth-team-modal').modal('hide');
306
+ //change show all entry
307
+ jQuery('.b2s-network-details-container-list[data-mandant-id=-1] .b2s-network-item-auth-list-li[data-network-auth-id=' + authId + ']').attr('data-network-mandant-id', mandantId);
308
+ jQuery('.b2s-network-details-container-list[data-mandant-id=-1] .b2s-network-item-auth-list-li[data-network-auth-id=' + authId + '] .b2s-network-item-team-btn-manage').attr('data-network-mandant-id', mandantId);
309
+ jQuery('.b2s-network-details-container-list[data-mandant-id=-1] .b2s-network-item-auth-list-li[data-network-auth-id=' + authId + '] .b2s-network-mandant-name').html('(' + jQuery('#b2s-move-connection-select option:selected').text() + ')');
310
+
311
+ //sort entry in show all
312
+ var allArray = [];
313
+ var first = true;
314
+ jQuery('.b2s-network-details-container-list[data-mandant-id=-1] .b2s-network-item-auth-list[data-network-id=' + networkId + '] li').each(function (index, element) {
315
+ if (first !== true) {
316
+ allArray.push(element);
317
+ } else {
318
+ first = element;
319
+ }
320
+ });
321
322
+ for (i = 0; i < allArray.length; i++) {
323
+ for (j = 0; j < (allArray.length - 1); j++) {
324
+ if ((jQuery(allArray[j + 1]).attr('data-network-mandant-id') < jQuery(allArray[j]).attr('data-network-mandant-id')) || (jQuery(allArray[j + 1]).attr('data-network-mandant-id') == jQuery(allArray[j]).attr('data-network-mandant-id') && jQuery(allArray[j + 1]).attr('data-network-type') < jQuery(allArray[j]).attr('data-network-type')) || (jQuery(allArray[j + 1]).attr('data-network-mandant-id') == jQuery(allArray[j]).attr('data-network-mandant-id') && jQuery(allArray[j + 1]).attr('data-network-type') == jQuery(allArray[j]).attr('data-network-type') && jQuery(allArray[j + 1]).attr('data-network-auth-id') < jQuery(allArray[j]).attr('data-network-auth-id'))) {
325
+ var temp = allArray[j + 1];
326
+ allArray[j + 1] = allArray[j];
327
+ allArray[j] = temp;
328
+ }
329
+ }
330
+ }
331
+ jQuery('.b2s-network-details-container-list[data-mandant-id=-1] .b2s-network-item-auth-list[data-network-id=' + networkId + ']').html('');
332
+ jQuery('.b2s-network-details-container-list[data-mandant-id=-1] .b2s-network-item-auth-list[data-network-id=' + networkId + ']').append(first);
333
+ for (i = 0; i < allArray.length; i++) {
334
+ jQuery('.b2s-network-details-container-list[data-mandant-id=-1] .b2s-network-item-auth-list[data-network-id=' + networkId + ']').append(allArray[i]);
335
+ }
336
+
337
+
338
+ //copy and remove entry in profile
339
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + oldMandantId + '] .b2s-network-item-auth-list-li[data-network-auth-id=' + authId + ']').attr('data-network-mandant-id', mandantId);
340
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + oldMandantId + '] .b2s-network-item-auth-list-li[data-network-auth-id=' + authId + '] .b2s-network-item-team-btn-manage').attr('data-network-mandant-id', mandantId);
341
+ var temp_list_entry = jQuery('.b2s-network-details-container-list[data-mandant-id=' + oldMandantId + '] .b2s-network-item-auth-list-li[data-network-auth-id=' + authId + ']');
342
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + oldMandantId + '] .b2s-network-item-auth-list-li[data-network-auth-id=' + authId + ']').remove();
343
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + mandantId + '] .b2s-network-item-auth-list[data-network-id=' + networkId + ']').append(temp_list_entry);
344
+
345
+ //sort entry in new profile
346
+ var mandantArray = [];
347
+ var mandantFirst = true;
348
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + mandantId + '] .b2s-network-item-auth-list[data-network-id=' + networkId + '] li').each(function (index, element) {
349
+ if (mandantFirst !== true) {
350
+ mandantArray.push(element);
351
+ } else {
352
+ mandantFirst = element;
353
+ }
354
+ });
355
+
356
+ for (i = 0; i < mandantArray.length; i++) {
357
+ for (j = 0; j < (mandantArray.length - 1); j++) {
358
+ if ((jQuery(mandantArray[j + 1]).attr('data-network-mandant-id') < jQuery(mandantArray[j]).attr('data-network-mandant-id')) || (jQuery(mandantArray[j + 1]).attr('data-network-mandant-id') == jQuery(mandantArray[j]).attr('data-network-mandant-id') && jQuery(mandantArray[j + 1]).attr('data-network-type') < jQuery(mandantArray[j]).attr('data-network-type')) || (jQuery(mandantArray[j + 1]).attr('data-network-mandant-id') == jQuery(mandantArray[j]).attr('data-network-mandant-id') && jQuery(mandantArray[j + 1]).attr('data-network-type') == jQuery(mandantArray[j]).attr('data-network-type') && jQuery(mandantArray[j + 1]).attr('data-network-auth-id') < jQuery(mandantArray[j]).attr('data-network-auth-id'))) {
359
+ var temp = mandantArray[j + 1];
360
+ mandantArray[j + 1] = mandantArray[j];
361
+ mandantArray[j] = temp;
362
+ }
363
+ }
364
+ }
365
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + mandantId + '] .b2s-network-item-auth-list[data-network-id=' + networkId + ']').html('');
366
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + mandantId + '] .b2s-network-item-auth-list[data-network-id=' + networkId + ']').append(mandantFirst);
367
+
368
+ for (i = 0; i < mandantArray.length; i++) {
369
+ jQuery('.b2s-network-details-container-list[data-mandant-id=' + mandantId + '] .b2s-network-item-auth-list[data-network-id=' + networkId + ']').append(mandantArray[i]);
370
+ }
371
+ } else {
372
+ jQuery('#b2s-move-connection-failed').show();
373
+ }
374
+ return false;
375
+ }
376
+ });
377
+ return false;
378
+ });
379
+
380
+ jQuery(document).on('click', '#b2s-assign-network-user-auth', function () {
381
+ if (jQuery('#b2s-select-assign-user').val() <= 0) {
382
+ return false;
383
+ }
384
+ jQuery('.b2s-move-connection').hide();
385
+ jQuery('#b2s-move-connection-failed').hide();
386
+ jQuery('.b2s-connection-assign').hide();
387
+ jQuery('.b2s-assignment-area').hide();
388
+ jQuery('.b2s-assign-error').hide();
389
+ jQuery('.b2s-loading-area-manage-auth-team-modal').show();
390
+
391
+ var authId = jQuery('#b2sUserAuthId').val();
392
+ var assignBlogUserId = jQuery('#b2s-select-assign-user').val();
393
+ jQuery.ajax({
394
+ url: ajaxurl,
395
+ type: "POST",
396
+ dataType: "json",
397
+ cache: false,
398
+ data: {
399
+ 'action': 'b2s_assign_network_user_auth',
400
+ 'networkAuthId': authId,
401
+ 'assignBlogUserId': assignBlogUserId,
402
+ },
403
+ error: function () {
404
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
405
+ jQuery('.b2s-assign-error[data-error-reason="default"]').show();
406
+ jQuery('.b2s-move-connection').show();
407
+ jQuery('.b2s-connection-assign').show();
408
+ jQuery('.b2s-assignment-area').show();
409
+ return false;
410
+ },
411
+ success: function (data) {
412
+ if (data.result == true) {
413
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
414
+ jQuery('#b2s-approved-user-list').append(data.newListEntry);
415
+ jQuery('#b2s-approved-user-list').show();
416
+ jQuery('#b2s-select-assign-user option[value="' + assignBlogUserId + '"]').remove();
417
+ if (jQuery('#b2s-select-assign-user').html() == '') {
418
+ jQuery('#b2s-select-assign-user').attr('disabled', true);
419
+ jQuery('#b2s-assign-info').hide();
420
+ jQuery('#b2s-no-assign-user').show();
421
+ }
422
+ } else {
423
+ jQuery('.b2s-assign-error[data-error-reason="' + data.error_reason + '"]').show();
424
+ }
425
+ jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
426
+ jQuery('.b2s-move-connection').show();
427
+ jQuery('.b2s-connection-assign').show();
428
+ jQuery('.b2s-assignment-area').show();
429
+ return false;
430
+ }
431
+ });
432
+ return false;
433
+ });
434
+
435
+ jQuery(document).on('click', '.b2s-modify-board-and-group-network-btn', function () {
436
jQuery('.b2s-modify-board-and-group-network-loading-area').show();
437
jQuery('.b2s-network-auth-info').hide();
438
jQuery('#b2s-modify-board-and-group-network-modal').modal('show');
469
jQuery('.b2s-modify-board-and-group-network-loading-area').hide();
470
if (data.result == true) {
471
jQuery('.b2s-modify-board-and-group-network-data').html(data.content);
472
jQuery('.b2s-modify-board-and-group-network-save-btn').show();
473
} else {
474
jQuery('#b2s-modify-board-and-group-network-no-data').show();
513
jQuery('.b2s-modify-board-and-group-network-loading-area').hide();
514
if (data.result == true) {
515
jQuery('#b2s-modify-board-and-group-network-save-success').show();
516
} else {
517
jQuery('#b2s-modify-board-and-group-network-save-error').show();
518
}
539
jQuery('#b2s-delete-network-auth-id').val(jQuery(this).attr('data-network-auth-id'));
540
jQuery('#b2s-delete-network-id').val(jQuery(this).attr('data-network-id'));
541
jQuery('#b2s-delete-network-type').val(jQuery(this).attr('data-network-type'));
542
+ jQuery('#b2s-delete-assign-network-auth-id').val(jQuery(this).attr('data-assign-network-auth-id'));
543
+ jQuery('#b2s-delete-blog-user-id').val(jQuery(this).attr('data-blog-user-id'));
544
jQuery('.b2s-server-connection-fail').hide();
545
+ jQuery('#b2s-delete-all-assign-text').hide();
546
jQuery('.b2s-btn-network-delete-auth-show-post-text').hide();
547
jQuery('.b2s-btn-network-delete-auth-show-post-btn').hide();
548
jQuery('.b2s-btn-network-delete-auth-confirm-text').hide();
549
jQuery('.b2s-btn-network-delete-auth-confirm-btn').hide();
550
+ jQuery('.b2s-btn-network-delete-sched-text').hide();
551
+ jQuery('.b2s-btn-network-delete-assign-text').hide();
552
+ jQuery('.b2s-btn-network-delete-assign-sched-text').hide();
553
+ var countSchedId = jQuery(this).attr('data-network-auth-id');
554
+ if (typeof jQuery(this).attr('data-assign-network-auth-id') != 'undefined' && jQuery(this).attr('data-assign-network-auth-id') > 0) {
555
+ countSchedId = jQuery(this).attr('data-assign-network-auth-id');
556
+ }
557
558
jQuery.ajax({
559
url: ajaxurl,
562
cache: false,
563
data: {
564
'action': 'b2s_get_sched_posts_by_user_auth',
565
+ 'networkAuthId': countSchedId
566
},
567
error: function () {
568
jQuery('.b2s-server-connection-fail').show();
570
},
571
success: function (data) {
572
jQuery('.b2s-loading-area').hide();
573
+ if (data.result == true) {
574
jQuery('.b2s-btn-network-delete-auth-confirm-btn').removeAttr('disabled');
575
+ if (data.count >= 1) {
576
+ jQuery('.b2s-btn-network-delete-auth-show-post-text').show();
577
+ jQuery('.b2s-btn-network-delete-sched-text').show();
578
+ jQuery('.b2s-btn-network-delete-auth-show-post-btn').show();
579
+ jQuery('#b2s-btn-network-delete-auth-show-post-count').text(data.count);
580
+ jQuery('.b2s-btn-network-delete-auth-confirm-btn').prop('disabled', true);
581
+ }
582
+ if (data.assignListCount >= 1) {
583
+ jQuery('.b2s-btn-network-delete-assign-text').show();
584
+ jQuery('#b2s-delete-assignment').val('all');
585
+ jQuery('.b2s-btn-network-delete-auth-confirm-btn').prop('disabled', true);
586
+ jQuery('.b2s-btn-network-delete-auth-show-post-text').show();
587
+ } else {
588
+ jQuery('#b2s-delete-assignment').val('');
589
+ }
590
+ if (data.assignCount >= 1) {
591
+ jQuery('.b2s-btn-network-delete-assign-sched-text').show();
592
+ jQuery('.b2s-btn-network-delete-auth-confirm-btn').prop('disabled', true);
593
+ jQuery('.b2s-btn-network-delete-auth-show-post-text').show();
594
+ }
595
+ jQuery('#b2s-delete-assign-list').val(data.assignList);
596
}
597
jQuery('.b2s-btn-network-delete-auth-confirm-text').show();
598
jQuery('.b2s-btn-network-delete-auth-confirm-btn').show();
611
jQuery(document).on('click', '.b2s-btn-network-delete-auth-confirm-btn', function () {
612
jQuery('.b2s-network-auth-area').hide();
613
jQuery('.b2s-loading-area').show();
614
+ jQuery('#b2s-manage-auth-team-modal').modal('hide');
615
jQuery('#b2s-network-delete-auth').modal('hide');
616
jQuery('.b2s-server-connection-fail').hide();
617
jQuery.ajax({
624
'networkAuthId': jQuery('#b2s-delete-network-auth-id').val(),
625
'networkId': jQuery('#b2s-delete-network-id').val(),
626
'networkType': jQuery('#b2s-delete-network-type').val(),
627
+ 'deleteSchedPost': jQuery('#b2s-delete-network-sched-post').val(),
628
+ 'assignNetworkAuthId': jQuery('#b2s-delete-assign-network-auth-id').val(),
629
+ 'blogUserId': jQuery('#b2s-delete-blog-user-id').val(),
630
+ 'deleteAssignment': jQuery('#b2s-delete-assignment').val(),
631
+ 'assignList': jQuery('#b2s-delete-assign-list').val()
632
},
633
error: function () {
634
jQuery('.b2s-server-connection-fail').show();
740
typ = new Array('Profil', 'Seite', 'Gruppe');
741
days = 'Tage';
742
}
743
//NEW
744
if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"]').length == 0) {
745
var html = "<li class='b2s-network-item-auth-list-li b2s-label-success-border-left' data-network-auth-id='" + networkAuthId + "' data-network-mandant-id='" + mandandId + "' data-network-id='" + networkId + "' data-network-type='" + networkType + "'>";
805
html += ' <span class="b2s-network-mandant-name">(' + mandantName + ')</span>';
806
}
807
jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"] div:first').html(html);
808
+ jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]').removeClass('b2s-label-danger-border-left').addClass('b2s-label-success-border-left');
809
}
810
}
811
}
895
896
function padDate(n) {
897
return ("0" + n).slice(-2);
898
+ }
assets/js/b2s/post.js CHANGED
@@ -277,7 +277,7 @@ jQuery(document).on('click', '.b2sDetailsSchedPostBtn', function () {
277
'action': 'b2s_sched_post_data',
278
'postId': postId,
279
'showByDate': showByDate,
280
- 'showByNetwork' : showByNetwork,
281
'userAuthId': userAuthId
282
},
283
error: function () {
@@ -496,6 +496,12 @@ jQuery(document).on('click', '.b2s-approve-delete-confirm-btn', function () {
496
});
497
});
498
499
jQuery(document).on('click', '.b2s-post-approve-area-drop-btn', function () {
500
jQuery('#b2s-delete-confirm-post-id').val(jQuery(this).attr('data-post-id'));
501
jQuery('#b2s-delete-confirm-post-count').html('1');
@@ -563,6 +569,7 @@ function showEditSchedPost(b2s_id, post_id, network_auth_id, network_type, netwo
563
{
564
jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
565
}
566
var $modal = jQuery("<div>");
567
jQuery.ajax({
568
url: ajaxurl,
@@ -661,8 +668,6 @@ function showEditSchedPost(b2s_id, post_id, network_auth_id, network_type, netwo
661
}
662
663
}
664
-
665
- jQuery("#b2sPostId").val(post_id);
666
var today = new Date();
667
var dateFormat = "yyyy-mm-dd";
668
var language = "en";
277
'action': 'b2s_sched_post_data',
278
'postId': postId,
279
'showByDate': showByDate,
280
+ 'showByNetwork': showByNetwork,
281
'userAuthId': userAuthId
282
},
283
error: function () {
496
});
497
});
498
499
+ //Modal Edit Post close
500
+ jQuery(document).on('click', '.b2s-modal-close-edit-post', function (e) {
501
+ jQuery(jQuery(this).attr('data-modal-name')).remove();
502
+ return false;
503
+ });
504
+
505
jQuery(document).on('click', '.b2s-post-approve-area-drop-btn', function () {
506
jQuery('#b2s-delete-confirm-post-id').val(jQuery(this).attr('data-post-id'));
507
jQuery('#b2s-delete-confirm-post-count').html('1');
569
{
570
jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
571
}
572
+ jQuery("#b2sPostId").val(post_id);
573
var $modal = jQuery("<div>");
574
jQuery.ajax({
575
url: ajaxurl,
668
}
669
670
}
671
var today = new Date();
672
var dateFormat = "yyyy-mm-dd";
673
var language = "en";
assets/js/b2s/premium.js ADDED
@@ -0,0 +1,55 @@
1
+ jQuery.noConflict();
2
+
3
+ jQuery("#b2s-license-user-select").chosen({
4
+ no_results_text: jQuery('#b2s-no-user-found').val(),
5
+ search_contains: true
6
+ });
7
+
8
+ jQuery('.chosen-search input').attr('placeholder', 'Search for blog user');
9
+
10
+ jQuery("#b2s-license-user-select").change(function () {
11
+ jQuery('#b2s-license-user').val(jQuery('#b2s-license-user-select').val());
12
+ return false;
13
+ });
14
+
15
+ var current_chosen_search = "";
16
+ var current_chosen_search_count = 0;
17
+ jQuery('.chosen-search input').on('keyup', function () {
18
+ if (this.value != current_chosen_search) {
19
+ current_chosen_search = this.value;
20
+ if (current_chosen_search.length >= 3) {
21
+ current_chosen_search_count++;
22
+ var temp_count = current_chosen_search_count;
23
+ jQuery('#b2s-license-user-select').empty();
24
+ jQuery.ajax({
25
+ url: ajaxurl,
26
+ type: "GET",
27
+ dataType: "json",
28
+ cache: false,
29
+ data: {
30
+ 'action': 'b2s_search_user',
31
+ 'search_user': current_chosen_search,
32
+ },
33
+ error: function () {
34
+ jQuery('.b2s-server-connection-fail').show();
35
+ return false;
36
+ },
37
+ success: function (data) {
38
+ if (current_chosen_search_count == temp_count) {
39
+ if (data.result == true) {
40
+ jQuery('#b2s-license-user-select').empty();
41
+ if (data.options != "") {
42
+ var newOptions = jQuery(data.options);
43
+ jQuery('#b2s-license-user-select').append(newOptions);
44
+ jQuery('#b2s-license-user-select').trigger("chosen:updated");
45
+ jQuery('.chosen-search input').val(current_chosen_search);
46
+ jQuery('#b2s-license-user').val(jQuery("#b2s-license-user-select option:first").val());
47
+ }
48
+ }
49
+ }
50
+ }
51
+ });
52
+ }
53
+ }
54
+ return false;
55
+ });
assets/js/b2s/wp/post-box.js CHANGED
@@ -203,6 +203,7 @@ jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', functio
203
error: function () {
204
jQuery('.b2s-loading-area').hide();
205
jQuery('#b2s-server-connection-fail').show();
206
return false;
207
},
208
success: function (data) {
@@ -227,10 +228,16 @@ jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', functio
227
228
} else {
229
jQuery('#b2s-server-connection-fail').show();
230
}
231
wp.heartbeat.connectNow();
232
} else {
233
- jQuery('#b2s-server-connection-fail').show();
234
}
235
}
236
});
203
error: function () {
204
jQuery('.b2s-loading-area').hide();
205
jQuery('#b2s-server-connection-fail').show();
206
+ jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
207
return false;
208
},
209
success: function (data) {
228
229
} else {
230
jQuery('#b2s-server-connection-fail').show();
231
+ jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
232
}
233
wp.heartbeat.connectNow();
234
} else {
235
+ if (data.content == 'no_auth') {
236
+ jQuery('#b2s-post-meta-box-state-no-auth').show();
237
+ } else {
238
+ jQuery('#b2s-server-connection-fail').show();
239
+ }
240
+ jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
241
}
242
}
243
});
blog2social.php CHANGED
@@ -7,12 +7,12 @@
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
- * Version: 5.4.1
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
- define('B2S_PLUGIN_VERSION', '541');
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.5.0
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
+ define('B2S_PLUGIN_VERSION', '550');
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
@@ -35,6 +35,8 @@ class Ajax_Get {
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
add_action('wp_ajax_b2s_support_systemrequirements', array($this, 'b2sSupportSystemRequirements'));
38
}
39
40
public function getBlogPostStatus() {
@@ -46,27 +48,26 @@ class Ajax_Get {
46
public function scrapeUrl() {
47
if (isset($_POST['url']) && !empty($_POST['url'])) {
48
$data = B2S_Util::scrapeUrl($_POST['url']);
49
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
50
$curation = new B2S_Curation_View();
51
$preview = $curation->getCurationPreviewHtml($_POST['url'], $data);
52
- if (!empty($preview) && $data !== false) {
53
if (isset($_POST['loadSettings']) && filter_var($_POST['loadSettings'], FILTER_VALIDATE_BOOLEAN)) {
54
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
55
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)) {
56
- require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
57
- $curation = new B2S_Curation_View();
58
- echo json_encode(array('result' => true, 'preview' => $preview, 'settings' => $curation->getShippingDetails($result->data->mandant, $result->data->auth)));
59
wp_die();
60
}
61
- echo json_encode(array('result' => false, 'preview' => $preview, 'error' => 'NO_AUTH'));
62
wp_die();
63
} else {
64
- echo json_encode(array('result' => true, 'preview' => $preview));
65
wp_die();
66
}
67
}
68
}
69
- echo json_encode(array('result' => false, 'preview' => '', 'error' => 'NO_PREVIEW'));
70
wp_die();
71
}
72
@@ -129,10 +130,15 @@ class Ajax_Get {
129
130
public function getPostMetaBox() {
131
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
132
- 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)) {
133
- $postBox = new B2S_PostBox();
134
- echo json_encode(array('result' => true, 'content' => $postBox->getPostBoxAutoHtml($result->data->mandant, $result->data->auth)));
135
- wp_die();
136
}
137
echo json_encode(array('result' => false, 'content' => ''));
138
wp_die();
@@ -158,11 +164,11 @@ class Ajax_Get {
158
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
159
//TOS XING Group
160
if ((int) $_POST['networkId'] == 19 && isset($_POST['networkTosGroupId']) && !empty($_POST['networkTosGroupId'])) {
161
- $options = new B2S_Options(0, 'B2S_PLUGIN_TOS_XING_GROUP_CROSSPOSTING');
162
- if($options->existsValueByKey($_POST['postId'],$_POST['networkTosGroupId'])){
163
- echo json_encode(array('result' => false, 'reason' => 'tos_xing_group_exists', 'networkAuthId' => (int) $_POST['networkAuthId']));
164
- wp_die();
165
- }
166
}
167
168
$userLang = isset($_POST['userLang']) ? trim($_POST['userLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
@@ -222,9 +228,26 @@ class Ajax_Get {
222
if ((int) $_POST['networkAuthId']) {
223
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Network/Item.php');
224
$networkData = new B2S_Network_Item(false);
225
- $count = $networkData->getCountSchedPostsByUserAuth((int) $_POST['networkAuthId']);
226
- if ($count !== false) {
227
- echo json_encode(array('result' => true, 'count' => $count));
228
wp_die();
229
}
230
}
@@ -353,7 +376,7 @@ class Ajax_Get {
353
$network_details_id = (isset($_GET['filter_network_auth']) && (int) $_GET['filter_network_auth'] >= 1) ? (int) $_GET['filter_network_auth'] : 0; // 0=all
354
//Filter Status
355
$status = (isset($_GET['filter_status']) && (int) $_GET['filter_status'] >= 0) ? (int) $_GET['filter_status'] : 0; // 0=all,1=publish, 2=scheduled
356
-
357
if (isset($_GET['start'])) {
358
$calendar = B2S_Calendar_Filter::getByTimespam($_GET['start'] . " 00:00:00", $_GET['end'] . " 23:59:59", $network_id, $network_details_id, $status);
359
} else {
@@ -440,9 +463,9 @@ class Ajax_Get {
440
echo json_encode($stats->get_result());
441
wp_die();
442
}
443
-
444
- public function b2sSupportSystemRequirements(){
445
- if(!current_user_can('administrator')){
446
echo json_encode(array('result' => false, 'error' => 'admin'));
447
wp_die();
448
}
@@ -450,7 +473,7 @@ class Ajax_Get {
450
$support = new B2S_Support_Check_System();
451
$htmlData = $support->htmlData();
452
$blogData = $support->blogData();
453
- if(empty($htmlData) || empty($blogData)){
454
$result = array('result' => false);
455
} else {
456
$result = array('result' => true, 'htmlData' => $htmlData, "blogData" => $blogData);
@@ -459,4 +482,41 @@ class Ajax_Get {
459
wp_die();
460
}
461
462
}
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
add_action('wp_ajax_b2s_support_systemrequirements', array($this, 'b2sSupportSystemRequirements'));
38
+ add_action('wp_ajax_b2s_search_user', array($this, 'searchUser'));
39
+ add_action('wp_ajax_b2s_get_select_mandant_user', array($this, 'getSelectMandantUser'));
40
}
41
42
public function getBlogPostStatus() {
48
public function scrapeUrl() {
49
if (isset($_POST['url']) && !empty($_POST['url'])) {
50
$data = B2S_Util::scrapeUrl($_POST['url']);
51
+ $scrapeError = ($data !== false) ? false : true;
52
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
53
$curation = new B2S_Curation_View();
54
$preview = $curation->getCurationPreviewHtml($_POST['url'], $data);
55
+ if (!empty($preview)) {
56
if (isset($_POST['loadSettings']) && filter_var($_POST['loadSettings'], FILTER_VALIDATE_BOOLEAN)) {
57
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
58
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)) {
59
+ echo json_encode(array('result' => true, 'preview' => $preview, 'scrapeError' => $scrapeError, 'settings' => $curation->getShippingDetails($result->data->mandant, $result->data->auth)));
60
wp_die();
61
}
62
+ echo json_encode(array('result' => false, 'preview' => $preview, 'scrapeError' => $scrapeError, 'error' => 'NO_AUTH'));
63
wp_die();
64
} else {
65
+ echo json_encode(array('result' => true, 'preview' => $preview, 'scrapeError' => $scrapeError));
66
wp_die();
67
}
68
}
69
}
70
+ echo json_encode(array('result' => false, 'preview' => '', 'scrapeError' => false, 'error' => 'NO_PREVIEW'));
71
wp_die();
72
}
73
130
131
public function getPostMetaBox() {
132
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
133
+ 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)) {
134
+ if (!empty($result->data->auth)) {
135
+ $postBox = new B2S_PostBox();
136
+ echo json_encode(array('result' => true, 'content' => $postBox->getPostBoxAutoHtml($result->data->mandant, $result->data->auth)));
137
+ wp_die();
138
+ } else {
139
+ echo json_encode(array('result' => false, 'content' => 'no_auth'));
140
+ wp_die();
141
+ }
142
}
143
echo json_encode(array('result' => false, 'content' => ''));
144
wp_die();
164
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
165
//TOS XING Group
166
if ((int) $_POST['networkId'] == 19 && isset($_POST['networkTosGroupId']) && !empty($_POST['networkTosGroupId'])) {
167
+ $options = new B2S_Options(0, 'B2S_PLUGIN_TOS_XING_GROUP_CROSSPOSTING');
168
+ if ($options->existsValueByKey($_POST['postId'], $_POST['networkTosGroupId'])) {
169
+ echo json_encode(array('result' => false, 'reason' => 'tos_xing_group_exists', 'networkAuthId' => (int) $_POST['networkAuthId']));
170
+ wp_die();
171
+ }
172
}
173
174
$userLang = isset($_POST['userLang']) ? trim($_POST['userLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
228
if ((int) $_POST['networkAuthId']) {
229
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Network/Item.php');
230
$networkData = new B2S_Network_Item(false);
231
+ global $wpdb;
232
+ $blogUserTokenResult = $wpdb->get_results("SELECT token FROM `b2s_user`");
233
+ $blogUserToken = array();
234
+ foreach ($blogUserTokenResult as $k => $row) {
235
+ array_push($blogUserToken, $row->token);
236
+ }
237
+ $data = array('action' => 'getTeamAssignUserAuth', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => (int) $_POST['networkAuthId'], 'blogUser' => $blogUserToken);
238
+ $networkAuthAssignment = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $data, 30), true);
239
+ if ($networkAuthAssignment['result'] == true) {
240
+ $count = $networkData->getCountSchedPostsByUserAuth((int) $_POST['networkAuthId']);
241
+ $assignCount = 0;
242
+ $assignList = array();
243
+ foreach ($networkAuthAssignment['assignList'] as $k => $v) {
244
+ $assignList[$v['assign_blog_user_id']] = (int) $v['assign_network_auth_id'];
245
+ $authCount = $networkData->getCountSchedPostsByUserAuth((int) $v['assign_network_auth_id']);
246
+ if ($authCount !== false) {
247
+ $assignCount += $authCount;
248
+ }
249
+ }
250
+ echo json_encode(array('result' => true, 'count' => ($count !== false) ? $count : 0, 'assignCount' => $assignCount, 'assignListCount' => count($networkAuthAssignment['assignList']), 'assignList' => serialize($assignList)));
251
wp_die();
252
}
253
}
376
$network_details_id = (isset($_GET['filter_network_auth']) && (int) $_GET['filter_network_auth'] >= 1) ? (int) $_GET['filter_network_auth'] : 0; // 0=all
377
//Filter Status
378
$status = (isset($_GET['filter_status']) && (int) $_GET['filter_status'] >= 0) ? (int) $_GET['filter_status'] : 0; // 0=all,1=publish, 2=scheduled
379
+
380
if (isset($_GET['start'])) {
381
$calendar = B2S_Calendar_Filter::getByTimespam($_GET['start'] . " 00:00:00", $_GET['end'] . " 23:59:59", $network_id, $network_details_id, $status);
382
} else {
463
echo json_encode($stats->get_result());
464
wp_die();
465
}
466
+
467
+ public function b2sSupportSystemRequirements() {
468
+ if (!current_user_can('administrator')) {
469
echo json_encode(array('result' => false, 'error' => 'admin'));
470
wp_die();
471
}
473
$support = new B2S_Support_Check_System();
474
$htmlData = $support->htmlData();
475
$blogData = $support->blogData();
476
+ if (empty($htmlData) || empty($blogData)) {
477
$result = array('result' => false);
478
} else {
479
$result = array('result' => true, 'htmlData' => $htmlData, "blogData" => $blogData);
482
wp_die();
483
}
484
485
+ public function searchUser() {
486
+ if (isset($_GET['search_user']) && !empty($_GET['search_user'])) {
487
+ $options = B2S_Tools::searchUser($_GET['search_user']);
488
+ echo json_encode(array('result' => true, 'options' => $options));
489
+ wp_die();
490
+ }
491
+ echo json_encode(array('result' => false));
492
+ wp_die();
493
+ }
494
+
495
+ public function getSelectMandantUser() {
496
+ if (isset($_GET['owner']) && (int) $_GET['owner'] > 0) {
497
+ $owner = stripslashes(get_user_by('id', $_GET['owner'])->display_name);
498
+ $owner = (empty($owner) || $owner == false) ? __("Unknown username", "blog2social") : $owner;
499
+ echo json_encode(array('result' => true, 'ownerName' => $owner));
500
+ wp_die();
501
+ } else {
502
+ $networkAuthId = (isset($_GET['networkAuthId']) && (int) $_GET['networkAuthId'] > 0) ? $_GET['networkAuthId'] : 0;
503
+ $networkId = (isset($_GET['networkId']) && (int) $_GET['networkId'] > 0) ? $_GET['networkId'] : 0;
504
+ $networkType = (isset($_GET['networkType']) && (int) $_GET['networkType'] >= 0) ? $_GET['networkType'] : 0;
505
+ if ($networkAuthId > 0 && $networkId > 0) {
506
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Network/Item.php');
507
+ $networkItem = new B2S_Network_Item();
508
+ $networkAuthAssignment = $networkItem->getNetworkAuthAssignment($networkAuthId, $networkId, $networkType);
509
+ if ($networkAuthAssignment['result'] !== false) {
510
+ $userSelect = $networkAuthAssignment['userSelect'];
511
+ $assignList = $networkAuthAssignment['assignList'];
512
+
513
+ echo json_encode(array('result' => true, 'userSelect' => $userSelect, 'assignList' => $assignList));
514
+ wp_die();
515
+ }
516
+ }
517
+ }
518
+ echo json_encode(array('result' => false));
519
+ wp_die();
520
+ }
521
+
522
}
includes/Ajax/Post.php CHANGED
@@ -48,16 +48,18 @@ class Ajax_Post {
48
add_action("wp_ajax_b2s_curation_share", array($this, 'curationShare'));
49
add_action("wp_ajax_b2s_curation_customize", array($this, 'curationCustomize'));
50
add_action("wp_ajax_b2s_curation_draft", array($this, 'curationDraft'));
51
}
52
53
public function curationDraft() {
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
- if(isset($_POST['b2s-draft-id']) && !empty($_POST['b2s-draft-id']) && (int) $_POST['b2s-draft-id'] > 0){
58
$data = array('ID' => $_POST['b2s-draft-id'], 'title' => $_POST['title'], 'url' => $_POST['url'], 'content' => (isset($_POST['comment']) ? $_POST['comment'] : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
59
$curation = new B2S_Curation_Save($data);
60
- $source = (get_post_meta((int)$_POST['b2s-draft-id'], "b2s_source", true));
61
$postId = $curation->updateContent($source);
62
if ($postId !== false) {
63
echo json_encode(array('result' => true, 'postId' => $postId));
@@ -76,7 +78,7 @@ class Ajax_Post {
76
echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
77
wp_die();
78
}
79
-
80
public function curationShare() {
81
//save as blog post
82
if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
@@ -745,11 +747,12 @@ class Ajax_Post {
745
}
746
747
public function deleteUserAuth() {
748
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Tools.php');
749
if (isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0 && isset($_POST['networkId']) && (int) $_POST['networkId'] > 0 && isset($_POST['networkType'])) {
750
global $wpdb;
751
if (isset($_POST['deleteSchedPost']) && (int) $_POST['deleteSchedPost'] == 1) {
752
- $res = $wpdb->get_results($wpdb->prepare("SELECT b.id, b.post_id, b.post_for_approve, b.post_for_relay FROM b2s_posts b LEFT JOIN b2s_posts_network_details d ON (d.id = b.network_details_id) WHERE d.network_auth_id= %d AND b.hide = %d AND b.publish_date =%s", (int) $_POST['networkAuthId'], 0, '0000-00-00 00:00:00'));
753
if (is_array($res) && !empty($res)) {
754
foreach ($res as $k => $row) {
755
if (isset($row->id) && (int) $row->id > 0) {
@@ -768,17 +771,51 @@ class Ajax_Post {
768
}
769
}
770
}
771
- B2S_Heartbeat::getInstance()->deleteSchedPost();
772
- sleep(2);
773
}
774
}
775
$post = array('token' => B2S_PLUGIN_TOKEN,
776
'action' => 'deleteUserAuth',
777
- 'networkAuthId' => (int) $_POST['networkAuthId']);
778
$deleteResult = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $post));
779
if ($deleteResult->result == true) {
780
- $wpdb->delete('b2s_user_network_settings', array('network_auth_id' => $_POST['networkAuthId'], 'blog_user_id' => B2S_PLUGIN_BLOG_USER_ID), array('%d', '%d'));
781
- echo json_encode(array('result' => true, 'networkId' => (int) $_POST['networkId'], 'networkAuthId' => (int) $_POST['networkAuthId']));
782
wp_die();
783
}
784
}
@@ -789,19 +826,50 @@ class Ajax_Post {
789
public function updateUserVersion() {
790
require_once (B2S_PLUGIN_DIR . '/includes/Tools.php');
791
if (isset($_POST['key']) && !empty($_POST['key'])) {
792
- $post = array('token' => B2S_PLUGIN_TOKEN,
793
- 'action' => 'updateUserVersion',
794
- 'version' => B2S_PLUGIN_VERSION,
795
- 'key' => $_POST['key']);
796
- $keyResult = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $post));
797
- if ($keyResult->result == true) {
798
- B2S_Tools::setUserDetails();
799
- $lizenzName = unserialize(B2S_PLUGIN_VERSION_TYPE);
800
- $printName = (isset($keyResult->trail) && $keyResult->trail == true) ? 'FREE-TRIAL' : $lizenzName[$keyResult->version];
801
- echo json_encode(array('result' => true, 'lizenzName' => $printName));
802
- wp_die();
803
- } else if (isset($keyResult->reason)) {
804
- echo json_encode(array('result' => false, 'reason' => $keyResult->reason));
805
wp_die();
806
}
807
}
@@ -1267,4 +1335,68 @@ class Ajax_Post {
1267
update_option("B2S_HIDE_TRAIL_ENDED", true, false);
1268
}
1269
1270
}
48
add_action("wp_ajax_b2s_curation_share", array($this, 'curationShare'));
49
add_action("wp_ajax_b2s_curation_customize", array($this, 'curationCustomize'));
50
add_action("wp_ajax_b2s_curation_draft", array($this, 'curationDraft'));
51
+ add_action("wp_ajax_b2s_move_user_auth_to_profile", array($this, 'moveUserAuthToProfile'));
52
+ add_action("wp_ajax_b2s_assign_network_user_auth", array($this, 'assignNetworkUserAuth'));
53
}
54
55
public function curationDraft() {
56
//save as blog post
57
if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
58
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/Save.php');
59
+ if (isset($_POST['b2s-draft-id']) && !empty($_POST['b2s-draft-id']) && (int) $_POST['b2s-draft-id'] > 0) {
60
$data = array('ID' => $_POST['b2s-draft-id'], 'title' => $_POST['title'], 'url' => $_POST['url'], 'content' => (isset($_POST['comment']) ? $_POST['comment'] : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
61
$curation = new B2S_Curation_Save($data);
62
+ $source = (get_post_meta((int) $_POST['b2s-draft-id'], "b2s_source", true));
63
$postId = $curation->updateContent($source);
64
if ($postId !== false) {
65
echo json_encode(array('result' => true, 'postId' => $postId));
78
echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
79
wp_die();
80
}
81
+
82
public function curationShare() {
83
//save as blog post
84
if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
747
}
748
749
public function deleteUserAuth() {
750
+ $assignList=array();
751
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Tools.php');
752
if (isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0 && isset($_POST['networkId']) && (int) $_POST['networkId'] > 0 && isset($_POST['networkType'])) {
753
global $wpdb;
754
if (isset($_POST['deleteSchedPost']) && (int) $_POST['deleteSchedPost'] == 1) {
755
+ $res = $wpdb->get_results($wpdb->prepare("SELECT b.id, b.post_id, b.post_for_approve, b.post_for_relay FROM b2s_posts b LEFT JOIN b2s_posts_network_details d ON (d.id = b.network_details_id) WHERE d.network_auth_id= %d AND b.hide = %d AND b.publish_date =%s", ((isset($_POST['assignNetworkAuthId']) && (int) $_POST['assignNetworkAuthId'] > 0) ? (int) $_POST['assignNetworkAuthId'] : (int) $_POST['networkAuthId']), 0, '0000-00-00 00:00:00'));
756
if (is_array($res) && !empty($res)) {
757
foreach ($res as $k => $row) {
758
if (isset($row->id) && (int) $row->id > 0) {
771
}
772
}
773
}
774
}
775
+ //V5.5.0 Approve User > Business Version
776
+ if (isset($_POST['assignList']) && !empty($_POST['assignList'])) {
777
+ $assignList = unserialize($_POST['assignList']);
778
+ if (is_array($assignList) && !empty($assignList)) {
779
+ foreach ($assignList as $i => $assignAuthId) {
780
+ $res = $wpdb->get_results($wpdb->prepare("SELECT b.id, b.post_id, b.post_for_approve, b.post_for_relay FROM b2s_posts b LEFT JOIN b2s_posts_network_details d ON (d.id = b.network_details_id) WHERE d.network_auth_id= %d AND b.hide = %d AND b.publish_date =%s", $assignAuthId, 0, '0000-00-00 00:00:00'));
781
+ if (is_array($res) && !empty($res)) {
782
+ foreach ($res as $k => $row) {
783
+ if (isset($row->id) && (int) $row->id > 0) {
784
+ $hookAction = (isset($row->post_for_approve) && (int) $row->post_for_approve == 0) ? 3 : 0; //since 4.9.1 Facebook Instant Sharing
785
+ $wpdb->update('b2s_posts', array('hook_action' => $hookAction, 'hide' => 1), array('id' => (int) $row->id));
786
+ //is post for relay
787
+ if ((int) $row->post_for_relay == 1) {
788
+ $relay = B2S_Post_Tools::getAllRelayByPrimaryPostId($row->id);
789
+ if (is_array($relay) && !empty($relay)) {
790
+ foreach ($relay as $item) {
791
+ if (isset($item->id) && (int) $item->id > 0) {
792
+ $wpdb->update('b2s_posts', array('hook_action' => 3, 'hide' => 1), array('id' => $item->id));
793
+ }
794
+ }
795
+ }
796
+ }
797
+ }
798
+ }
799
+ }
800
+ }
801
+ }
802
+ }
803
+ B2S_Heartbeat::getInstance()->deleteSchedPost();
804
+ sleep(2);
805
}
806
$post = array('token' => B2S_PLUGIN_TOKEN,
807
'action' => 'deleteUserAuth',
808
+ 'networkAuthId' => (int) $_POST['networkAuthId'],
809
+ 'assignNetworkAuthId' => (isset($_POST['deleteAssignment']) && $_POST['deleteAssignment'] == 'all') ? $_POST['deleteAssignment'] : ((isset($_POST['assignNetworkAuthId']) && (int) $_POST['assignNetworkAuthId'] > 0) ? (int) $_POST['assignNetworkAuthId'] : 0));
810
$deleteResult = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $post));
811
if ($deleteResult->result == true) {
812
+ $wpdb->delete('b2s_user_network_settings', array('network_auth_id' => ((isset($_POST['assignNetworkAuthId']) && $_POST['assignNetworkAuthId'] != "all" && (int) $_POST['assignNetworkAuthId'] > 0) ? (int) $_POST['assignNetworkAuthId'] : (int) $_POST['networkAuthId']), 'blog_user_id' => ((isset($_POST['blogUserId']) && (int) $_POST['blogUserId'] > 0) ? (int) $_POST['blogUserId'] : B2S_PLUGIN_BLOG_USER_ID)), array('%d', '%d'));
813
+ if (is_array($assignList) && !empty($assignList)) {
814
+ foreach ($assignList as $blogUserId => $assignAuthId) {
815
+ $wpdb->delete('b2s_user_network_settings', array('network_auth_id' => $assignAuthId, 'blog_user_id' => $blogUserId), array('%d', '%d'));
816
+ }
817
+ }
818
+ echo json_encode(array('result' => true, 'networkId' => (int) $_POST['networkId'], 'networkAuthId' => ((isset($_POST['assignNetworkAuthId']) && $_POST['assignNetworkAuthId'] != "all" && (int) $_POST['assignNetworkAuthId'] > 0) ? (int) $_POST['assignNetworkAuthId'] : (int) $_POST['networkAuthId'])));
819
wp_die();
820
}
821
}
826
public function updateUserVersion() {
827
require_once (B2S_PLUGIN_DIR . '/includes/Tools.php');
828
if (isset($_POST['key']) && !empty($_POST['key'])) {
829
+ $isCurrentUser = true;
830
+ if (isset($_POST['user_id']) && !empty($_POST['user_id']) && (int) $_POST['user_id'] != B2S_PLUGIN_BLOG_USER_ID) {
831
+ $user_id = (int) $_POST['user_id'];
832
+ $user_token = B2S_Tools::getTokenById($user_id);
833
+ $isCurrentUser = false;
834
+ } else {
835
+ $user_id = B2S_PLUGIN_BLOG_USER_ID;
836
+ $user_token = B2S_PLUGIN_TOKEN;
837
+ }
838
+ if ($user_token != false) {
839
+ $post = array('token' => $user_token,
840
+ 'action' => 'updateUserVersion',
841
+ 'version' => B2S_PLUGIN_VERSION,
842
+ 'key' => $_POST['key']);
843
+ $keyResult = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $post));
844
+ if (isset($keyResult->result) && $keyResult->result == true) {
845
+ if ($isCurrentUser) {
846
+ $option = get_option('B2S_PLUGIN_USER_VERSION_' . $user_id);
847
+ $option['B2S_PLUGIN_USER_VERSION'] = $keyResult->version;
848
+ update_option('B2S_PLUGIN_USER_VERSION_' . $user_id, $option, false);
849
+ $licenseName = unserialize(B2S_PLUGIN_VERSION_TYPE);
850
+ $printName = (isset($keyResult->trail) && $keyResult->trail == true) ? 'FREE-TRIAL' : $licenseName[$keyResult->version];
851
+ } else {
852
+ $tokenInfo['B2S_PLUGIN_USER_VERSION'] = (isset($keyResult->version) ? $keyResult->version : 0);
853
+ $tokenInfo['B2S_PLUGIN_VERSION'] = B2S_PLUGIN_VERSION;
854
+ if (isset($keyResult->trail) && $keyResult->trail == true && isset($keyResult->trailEndDate) && $keyResult->trailEndDate != "") {
855
+ $tokenInfo['B2S_PLUGIN_TRAIL_END'] = $keyResult->trailEndDate;
856
+ }
857
+ if (!isset($keyResult->version)) {
858
+ define('B2S_PLUGIN_NOTICE', 'CONNECTION');
859
+ } else {
860
+ $tokenInfo['B2S_PLUGIN_USER_VERSION_NEXT_REQUEST'] = time() + 3600;
861
+ update_option('B2S_PLUGIN_USER_VERSION_' . $user_id, $tokenInfo, false);
862
+ }
863
+ $printName = false;
864
+ }
865
+ echo json_encode(array('result' => true, 'licenseName' => $printName));
866
+ wp_die();
867
+ } else if (isset($keyResult->reason)) {
868
+ echo json_encode(array('result' => false, 'reason' => $keyResult->reason));
869
+ wp_die();
870
+ }
871
+ } else {
872
+ echo json_encode(array('result' => false, 'reason' => 2));
873
wp_die();
874
}
875
}
1335
update_option("B2S_HIDE_TRAIL_ENDED", true, false);
1336
}
1337
1338
+ public function moveUserAuthToProfile() {
1339
+ if (isset($_POST['mandantId']) && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
1340
+ $data = array('action' => 'moveUserAuthToProfile', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => (int) $_POST['networkAuthId'], 'mandantId' => (int) $_POST['mandantId']);
1341
+ $moveUserAuth = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $data, 30));
1342
+ if ($moveUserAuth->result == true) {
1343
+ global $wpdb;
1344
+ $sql = $wpdb->prepare("SELECT * FROM `b2s_user_network_settings` WHERE `blog_user_id` = %d AND `network_auth_id` = %d", (int) B2S_PLUGIN_BLOG_USER_ID, (int) $_POST['networkAuthId']);
1345
+ $networkAuthIdExist = $wpdb->get_row($sql);
1346
+ if (!empty($networkAuthIdExist) && isset($networkAuthIdExist->id)) {
1347
+ $sqlUpdateNetworkAuthId = $wpdb->prepare("UPDATE `b2s_user_network_settings` SET `mandant_id` = %d WHERE `blog_user_id` = %d AND `network_auth_id` = %d;", (int) $_POST['mandantId'], (int) B2S_PLUGIN_BLOG_USER_ID, (int) $_POST['networkAuthId']);
1348
+ $wpdb->query($sqlUpdateNetworkAuthId);
1349
+ }
1350
+ echo json_encode(array('result' => true));
1351
+ wp_die();
1352
+ }
1353
+ }
1354
+ echo json_encode(array('result' => false));
1355
+ wp_die();
1356
+ }
1357
+
1358
+ public function assignNetworkUserAuth() {
1359
+ if (isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0 && isset($_POST['assignBlogUserId']) && (int) $_POST['assignBlogUserId'] > 0) {
1360
+ $assignToken = B2S_Tools::getTokenById($_POST['assignBlogUserId']);
1361
+ $data = array('action' => 'approveUserAuth', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => (int) $_POST['networkAuthId'], 'assignToken' => $assignToken, 'tokenBlogUserId' => B2S_PLUGIN_BLOG_USER_ID, 'assignTokenBlogUserId' => $_POST['assignBlogUserId']);
1362
+ $assignUserAuth = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $data, 30), true);
1363
+ if (isset($assignUserAuth['result']) && $assignUserAuth['result'] == true && isset($assignUserAuth['assign_network_auth_id']) && (int) $assignUserAuth['assign_network_auth_id'] > 0) {
1364
+ global $wpdb;
1365
+ $sql = $wpdb->prepare("SELECT * FROM `b2s_posts_network_details` WHERE `network_auth_id` = %d", (int) $assignUserAuth['assign_network_auth_id']);
1366
+ $networkAuthIdExist = $wpdb->get_row($sql);
1367
+ if (empty($networkAuthIdExist) || !isset($networkAuthIdExist->id)) {
1368
+ //Insert
1369
+ $sqlInsertNetworkAuthId = $wpdb->prepare("INSERT INTO `b2s_posts_network_details` (`network_id`, `network_type`,`network_auth_id`,`network_display_name`) VALUES (%d,%d,%d,%s);", (int) $assignUserAuth['assign_network_id'], $assignUserAuth['assign_network_type'], (int) $assignUserAuth['assign_network_auth_id'], $assignUserAuth['assign_network_display_name']);
1370
+ $wpdb->query($sqlInsertNetworkAuthId);
1371
+ } else {
1372
+ //Update
1373
+ $sqlUpdateNetworkAuthId = $wpdb->prepare("UPDATE `b2s_posts_network_details` SET `network_id` = %d, `network_type` = %d, `network_auth_id` = %d, `network_display_name` = %s WHERE `network_auth_id` = %d;", (int) $assignUserAuth['assign_network_id'], $assignUserAuth['assign_network_type'], (int) $assignUserAuth['assign_network_auth_id'], $assignUserAuth['assign_network_display_name'], (int) $assignUserAuth['assign_network_auth_id']);
1374
+ $wpdb->query($sqlUpdateNetworkAuthId);
1375
+ }
1376
+ $wpdb->insert('b2s_user_network_settings', array('blog_user_id' => (int) $_POST['assignBlogUserId'], 'mandant_id' => 0, 'network_auth_id' => (int) $assignUserAuth['assign_network_auth_id']), array('%d', '%d', '%d'));
1377
+
1378
+ $options = new B2S_Options((int) B2S_PLUGIN_BLOG_USER_ID);
1379
+ $optionUserTimeZone = $options->_getOption('user_time_zone');
1380
+ $userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
1381
+ $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
1382
+ $current_user_date = date((strtolower(substr(B2S_LANGUAGE, 0, 2)) == 'de') ? 'd.m.Y' : 'Y-m-d', strtotime(B2S_Util::getUTCForDate(date('Y-m-d H:i:s'), $userTimeZoneOffset)));
1383
+ $displayName = stripslashes(get_user_by('id', $_POST['assignBlogUserId'])->display_name);
1384
+ $newListEntry = '<li class="b2s-network-item-auth-list-li">';
1385
+ $newListEntry .= '<div class="pull-left" style="padding-top: 5px;"><span>' . ((empty($displayName) || $displayName == false) ? __("Unknown username", "blog2social") : $displayName) . '</span></div>';
1386
+ $newListEntry .= '<div class="pull-right"><span style="margin-right: 10px;">' . $current_user_date . '</span> <button class="b2s-network-item-auth-list-btn-delete btn btn-danger btn-sm" data-network-auth-id="' . $_POST['networkAuthId'] . '" data-assign-network-auth-id="' . $assignUserAuth['assign_network_auth_id'] . '" data-network-id="' . $assignUserAuth['assign_network_id'] . '" data-network-type="' . $assignUserAuth['assign_network_type'] . '" data-blog-user-id="' . $_POST['assignBlogUserId'] . '">' . __('delete', 'blog2social') . '</button></div>';
1387
+ $newListEntry .= '<div class="clearfix"></div></li>';
1388
+ echo json_encode(array('result' => true, 'newListEntry' => $newListEntry));
1389
+ wp_die();
1390
+ } else if (isset($assignUserAuth['error_reason'])) {
1391
+ echo json_encode(array('result' => false, 'error_reason' => $assignUserAuth['error_reason']));
1392
+ wp_die();
1393
+ } else {
1394
+ echo json_encode(array('result' => false, 'error_reason' => 'invalid_data'));
1395
+ wp_die();
1396
+ }
1397
+ }
1398
+ echo json_encode(array('result' => false, 'error_reason' => 'default'));
1399
+ wp_die();
1400
+ }
1401
+
1402
}
includes/B2S/Curation/View.php CHANGED
@@ -32,7 +32,7 @@ class B2S_Curation_View {
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>';
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" class="form-control" name="title" value="' . addslashes($title) . '" placeholder="'.__('Title', 'blog2social').'">';
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>';
includes/B2S/Network/Item.php CHANGED
@@ -24,7 +24,8 @@ class B2S_Network_Item {
24
if (!isset($this->userSchedData['time'])) {
25
$this->userSchedDataOld = $this->getSchedDataByUser();
26
}
27
- $this->authurl = B2S_PLUGIN_API_ENDPOINT_AUTH . '?b2s_token=' . B2S_PLUGIN_TOKEN . '&sprache=' . substr(B2S_LANGUAGE, 0, 2) . '&unset=true&hostUrl='.get_site_url();
28
$this->allowProfil = unserialize(B2S_PLUGIN_NETWORK_ALLOW_PROFILE);
29
$this->allowPage = unserialize(B2S_PLUGIN_NETWORK_ALLOW_PAGE);
30
$this->allowGroup = unserialize(B2S_PLUGIN_NETWORK_ALLOW_GROUP);
@@ -200,22 +201,30 @@ class B2S_Network_Item {
200
if ($notAllow) {
201
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('To reactivate this connection,', 'blog2social') . ' <a href="' . B2S_Tools::getSupportLink('affiliate') . '"target="_blank">' . __('please upgrade', 'blog2social') . '</a></div>';
202
}
203
-
204
if ($isInterrupted && !$notAllow) {
205
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
206
}
207
-
208
$html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . __('Profile', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
209
210
if (!empty($mandantName)) {
211
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
212
}
213
$html .='</div>';
214
215
$html .='<div class="pull-right">';
216
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="0" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
217
if (!$notAllow && !$isDeprecated) {
218
- $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=profil&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
219
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
220
if (isset($this->modifyBoardAndGroup[$networkId])) {
221
if (in_array(0, $this->modifyBoardAndGroup[$networkId]['TYPE'])) {
@@ -227,12 +236,12 @@ class B2S_Network_Item {
227
}
228
//Sched Manager since V 5.1.0
229
if (B2S_PLUGIN_USER_VERSION > 0) {
230
- $html .='<span class="b2s-sched-manager-time-area pull-right ' . (!$isEdit ? 'b2s-sched-manager-add-padding' : '') . ' hidden-xs" style="' . (($isInterrupted || $notAllow) ? 'display:none;' : '') . '">
231
<input class="form-control b2s-box-sched-time-input b2s-settings-sched-item-input-time" type="text" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 0, 'time') . '" readonly="" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="0" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[time][' . $v['networkAuthId'] . ']">
232
</span>';
233
- $html .='<span class="b2s-sched-manager-day-area pull-right hidden-xs" style="' . (($isInterrupted || $notAllow) ? 'display:none;' : '') . '"><span class="b2s-sched-manager-item-input-day-btn-minus" data-network-auth-id="' . $v['networkAuthId'] . '">-</span> <span class="b2s-text-middle">+</span> <input type="text" class="b2s-sched-manager-item-input-day" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="0" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[delay_day][' . $v['networkAuthId'] . ']" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 0, 'day') . '" readonly> <span class="b2s-text-middle">' . __('Days', 'blog2social') . '</span> <span class="b2s-sched-manager-item-input-day-btn-plus" data-network-auth-id="' . $v['networkAuthId'] . '">+</span></span>';
234
} else {
235
- $html .='<span class="b2s-sched-manager-premium-area pull-right hidden-xs"><span class="label label-success"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sInfoSchedTimesModal">' . __('PREMIUM', 'blog2social') . '</a></span></span>';
236
}
237
238
$html .='</div>';
@@ -253,21 +262,30 @@ class B2S_Network_Item {
253
if ($notAllow) {
254
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('To reactivate this connection,', 'blog2social') . ' <a href="' . B2S_Tools::getSupportLink('affiliate') . '"target="_blank">' . __('please upgrade', 'blog2social') . '</a></div>';
255
}
256
-
257
if ($isInterrupted && !$notAllow) {
258
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
259
}
260
-
261
$html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . ($networkId == 19 && isset($this->networkKindName[$v['networkKind']]) ? $this->networkKindName[$v['networkKind']] . '-' : '') . __('Page', 'blog2social') . (($networkId == 19 && (int) $v['networkKind'] == 0) ? ' <span class="hidden-xs">(' . __('Employer Branding', 'blog2social') . ')</span>' : '') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
262
263
if (!empty($mandantName)) {
264
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
265
}
266
$html .='</div>';
267
$html .='<div class="pull-right">';
268
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="1" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
269
if (!$notAllow && !$isDeprecated) {
270
- $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=page&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
271
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
272
if (isset($this->modifyBoardAndGroup[$networkId])) {
273
if (in_array(1, $this->modifyBoardAndGroup[$networkId]['TYPE'])) {
@@ -280,12 +298,12 @@ class B2S_Network_Item {
280
281
//Sched Manager since V 5.1.0
282
if (B2S_PLUGIN_USER_VERSION > 0) {
283
- $html .='<span class="b2s-sched-manager-time-area pull-right ' . (!$isEdit ? 'b2s-sched-manager-add-padding' : '') . ' hidden-xs" style="' . (($isInterrupted || $notAllow) ? 'display:none;' : '') . '">
284
<input class="form-control b2s-box-sched-time-input b2s-settings-sched-item-input-time" type="text" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 1, 'time') . '" readonly="" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="1" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[time][' . $v['networkAuthId'] . ']">
285
</span>';
286
- $html .='<span class="b2s-sched-manager-day-area pull-right hidden-xs" style="' . (($isInterrupted || $notAllow) ? 'display:none;' : '') . '"><span class="b2s-sched-manager-item-input-day-btn-minus" data-network-auth-id="' . $v['networkAuthId'] . '">-</span> <span class="b2s-text-middle">+</span> <input type="text" class="b2s-sched-manager-item-input-day" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="1" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[delay_day][' . $v['networkAuthId'] . ']" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 1, 'day') . '" readonly> <span class="b2s-text-middle">' . __('Days', 'blog2social') . '</span> <span class="b2s-sched-manager-item-input-day-btn-plus" data-network-auth-id="' . $v['networkAuthId'] . '">+</span></span>';
287
} else {
288
- $html .='<span class="b2s-sched-manager-premium-area pull-right hidden-xs"><span class="label label-success"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sInfoSchedTimesModal">' . __('PREMIUM', 'blog2social') . '</a></span></span>';
289
}
290
291
$html .='</div>';
@@ -307,11 +325,13 @@ class B2S_Network_Item {
307
if ($notAllow) {
308
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('To reactivate this connection,', 'blog2social') . ' <a href="' . B2S_Tools::getSupportLink('affiliate') . '"target="_blank">' . __('please upgrade', 'blog2social') . '</a></div>';
309
}
310
-
311
if ($isInterrupted && !$notAllow) {
312
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
313
}
314
-
315
$html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . __('Group', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
316
317
if (!empty($mandantName)) {
@@ -321,7 +341,12 @@ class B2S_Network_Item {
321
$html .='<div class="pull-right">';
322
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="2" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
323
if (!$notAllow && !$isDeprecated) {
324
- $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=group&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
325
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
326
if (isset($this->modifyBoardAndGroup[$networkId])) {
327
if (in_array(2, $this->modifyBoardAndGroup[$networkId]['TYPE'])) {
@@ -334,12 +359,12 @@ class B2S_Network_Item {
334
335
//Sched Manager since V 5.1.0
336
if (B2S_PLUGIN_USER_VERSION > 0) {
337
- $html .='<span class="b2s-sched-manager-time-area pull-right ' . (!$isEdit ? 'b2s-sched-manager-add-padding' : '') . ' hidden-xs" style="' . (($isInterrupted || $notAllow) ? 'display:none;' : '') . '">
338
<input class="form-control b2s-box-sched-time-input b2s-settings-sched-item-input-time" type="text" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 2, 'time') . '" readonly="" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="2" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[time][' . $v['networkAuthId'] . ']">
339
</span>';
340
- $html .='<span class="b2s-sched-manager-day-area pull-right hidden-xs" style="' . (($isInterrupted || $notAllow) ? 'display:none;' : '') . '"><span class="b2s-sched-manager-item-input-day-btn-minus" data-network-auth-id="' . $v['networkAuthId'] . '">-</span> <span class="b2s-text-middle">+</span> <input type="text" class="b2s-sched-manager-item-input-day" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="2" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[delay_day][' . $v['networkAuthId'] . ']" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 2, 'day') . '" readonly> <span class="b2s-text-middle">' . __('Days', 'blog2social') . '</span> <span class="b2s-sched-manager-item-input-day-btn-plus" data-network-auth-id="' . $v['networkAuthId'] . '">+</span></span>';
341
} else {
342
- $html .='<span class="b2s-sched-manager-premium-area pull-right hidden-xs"><span class="label label-success"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sInfoSchedTimesModal">' . __('PREMIUM', 'blog2social') . '</a></span></span>';
343
}
344
345
$html .='</div>';
@@ -358,7 +383,8 @@ class B2S_Network_Item {
358
'networkUserName' => $value->networkUserName,
359
'expiredDate' => $value->expiredDate,
360
'networkKind' => $value->networkKind,
361
- 'notAllow' => (isset($value->notAllow) ? $value->notAllow : false)
362
);
363
}
364
return $convertAuth;
@@ -406,4 +432,55 @@ class B2S_Network_Item {
406
return $saveSchedData;
407
}
408
409
}
24
if (!isset($this->userSchedData['time'])) {
25
$this->userSchedDataOld = $this->getSchedDataByUser();
26
}
27
+ $hostUrl = (function_exists('rest_url')) ? rest_url() : get_site_url();
28
+ $this->authurl = B2S_PLUGIN_API_ENDPOINT_AUTH . '?b2s_token=' . B2S_PLUGIN_TOKEN . '&sprache=' . substr(B2S_LANGUAGE, 0, 2) . '&unset=true&hostUrl=' . $hostUrl;
29
$this->allowProfil = unserialize(B2S_PLUGIN_NETWORK_ALLOW_PROFILE);
30
$this->allowPage = unserialize(B2S_PLUGIN_NETWORK_ALLOW_PAGE);
31
$this->allowGroup = unserialize(B2S_PLUGIN_NETWORK_ALLOW_GROUP);
201
if ($notAllow) {
202
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('To reactivate this connection,', 'blog2social') . ' <a href="' . B2S_Tools::getSupportLink('affiliate') . '"target="_blank">' . __('please upgrade', 'blog2social') . '</a></div>';
203
}
204
if ($isInterrupted && !$notAllow) {
205
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
206
}
207
+ if ($v['owner_blog_user_id'] !== false) {
208
+ $displayName = stripslashes(get_user_by('id', $v['owner_blog_user_id'])->display_name);
209
+ $html .='<div class="b2s-network-approved-from">' . __("Assigned by", "blog2social") . ' ' . ((empty($displayName) || $displayName == false) ? __("Unknown username", "blog2social") : $displayName) . '</div> ';
210
+ }
211
$html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . __('Profile', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
212
213
if (!empty($mandantName)) {
214
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
215
}
216
+
217
$html .='</div>';
218
219
$html .='<div class="pull-right">';
220
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="0" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
221
if (!$notAllow && !$isDeprecated) {
222
+ if ($v['owner_blog_user_id'] == false) {
223
+ $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=profil&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
224
+ } else {
225
+ $html .= '<span class="b2s-add-padding-network-placeholder-btn pull-right"></span>';
226
+ }
227
+ $html .='<a href="#" class="pull-right b2s-network-item-team-btn-manage b2s-add-padding-network-team pull-right" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-id="' . $networkId . '" data-network-type="0" data-network-mandant-id="' . $mandantId . '" data-connection-owner="' . (($v['owner_blog_user_id'] !== false) ? $v['owner_blog_user_id'] : '0') . '"><span class="glyphicon glyphicon-user glyphicon-grey"></span></a>';
228
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
229
if (isset($this->modifyBoardAndGroup[$networkId])) {
230
if (in_array(0, $this->modifyBoardAndGroup[$networkId]['TYPE'])) {
236
}
237
//Sched Manager since V 5.1.0
238
if (B2S_PLUGIN_USER_VERSION > 0) {
239
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-time-area pull-right ' . (!$isEdit ? 'b2s-sched-manager-add-padding' : '') . ' hidden-xs" style="' . (($notAllow) ? 'display:none;' : '') . '">
240
<input class="form-control b2s-box-sched-time-input b2s-settings-sched-item-input-time" type="text" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 0, 'time') . '" readonly="" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="0" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[time][' . $v['networkAuthId'] . ']">
241
</span>';
242
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-day-area pull-right hidden-xs" style="' . (($notAllow) ? 'display:none;' : '') . '"><span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-item-input-day-btn-minus" data-network-auth-id="' . $v['networkAuthId'] . '">-</span> <span class="b2s-text-middle">+</span> <input type="text" class="b2s-sched-manager-item-input-day" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="0" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[delay_day][' . $v['networkAuthId'] . ']" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 0, 'day') . '" readonly> <span class="b2s-text-middle">' . __('Days', 'blog2social') . '</span> <span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-item-input-day-btn-plus" data-network-auth-id="' . $v['networkAuthId'] . '">+</span></span>';
243
} else {
244
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-premium-area pull-right hidden-xs"><span class="label label-success"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sInfoSchedTimesModal">' . __('PREMIUM', 'blog2social') . '</a></span></span>';
245
}
246
247
$html .='</div>';
262
if ($notAllow) {
263
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('To reactivate this connection,', 'blog2social') . ' <a href="' . B2S_Tools::getSupportLink('affiliate') . '"target="_blank">' . __('please upgrade', 'blog2social') . '</a></div>';
264
}
265
if ($isInterrupted && !$notAllow) {
266
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
267
}
268
+ if ($v['owner_blog_user_id'] !== false) {
269
+ $displayName = stripslashes(get_user_by('id', $v['owner_blog_user_id'])->display_name);
270
+ $html .='<div class="b2s-network-approved-from">' . __("Assigned by", "blog2social") . ' ' . ((empty($displayName) || $displayName == false) ? __("Unknown username", "blog2social") : $displayName) . '</div> ';
271
+ }
272
$html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . ($networkId == 19 && isset($this->networkKindName[$v['networkKind']]) ? $this->networkKindName[$v['networkKind']] . '-' : '') . __('Page', 'blog2social') . (($networkId == 19 && (int) $v['networkKind'] == 0) ? ' <span class="hidden-xs">(' . __('Employer Branding', 'blog2social') . ')</span>' : '') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
273
274
if (!empty($mandantName)) {
275
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
276
}
277
+
278
$html .='</div>';
279
$html .='<div class="pull-right">';
280
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="1" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
281
if (!$notAllow && !$isDeprecated) {
282
+ if ($v['owner_blog_user_id'] == false) {
283
+ $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=page&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
284
+ } else {
285
+ $html .= '<span class="b2s-add-padding-network-placeholder-btn pull-right"></span>';
286
+ }
287
+
288
+ $html .='<a href="#" class="pull-right b2s-network-item-team-btn-manage b2s-add-padding-network-team pull-right" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-id="' . $networkId . '" data-network-type="1" data-network-mandant-id="' . $mandantId . '" data-connection-owner="' . (($v['owner_blog_user_id'] !== false) ? $v['owner_blog_user_id'] : '0') . '"><span class="glyphicon glyphicon-user glyphicon-grey"></span></a>';
289
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
290
if (isset($this->modifyBoardAndGroup[$networkId])) {
291
if (in_array(1, $this->modifyBoardAndGroup[$networkId]['TYPE'])) {
298
299
//Sched Manager since V 5.1.0
300
if (B2S_PLUGIN_USER_VERSION > 0) {
301
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-time-area pull-right ' . (!$isEdit ? 'b2s-sched-manager-add-padding' : '') . ' hidden-xs" style="' . (($notAllow) ? 'display:none;' : '') . '">
302
<input class="form-control b2s-box-sched-time-input b2s-settings-sched-item-input-time" type="text" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 1, 'time') . '" readonly="" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="1" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[time][' . $v['networkAuthId'] . ']">
303
</span>';
304
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-day-area pull-right hidden-xs" style="' . (($notAllow) ? 'display:none;' : '') . '"><span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-item-input-day-btn-minus" data-network-auth-id="' . $v['networkAuthId'] . '">-</span> <span class="b2s-text-middle">+</span> <input type="text" class="b2s-sched-manager-item-input-day" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="1" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[delay_day][' . $v['networkAuthId'] . ']" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 1, 'day') . '" readonly> <span class="b2s-text-middle">' . __('Days', 'blog2social') . '</span> <span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-item-input-day-btn-plus" data-network-auth-id="' . $v['networkAuthId'] . '">+</span></span>';
305
} else {
306
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-premium-area pull-right hidden-xs"><span class="label label-success"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sInfoSchedTimesModal">' . __('PREMIUM', 'blog2social') . '</a></span></span>';
307
}
308
309
$html .='</div>';
325
if ($notAllow) {
326
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('To reactivate this connection,', 'blog2social') . ' <a href="' . B2S_Tools::getSupportLink('affiliate') . '"target="_blank">' . __('please upgrade', 'blog2social') . '</a></div>';
327
}
328
if ($isInterrupted && !$notAllow) {
329
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
330
}
331
+ if ($v['owner_blog_user_id'] !== false) {
332
+ $displayName = stripslashes(get_user_by('id', $v['owner_blog_user_id'])->display_name);
333
+ $html .='<div class="b2s-network-approved-from">' . __("Assigned by", "blog2social") . ' ' . ((empty($displayName) || $displayName == false) ? __("Unknown username", "blog2social") : $displayName) . '</div> ';
334
+ }
335
$html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . __('Group', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
336
337
if (!empty($mandantName)) {
341
$html .='<div class="pull-right">';
342
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="2" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
343
if (!$notAllow && !$isDeprecated) {
344
+ if ($v['owner_blog_user_id'] == false) {
345
+ $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=group&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
346
+ } else {
347
+ $html .= '<span class="b2s-add-padding-network-placeholder-btn pull-right"></span>';
348
+ }
349
+ $html .='<a href="#" class="pull-right b2s-network-item-team-btn-manage b2s-add-padding-network-team pull-right" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-id="' . $networkId . '" data-network-type="2" data-network-mandant-id="' . $mandantId . '" data-connection-owner="' . (($v['owner_blog_user_id'] !== false) ? $v['owner_blog_user_id'] : '0') . '"><span class="glyphicon glyphicon-user glyphicon-grey"></span></a>';
350
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
351
if (isset($this->modifyBoardAndGroup[$networkId])) {
352
if (in_array(2, $this->modifyBoardAndGroup[$networkId]['TYPE'])) {
359
360
//Sched Manager since V 5.1.0
361
if (B2S_PLUGIN_USER_VERSION > 0) {
362
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-time-area pull-right ' . (!$isEdit ? 'b2s-sched-manager-add-padding' : '') . ' hidden-xs" style="' . (($notAllow) ? 'display:none;' : '') . '">
363
<input class="form-control b2s-box-sched-time-input b2s-settings-sched-item-input-time" type="text" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 2, 'time') . '" readonly="" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="2" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[time][' . $v['networkAuthId'] . ']">
364
</span>';
365
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-day-area pull-right hidden-xs" style="' . (($notAllow) ? 'display:none;' : '') . '"><span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-item-input-day-btn-minus" data-network-auth-id="' . $v['networkAuthId'] . '">-</span> <span class="b2s-text-middle">+</span> <input type="text" class="b2s-sched-manager-item-input-day" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="2" data-network-container-mandant-id="' . $containerMandantId . '" name="b2s-user-sched-data[delay_day][' . $v['networkAuthId'] . ']" value="' . $this->getUserSchedTime($v['networkAuthId'], $networkId, 2, 'day') . '" readonly> <span class="b2s-text-middle">' . __('Days', 'blog2social') . '</span> <span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-item-input-day-btn-plus" data-network-auth-id="' . $v['networkAuthId'] . '">+</span></span>';
366
} else {
367
+ $html .='<span data-network-auth-id="' . $v['networkAuthId'] . '" class="b2s-sched-manager-premium-area pull-right hidden-xs"><span class="label label-success"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sInfoSchedTimesModal">' . __('PREMIUM', 'blog2social') . '</a></span></span>';
368
}
369
370
$html .='</div>';
383
'networkUserName' => $value->networkUserName,
384
'expiredDate' => $value->expiredDate,
385
'networkKind' => $value->networkKind,
386
+ 'notAllow' => (isset($value->notAllow) ? $value->notAllow : false),
387
+ 'owner_blog_user_id' => (isset($value->owner_blog_user_id) ? $value->owner_blog_user_id : false)
388
);
389
}
390
return $convertAuth;
432
return $saveSchedData;
433
}
434
435
+ public function getNetworkAuthAssignment($networkAuthId = 0, $networkId = 0, $networkType = 0) {
436
+ global $wpdb;
437
+ $blogUserTokenResult = $wpdb->get_results("SELECT token FROM `b2s_user`");
438
+ $blogUserToken = array();
439
+ foreach ($blogUserTokenResult as $k => $row) {
440
+ array_push($blogUserToken, $row->token);
441
+ }
442
+ $data = array('action' => 'getTeamAssignUserAuth', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $networkAuthId, 'blogUser' => $blogUserToken);
443
+ $networkAuthAssignment = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $data, 30), true);
444
+ if (isset($networkAuthAssignment['result']) && $networkAuthAssignment['result'] !== false) {
445
+ $doneIds = array();
446
+ $assignList = '<ul class="b2s-network-item-auth-list" id="b2s-approved-user-list"><li class="b2s-network-item-auth-list-li b2s-bold">' . __('Connection currently assigned to', 'blog2social') . '</li>';
447
+ if (isset($networkAuthAssignment['assignList']) && is_array($networkAuthAssignment['assignList']) && !empty($networkAuthAssignment['assignList'])) {
448
+ $options = new B2S_Options((int) B2S_PLUGIN_BLOG_USER_ID);
449
+ $optionUserTimeZone = $options->_getOption('user_time_zone');
450
+ $userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
451
+ $userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
452
+ foreach ($networkAuthAssignment['assignList'] as $k => $listUser) {
453
+ array_push($doneIds, $listUser['assign_blog_user_id']);
454
+ if (get_userdata($listUser['assign_blog_user_id']) !== false) {
455
+ $current_user_date = date((strtolower(substr(B2S_LANGUAGE, 0, 2)) == 'de') ? 'd.m.Y' : 'Y-m-d', strtotime(B2S_Util::getUTCForDate($listUser['created_utc'], $userTimeZoneOffset)));
456
+ $displayName = stripslashes(get_user_by('id', $listUser['assign_blog_user_id'])->display_name);
457
+ $assignList .= '<li class="b2s-network-item-auth-list-li">';
458
+ $assignList .= '<div class="pull-left" style="padding-top: 5px;"><span>' . ((empty($displayName) || $displayName == false) ? __("Unknown username", "blog2social") : $displayName) . '</span></div>';
459
+ $assignList .= '<div class="pull-right"><span style="margin-right: 10px;">' . $current_user_date . '</span> <button class="b2s-network-item-auth-list-btn-delete btn btn-danger btn-sm" data-assign-network-auth-id="' . $listUser['assign_network_auth_id'] . '" data-network-auth-id="' . $networkAuthId . '" data-network-id="' . $networkId . '" data-network-type="' . $networkType . '" data-blog-user-id="' . $listUser['assign_blog_user_id'] . '">' . __('delete', 'blog2social') . '</button></div>';
460
+ $assignList .= '<div class="clearfix"></div></li>';
461
+ }
462
+ }
463
+ }
464
+ $assignList .= '</ul>';
465
+
466
+ $select = '<select class="form-control b2s-select" id="b2s-select-assign-user">';
467
+ if (isset($networkAuthAssignment['userList']) && !empty($networkAuthAssignment['userList'])) {
468
+ foreach ($networkAuthAssignment['userList'] as $k => $listUser) {
469
+ if ((int) $listUser != B2S_PLUGIN_BLOG_USER_ID && !in_array($listUser, $doneIds)) {
470
+ array_push($doneIds, $listUser);
471
+ $userDetails = get_option('B2S_PLUGIN_USER_VERSION_' . $listUser);
472
+ if (isset($userDetails['B2S_PLUGIN_USER_VERSION']) && (int) $userDetails['B2S_PLUGIN_USER_VERSION'] == 3) {
473
+ $displayName = stripslashes(get_user_by('id', $listUser)->display_name);
474
+ $select .= '<option value="' . $listUser . '">' . ((empty($displayName) || $displayName == false) ? __("Unknown username", "blog2social") : $displayName) . '</option>';
475
+ }
476
+ }
477
+ }
478
+ }
479
+ $select .= '</select>';
480
+
481
+ return array('result' => true, 'userSelect' => $select, 'assignList' => $assignList);
482
+ }
483
+ return array('result' => false);
484
+ }
485
+
486
}
includes/B2S/Post/Item.php CHANGED
@@ -358,7 +358,7 @@ class B2S_Post_Item {
358
<div class="media-body">
359
<strong><a target="_blank" href="' . $url . '">' . $postTitle . '</a></strong>' . $browser . '
360
<span class="pull-right b2s-publish-btn">
361
- <a class="btn btn-primary btn-sm publishPostBtn" href="admin.php?page=blog2social-curation&postId=' . $var->ID . '&url=' . urlencode($url) . '&comment=' . urlencode($var->post_content) . '">' . __('Share on Social Media', 'blog2social') . '</a>
362
</span>
363
<p class="info hidden-xs">#' . $var->ID . ' | ' . __('Author', 'blog2social') . ' <a href="' . get_author_posts_url($var->post_author) . '">' . (isset($userInfo['nickname'][0]) ? $userInfo['nickname'][0] : '-') . '</a> | ' . __('saved', 'blog2social') . ': ' . B2S_Util::getCustomDateFormat($var->post_date, substr(B2S_LANGUAGE, 0, 2)) . $lastPublish . '</p>
364
</div>
358
<div class="media-body">
359
<strong><a target="_blank" href="' . $url . '">' . $postTitle . '</a></strong>' . $browser . '
360
<span class="pull-right b2s-publish-btn">
361
+ <a class="btn btn-primary btn-sm publishPostBtn" href="admin.php?page=blog2social-curation&postId=' . $var->ID . '&url=' . urlencode($url) . '&title=' . urlencode($var->post_title) . '&comment=' . urlencode($var->post_content) . '">' . __('Share on Social Media', 'blog2social') . '</a>
362
</span>
363
<p class="info hidden-xs">#' . $var->ID . ' | ' . __('Author', 'blog2social') . ' <a href="' . get_author_posts_url($var->post_author) . '">' . (isset($userInfo['nickname'][0]) ? $userInfo['nickname'][0] : '-') . '</a> | ' . __('saved', 'blog2social') . ': ' . B2S_Util::getCustomDateFormat($var->post_date, substr(B2S_LANGUAGE, 0, 2)) . $lastPublish . '</p>
364
</div>
includes/B2S/PostBox.php CHANGED
@@ -104,7 +104,7 @@ class B2S_PostBox {
104
$content .='<input id="b2s-post-meta-box-time-dropdown-publish" class="post-format" ' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'disabled' : '') . ' name="b2s-post-meta-box-time-dropdown" value="publish" type="checkbox" ' . $isChecked . '>
105
<label for="b2s-post-meta-box-time-dropdown-publish" class="post-format-icon">' . __('enable Auto-Posting', 'blog2social') . '</label>';
106
107
- if (B2S_PLUGIN_USER_VERSION <= 1) {
108
$content .= ' <span class="b2s-label b2s-label-success"><a href="#" class="b2s-btn-label-premium b2s-info-btn" data-modal-target="b2sInfoMetaBoxModalAutoPost">' . __("PREMIUM", "blog2social") . '</a></span>';
109
}
110
104
$content .='<input id="b2s-post-meta-box-time-dropdown-publish" class="post-format" ' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'disabled' : '') . ' name="b2s-post-meta-box-time-dropdown" value="publish" type="checkbox" ' . $isChecked . '>
105
<label for="b2s-post-meta-box-time-dropdown-publish" class="post-format-icon">' . __('enable Auto-Posting', 'blog2social') . '</label>';
106
107
+ if (B2S_PLUGIN_USER_VERSION == 0) {
108
$content .= ' <span class="b2s-label b2s-label-success"><a href="#" class="b2s-btn-label-premium b2s-info-btn" data-modal-target="b2sInfoMetaBoxModalAutoPost">' . __("PREMIUM", "blog2social") . '</a></span>';
109
}
110
includes/B2S/Settings/Item.php CHANGED
@@ -323,7 +323,7 @@ class B2S_Settings_Item {
323
$content .='<h4>' . __('Frontpage Settings', 'blog2social');
324
$content .=' <a class="btn-link b2s-btn-link-txt" href="admin.php?page=blog2social-support#b2s-support-sharing-debugger">' . __("Check Settings with Sharing-Debugger", "blog2social") . '</a>';
325
$content .='</h4>';
326
- $content .='<div><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/1_flat.png', B2S_PLUGIN_FILE) . '"> <b>Facebook</b></div>';
327
$content .= '<p>' . __('Add the default Open Graph parameters for title, description and image you want Facebook to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
328
$content .='<br>';
329
$content .='<div class="col-md-8">';
@@ -339,7 +339,7 @@ class B2S_Settings_Item {
339
$content .='</div>';
340
$content .='<div class="clearfix"></div>';
341
$content .='<br>';
342
- $content .='<div><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/2_flat.png', B2S_PLUGIN_FILE) . '"> <b>Twitter</b></div>';
343
$content .='<p>' . __('Add the default Twitter Card parameters for title, description and image you want Twitter to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
344
$content .='<br>';
345
$content .='<div class="col-md-8">';
323
$content .='<h4>' . __('Frontpage Settings', 'blog2social');
324
$content .=' <a class="btn-link b2s-btn-link-txt" href="admin.php?page=blog2social-support#b2s-support-sharing-debugger">' . __("Check Settings with Sharing-Debugger", "blog2social") . '</a>';
325
$content .='</h4>';
326
+ $content .='<div><b>Open Graph</b></div>';
327
$content .= '<p>' . __('Add the default Open Graph parameters for title, description and image you want Facebook to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
328
$content .='<br>';
329
$content .='<div class="col-md-8">';
339
$content .='</div>';
340
$content .='<div class="clearfix"></div>';
341
$content .='<br>';
342
+ $content .='<div><b>Twitter Card</b></div>';
343
$content .='<p>' . __('Add the default Twitter Card parameters for title, description and image you want Twitter to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
344
$content .='<br>';
345
$content .='<div class="col-md-8">';
includes/B2S/Ship/Item.php CHANGED
@@ -299,7 +299,7 @@ class B2S_Ship_Item {
299
$content .='<span class="b2s-post-tool-area" data-network-auth-id="' . $data->networkAuthId . '">';
300
$content .= (in_array($data->networkId, $this->setPostFormat)) ? ' | ' : '';
301
if (in_array($data->networkId, $this->getText)) {
302
- $content .= '<button class="btn btn-xs btn-link b2s-post-ship-item-full-text" data-network-id="'.$data->networkId.'" data-network-count="-1" data-network-auth-id="' . $data->networkAuthId . '" >' . __('Insert full-text', 'blog2social') . '</button> | ';
303
}
304
$content .= '<button class="btn btn-xs btn-link b2s-post-ship-item-message-delete" data-network-count="-1" data-network-auth-id="' . $data->networkAuthId . '">' . __('Delete text', 'blog2social') . '</button> | ';
305
$content .= $textareaLimitInfo . '</span></div>';
@@ -327,7 +327,7 @@ class B2S_Ship_Item {
327
$content .= (in_array($data->networkId, $this->showBoards) || ($data->networkType == 2 && in_array($data->networkId, $this->showBoardsGroup))) ? $this->getBoardHtml($data->networkAuthId, $data->networkId) : '';
328
$content .= (in_array($data->networkId, $this->showGroups) && ($data->networkType == 2 || $data->networkId == 15)) ? $this->getGroupsHtml($data->networkAuthId, $data->networkId) : '';
329
$content .= (in_array($data->networkId, $this->showMarketplace) && $data->networkType == 2) ? $this->getMarketplaceAreaHtml($data->networkAuthId, $data->networkId, $data->networkType, $data->networkKind) : '';
330
- $content .= ((in_array($data->networkId, $this->showTitleProfile) && $data->networkType == 0) || (((in_array($data->networkId, $this->showTitlePage) && !is_array($this->showTitlePage[$data->networkId])) || (is_array($this->showTitlePage[$data->networkId]) && in_array($data->networkKind, $this->showTitlePage[$data->networkId]))) && $data->networkType == 1) || (in_array($data->networkId, $this->showTitleGroup) && $data->networkType == 2)) ? $this->getTitleHtml($data->networkId, $data->networkAuthId, $data->networkKind, $data->networkType, $this->postData->post_title) : '';
331
$content .= $this->getCustomEditArea($data->networkId, $data->networkAuthId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
332
$content .= (in_array($data->networkId, $this->allowTag) && $data->networkType == 0) ? $this->getTagsHtml($data->networkAuthId, (($allowUserHashTag === false || $allowUserHashTag == 1) ? true : false)) : '';
333
@@ -395,7 +395,7 @@ class B2S_Ship_Item {
395
396
397
if ($networkId == 1) {
398
- $edit = '<textarea class="form-control fb-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="'.$networkId.'" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
399
$edit .= '<div class="row">';
400
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
401
$edit .= '<button class="btn btn-primary btn-circle b2s-image-remove-btn" data-network-count="-1" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" ' . ($imageUrl ? '' : 'style="display:none"') . '><i class="glyphicon glyphicon-trash"></i></button>';
@@ -419,7 +419,7 @@ class B2S_Ship_Item {
419
}
420
421
if ($networkId == 2) {
422
- $edit = '<textarea class="form-control tw-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="'.$networkId.'" data-network-text-limit="' . $limitValue . '" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" unique="currency" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
423
$edit .= '<div class="row">';
424
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
425
$edit .= '<button class="btn btn-primary btn-circle b2s-image-remove-btn" data-network-count="-1" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" ' . ($imageUrl ? '' : 'style="display:none"') . '><i class="glyphicon glyphicon-trash"></i></button>';
@@ -443,7 +443,7 @@ class B2S_Ship_Item {
443
}
444
445
if ($networkId == 3) {
446
- $edit = '<textarea class="form-control linkedin-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="'.$networkId.'" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
447
$edit .= '<div class="row">';
448
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '" >';
449
$edit .= '<button class="btn btn-primary btn-circle b2s-image-remove-btn" data-network-count="-1" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" ' . ($imageUrl ? '' : 'style="display:none"') . '><i class="glyphicon glyphicon-trash"></i></button>';
@@ -461,7 +461,7 @@ class B2S_Ship_Item {
461
}
462
463
if (($networkId == 8 || $networkId == 19) && $networkType == 0) {
464
- $edit = '<textarea class="form-control xing-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="'.$networkId.'" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
465
$edit .= '<div class="row">';
466
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
467
$edit .= '<img src="' . (isset($meta['image']) && !empty($meta['image']) ? $meta['image'] : $this->defaultImage) . '" class="xing-url-image b2s-post-item-details-url-image center-block img-responsive" data-network-count="-1" data-network-id="' . $networkId . '" data-network-image-change="0" data-network-auth-id="' . $networkAuthId . '">';
@@ -502,7 +502,7 @@ class B2S_Ship_Item {
502
$edit .= '</div>';
503
$edit .= '<div class="col-xs-12 col-sm-7 col-lg-9">';
504
$edit .= $infoArea;
505
- $edit .= '<textarea disabled="disabled" class="form-control fb-textarea-input b2s-post-item-sched-customize-text b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '" data-network-count="' . $schedCount . '" data-network-id="'.$networkId.'" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][sched_content][' . $schedCount . ']" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
506
$edit .= '</div>';
507
$edit .= '</div>';
508
}
@@ -536,7 +536,7 @@ class B2S_Ship_Item {
536
$edit .= '</div>';
537
$edit .= '<div class="col-xs-12 col-sm-7 col-lg-9">';
538
$edit .= $infoArea;
539
- $edit .= '<textarea disabled="disabled" class="form-control linkedin-textarea-input b2s-post-item-sched-customize-text b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '" data-network-count="' . $schedCount . '" data-network-id="'.$networkId.'" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][sched_content][' . $schedCount . ']" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
540
$edit .= '</div>';
541
$edit .= '</div>';
542
}
@@ -549,7 +549,7 @@ class B2S_Ship_Item {
549
$edit .= '</div>';
550
$edit .= '<div class="col-xs-12 col-sm-7 col-lg-9">';
551
$edit .= $infoArea;
552
- $edit .= '<textarea disabled="disabled" class="form-control xing-textarea-input b2s-post-item-sched-customize-text b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '" data-network-count="' . $schedCount . '" data-network-id="'.$networkId.'" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][sched_content][' . $schedCount . ']" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
553
$edit .= '</div>';
554
$edit .= '</div>';
555
}
@@ -565,12 +565,12 @@ class B2S_Ship_Item {
565
$edit .= '</div>';
566
$edit .= '<div class="col-xs-12 col-sm-7 col-lg-9">';
567
$edit .= $infoArea;
568
- $edit .= '<textarea disabled="disabled" class="form-control b2s-post-item-sched-customize-text b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '" data-network-count="' . $schedCount . '" data-network-text-limit="' . $limitValue . '" data-network-id="' . $networkId . '" data-network-count="' . $schedCount . '" data-network-id="'.$networkId.'" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][sched_content][' . $schedCount . ']" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
569
$edit .= '</div>';
570
} else {
571
$edit .= '<div class="col-xs-12">';
572
$edit .= $infoArea;
573
- $edit .= '<textarea disabled="disabled" class="form-control b2s-post-item-sched-customize-text b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '" data-network-count="' . $schedCount . '" data-network-text-limit="' . $limitValue . '" data-network-count="' . $schedCount . '" data-network-id="'.$networkId.'" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][sched_content][' . $schedCount . '] ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
574
$edit .= '</div>';
575
}
576
$edit .= '</div>';
@@ -632,7 +632,12 @@ class B2S_Ship_Item {
632
}
633
634
private function getHashTagsString($add = "\n\n") {
635
- $hashTagsData = get_the_tags($this->postId);
636
$hashTags = '';
637
if (is_array($hashTagsData) && !empty($hashTagsData)) {
638
foreach ($hashTagsData as $tag) {
@@ -919,7 +924,7 @@ class B2S_Ship_Item {
919
$edit = '<div class="pull-right hidden-xs b2s-post-item-info-area" data-network-id="' . $networkId . '" data-network-count="' . $schedcount . '" data-network-auth-id="' . $networkAuthId . '">';
920
$edit .= '<button class="btn btn-xs btn-link b2s-post-ship-item-copy-original-text" data-network-id="' . $networkId . '" data-network-count="' . $schedcount . '" data-network-auth-id="' . $networkAuthId . '" >' . __('Copy from original', 'blog2social') . '</button> | ';
921
if (in_array($networkId, $this->getText)) {
922
- $edit .= '<button class="btn btn-xs btn-link b2s-post-ship-item-full-text" data-network-id="'.$networkId.'" data-network-count="' . $schedcount . '" data-network-auth-id="' . $networkAuthId . '" >' . __('Insert full-text', 'blog2social') . '</button> | ';
923
}
924
$edit .= '<button class="btn btn-xs btn-link b2s-post-ship-item-message-delete" data-network-count="' . $schedcount . '" data-network-auth-id="' . $networkAuthId . '">' . __('Delete text', 'blog2social') . '</button> | ';
925
$edit .= $textareaLimitInfo . '</div>';
299
$content .='<span class="b2s-post-tool-area" data-network-auth-id="' . $data->networkAuthId . '">';
300
$content .= (in_array($data->networkId, $this->setPostFormat)) ? ' | ' : '';
301
if (in_array($data->networkId, $this->getText)) {
302
+ $content .= '<button class="btn btn-xs btn-link b2s-post-ship-item-full-text" data-network-id="' . $data->networkId . '" data-network-count="-1" data-network-auth-id="' . $data->networkAuthId . '" >' . __('Insert full-text', 'blog2social') . '</button> | ';
303
}
304
$content .= '<button class="btn btn-xs btn-link b2s-post-ship-item-message-delete" data-network-count="-1" data-network-auth-id="' . $data->networkAuthId . '">' . __('Delete text', 'blog2social') . '</button> | ';
305
$content .= $textareaLimitInfo . '</span></div>';
327
$content .= (in_array($data->networkId, $this->showBoards) || ($data->networkType == 2 && in_array($data->networkId, $this->showBoardsGroup))) ? $this->getBoardHtml($data->networkAuthId, $data->networkId) : '';
328
$content .= (in_array($data->networkId, $this->showGroups) && ($data->networkType == 2 || $data->networkId == 15)) ? $this->getGroupsHtml($data->networkAuthId, $data->networkId) : '';
329
$content .= (in_array($data->networkId, $this->showMarketplace) && $data->networkType == 2) ? $this->getMarketplaceAreaHtml($data->networkAuthId, $data->networkId, $data->networkType, $data->networkKind) : '';
330
+ $content .= ((in_array($data->networkId, $this->showTitleProfile) && $data->networkType == 0) || (((in_array($data->networkId, $this->showTitlePage) && isset($this->showTitlePage[$data->networkId]) && !is_array($this->showTitlePage[$data->networkId]) ) || (isset($this->showTitlePage[$data->networkId]) && is_array($this->showTitlePage[$data->networkId]) && in_array($data->networkKind, $this->showTitlePage[$data->networkId]))) && $data->networkType == 1) || (in_array($data->networkId, $this->showTitleGroup) && $data->networkType == 2)) ? $this->getTitleHtml($data->networkId, $data->networkAuthId, $data->networkKind, $data->networkType, $this->postData->post_title) : '';
331
$content .= $this->getCustomEditArea($data->networkId, $data->networkAuthId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
332
$content .= (in_array($data->networkId, $this->allowTag) && $data->networkType == 0) ? $this->getTagsHtml($data->networkAuthId, (($allowUserHashTag === false || $allowUserHashTag == 1) ? true : false)) : '';
333
395
396
397
if ($networkId == 1) {
398
+ $edit = '<textarea class="form-control fb-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="' . $networkId . '" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
399
$edit .= '<div class="row">';
400
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
401
$edit .= '<button class="btn btn-primary btn-circle b2s-image-remove-btn" data-network-count="-1" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" ' . ($imageUrl ? '' : 'style="display:none"') . '><i class="glyphicon glyphicon-trash"></i></button>';
419
}
420
421
if ($networkId == 2) {
422
+ $edit = '<textarea class="form-control tw-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="' . $networkId . '" data-network-text-limit="' . $limitValue . '" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" unique="currency" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
423
$edit .= '<div class="row">';
424
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
425
$edit .= '<button class="btn btn-primary btn-circle b2s-image-remove-btn" data-network-count="-1" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" ' . ($imageUrl ? '' : 'style="display:none"') . '><i class="glyphicon glyphicon-trash"></i></button>';
443
}
444
445
if ($networkId == 3) {
446
+ $edit = '<textarea class="form-control linkedin-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="' . $networkId . '" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
447
$edit .= '<div class="row">';
448
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '" >';
449
$edit .= '<button class="btn btn-primary btn-circle b2s-image-remove-btn" data-network-count="-1" data-network-id="' . $networkId . '" data-network-auth-id="' . $networkAuthId . '" ' . ($imageUrl ? '' : 'style="display:none"') . '><i class="glyphicon glyphicon-trash"></i></button>';
461
}
462
463
if (($networkId == 8 || $networkId == 19) && $networkType == 0) {
464
+ $edit = '<textarea class="form-control xing-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-id="' . $networkId . '" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
465
$edit .= '<div class="row">';
466
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
467
$edit .= '<img src="' . (isset($meta['image']) && !empty($meta['image']) ? $meta['image'] : $this->defaultImage) . '" class="xing-url-image b2s-post-item-details-url-image center-block img-responsive" data-network-count="-1" data-network-id="' . $networkId . '" data-network-image-change="0" data-network-auth-id="' . $networkAuthId . '">';
502
$edit .= '</div>';
503
$edit .= '<div class="col-xs-12 col-sm-7 col-lg-9">';
504
$edit .= $infoArea;
505
+ $edit .= '<textarea disabled="disabled" class="form-control fb-textarea-input b2s-post-item-sched-customize-text b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '" data-network-count="' . $schedCount . '" data-network-id="' . $networkId . '" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][sched_content][' . $schedCount . ']" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
506
$edit .= '</div>';
507
$edit .= '</div>';
508
}
536
$edit .= '</div>';
537
$edit .= '<div class="col-xs-12 col-sm-7 col-lg-9">';
538
$edit .= $infoArea;