Blog2Social: Social Media Auto Post & Scheduler - Version 6.1.0

Version Description

Usability Optimization, Rebrandly integration, url parameter settings

Download this release

Release Info

Developer PR-Gateway
Plugin Icon 128x128 Blog2Social: Social Media Auto Post & Scheduler
Version 6.1.0
Comparing to
See all releases

Code changes from version 6.0.0 to 6.1.0

Files changed (55) hide show
  1. assets/css/b2s/curation.css +5 -0
  2. assets/css/b2s/network.css +19 -6
  3. assets/css/b2s/settings.css +18 -0
  4. assets/css/b2s/ship.css +10 -5
  5. assets/css/b2s/wp/post-box.css +52 -1
  6. assets/css/general.css +12 -0
  7. assets/images/portale/12_flat.png +0 -0
  8. assets/images/settings/b2s-post-format-17-1-de.png +0 -0
  9. assets/images/settings/b2s-post-format-17-1-en.png +0 -0
  10. assets/images/settings/b2s-post-format-17-2-de.png +0 -0
  11. assets/images/settings/b2s-post-format-17-2-en.png +0 -0
  12. assets/images/settings/rebrandly.png +0 -0
  13. assets/js/b2s/calendar.js +1 -1
  14. assets/js/b2s/curation.js +29 -3
  15. assets/js/b2s/network.js +277 -148
  16. assets/js/b2s/post.js +16 -3
  17. assets/js/b2s/settings.js +108 -19
  18. assets/js/b2s/ship.js +34 -9
  19. assets/js/b2s/wp/post-box.js +83 -131
  20. blog2social.php +2 -2
  21. includes/Ajax/Get.php +107 -61
  22. includes/Ajax/Post.php +239 -99
  23. includes/B2S/AutoPost.php +14 -2
  24. includes/B2S/Curation/Save.php +4 -2
  25. includes/B2S/Curation/View.php +1 -1
  26. includes/B2S/Network/Item.php +52 -14
  27. includes/B2S/Post/Filter.php +38 -9
  28. includes/B2S/Post/Item.php +29 -17
  29. includes/B2S/Post/Tools.php +1 -1
  30. includes/B2S/PostBox.php +163 -90
  31. includes/B2S/Settings/Item.php +106 -49
  32. includes/B2S/Ship/Item.php +92 -22
  33. includes/B2S/Ship/Navbar.php +2 -2
  34. includes/B2S/Ship/Portale.php +2 -1
  35. includes/B2S/Ship/Save.php +1 -1
  36. includes/Loader.php +252 -157
  37. includes/Meta.php +24 -17
  38. includes/Tools.php +15 -2
  39. includes/Util.php +15 -1
  40. languages/blog2social-de_DE.mo +0 -0
  41. languages/blog2social-de_DE.po +892 -774
  42. languages/blog2social.pot +820 -714
  43. readme.txt +21 -99
  44. views/b2s/curation.draft.php +8 -1
  45. views/b2s/curation.php +1 -1
  46. views/b2s/network.php +162 -139
  47. views/b2s/post.approve.php +8 -1
  48. views/b2s/post.draft.php +8 -1
  49. views/b2s/post.favorites.php +8 -1
  50. views/b2s/post.notice.php +8 -1
  51. views/b2s/post.php +8 -1
  52. views/b2s/post.publish.php +8 -1
  53. views/b2s/post.sched.php +8 -1
  54. views/b2s/settings.php +14 -0
  55. views/b2s/ship.php +1 -1
assets/css/b2s/curation.css CHANGED
@@ -201,4 +201,9 @@
201
202
.b2s-curation-result-area {
203
margin-top: 20px;
204
}
201
202
.b2s-curation-result-area {
203
margin-top: 20px;
204
+ }
205
+
206
+ .b2s-break-word {
207
+ white-space: normal !important;
208
+ text-align: left !important;
209
}
assets/css/b2s/network.css CHANGED
@@ -66,7 +66,7 @@
66
}
67
68
.b2s-add-padding-network-team{
69
- padding: 4px 3px;
70
line-height: 2;
71
}
72
@@ -158,7 +158,7 @@ ul.b2s-network-item-auth-list li:last-child{
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
@@ -237,7 +237,7 @@ ul.b2s-network-item-auth-list li:last-child{
237
margin-bottom: 8px;
238
}
239
240
- #b2s-manage-auth-team-modal {
241
z-index: 1049;
242
}
243
@@ -621,7 +621,20 @@ ul.b2s-network-item-auth-list li:last-child{
621
display: inline;
622
}
623
624
- #b2sXingBusinessPageInfo {
625
- margin: 10px 0px;
626
- display: none;
627
}
66
}
67
68
.b2s-add-padding-network-team{
69
+ padding: 4px 5px;
70
line-height: 2;
71
}
72
158
line-height: 2;
159
}
160
161
+ .b2s-modify-board-and-group-network-modal-footer, .b2s-edit-network-auth-settings-footer{
162
border: 0px !important;
163
}
164
237
margin-bottom: 8px;
238
}
239
240
+ #b2s-manage-auth-team-modal, #b2s-edit-network-auth-settings {
241
z-index: 1049;
242
}
243
621
display: inline;
622
}
623
624
+ .b2s-url-parameter-remove-btn {
625
+ font-weight: bold;
626
+ font-size: 18px;
627
+ line-height: 1.5;
628
+ cursor: pointer;
629
+ }
630
+
631
+ .b2s-url-parameter-legend-text {
632
+ font-size: 12px;
633
+ font-weight: 600;
634
+ letter-spacing: 0;
635
+ margin-top: 10px;
636
+ }
637
+
638
+ .b2s-url-parameter-content {
639
+ padding-top: 6px;
640
}
assets/css/b2s/settings.css CHANGED
@@ -127,3 +127,21 @@ ul.chosen-choices {
127
font-size: 14px !important;
128
font-weight: 500 !important;
129
}
127
font-size: 14px !important;
128
font-weight: 500 !important;
129
}
130
+
131
+ .b2s-user-network-shortener-connect {
132
+ margin-left: 5px;
133
+ }
134
+
135
+ #b2s-auto-post-profil-dropdown-twitter option:disabled {
136
+ color: #ff4f68;
137
+ }
138
+
139
+ .b2s-w-100 {
140
+ width: 100%;
141
+ padding: 0px;
142
+ }
143
+
144
+ .b2s-auto-post-header {
145
+ display: inline-block;
146
+ margin-right: 5px;
147
+ }
assets/css/b2s/ship.css CHANGED
@@ -565,7 +565,7 @@ input[type="checkbox"], input[type="radio"] {
565
566
/*Custom Network Layout*/
567
568
- .fb-url-image, .xing-url-image, .linkedin-url-image, .tw-url-image, .b2s-image-border{
569
margin-right: 10px;
570
margin-bottom: 20px;
571
border: 1px dashed #bdbfc2;
@@ -637,10 +637,15 @@ input[type="checkbox"], input[type="radio"] {
637
638
639
.tw-url-title{
640
- font-size: 1.2em !important;
641
- font-weight: 600;
642
- text-overflow: ellipsis;
643
- color: inherit !important;
644
}
645
646
.tw-url-desc{
565
566
/*Custom Network Layout*/
567
568
+ .fb-url-image, .xing-url-image, .linkedin-url-image, .tw-url-image, .b2s-url-image, .b2s-image-border{
569
margin-right: 10px;
570
margin-bottom: 20px;
571
border: 1px dashed #bdbfc2;
637
638
639
.tw-url-title{
640
+ font-size: 18px !important;
641
+ font-weight: 500;
642
+ line-height: 22px;
643
+ margin-top: 12px !important;
644
+ margin-bottom: 8px !important;
645
+ max-height: 110px;
646
+ overflow: hidden;
647
+ word-wrap: break-word;
648
+ font-family: Georgia,serif;
649
}
650
651
.tw-url-desc{
assets/css/b2s/wp/post-box.css CHANGED
@@ -176,7 +176,7 @@
176
}
177
178
.b2s-btn-sm{
179
- padding: 4px 12px !important;
180
}
181
182
.b2s-btn-close-meta-box{
@@ -251,3 +251,54 @@
251
.pull-right{
252
float: right;
253
}
176
}
177
178
.b2s-btn-sm{
179
+ padding: 7px !important;
180
}
181
182
.b2s-btn-close-meta-box{
251
.pull-right{
252
float: right;
253
}
254
+
255
+ .b2s-meta-box-share-info {
256
+ background-color: #79B232;
257
+ padding: 10px;
258
+ color: #fff;
259
+ }
260
+
261
+ @font-face {
262
+ font-family: 'Glyphicons Halflings';
263
+
264
+ src: url('../../../fonts/glyphicons-halflings-regular.eot');
265
+ src: url('../../../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../../../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../../../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../../../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../../../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
266
+ }
267
+ .glyphicon {
268
+ position: relative;
269
+ top: 1px;
270
+ display: inline-block;
271
+ font-family: 'Glyphicons Halflings';
272
+ font-style: normal;
273
+ font-weight: normal;
274
+ line-height: 1;
275
+
276
+ -webkit-font-smoothing: antialiased;
277
+ -moz-osx-font-smoothing: grayscale;
278
+ }
279
+
280
+ .glyphicon-chevron-up::before {
281
+ content: "\e113";
282
+ }
283
+ .glyphicon-chevron-down::before {
284
+ content: "\e114";
285
+ }
286
+
287
+ .b2s-options-btn {
288
+ cursor: pointer;
289
+ text-decoration: underline;
290
+ margin-top: 5px;
291
+ }
292
+
293
+ #b2s-meta-box-btn-customize {
294
+ text-decoration: none;
295
+ }
296
+
297
+ .b2s-options-btn-area {
298
+ text-align: right;
299
+ }
300
+
301
+ .b2s-w-100 {
302
+ width: 100%;
303
+ padding: 0px !important;
304
+ }
assets/css/general.css CHANGED
@@ -7622,3 +7622,15 @@ CSS CheckBOX
7622
bottom: 50px;
7623
right: 40px;
7624
}
7622
bottom: 50px;
7623
right: 40px;
7624
}
7625
+
7626
+ .margin-bottom-0 {
7627
+ margin-bottom: 0px !important;
7628
+ }
7629
+
7630
+ .b2s-sort-pagination-area {
7631
+ display: none;
7632
+ }
7633
+
7634
+ .b2s-post-per-page {
7635
+ margin: 20px 0px;
7636
+ }
assets/images/portale/12_flat.png CHANGED
Binary file
assets/images/settings/b2s-post-format-17-1-de.png ADDED
Binary file
assets/images/settings/b2s-post-format-17-1-en.png ADDED
Binary file
assets/images/settings/b2s-post-format-17-2-de.png ADDED
Binary file
assets/images/settings/b2s-post-format-17-2-en.png ADDED
Binary file
assets/images/settings/rebrandly.png ADDED
Binary file
assets/js/b2s/calendar.js CHANGED
@@ -644,7 +644,7 @@ function checkSchedDateTime(dataNetworkAuthId) {
644
//utc current time
645
var now = new Date();
646
//offset between utc und user
647
- var offset = (parseInt(now.getTimezoneOffset() / 60)) * (-1);
648
//enter hour to user time
649
var hour = parseInt(minParts3[0]) + timeZone + offset;
650
//calculate datetime in utc
644
//utc current time
645
var now = new Date();
646
//offset between utc und user
647
+ var offset = (parseInt(now.getTimezoneOffset() / 60)) * (-1);
648
//enter hour to user time
649
var hour = parseInt(minParts3[0]) + timeZone + offset;
650
//calculate datetime in utc
assets/js/b2s/curation.js CHANGED
@@ -29,7 +29,7 @@ jQuery(window).on("load", function () {
29
jQuery('.b2s-image-id-hidden-field').val(image_id);
30
jQuery('.b2s-image-remove-btn').show();
31
}
32
- }
33
});
34
35
jQuery(document).on('click', '.b2s-btn-curation-continue', function () {
@@ -182,7 +182,7 @@ function scrapeDetails(url) {
182
if (typeof comment != "undefined" && comment != "") {
183
jQuery('#b2s-post-curation-comment').val(comment);
184
}
185
-
186
} else {
187
if(data.error == 'nonce') {
188
jQuery('.b2s-nonce-check-fail').show();
@@ -614,6 +614,7 @@ jQuery(document).on('click', '.b2s-curation-format-image', function() {
614
jQuery('.b2s-loading-area').hide();
615
jQuery('.b2s-curation-image-area').show();
616
jQuery('.b2s-curation-settings-area').show();
617
return false;
618
} else {
619
jQuery('.b2s-loading-area').hide();
@@ -794,4 +795,29 @@ jQuery(document).on('click', '.b2s-re-share-btn', function() {
794
} else {
795
jQuery('.b2s-curation-image-area').show();
796
}
797
- });
29
jQuery('.b2s-image-id-hidden-field').val(image_id);
30
jQuery('.b2s-image-remove-btn').show();
31
}
32
+ }
33
});
34
35
jQuery(document).on('click', '.b2s-btn-curation-continue', function () {
182
if (typeof comment != "undefined" && comment != "") {
183
jQuery('#b2s-post-curation-comment').val(comment);
184
}
185
+ loadDraftShipData();
186
} else {
187
if(data.error == 'nonce') {
188
jQuery('.b2s-nonce-check-fail').show();
614
jQuery('.b2s-loading-area').hide();
615
jQuery('.b2s-curation-image-area').show();
616
jQuery('.b2s-curation-settings-area').show();
617
+ loadDraftShipData();
618
return false;
619
} else {
620
jQuery('.b2s-loading-area').hide();
795
} else {
796
jQuery('.b2s-curation-image-area').show();
797
}
798
+ });
799
+
800
+ function loadDraftShipData() {
801
+ var url_string = window.location.href;
802
+ var url_param = new URL(url_string);
803
+ var ship_type = url_param.searchParams.get("ship_type");
804
+ var ship_date = url_param.searchParams.get("ship_date");
805
+ var profile_select = url_param.searchParams.get("profile_select");
806
+ var twitter_select = url_param.searchParams.get("twitter_select");
807
+ if (typeof ship_type != "undefined" && ship_type != "" && ship_type != null && ship_type > 0) {
808
+ jQuery('#b2s-post-curation-ship-type').val(ship_type);
809
+ jQuery('#b2s-post-curation-ship-type').trigger('change');
810
+ if (typeof ship_date != "undefined" && ship_date != "" && ship_date != null) {
811
+ jQuery('#b2s-post-curation-ship-date').val(ship_date);
812
+ jQuery('#b2s-post-curation-ship-date').trigger('change');
813
+ }
814
+ }
815
+ if (typeof profile_select != "undefined" && profile_select != "" && profile_select != null) {
816
+ jQuery('#b2s-post-curation-profile-select').val(profile_select);
817
+ jQuery('#b2s-post-curation-profile-select').trigger('change');
818
+ if (typeof twitter_select != "undefined" && twitter_select != "" && twitter_select != null && twitter_select > 0) {
819
+ jQuery('#b2s-post-curation-twitter-select').val(twitter_select);
820
+ jQuery('#b2s-post-curation-twitter-select').trigger('change');
821
+ }
822
+ }
823
+ }
assets/js/b2s/network.js CHANGED
@@ -15,16 +15,8 @@ jQuery(window).on("load", function () {
15
jQuery('.b2s-network-item-auth-list[data-network-count="true"]').each(function () {
16
jQuery('.b2s-network-auth-count-current[data-network-id="' + jQuery(this).attr("data-network-id") + '"').text(jQuery(this).children('li').length - 1);
17
});
18
-
19
- if(jQuery('#b2sHasXingBusinessPage').length > 0) {
20
- jQuery('#b2sXingBusinessPageInfo').show();
21
- }
22
-
23
});
24
25
-
26
-
27
-
28
function init() {
29
var showMeridian = true;
30
if (jQuery('#b2sUserLang').val() == 'de') {
@@ -172,130 +164,11 @@ jQuery(document).on('change', '#b2s-modify-board-and-group-network-selected', fu
172
return true;
173
});
174
175
- jQuery(document).on('click', '.b2s-network-item-team-btn-manage', function () {
176
- jQuery('#b2s-manage-auth-team-modal').modal('show');
177
-
178
- if (jQuery('#b2sUserVersion').val() < 3) {
179
- return false;
180
- }
181
-
182
- jQuery('.b2s-move-connection').hide();
183
- jQuery('#b2s-move-connection-failed').hide();
184
- jQuery('.b2s-connection-assign').hide();
185
- jQuery('.b2s-assignment-area').hide();
186
- jQuery('.b2s-connection-owner').hide();
187
- jQuery('.b2s-assign-error').hide();
188
- jQuery('#b2s-no-assign-user').hide();
189
- jQuery('.b2s-loading-area-manage-auth-team-modal').show();
190
- jQuery('#b2s-assign-info').show();
191
-
192
-
193
-
194
- jQuery('#b2sUserAuthId').val(jQuery(this).attr('data-network-auth-id'));
195
- jQuery('#b2sOldMandantId').val(jQuery(this).attr('data-network-mandant-id'));
196
- jQuery('#b2sNetworkId').val(jQuery(this).attr('data-network-id'));
197
- jQuery('#b2sNetworkType').val(jQuery(this).attr('data-network-type'));
198
-
199
- if (jQuery('#b2s-move-connection-select').length) {
200
- jQuery('#b2s-move-connection-select').html(jQuery('.b2s-network-mandant-select').html());
201
- jQuery("#b2s-move-connection-select option[value='-1']").remove();
202
- jQuery("#b2s-move-connection-select option[value='" + jQuery(this).attr('data-network-mandant-id') + "']").remove();
203
- if (jQuery(this).attr('data-network-mandant-id') <= 0) {
204
- if (jQuery('#b2s-network-select-more-client').length) {
205
- var temp_options = jQuery('#b2s-move-connection-select #b2s-network-select-more-client').html();
206
- jQuery("#b2s-move-connection-select optiongroup").remove();
207
- jQuery("#b2s-move-connection-select").html(temp_options);
208
- } else {
209
- jQuery('#b2s-move-connection-input').hide();
210
- jQuery('#b2s-move-connection-error').show();
211
- }
212
- } else {
213
- if (!jQuery('#b2s-move-connection-select #b2s-network-select-more-client option').length) {
214
- var temp_options = jQuery("#b2s-move-connection-select option[value='0']");
215
- jQuery("#b2s-move-connection-select optiongroup").remove();
216
- jQuery("#b2s-move-connection-select").html(temp_options);
217
- }
218
- }
219
- }
220
-
221
- jQuery.ajax({
222
- url: ajaxurl,
223
- type: "GET",
224
- dataType: "json",
225
- cache: false,
226
- data: {
227
- 'action': 'b2s_get_select_mandant_user',
228
- 'networkAuthId': jQuery(this).attr('data-network-auth-id'),
229
- 'owner': jQuery(this).attr('data-connection-owner'),
230
- 'networkId': jQuery('#b2sNetworkId').val(),
231
- 'networkType': jQuery('#b2sNetworkType').val(),
232
- 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
233
- },
234
- error: function () {
235
- jQuery('.b2s-server-connection-fail').show();
236
- return false;
237
- },
238
- success: function (data) {
239
- if (data.result == true) {
240
- if (typeof data.ownerName != 'undefined') {
241
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
242
- jQuery('#b2s-connection-owner-name').text(data.ownerName);
243
- jQuery('.b2s-move-connection').show();
244
- jQuery('.b2s-connection-owner').show();
245
- jQuery('.b2s-assignment-area').show();
246
- } else if (typeof data.userSelect != 'undefined' && typeof data.assignList != 'undefined') {
247
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
248
- jQuery('#b2s-connection-assign-select').html(data.userSelect);
249
- jQuery('.b2s-network-assign-list').html(data.assignList);
250
- if (jQuery('#b2s-approved-user-list li').length <= 1) {
251
- jQuery('#b2s-approved-user-list').hide();
252
- } else {
253
- jQuery('#b2s-approved-user-list').show();
254
- }
255
- if (jQuery('#b2s-select-assign-user').html() == '') {
256
- jQuery('#b2s-select-assign-user').attr('disabled', true);
257
- jQuery('#b2s-assign-network-user-auth').attr('disabled', true);
258
- jQuery('.b2s-network-assign-option').hide();
259
- jQuery('#b2s-assign-info').hide();
260
- jQuery('#b2s-no-assign-user').show();
261
- } else {
262
- jQuery('#b2s-select-assign-user').removeAttr('disabled');
263
- jQuery('#b2s-assign-network-user-auth').removeAttr('disabled');
264
- jQuery('.b2s-network-assign-option').show();
265
- jQuery('#b2s-no-assign-user').hide();
266
- jQuery('#b2s-assign-info').show();
267
- }
268
- jQuery('.b2s-move-connection').show();
269
- jQuery('.b2s-connection-assign').show();
270
- jQuery('.b2s-assignment-area').show();
271
- } else {
272
- jQuery('.b2s-assign-error[data-error-reason="default"]').show();
273
- jQuery('.b2s-connection-assign').show();
274
- jQuery('.b2s-assignment-area').show();
275
- }
276
-
277
- } else {
278
- if (data.error == 'nonce') {
279
- jQuery('.b2s-nonce-check-fail').show();
280
- }
281
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
282
- jQuery('.b2s-assign-error[data-error-reason="default"]').show();
283
- jQuery('.b2s-connection-assign').show();
284
- jQuery('.b2s-assignment-area').show();
285
- }
286
- return false;
287
- }
288
- });
289
- return false;
290
- });
291
-
292
jQuery(document).on('click', '#b2s-move-user-auth-to-profile', function () {
293
- jQuery('.b2s-move-connection').hide();
294
- jQuery('#b2s-move-connection-failed').hide();
295
- jQuery('.b2s-connection-assign').hide();
296
- jQuery('.b2s-assignment-area').hide();
297
jQuery('.b2s-assign-error').hide();
298
- jQuery('.b2s-loading-area-manage-auth-team-modal').show();
299
300
var authId = jQuery('#b2sUserAuthId').val();
301
var mandantId = jQuery('#b2s-move-connection-select').val();
@@ -313,14 +186,14 @@ jQuery(document).on('click', '#b2s-move-user-auth-to-profile', function () {
313
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
314
},
315
error: function () {
316
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
317
jQuery('.b2s-server-connection-fail').show();
318
return false;
319
},
320
success: function (data) {
321
if (data.result == true) {
322
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
323
- jQuery('#b2s-manage-auth-team-modal').modal('hide');
324
//change show all entry
325
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);
326
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);
@@ -390,7 +263,9 @@ jQuery(document).on('click', '#b2s-move-user-auth-to-profile', function () {
390
if (data.error == 'nonce') {
391
jQuery('.b2s-nonce-check-fail').show();
392
}
393
- jQuery('#b2s-move-connection-failed').show();
394
}
395
return false;
396
}
@@ -402,12 +277,12 @@ jQuery(document).on('click', '#b2s-assign-network-user-auth', function () {
402
if (jQuery('#b2s-select-assign-user').val() <= 0) {
403
return false;
404
}
405
- jQuery('.b2s-move-connection').hide();
406
- jQuery('#b2s-move-connection-failed').hide();
407
jQuery('.b2s-connection-assign').hide();
408
jQuery('.b2s-assignment-area').hide();
409
jQuery('.b2s-assign-error').hide();
410
- jQuery('.b2s-loading-area-manage-auth-team-modal').show();
411
412
var authId = jQuery('#b2sUserAuthId').val();
413
var assignBlogUserId = jQuery('#b2s-select-assign-user').val();
@@ -422,19 +297,20 @@ jQuery(document).on('click', '#b2s-assign-network-user-auth', function () {
422
'assignBlogUserId': assignBlogUserId,
423
'optionBestTimes': jQuery('#b2s-network-assign-option-best-times').is(':checked'),
424
'optionPostingTemplate': jQuery('#b2s-network-assign-option-posting-template').is(':checked'),
425
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
426
},
427
error: function () {
428
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
429
jQuery('.b2s-assign-error[data-error-reason="default"]').show();
430
- jQuery('.b2s-move-connection').show();
431
jQuery('.b2s-connection-assign').show();
432
jQuery('.b2s-assignment-area').show();
433
return false;
434
},
435
success: function (data) {
436
if (data.result == true) {
437
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
438
jQuery('#b2s-approved-user-list').append(data.newListEntry);
439
jQuery('#b2s-approved-user-list').show();
440
jQuery('#b2s-select-assign-user option[value="' + assignBlogUserId + '"]').remove();
@@ -450,9 +326,9 @@ jQuery(document).on('click', '#b2s-assign-network-user-auth', function () {
450
}
451
jQuery('.b2s-assign-error[data-error-reason="' + data.error_reason + '"]').show();
452
}
453
- jQuery('.b2s-loading-area-manage-auth-team-modal').hide();
454
- jQuery('.b2s-move-connection').show();
455
jQuery('.b2s-connection-assign').show();
456
jQuery('.b2s-assignment-area').show();
457
return false;
458
}
@@ -570,6 +446,7 @@ jQuery(document).on('click', '#b2s-delete-network-sched-post', function () {
570
571
jQuery(document).on('click', '.b2s-network-item-auth-list-btn-delete', function () {
572
jQuery('.b2s-loading-area').show();
573
jQuery('.b2s-network-auth-info').hide();
574
jQuery('#b2s-network-delete-auth').modal('show');
575
jQuery('#b2s-delete-network-auth-id').val(jQuery(this).attr('data-network-auth-id'));
@@ -652,7 +529,7 @@ jQuery(document).on('click', '.b2s-btn-network-delete-auth-show-post-btn', funct
652
jQuery(document).on('click', '.b2s-btn-network-delete-auth-confirm-btn', function () {
653
jQuery('.b2s-network-auth-area').hide();
654
jQuery('.b2s-loading-area').show();
655
- jQuery('#b2s-manage-auth-team-modal').modal('hide');
656
jQuery('#b2s-network-delete-auth').modal('hide');
657
jQuery('.b2s-server-connection-fail').hide();
658
jQuery.ajax({
@@ -790,10 +667,17 @@ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandan
790
typ = new Array('Profil', 'Seite', 'Gruppe');
791
days = 'Tage';
792
}
793
//NEW
794
if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"]').length == 0) {
795
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 + "'>";
796
- html += '<div class="pull-left"><span class="b2s-network-item-auth-type">' + typ[networkType] + '</span>: ';
797
html += '<span class="b2s-network-item-auth-user-name">' + displayName + '</span>';
798
if (mandandId >= 0) {
799
var mandantName = jQuery(".b2s-network-mandant-select option:selected").text();
@@ -985,7 +869,7 @@ jQuery(document).on('click', '.b2s-edit-template-btn', function () {
985
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
986
},
987
error: function () {
988
- //TODO Fehlermeldung
989
return false;
990
},
991
success: function (data) {
@@ -1309,7 +1193,7 @@ jQuery(document).on('click', '.b2s-auth-network-6-login-btn', function () {
1309
jQuery('.b2s-loading-area').hide();
1310
jQuery('.b2s-auth-network-6-login-area').show();
1311
jQuery('.b2s-auth-network-6-login-btn').show();
1312
- if(jqXHR.status == 403) {
1313
jQuery('.b2s-auth-network-6-info[data-info="error_code_403"]').show();
1314
} else {
1315
jQuery('.b2s-auth-network-6-info[data-info="default"]').show();
@@ -1364,7 +1248,7 @@ jQuery(document).on('click', '.b2s-auth-network-6-confirm-btn', function () {
1364
jQuery('.b2s-loading-area').hide();
1365
jQuery('.b2s-auth-network-6-login-area').show();
1366
jQuery('.b2s-auth-network-6-confirm-btn').show();
1367
- if(jqXHR.status == 403) {
1368
jQuery('.b2s-auth-network-6-info[data-info="error_code_403"]').show();
1369
} else {
1370
jQuery('.b2s-auth-network-6-info[data-info="default"]').show();
@@ -1445,4 +1329,249 @@ jQuery(".b2s-auth-network-6-reveal").mouseup(function () {
1445
jQuery(".b2s-auth-network-6-reveal").mouseout(function () {
1446
jQuery("#b2s-auth-network-6-password").replaceWith(jQuery('#b2s-auth-network-6-password').clone().attr('type', 'password'));
1447
});
1448
- // END Pinterest
15
jQuery('.b2s-network-item-auth-list[data-network-count="true"]').each(function () {
16
jQuery('.b2s-network-auth-count-current[data-network-id="' + jQuery(this).attr("data-network-id") + '"').text(jQuery(this).children('li').length - 1);
17
});
18
});
19
20
function init() {
21
var showMeridian = true;
22
if (jQuery('#b2sUserLang').val() == 'de') {
164
return true;
165
});
166
167
jQuery(document).on('click', '#b2s-move-user-auth-to-profile', function () {
168
+ jQuery('.b2s-network-auth-settings-content').hide();
169
+ jQuery('.b2s-move-connection-error').hide();
170
jQuery('.b2s-assign-error').hide();
171
+ jQuery('.b2s-loading-area').show();
172
173
var authId = jQuery('#b2sUserAuthId').val();
174
var mandantId = jQuery('#b2s-move-connection-select').val();
186
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
187
},
188
error: function () {
189
+ jQuery('.b2s-loading-area').hide();
190
jQuery('.b2s-server-connection-fail').show();
191
return false;
192
},
193
success: function (data) {
194
if (data.result == true) {
195
+ jQuery('.b2s-loading-area').hide();
196
+ jQuery('#b2s-edit-network-auth-settings').modal('hide');
197
//change show all entry
198
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);
199
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);
263
if (data.error == 'nonce') {
264
jQuery('.b2s-nonce-check-fail').show();
265
}
266
+ jQuery('.b2s-loading-area').hide();
267
+ jQuery('.b2s-network-auth-settings-content').show();
268
+ jQuery('.b2s-move-connection-error').show();
269
}
270
return false;
271
}
277
if (jQuery('#b2s-select-assign-user').val() <= 0) {
278
return false;
279
}
280
+ jQuery('.b2s-network-auth-settings-content').hide();
281
+ jQuery('.b2s-move-connection-error').hide();
282
jQuery('.b2s-connection-assign').hide();
283
jQuery('.b2s-assignment-area').hide();
284
jQuery('.b2s-assign-error').hide();
285
+ jQuery('.b2s-loading-area').show();
286
287
var authId = jQuery('#b2sUserAuthId').val();
288
var assignBlogUserId = jQuery('#b2s-select-assign-user').val();
297
'assignBlogUserId': assignBlogUserId,
298
'optionBestTimes': jQuery('#b2s-network-assign-option-best-times').is(':checked'),
299
'optionPostingTemplate': jQuery('#b2s-network-assign-option-posting-template').is(':checked'),
300
+ 'optionUrlParameter': jQuery('#b2s-network-assign-option-url-parameter').is(':checked'),
301
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
302
},
303
error: function () {
304
+ jQuery('.b2s-loading-area').hide();
305
jQuery('.b2s-assign-error[data-error-reason="default"]').show();
306
+ jQuery('.b2s-network-auth-settings-content').show();
307
jQuery('.b2s-connection-assign').show();
308
jQuery('.b2s-assignment-area').show();
309
return false;
310
},
311
success: function (data) {
312
if (data.result == true) {
313
+ jQuery('.b2s-loading-area').hide();
314
jQuery('#b2s-approved-user-list').append(data.newListEntry);
315
jQuery('#b2s-approved-user-list').show();
316
jQuery('#b2s-select-assign-user option[value="' + assignBlogUserId + '"]').remove();
326
}
327
jQuery('.b2s-assign-error[data-error-reason="' + data.error_reason + '"]').show();
328
}
329
+ jQuery('.b2s-loading-area').hide();
330
jQuery('.b2s-connection-assign').show();
331
+ jQuery('.b2s-network-auth-settings-content').show();
332
jQuery('.b2s-assignment-area').show();
333
return false;
334
}
446
447
jQuery(document).on('click', '.b2s-network-item-auth-list-btn-delete', function () {
448
jQuery('.b2s-loading-area').show();
449
+ jQuery('.b2s-network-auth-settings-content').hide();
450
jQuery('.b2s-network-auth-info').hide();
451
jQuery('#b2s-network-delete-auth').modal('show');
452
jQuery('#b2s-delete-network-auth-id').val(jQuery(this).attr('data-network-auth-id'));
529
jQuery(document).on('click', '.b2s-btn-network-delete-auth-confirm-btn', function () {
530
jQuery('.b2s-network-auth-area').hide();
531
jQuery('.b2s-loading-area').show();
532
+ jQuery('#b2s-edit-network-auth-settings').modal('hide');
533
jQuery('#b2s-network-delete-auth').modal('hide');
534
jQuery('.b2s-server-connection-fail').hide();
535
jQuery.ajax({
667
typ = new Array('Profil', 'Seite', 'Gruppe');
668
days = 'Tage';
669
}
670
+
671
+ var networkTypeName = typ[networkType];
672
+ //Tumblr
673
+ if (networkId == 4) {
674
+ networkTypeName = 'Blog';
675
+ }
676
+
677
//NEW
678
if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"]').length == 0) {
679
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 + "'>";
680
+ html += '<div class="pull-left"><span class="b2s-network-item-auth-type">' + networkTypeName + '</span>: ';
681
html += '<span class="b2s-network-item-auth-user-name">' + displayName + '</span>';
682
if (mandandId >= 0) {
683
var mandantName = jQuery(".b2s-network-mandant-select option:selected").text();
869
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
870
},
871
error: function () {
872
+ jQuery('.b2s-server-connection-fail').show();
873
return false;
874
},
875
success: function (data) {
1193
jQuery('.b2s-loading-area').hide();
1194
jQuery('.b2s-auth-network-6-login-area').show();
1195
jQuery('.b2s-auth-network-6-login-btn').show();
1196
+ if (jqXHR.status == 403) {
1197
jQuery('.b2s-auth-network-6-info[data-info="error_code_403"]').show();
1198
} else {
1199
jQuery('.b2s-auth-network-6-info[data-info="default"]').show();
1248
jQuery('.b2s-loading-area').hide();
1249
jQuery('.b2s-auth-network-6-login-area').show();
1250
jQuery('.b2s-auth-network-6-confirm-btn').show();
1251
+ if (jqXHR.status == 403) {
1252
jQuery('.b2s-auth-network-6-info[data-info="error_code_403"]').show();
1253
} else {
1254
jQuery('.b2s-auth-network-6-info[data-info="default"]').show();
1329
jQuery(".b2s-auth-network-6-reveal").mouseout(function () {
1330
jQuery("#b2s-auth-network-6-password").replaceWith(jQuery('#b2s-auth-network-6-password').clone().attr('type', 'password'));
1331
});
1332
+ // END Pinterest
1333
+
1334
+ //START Network Auth Settings
1335
+ jQuery(document).on('click', '.b2s-network-auth-settings-btn', function () {
1336
+ jQuery('#b2s-edit-network-auth-settings').modal('show');
1337
+ if (jQuery('#b2sUserVersion').val() >= 3) {
1338
+
1339
+ jQuery('.b2s-network-auth-settings-content').hide();
1340
+ jQuery('.b2s-loading-area').show();
1341
+
1342
+ jQuery('.b2s-move-connection-error').hide();
1343
+ jQuery('.b2s-connection-assign').hide();
1344
+ jQuery('.b2s-assignment-area').hide();
1345
+ jQuery('.b2s-connection-owner').hide();
1346
+ jQuery('.b2s-assign-error').hide();
1347
+ jQuery('#b2s-no-assign-user').hide();
1348
+ jQuery('#b2s-assign-info').show();
1349
+ jQuery('.b2s-url-parameter-error').hide();
1350
+ jQuery('.b2s-url-parameter-content').show();
1351
+
1352
+ jQuery('#b2sUserAuthId').val(jQuery(this).attr('data-network-auth-id'));
1353
+ jQuery('#b2sOldMandantId').val(jQuery(this).attr('data-network-mandant-id'));
1354
+ jQuery('#b2sNetworkId').val(jQuery(this).attr('data-network-id'));
1355
+ jQuery('#b2sNetworkType').val(jQuery(this).attr('data-network-type'));
1356
+
1357
+ //Move connection to network mandant
1358
+ if (jQuery('#b2s-move-connection-select').length) {
1359
+ jQuery('#b2s-move-connection-select').html(jQuery('.b2s-network-mandant-select').html());
1360
+ jQuery("#b2s-move-connection-select option[value='-1']").remove();
1361
+ jQuery("#b2s-move-connection-select option[value='" + jQuery(this).attr('data-network-mandant-id') + "']").remove();
1362
+ if (jQuery(this).attr('data-network-mandant-id') <= 0) {
1363
+ if (jQuery('#b2s-network-select-more-client').length) {
1364
+ var temp_options = jQuery('#b2s-move-connection-select #b2s-network-select-more-client').html();
1365
+ jQuery("#b2s-move-connection-select optiongroup").remove();
1366
+ jQuery("#b2s-move-connection-select").html(temp_options);
1367
+ } else {
1368
+ jQuery('#b2s-move-connection-input').hide();
1369
+ jQuery('#b2s-move-connection-error').show();
1370
+ }
1371
+ } else {
1372
+ if (!jQuery('#b2s-move-connection-select #b2s-network-select-more-client option').length) {
1373
+ var temp_options = jQuery("#b2s-move-connection-select option[value='0']");
1374
+ jQuery("#b2s-move-connection-select optiongroup").remove();
1375
+ jQuery("#b2s-move-connection-select").html(temp_options);
1376
+ }
1377
+ }
1378
+ }
1379
+
1380
+ jQuery.ajax({
1381
+ url: ajaxurl,
1382
+ type: "GET",
1383
+ dataType: "json",
1384
+ cache: false,
1385
+ data: {
1386
+ 'action': 'b2s_get_network_auth_settings',
1387
+ 'networkAuthId': jQuery(this).attr('data-network-auth-id'),
1388
+ 'owner': jQuery(this).attr('data-connection-owner'),
1389
+ 'networkId': jQuery(this).attr('data-network-id'),
1390
+ 'networkType': jQuery('#b2sNetworkType').val(),
1391
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
1392
+ },
1393
+ error: function () {
1394
+ jQuery('.b2s-server-connection-fail').show();
1395
+ return false;
1396
+ },
1397
+ success: function (data) {
1398
+ if (data.result == true) {
1399
+ jQuery('.b2s-loading-area').hide();
1400
+ jQuery('.b2s-network-auth-settings-content').show();
1401
+ var result = JSON.parse(data.data);
1402
+
1403
+ //URL Parameter
1404
+ if (typeof result.urlParameter != 'undefined' && result.urlParameter.length > 0) {
1405
+ jQuery('.b2s-url-parameter-content').html(result.urlParameter);
1406
+ if (jQuery('.b2s-url-parameter-entry').length <= 0) {
1407
+ jQuery('.b2s-col-name').hide();
1408
+ }
1409
+ } else {
1410
+ jQuery('.b2s-url-parameter-error[data-error-reason="default"]').show();
1411
+ jQuery('.b2s-url-parameter-content').hide();
1412
+ }
1413
+
1414
+ //User Assign
1415
+ if (typeof result.ownerName != 'undefined') { //Case: network is assigned by other user
1416
+ jQuery('#b2s-connection-owner-name').text(result.ownerName);
1417
+ jQuery('.b2s-connection-owner').show();
1418
+ jQuery('.b2s-assignment-area').show();
1419
+ } else if (typeof result.userSelect != 'undefined' && typeof result.assignList != 'undefined') { //Case: user is network owner
1420
+ jQuery('#b2s-connection-assign-select').html(result.userSelect);
1421
+ jQuery('.b2s-network-assign-list').html(result.assignList);
1422
+ if (jQuery('#b2s-approved-user-list li').length <= 1) {
1423
+ jQuery('#b2s-approved-user-list').hide();
1424
+ } else {
1425
+ jQuery('#b2s-approved-user-list').show();
1426
+ }
1427
+ if (jQuery('#b2s-select-assign-user').html() == '') {
1428
+ jQuery('#b2s-select-assign-user').attr('disabled', true);
1429
+ jQuery('#b2s-assign-network-user-auth').attr('disabled', true);
1430
+ jQuery('.b2s-network-assign-option').hide();
1431
+ jQuery('#b2s-assign-info').hide();
1432
+ jQuery('#b2s-no-assign-user').show();
1433
+ } else {
1434
+ jQuery('#b2s-select-assign-user').removeAttr('disabled');
1435
+ jQuery('#b2s-assign-network-user-auth').removeAttr('disabled');
1436
+ jQuery('.b2s-network-assign-option').show();
1437
+ jQuery('#b2s-no-assign-user').hide();
1438
+ jQuery('#b2s-assign-info').show();
1439
+ }
1440
+ jQuery('.b2s-connection-assign').show();
1441
+ jQuery('.b2s-assignment-area').show();
1442
+ jQuery('.b2s-network-assign-list').show();
1443
+ jQuery('#b2s-connection-assign-select').show();
1444
+ } else {
1445
+ jQuery('.b2s-assign-error[data-error-reason="default"]').show();
1446
+ jQuery('.b2s-connection-assign').show();
1447
+ jQuery('.b2s-assignment-area').show();
1448
+ jQuery('#b2s-assign-network-user-auth').hide();
1449
+ jQuery('#b2s-assign-info').hide();
1450
+ jQuery('.b2s-network-assign-option').hide();
1451
+ jQuery('.b2s-network-assign-list').hide();
1452
+ jQuery('#b2s-connection-assign-select').hide();
1453
+ }
1454
+
1455
+ } else {
1456
+ jQuery('#b2s-edit-network-auth-settings').modal('hide');
1457
+ if(result.error == 'nonce') {
1458
+ jQuery('.b2s-nonce-check-fail').show();
1459
+ return false;
1460
+ }
1461
+ jQuery('.b2s-server-connection-fail').show();
1462
+ return false;
1463
+ }
1464
+ }
1465
+ });
1466
+ } else {
1467
+ jQuery('.b2s-loading-area').hide();
1468
+ }
1469
+ });
1470
+
1471
+ //START URL Parameter
1472
+ jQuery(document).on('click', '.b2s-url-parameter-add-btn', function () {
1473
+ jQuery('.b2s-col-name').show();
1474
+ var html = '<li class="b2s-url-parameter-entry row">';
1475
+ html += '<div class="col-md-5"><input class="form-control b2s-link-parameter-name" value=""></div>';
1476
+ html += '<div class="col-md-5"><input class="form-control b2s-link-parameter-value" value=""></div>';
1477
+ html += '<div class="col-md-1"><span aria-hidden="true" class="b2s-url-parameter-remove-btn text-danger">&times;</span></div>';
1478
+ html += '</li>';
1479
+ jQuery('.b2s-url-parameter-list').append(html);
1480
+ if (jQuery('.b2s-url-parameter-entry').length >= 10) {
1481
+ jQuery('.b2s-url-parameter-add-btn').hide();
1482
+ }
1483
+ });
1484
+
1485
+ jQuery(document).on('click', '.b2s-url-parameter-remove-btn', function () {
1486
+ jQuery(this).closest('li').remove();
1487
+ if (jQuery('.b2s-url-parameter-entry').length <= 0) {
1488
+ jQuery('.b2s-col-name').hide();
1489
+ }
1490
+ jQuery('.b2s-url-parameter-add-btn').show();
1491
+ });
1492
+
1493
+ jQuery(document).on('click', '.b2s-url-parameter-save-btn', function () {
1494
+ jQuery('.b2s-network-auth-settings-content').hide();
1495
+ jQuery('.b2s-loading-area').show();
1496
+ jQuery('.b2s-url-parameter-error').hide();
1497
+
1498
+ var urlParameter = {};
1499
+ jQuery('.b2s-url-parameter-entry').each(function () {
1500
+ if (jQuery(this).find('.b2s-link-parameter-name').val().length != 0 && jQuery(this).find('.b2s-link-parameter-value').val().length != 0) {
1501
+ urlParameter[jQuery(this).find('.b2s-link-parameter-name').val()] = jQuery(this).find('.b2s-link-parameter-value').val();
1502
+ }
1503
+ });
1504
+
1505
+ var originNetworkAuthId = jQuery(this).attr('data-network-auth-id');
1506
+
1507
+ var networks = [];
1508
+ if (jQuery('.b2s-url-parameter-for-all').is(':checked')) { //get all network connections
1509
+ jQuery('.b2s-network-details-container-list[data-mandant-id="-1"] .b2s-network-item-auth-list-li').each(function () {
1510
+ if (typeof jQuery(this).data('network-auth-id') != 'undefined') {
1511
+ networks.push({
1512
+ 'networkAuthId': jQuery(this).data('network-auth-id'),
1513
+ 'networkId': jQuery(this).data('network-id'),
1514
+ 'networkType': jQuery(this).data('network-type'),
1515
+ 'displayName': jQuery(this).find('.b2s-network-item-auth-user-name').text()
1516
+ });
1517
+ }
1518
+ });
1519
+ } else if (jQuery('.b2s-url-parameter-for-all-network').is(':checked')) { //get all network connections for specific network
1520
+ jQuery('.b2s-network-details-container-list[data-mandant-id="-1"] .b2s-network-item-auth-list-li[data-network-id="' + jQuery(this).data('network-id') + '"]').each(function () {
1521
+ if (typeof jQuery(this).data('network-auth-id') != 'undefined') {
1522
+ networks.push({
1523
+ 'networkAuthId': jQuery(this).data('network-auth-id'),
1524
+ 'networkId': jQuery(this).data('network-id'),
1525
+ 'networkType': jQuery(this).data('network-type'),
1526
+ 'displayName': jQuery(this).find('.b2s-network-item-auth-user-name').text()
1527
+ });
1528
+ }
1529
+ });
1530
+ } else { //only current network connection
1531
+ networks.push({
1532
+ 'networkAuthId': originNetworkAuthId,
1533
+ 'networkId': jQuery(this).data('network-id'),
1534
+ 'networkType': jQuery('.b2s-network-details-container-list[data-mandant-id="-1"] .b2s-network-item-auth-list-li[data-network-auth-id="' + originNetworkAuthId + '"]').data('network-type'),
1535
+ 'displayName': jQuery('.b2s-network-details-container-list[data-mandant-id="-1"] .b2s-network-item-auth-list-li[data-network-auth-id="' + originNetworkAuthId + '"]').find('.b2s-network-item-auth-user-name').text()
1536
+ });
1537
+ }
1538
+
1539
+ jQuery.ajax({
1540
+ url: ajaxurl,
1541
+ type: "POST",
1542
+ dataType: "json",
1543
+ cache: false,
1544
+ data: {
1545
+ 'action': 'b2s_save_url_parameter',
1546
+ 'originNetworkAuthId': originNetworkAuthId,
1547
+ 'networks': networks,
1548
+ 'networkId': jQuery(this).attr('data-network-id'),
1549
+ 'urlParameter': JSON.stringify(urlParameter),
1550
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
1551
+ },
1552
+ error: function () {
1553
+ jQuery('.b2s-server-connection-fail').show();
1554
+ return false;
1555
+ },
1556
+ success: function (data) {
1557
+ jQuery('.b2s-loading-area').hide();
1558
+ jQuery('.b2s-network-auth-settings-content').show();
1559
+ if (data.result == true) {
1560
+ if (data.html.length > 0) {
1561
+ jQuery('.b2s-url-parameter-content').html(data.html);
1562
+ if (jQuery('.b2s-url-parameter-entry').length <= 0) {
1563
+ jQuery('.b2s-col-name').hide();
1564
+ }
1565
+ }
1566
+ } else {
1567
+ if (data.error == 'nonce') {
1568
+ jQuery('.b2s-nonce-check-fail').show();
1569
+ } else {
1570
+ jQuery('.b2s-url-parameter-error[data-error-reason="save"]').show();
1571
+ }
1572
+ }
1573
+ }
1574
+ });
1575
+ });
1576
+ //END URL Parameter
1577
+ //END Network Auth Settings
assets/js/b2s/post.js CHANGED
@@ -197,7 +197,8 @@ function b2sSortFormSubmit(sched_dates) {
197
jQuery('.b2s-loading-area').show();
198
jQuery('.b2s-sort-result-area').hide();
199
jQuery('.b2s-sort-result-item-area').html("").hide();
200
- jQuery('.b2s-sort-pagination-area').html("").hide();
201
202
var currentType = jQuery('#b2sType').val();
203
if (currentType != "undefined") {
@@ -223,6 +224,8 @@ function b2sSortFormSubmit(sched_dates) {
223
'b2sSortPostShareStatus': jQuery('#b2sSortPostShareStatus').val(),
224
'b2sSortPostPublishDate': jQuery('#b2sSortPostPublishDate').val(),
225
'b2sUserLang': jQuery('#b2sUserLang').val(),
226
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
227
};
228
@@ -258,7 +261,10 @@ function b2sSortFormSubmit(sched_dates) {
258
jQuery('.b2s-loading-area').hide();
259
jQuery('.b2s-sort-result-area').show();
260
jQuery('.b2s-sort-result-item-area').html(data.content).show();
261
- jQuery('.b2s-sort-pagination-area').html(data.pagination).show();
262
263
//extern - Routing from dashboard
264
if (jQuery('#b2sPostBlogId').val() !== undefined) {
@@ -878,7 +884,7 @@ function checkSchedDateTime() {
878
//utc current time
879
var now = new Date();
880
//offset between utc und user
881
- var offset = (parseInt(now.getTimezoneOffset() / 60)) * (-1);
882
//enter hour to user time
883
var hour = parseInt(minParts3[0]) + timeZone + offset;
884
//calculate datetime in utc
@@ -1004,4 +1010,11 @@ jQuery(document).on('click', '.b2sFavoriteStar', function () {
1004
}
1005
});
1006
1007
});
197
jQuery('.b2s-loading-area').show();
198
jQuery('.b2s-sort-result-area').hide();
199
jQuery('.b2s-sort-result-item-area').html("").hide();
200
+ jQuery('.b2s-sort-pagination-content').html("");
201
+ jQuery('.b2s-sort-pagination-area').hide();
202
203
var currentType = jQuery('#b2sType').val();
204
if (currentType != "undefined") {
224
'b2sSortPostShareStatus': jQuery('#b2sSortPostShareStatus').val(),
225
'b2sSortPostPublishDate': jQuery('#b2sSortPostPublishDate').val(),
226
'b2sUserLang': jQuery('#b2sUserLang').val(),
227
+ 'b2sPostsPerPage': jQuery('#b2sPostsPerPage').val(),
228
+ 'b2sSortPostSharedBy': jQuery('#b2sSortPostSharedBy').val(),
229
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
230
};
231
261
jQuery('.b2s-loading-area').hide();
262
jQuery('.b2s-sort-result-area').show();
263
jQuery('.b2s-sort-result-item-area').html(data.content).show();
264
+ if(data.pagination != '') {
265
+ jQuery('.b2s-sort-pagination-content').html(data.pagination);
266
+ jQuery('.b2s-sort-pagination-area').show();
267
+ }
268
269
//extern - Routing from dashboard
270
if (jQuery('#b2sPostBlogId').val() !== undefined) {
884
//utc current time
885
var now = new Date();
886
//offset between utc und user
887
+ var offset = (parseInt(now.getTimezoneOffset() / 60)) * (-1);
888
//enter hour to user time
889
var hour = parseInt(minParts3[0]) + timeZone + offset;
890
//calculate datetime in utc
1010
}
1011
});
1012
1013
+ });
1014
+
1015
+ jQuery(document).on('click', '.b2s-post-per-page', function() {
1016
+ jQuery('#b2sPostsPerPage').val(jQuery(this).data('post-per-page'));
1017
+ jQuery('.b2s-post-per-page').addClass('btn-default').removeClass('btn-primary');
1018
+ jQuery(this).removeClass('btn-default').addClass('btn-primary');
1019
+ jQuery('#b2s-sort-submit-btn').trigger('click');
1020
});
assets/js/b2s/settings.js CHANGED
@@ -29,6 +29,8 @@ jQuery(window).on("load", function () {
29
30
//TOS Twitter 032018 - none multiple Accounts - User select once
31
checkNetworkTos(2);
32
33
});
34
@@ -98,11 +100,11 @@ function checkNetworkTos(networkId) {
98
var len = jQuery('.b2s-network-tos-check[data-network-id="' + networkId + '"]:checked').length;
99
if (len > 1) {
100
jQuery('.b2s-network-tos-auto-post-import-warning').show();
101
- jQuery('#b2s-auto-post-import-settings-btn').attr('disabled', 'disabled');
102
return false;
103
} else {
104
jQuery('.b2s-network-tos-auto-post-import-warning').hide();
105
- jQuery('#b2s-auto-post-import-settings-btn').attr('disabled', false);
106
return true;
107
}
108
}
@@ -189,13 +191,14 @@ jQuery(document).on('click', '.b2s-save-settings-pro-info', function () {
189
return false;
190
});
191
192
- jQuery(document).on('click', '#b2s-user-network-settings-short-url', function () {
193
jQuery('.b2s-settings-user-success').hide();
194
jQuery('.b2s-settings-user-error').hide();
195
jQuery('.b2s-server-connection-fail').hide();
196
-
197
- if (jQuery('#b2s-user-network-shortener-state[data-provider-id="0"]').val() == "0") {
198
- jQuery('.b2s-shortener-account-connect-btn[data-provider-id="0"]').trigger('click');
199
} else {
200
jQuery(".b2s-user-settings-area").hide();
201
jQuery(".b2s-loading-area").show();
@@ -207,7 +210,7 @@ jQuery(document).on('click', '#b2s-user-network-settings-short-url', function ()
207
cache: false,
208
data: {
209
'action': 'b2s_user_network_settings',
210
- 'short_url': jQuery('#b2s-user-network-settings-short-url').val(),
211
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
212
},
213
error: function () {
@@ -219,11 +222,10 @@ jQuery(document).on('click', '#b2s-user-network-settings-short-url', function ()
219
jQuery(".b2s-user-settings-area").show();
220
if (data.result == true) {
221
jQuery('.b2s-settings-user-success').show();
222
- jQuery('#b2s-user-network-settings-short-url').val(data.content);
223
- if (jQuery("#b2s-user-network-settings-short-url").is(":checked")) {
224
- jQuery('#b2s-user-network-settings-short-url').prop('checked', false);
225
} else {
226
- jQuery('#b2s-user-network-settings-short-url').prop('checked', true);
227
}
228
} else {
229
if(data.error == 'nonce') {
@@ -265,10 +267,12 @@ jQuery(document).on('click', '.b2s-shortener-account-delete-btn', function () {
265
jQuery(".b2s-user-settings-area").show();
266
if (data.result == true) {
267
jQuery('.b2s-user-network-shortener-account-detail[data-provider-id="' + provider_id + '"]').hide();
268
- jQuery('.b2s-shortener-account-connect-btn[data-provider-id="' + provider_id + '"]').css('display', 'inline-block');
269
- jQuery('#b2s-user-network-settings-short-url').prop('checked', false);
270
- jQuery('#b2s-user-network-settings-short-url').val("1");
271
- jQuery('#b2s-user-network-shortener-state[data-provider-id="0"]').val("0");
272
} else {
273
if(data.error == 'nonce') {
274
jQuery('.b2s-nonce-check-fail').show();
@@ -621,11 +625,11 @@ window.addEventListener('message', function (e) {
621
622
function loginSuccessShortener(providerId, displayName) {
623
jQuery('.b2s-user-network-shortener-account-detail[data-provider-id="' + providerId + '"]').css('display', 'inline-block');
624
- jQuery('#b2s-shortener-account-display-name[data-provider-id="' + providerId + '"]').html(displayName);
625
jQuery('.b2s-shortener-account-connect-btn[data-provider-id="' + providerId + '"]').hide();
626
- jQuery('#b2s-user-network-settings-short-url').prop("checked", true);
627
- jQuery('#b2s-user-network-settings-short-url').val("0");
628
- jQuery('#b2s-user-network-shortener-state[data-provider-id="0"]').val("1");
629
}
630
631
jQuery(document).on('click', '.b2sInfoTimeZoneModalBtn', function () {
@@ -648,4 +652,89 @@ jQuery(document).on('click', '.b2sInfoAutoPosterMModalBtn', function () {
648
});
649
jQuery(document).on('click', '.b2sInfoAutoPosterAModalBtn', function () {
650
jQuery('#b2sInfoAutoPosterAModal').modal('show');
651
});
29
30
//TOS Twitter 032018 - none multiple Accounts - User select once
31
checkNetworkTos(2);
32
+
33
+ jQuery('#b2s-auto-post-profil-dropdown').trigger('change');
34
35
});
36
100
var len = jQuery('.b2s-network-tos-check[data-network-id="' + networkId + '"]:checked').length;
101
if (len > 1) {
102
jQuery('.b2s-network-tos-auto-post-import-warning').show();
103
+ jQuery('#b2s-auto-post-settings-btn').attr('disabled', 'disabled');
104
return false;
105
} else {
106
jQuery('.b2s-network-tos-auto-post-import-warning').hide();
107
+ jQuery('#b2s-auto-post-settings-btn').attr('disabled', false);
108
return true;
109
}
110
}
191
return false;
192
});
193
194
+ jQuery(document).on('click', '.b2s-user-network-settings-short-url', function () {
195
jQuery('.b2s-settings-user-success').hide();
196
jQuery('.b2s-settings-user-error').hide();
197
jQuery('.b2s-server-connection-fail').hide();
198
+
199
+ var provider_id = jQuery(this).data('provider-id');
200
+ if (jQuery('.b2s-user-network-shortener-state[data-provider-id="'+provider_id+'"]').val() == "0") {
201
+ jQuery('.b2s-shortener-account-connect-btn[data-provider-id="'+provider_id+'"]').trigger('click');
202
} else {
203
jQuery(".b2s-user-settings-area").hide();
204
jQuery(".b2s-loading-area").show();
210
cache: false,
211
data: {
212
'action': 'b2s_user_network_settings',
213
+ 'short_url': jQuery('.b2s-user-network-settings-short-url[data-provider-id="'+provider_id+'"]').val(),
214
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
215
},
216
error: function () {
222
jQuery(".b2s-user-settings-area").show();
223
if (data.result == true) {
224
jQuery('.b2s-settings-user-success').show();
225
+ if (jQuery('.b2s-user-network-settings-short-url[data-provider-id="'+provider_id+'"]').is(":checked")) {
226
+ jQuery('.b2s-user-network-settings-short-url[data-provider-id="'+provider_id+'"]').prop('checked', false);
227
} else {
228
+ jQuery('.b2s-user-network-settings-short-url[data-provider-id="'+provider_id+'"]').prop('checked', true);
229
}
230
} else {
231
if(data.error == 'nonce') {
267
jQuery(".b2s-user-settings-area").show();
268
if (data.result == true) {
269
jQuery('.b2s-user-network-shortener-account-detail[data-provider-id="' + provider_id + '"]').hide();
270
+ jQuery('.b2s-user-network-shortener-connect[data-provider-id="' + provider_id + '"]').css('display', 'inline-block');
271
+ if(jQuery('.b2s-user-network-settings-short-url[data-provider-id="'+provider_id+'"]').prop('checked') == true) {
272
+ jQuery('.b2s-user-network-settings-short-url[data-provider-id="'+provider_id+'"]').prop('checked', false);
273
+ jQuery('.b2s-user-network-settings-short-url[data-provider-id="-1"]').prop('checked', true);
274
+ }
275
+ jQuery('.b2s-user-network-shortener-state[data-provider-id="'+provider_id+'"]').val("0");
276
} else {
277
if(data.error == 'nonce') {
278
jQuery('.b2s-nonce-check-fail').show();
625
626
function loginSuccessShortener(providerId, displayName) {
627
jQuery('.b2s-user-network-shortener-account-detail[data-provider-id="' + providerId + '"]').css('display', 'inline-block');
628
+ jQuery('.b2s-shortener-account-display-name[data-provider-id="' + providerId + '"]').html(displayName);
629
jQuery('.b2s-shortener-account-connect-btn[data-provider-id="' + providerId + '"]').hide();
630
+ jQuery('.b2s-user-network-settings-short-url[data-provider-id="' + providerId + '"]').prop("checked", true);
631
+ jQuery('.b2s-user-network-settings-short-url[data-provider-id="' + providerId + '"]').val("0");
632
+ jQuery('.b2s-user-network-shortener-state[data-provider-id="'+providerId+'"]').val("1");
633
}
634
635
jQuery(document).on('click', '.b2sInfoTimeZoneModalBtn', function () {
652
});
653
jQuery(document).on('click', '.b2sInfoAutoPosterAModalBtn', function () {
654
jQuery('#b2sInfoAutoPosterAModal').modal('show');
655
+ });
656
+ jQuery(document).on('click', '.b2sTwitterInfoModalBtn', function () {
657
+ jQuery('#b2sTwitterInfoModal').modal('show');
658
+ });
659
+
660
+ jQuery(document).on('change', '.b2s-auto-post-area-toggle', function() {
661
+ if(jQuery(this).is(':checked')) {
662
+ jQuery('.b2s-auto-post-area[data-area-type="'+jQuery(this).data('area-type')+'"]').show();
663
+ } else {
664
+ jQuery('.b2s-auto-post-area[data-area-type="'+jQuery(this).data('area-type')+'"]').hide();
665
+ }
666
+ });
667
+
668
+ jQuery(document).on('change', '#b2s-auto-post-profil-dropdown', function () {
669
+ jQuery('.b2s-auto-post-error[data-error-reason="no-auth-in-mandant"]').hide();
670
+ var tos = false;
671
+ if (jQuery('#b2s-auto-post-profil-data-' + jQuery(this).val()).val() == "") {
672
+ tos = true;
673
+ } else {
674
+ //TOS Twitter Check
675
+ var len = jQuery('#b2s-auto-post-profil-dropdown-twitter').children('option[data-mandant-id="' + jQuery(this).val() + '"]').length;
676
+ if (len >= 1) {
677
+ jQuery('.b2s-auto-post-twitter-profile').show();
678
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').prop('disabled', false);
679
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').show();
680
+ jQuery('#b2s-auto-post-profil-dropdown-twitter option').attr("disabled", "disabled");
681
+ jQuery('#b2s-auto-post-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]').attr("disabled", false);
682
+ jQuery('#b2s-auto-post-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]:first').attr("selected", "selected");
683
+ } else {
684
+ tos = true;
685
+ }
686
+
687
+ }
688
+ //TOS Twitter 032018
689
+ if (tos) {
690
+ jQuery('.b2s-auto-post-twitter-profile').hide();
691
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').prop('disabled', 'disabled');
692
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').hide();
693
+ }
694
+ });
695
+
696
+ jQuery(document).on('click', '#b2s-auto-post-settings-btn', function() {
697
+ var submit = true;
698
+ if(jQuery('.b2s-auto-post-area-toggle[data-area-type="manuell"]').is(':checked')) {
699
+ var publish = jQuery('.b2s-post-type-item-publish').is(':checked');
700
+ var update = jQuery('.b2s-post-type-item-update').is(':checked');
701
+ if(publish == false && update == false) {
702
+ submit = false;
703
+ jQuery('.b2s-auto-post-error[data-error-reason="no-post-type"]').show();
704
+ jQuery('.b2s-post-type-item-publish').css('border-color', 'red');
705
+ jQuery('.b2s-post-type-item-update').css('border-color', 'red');
706
+ }
707
+ if(jQuery('#b2s-auto-post-profil-data-'+jQuery('#b2s-auto-post-profil-dropdown').val()).val() == "") {
708
+ submit = false;
709
+ jQuery('.b2s-auto-post-error[data-error-reason="no-auth-in-mandant"]').show();
710
+ }
711
+ }
712
+
713
+ if(jQuery('.b2s-auto-post-area-toggle[data-area-type="import"]').is(':checked')) {
714
+ if(jQuery('.b2s-network-tos-check').is(':checked') == false) {
715
+ submit = false;
716
+ jQuery('.b2s-auto-post-error[data-error-reason="import-no-auth"]').show();
717
+ jQuery('.b2s-network-tos-check').css('border-color', 'red');
718
+ }
719
+ }
720
+
721
+ if(submit) {
722
+ jQuery('#b2s-user-network-settings-auto-post-own').submit();
723
+ }
724
+ });
725
+
726
+ jQuery(document).on('change', '.b2s-post-type-item-publish', function() {
727
+ jQuery('.b2s-auto-post-error[data-error-reason="no-post-type"]').hide();
728
+ jQuery('.b2s-post-type-item-publish').css('border-color', '');
729
+ jQuery('.b2s-post-type-item-update').css('border-color', '');
730
+ });
731
+ jQuery(document).on('change', '.b2s-post-type-item-update', function() {
732
+ jQuery('.b2s-auto-post-error[data-error-reason="no-post-type"]').hide();
733
+ jQuery('.b2s-post-type-item-publish').css('border-color', '');
734
+ jQuery('.b2s-post-type-item-update').css('border-color', '');
735
+ });
736
+
737
+ jQuery(document).on('change', '.b2s-network-tos-check', function() {
738
+ jQuery('.b2s-auto-post-error[data-error-reason="import-no-auth"]').hide();
739
+ jQuery('.b2s-network-tos-check').css('border-color', '');
740
});
assets/js/b2s/ship.js CHANGED
@@ -2,6 +2,7 @@ jQuery.noConflict();
2
3
var b2sTosXingGroupCount = 0;
4
var currentOGImage = '';
5
6
jQuery(document).on('heartbeat-send', function (e, data) {
7
data['b2s_heartbeat'] = 'b2s_listener';
@@ -38,7 +39,7 @@ jQuery(document).on('click', '.btn-toggle-menu', function () {
38
}
39
});
40
41
- jQuery.sceditor.plugins.xhtml.allowedTags = ['h1', 'h2', 'p', 'br', 'i', 'b', 'a', 'img'];
42
jQuery.sceditor.command.set(
43
"h1", {
44
exec: function () {
@@ -448,7 +449,7 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-user', function () {
448
jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + network_auth_id + '"]').val('1').trigger("change");
449
}
450
jQuery('.b2s-post-item-details-release-input-time[data-network-auth-id="' + network_auth_id + '"][data-network-count="0"]').val(time);
451
- jQuery('.b2s-post-item-details-release-input-time[data-network-auth-id="' + network_auth_id + '"][data-network-count="0"]').timepicker('setTime', time);
452
var hours = time.substring(0, 2);
453
if (lang == "en") {
454
var timeparts = time.split(' ');
@@ -875,7 +876,18 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
875
}
876
});
877
jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
878
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
879
} else {
880
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
881
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
@@ -929,7 +941,6 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
929
jQuery('.b2s-empty-area').hide();
930
loadingDummyShow(networkAuthId, jQuery(this).attr('data-network-id'));
931
jQuery('.b2s-server-connection-fail').hide();
932
- var networkId = jQuery(this).attr('data-network-id');
933
var legacyMode = jQuery('#isLegacyMode').val();
934
if (legacyMode == "1") {
935
legacyMode = false; // loading is sync (stack)
@@ -1049,7 +1060,6 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
1049
if (jQuery('#b2s_blog_default_image').val() != "") {
1050
if (jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + data.networkAuthId + '"]').length > 0) {
1051
var networkNotAllowGif = jQuery('#b2sNotAllowGif').val().split(";");
1052
- var networkId = jQuery('.b2s-network-select-btn[data-network-auth-id="' + networkAuthId + '"]').attr('data-network-id');
1053
var attachmenUrl = jQuery('#b2s_blog_default_image').val();
1054
var attachmenUrlExt = attachmenUrl.substr(attachmenUrl.lastIndexOf('.') + 1);
1055
attachmenUrlExt = attachmenUrlExt.toLowerCase();
@@ -1115,7 +1125,19 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
1115
});
1116
jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + data.networkAuthId + '"]').show();
1117
if (data.draft == false) {
1118
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + data.networkAuthId + '"]').trigger("click");
1119
}
1120
} else {
1121
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
@@ -1545,7 +1567,7 @@ jQuery(document).on('change', '.b2s-post-item-details-release-input-date-select'
1545
jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val(content);
1546
1547
}
1548
-
1549
checkSchedDateTime(jQuery(this).attr('data-network-auth-id'));
1550
if (dataNetworkCount == 2) {
1551
jQuery('.b2s-post-item-details-release-input-add[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"][data-network-count="0"]').hide();
@@ -1829,6 +1851,7 @@ jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
1829
1830
jQuery(document).on('click', '.b2s-image-change-meta-network', function () {
1831
currentOGImage = jQuery('input[name=image_url]:checked').val();
1832
if (jQuery('.b2s-input-hidden[name="action"][value="b2s_edit_save_post"]').length > 0) { //sched or calender view
1833
jQuery('.b2s-image-change-this-network').trigger('click');
1834
} else { //ship view
@@ -1910,6 +1933,7 @@ jQuery(document).on('click', '.b2s-image-remove-btn', function () {
1910
}
1911
});
1912
currentOGImage = '';
1913
}
1914
//customize sched content
1915
jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + networkAuthId + '"]').attr('src', defaultImage);
@@ -2108,6 +2132,7 @@ jQuery(document).on('click', '.b2s-image-change-all-network', function () {
2108
jQuery('#b2s-network-select-image').modal('hide');
2109
2110
currentOGImage = jQuery('input[name=image_url]:checked').val();
2111
if (typeof currentOGImage !== typeof undefined) {
2112
var attachmenUrlExt = currentOGImage.substr(currentOGImage.lastIndexOf('.') + 1);
2113
attachmenUrlExt = attachmenUrlExt.toLowerCase();
@@ -2251,7 +2276,7 @@ jQuery.validator.classRuleSettings.unique = {
2251
unique: true
2252
};
2253
jQuery.validator.addMethod("checkTags", function (value, element, test) {
2254
- var allowed_tags = ['p', 'h1', 'h2', 'br', 'i', 'b', 'a', 'img'];
2255
var tags = value.match(/(<([^>]+)>)/ig);
2256
if (tags !== null && tags.length > 0) {
2257
if (jQuery(element).hasClass('b2s-post-item-details-item-message-input-allow-html')) {
@@ -3425,7 +3450,7 @@ function checkSchedDateTime(dataNetworkAuthId) {
3425
//utc current time
3426
var now = new Date();
3427
//offset between utc und user
3428
- var offset = (parseInt(now.getTimezoneOffset() / 60)) * (-1);
3429
//enter hour to user time
3430
var hour = parseInt(minParts3[0]) + timeZone + offset;
3431
//calculate datetime in utc
2
3
var b2sTosXingGroupCount = 0;
4
var currentOGImage = '';
5
+ var changedOGImage = false;
6
7
jQuery(document).on('heartbeat-send', function (e, data) {
8
data['b2s_heartbeat'] = 'b2s_listener';
39
}
40
});
41
42
+ jQuery.sceditor.plugins.xhtml.allowedTags = ['h1', 'h2', 'p', 'br', 'i', 'em', 'b', 'a', 'img'];
43
jQuery.sceditor.command.set(
44
"h1", {
45
exec: function () {
449
jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + network_auth_id + '"]').val('1').trigger("change");
450
}
451
jQuery('.b2s-post-item-details-release-input-time[data-network-auth-id="' + network_auth_id + '"][data-network-count="0"]').val(time);
452
+ jQuery('.b2s-post-item-details-release-input-time[data-network-auth-id="' + network_auth_id + '"][data-network-count="0"]').timepicker('setTime', new Date(today.getFullYear(), today.getMonth(), today.getDate(), time.slice(0, 2), time.slice(-2)));
453
var hours = time.substring(0, 2);
454
if (lang == "en") {
455
var timeparts = time.split(' ');
876
}
877
});
878
jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
879
+ if(jQuery('.b2s-network-select-btn[data-network-auth-id="'+networkAuthId+'"]').data('meta-type') == 'og' && changedOGImage == true) {
880
+ if (currentOGImage != "") {
881
+ jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + networkAuthId + '"]').attr('src', currentOGImage);
882
+ jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + networkAuthId + '"]').val(currentOGImage);
883
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').show();
884
+ } else {
885
+ jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + networkAuthId + '"]').attr('src', jQuery('#b2sDefaultNoImage').val());
886
+ jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('#b2sDefaultNoImage').val());
887
+ }
888
+ } else {
889
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
890
+ }
891
} else {
892
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
893
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
941
jQuery('.b2s-empty-area').hide();
942
loadingDummyShow(networkAuthId, jQuery(this).attr('data-network-id'));
943
jQuery('.b2s-server-connection-fail').hide();
944
var legacyMode = jQuery('#isLegacyMode').val();
945
if (legacyMode == "1") {
946
legacyMode = false; // loading is sync (stack)
1060
if (jQuery('#b2s_blog_default_image').val() != "") {
1061
if (jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + data.networkAuthId + '"]').length > 0) {
1062
var networkNotAllowGif = jQuery('#b2sNotAllowGif').val().split(";");
1063
var attachmenUrl = jQuery('#b2s_blog_default_image').val();
1064
var attachmenUrlExt = attachmenUrl.substr(attachmenUrl.lastIndexOf('.') + 1);
1065
attachmenUrlExt = attachmenUrlExt.toLowerCase();
1125
});
1126
jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + data.networkAuthId + '"]').show();
1127
if (data.draft == false) {
1128
+ if(jQuery('.b2s-network-select-btn[data-network-auth-id="'+data.networkAuthId+'"]').data('meta-type') == 'og' && changedOGImage == true) {
1129
+ if (currentOGImage != "") {
1130
+ jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + data.networkAuthId + '"]').attr('src', currentOGImage);
1131
+ jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + data.networkAuthId + '"]').val(currentOGImage);
1132
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + data.networkAuthId + '"]').show();
1133
+ } else {
1134
+ jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + data.networkAuthId + '"]').attr('src', jQuery('#b2sDefaultNoImage').val());
1135
+ jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + data.networkAuthId + '"]').val(jQuery('#b2sDefaultNoImage').val());
1136
+ }
1137
+ } else {
1138
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + data.networkAuthId + '"]').trigger("click");
1139
+ }
1140
+
1141
}
1142
} else {
1143
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
1567
jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val(content);
1568
1569
}
1570
+
1571
checkSchedDateTime(jQuery(this).attr('data-network-auth-id'));
1572
if (dataNetworkCount == 2) {
1573
jQuery('.b2s-post-item-details-release-input-add[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"][data-network-count="0"]').hide();
1851
1852
jQuery(document).on('click', '.b2s-image-change-meta-network', function () {
1853
currentOGImage = jQuery('input[name=image_url]:checked').val();
1854
+ changedOGImage = true;
1855
if (jQuery('.b2s-input-hidden[name="action"][value="b2s_edit_save_post"]').length > 0) { //sched or calender view
1856
jQuery('.b2s-image-change-this-network').trigger('click');
1857
} else { //ship view
1933
}
1934
});
1935
currentOGImage = '';
1936
+ changedOGImage = true;
1937
}
1938
//customize sched content
1939
jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + networkAuthId + '"]').attr('src', defaultImage);
2132
jQuery('#b2s-network-select-image').modal('hide');
2133
2134
currentOGImage = jQuery('input[name=image_url]:checked').val();
2135
+ changedOGImage = true;
2136
if (typeof currentOGImage !== typeof undefined) {
2137
var attachmenUrlExt = currentOGImage.substr(currentOGImage.lastIndexOf('.') + 1);
2138
attachmenUrlExt = attachmenUrlExt.toLowerCase();
2276
unique: true
2277
};
2278
jQuery.validator.addMethod("checkTags", function (value, element, test) {
2279
+ var allowed_tags = ['p', 'h1', 'h2', 'br', 'i', 'em', 'b', 'a', 'img'];
2280
var tags = value.match(/(<([^>]+)>)/ig);
2281
if (tags !== null && tags.length > 0) {
2282
if (jQuery(element).hasClass('b2s-post-item-details-item-message-input-allow-html')) {
3450
//utc current time
3451
var now = new Date();
3452
//offset between utc und user
3453
+ var offset = (parseInt(now.getTimezoneOffset() / 60)) * (-1);
3454
//enter hour to user time
3455
var hour = parseInt(minParts3[0]) + timeZone + offset;
3456
//calculate datetime in utc
assets/js/b2s/wp/post-box.js CHANGED
@@ -4,6 +4,60 @@ jQuery(document).on('heartbeat-send', function (e, data) {
4
});
5
6
jQuery(window).on("load", function () {
7
//Gutenberg V5.0.0
8
jQuery('#b2s-post-meta-box-auto').removeClass('hide-if-js');
9
//--
@@ -22,62 +76,14 @@ jQuery(window).on("load", function () {
22
//TOS Twitter 032018
23
jQuery('#b2s-network-tos-warning').show();
24
25
- if (jQuery('#b2s-post-meta-box-time-dropdown-publish').is(':checked')) {
26
jQuery('#b2s-post-box-calendar-header').show();
27
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
28
- jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
29
- } else {
30
- if (jQuery('#b2s-post-meta-box-profil-dropdown').length == 0) {
31
- jQuery('.b2s-loading-area').show();
32
- jQuery.ajax({
33
- url: ajaxurl,
34
- type: "POST",
35
- dataType: "json",
36
- cache: false,
37
- data: {
38
- 'action': 'b2s_post_meta_box',
39
- 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
40
- },
41
- error: function () {
42
- jQuery('.b2s-loading-area').hide();
43
- jQuery('#b2s-server-connection-fail').show();
44
- return false;
45
- },
46
- success: function (data) {
47
- jQuery('.b2s-loading-area').hide();
48
- if (data.result == true) {
49
- if (data.content != '') {
50
- jQuery('.b2s-loading-area').after(data.content);
51
- var today = new Date();
52
- if (today.getMinutes() >= 30) {
53
- today.setHours(today.getHours() + 1);
54
- today.setMinutes(0);
55
- } else {
56
- today.setMinutes(30);
57
- }
58
- var setTodayDate = today.getFullYear() + '-' + (padDate(today.getMonth() + 1)) + '-' + padDate(today.getDate()) + ' ' + formatAMPM(today);
59
- if (jQuery('#b2sUserLang').val() == 'de') {
60
- setTodayDate = padDate(today.getDate()) + '.' + (padDate(today.getMonth() + 1)) + '.' + today.getFullYear() + ' ' + padDate(today.getHours()) + ':' + padDate(today.getMinutes());
61
- }
62
- jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
63
- jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today, 'position': 'top left'});
64
- jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
65
-
66
- } else {
67
- jQuery('#b2s-server-connection-fail').show();
68
- }
69
- wp.heartbeat.connectNow();
70
- } else {
71
- if (data.error == 'nonce') {
72
- jQuery('.b2s-nonce-check-fail').show();
73
- }
74
- jQuery('#b2s-server-connection-fail').show();
75
- }
76
- }
77
- });
78
- }
79
}
80
}
81
});
82
83
@@ -191,89 +197,20 @@ jQuery(document).on('click', '#b2s-post-box-calendar-btn', function () {
191
192
193
194
- jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', function () {
195
jQuery('#b2s-post-box-calendar-header').show();
196
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
197
- jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
198
jQuery('#b2s-post-meta-box-note-trial').show();
199
} else {
200
jQuery('#b2s-post-meta-box-note-trial').hide();
201
- if (jQuery('#b2s-post-meta-box-profil-dropdown').length == 0) {
202
- jQuery('.b2s-loading-area').show();
203
- jQuery.ajax({
204
- url: ajaxurl,
205
- type: "POST",
206
- dataType: "json",
207
- cache: false,
208
- data: {
209
- 'action': 'b2s_post_meta_box',
210
- 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
211
- },
212
- error: function () {
213
- jQuery('.b2s-loading-area').hide();
214
- jQuery('#b2s-server-connection-fail').show();
215
- jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
216
- return false;
217
- },
218
- success: function (data) {
219
- jQuery('.b2s-loading-area').hide();
220
- if (data.result == true) {
221
- if (data.content != '') {
222
- jQuery('.b2s-loading-area').after(data.content);
223
- var today = new Date();
224
- if (today.getMinutes() >= 30) {
225
- today.setHours(today.getHours() + 1);
226
- today.setMinutes(0);
227
- } else {
228
- today.setMinutes(30);
229
- }
230
- var setTodayDate = today.getFullYear() + '-' + (padDate(today.getMonth() + 1)) + '-' + padDate(today.getDate()) + ' ' + formatAMPM(today);
231
- if (jQuery('#b2sUserLang').val() == 'de') {
232
- setTodayDate = padDate(today.getDate()) + '.' + (padDate(today.getMonth() + 1)) + '.' + today.getFullYear() + ' ' + padDate(today.getHours()) + ':' + padDate(today.getMinutes());
233
- }
234
- jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
235
- jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today, 'position': 'top left'});
236
- jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
237
-
238
- } else {
239
- jQuery('#b2s-server-connection-fail').show();
240
- jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
241
- }
242
- wp.heartbeat.connectNow();
243
- } else {
244
- if (data.error == 'nonce') {
245
- jQuery('.b2s-nonce-check-fail').show();
246
- }
247
- if (data.content == 'no_auth') {
248
- jQuery('#b2s-post-meta-box-state-no-auth').show();
249
- } else {
250
- jQuery('#b2s-server-connection-fail').show();
251
- }
252
- jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
253
- }
254
- }
255
- });
256
- }
257
}
258
});
259
260
jQuery(document).on('change', '.b2s-post-meta-box-sched-select', function () {
261
- if (jQuery(this).val() >= '1') {
262
- if (jQuery('#b2s-post-meta-box-version').val() > 1) {
263
- if (jQuery(this).val() == '1') {
264
- jQuery('.b2s-post-meta-box-sched-best-time').hide();
265
- jQuery('.b2s-post-meta-box-sched-once').show();
266
- } else if (jQuery(this).val() == '2') {
267
- jQuery('.b2s-post-meta-box-sched-once').hide();
268
- jQuery('.b2s-post-meta-box-sched-best-time').show();
269
- }
270
- } else {
271
- jQuery(this).val('0');
272
- jQuery('#b2s-post-meta-box-note-premium').show();
273
- }
274
- } else {
275
- jQuery('.b2s-post-meta-box-sched-once').hide();
276
- jQuery('.b2s-post-meta-box-sched-best-time').hide();
277
}
278
});
279
@@ -293,7 +230,7 @@ jQuery(document).on('click', '#publish', function () {
293
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
294
},
295
success: function (data) {
296
- if(data.error == 'nonce') {
297
jQuery('.b2s-nonce-check-fail').show();
298
}
299
}
@@ -318,7 +255,7 @@ jQuery(document).on('click', '.editor-post-publish-button', function () {
318
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
319
},
320
success: function (data) {
321
- if(data.error == 'nonce') {
322
jQuery('.b2s-nonce-check-fail').show();
323
}
324
}
@@ -395,7 +332,22 @@ function formatAMPM(date) {
395
return strTime;
396
}
397
398
399
-
400
-
401
-
4
});
5
6
jQuery(window).on("load", function () {
7
+
8
+ //add Logo
9
+ jQuery('#b2s-post-meta-box-auto').children('h2').children('span').before('<span style="padding: 10px 0 10px 25px; background: url(' + "'" + jQuery('#b2s-logo-url').val() + "'" + ') no-repeat left center;"></span>');
10
+ jQuery('#b2s-post-box-calendar-header').children('h2').children('span').before('<span style="padding: 10px 0 10px 25px; background: url(' + "'" + jQuery('#b2s-logo-url').val() + "'" + ') no-repeat left center;"></span>');
11
+
12
+ //Editor Gutenberg
13
+ //ref https://developer.wordpress.org/block-editor/data/data-core-editor/
14
+ if (wp && wp.data && wp.data.select && wp.data.subscribe) {
15
+ var originalModifiedDate = new Date(wp.data.select('core/editor').getCurrentPostAttribute("modified"));
16
+ wp.data.subscribe(function () {
17
+ var isAutosavingPost = wp.data.select('core/editor').isAutosavingPost();
18
+ var isSavingPost = wp.data.select('core/editor').isSavingPost();
19
+ if (!isAutosavingPost && isSavingPost) {
20
+ var currentModifiedDate = new Date(wp.data.select('core/editor').getCurrentPostAttribute("modified"));
21
+ if ((originalModifiedDate.getTime() < currentModifiedDate.getTime())) {
22
+ originalModifiedDate = currentModifiedDate;
23
+
24
+ //update infobox
25
+ jQuery.ajax({
26
+ url: ajaxurl,
27
+ type: "GET",
28
+ dataType: "json",
29
+ cache: false,
30
+ data: {
31
+ 'action': 'b2s_update_post_box',
32
+ 'post_id': jQuery('#post_ID').val(),
33
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
34
+ },
35
+ error: function () {
36
+ return false;
37
+ },
38
+ success: function (data) {
39
+ if (data.result == true) {
40
+ if (typeof data.shareCount != 'undefined') {
41
+ jQuery('.b2s-meta-box-share-count').html(data.shareCount);
42
+ }
43
+ if (typeof data.lastPostDate != 'undefined') {
44
+ jQuery('.b2s-meta-box-last-post-date').html(data.lastPostDate);
45
+ }
46
+ if (typeof data.active != 'undefined') {
47
+ if(data.active == true) {
48
+ jQuery('.b2s-enable-auto-post').prop('checked', true).trigger('change');
49
+ } else {
50
+ jQuery('.b2s-enable-auto-post').prop('checked', false).trigger('change');
51
+ }
52
+ }
53
+ }
54
+ }
55
+ });
56
+ }
57
+ }
58
+ });
59
+ }
60
+
61
//Gutenberg V5.0.0
62
jQuery('#b2s-post-meta-box-auto').removeClass('hide-if-js');
63
//--
76
//TOS Twitter 032018
77
jQuery('#b2s-network-tos-warning').show();
78
79
+ if (jQuery('#b2s-enable-auto-post').is(':checked')) {
80
jQuery('#b2s-post-box-calendar-header').show();
81
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
82
+ jQuery('#b2s-enable-auto-post').prop('checked', false);
83
}
84
}
85
+
86
+ jQuery('#b2s-post-meta-box-profil-dropdown').trigger('change');
87
});
88
89
197
198
199
200
+ jQuery(document).on('click', '#b2s-enable-auto-post', function () {
201
jQuery('#b2s-post-box-calendar-header').show();
202
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
203
+ jQuery('#b2s-enable-auto-post').prop('checked', false);
204
jQuery('#b2s-post-meta-box-note-trial').show();
205
} else {
206
jQuery('#b2s-post-meta-box-note-trial').hide();
207
}
208
});
209
210
jQuery(document).on('change', '.b2s-post-meta-box-sched-select', function () {
211
+ if (jQuery(this).val() >= '1' && jQuery('#b2s-post-meta-box-version').val() <= 1) {
212
+ jQuery(this).val('0');
213
+ jQuery('#b2s-post-meta-box-note-premium').show();
214
}
215
});
216
230
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
231
},
232
success: function (data) {
233
+ if (data.error == 'nonce') {
234
jQuery('.b2s-nonce-check-fail').show();
235
}
236
}
255
'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
256
},
257
success: function (data) {
258
+ if (data.error == 'nonce') {
259
jQuery('.b2s-nonce-check-fail').show();
260
}
261
}
332
return strTime;
333
}
334
335
+ jQuery(document).on('click', '.b2s-options-btn', function () {
336
+ if (jQuery('.b2s-options').is(':visible')) {
337
+ jQuery('.b2s-options').hide();
338
+ jQuery('.b2s-options-btn > .glyphicon').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
339
+ } else {
340
+ jQuery('.b2s-options').show();
341
+ jQuery('.b2s-options-btn > .glyphicon').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
342
+ }
343
+ });
344
345
+ jQuery(document).on('change', '.b2s-enable-auto-post', function () {
346
+ if (jQuery(this).is(':checked')) {
347
+ jQuery('.b2s-post-meta-box-active').show();
348
+ jQuery('.b2s-post-meta-box-inactive').hide();
349
+ } else {
350
+ jQuery('.b2s-post-meta-box-active').hide();
351
+ jQuery('.b2s-post-meta-box-inactive').show();
352
+ }
353
+ });
blog2social.php CHANGED
@@ -6,12 +6,12 @@
6
* Author: Blog2Social, Adenion
7
* Text Domain: blog2social
8
* Domain Path: /languages
9
- * Version: 6.0.0
10
* Author URI: https://www.blog2social.com
11
* License: GPL2+
12
*/
13
14
- define('B2S_PLUGIN_VERSION', '600');
15
define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
16
define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
17
define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
6
* Author: Blog2Social, Adenion
7
* Text Domain: blog2social
8
* Domain Path: /languages
9
+ * Version: 6.1.0
10
* Author URI: https://www.blog2social.com
11
* License: GPL2+
12
*/
13
14
+ define('B2S_PLUGIN_VERSION', '610');
15
define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
16
define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
17
define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
includes/Ajax/Get.php CHANGED
@@ -20,7 +20,6 @@ class Ajax_Get {
20
add_action('wp_ajax_b2s_sched_post_data', array($this, 'getSchedPostData'));
21
add_action('wp_ajax_b2s_approve_post_data', array($this, 'getApprovePostData'));
22
add_action('wp_ajax_b2s_ship_navbar_item', array($this, 'getNavbarItem'));
23
- add_action('wp_ajax_b2s_post_meta_box', array($this, 'getPostMetaBox'));
24
add_action('wp_ajax_b2s_scrape_url', array($this, 'scrapeUrl'));
25
add_action('wp_ajax_b2s_get_settings_sched_time_default', array($this, 'getSettingsSchedTimeDefault'));
26
add_action('wp_ajax_b2s_get_settings_sched_time_user', array($this, 'getUserTimeSettings'));
@@ -40,10 +39,12 @@ class Ajax_Get {
40
add_action('wp_ajax_b2s_get_edit_template', array($this, 'getEditTemplateForm'));
41
add_action('wp_ajax_b2s_check_draft_exists', array($this, 'checkDraftExists'));
42
add_action('wp_ajax_b2s_get_curation_ship_details', array($this, 'getCurationShipDetails'));
43
}
44
45
public function getBlogPostStatus() {
46
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
47
$status = ((int) $_GET['post_id'] > 0) ? get_post_status((int) $_GET['post_id']) : '';
48
echo json_encode($status);
49
wp_die();
@@ -54,7 +55,7 @@ class Ajax_Get {
54
}
55
56
public function scrapeUrl() {
57
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
58
if (isset($_POST['url']) && !empty($_POST['url'])) {
59
$data = B2S_Util::scrapeUrl(esc_url($_POST['url']));
60
$scrapeError = ($data !== false) ? false : true;
@@ -85,7 +86,7 @@ class Ajax_Get {
85
}
86
87
public function getSortData() {
88
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
89
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
90
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
91
/* Sort */
@@ -107,8 +108,24 @@ class Ajax_Get {
107
$b2sSelectSchedDate = isset($_POST['b2sSchedDate']) ? (preg_match("#^[0-9\-.\]]+$#", trim($_POST['b2sSchedDate'])) ? trim($_POST['b2sSchedDate']) : "") : "";
108
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim(sanitize_text_field($_POST['b2sUserLang'])) : strtolower(substr(B2S_LANGUAGE, 0, 2));
109
$b2sResultsPerPage = (isset($_POST['b2sPostsPerPage']) && (int) $_POST['b2sPostsPerPage'] > 0) ? (int) $_POST['b2sPostsPerPage'] : B2S_PLUGIN_POSTPERPAGE;
110
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish', 'notice', 'approve', 'draft', 'draft-post', 'favorites'))) {
111
- $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostShareStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sShowByNetwork, $b2sUserAuthId, $b2sPostBlogId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
112
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
113
if ($b2sShowPagination) {
114
$result['pagination'] = $postItem->getPaginationHtml();
@@ -125,7 +142,7 @@ class Ajax_Get {
125
}
126
127
public function getNetworkBoardAndGroup() {
128
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
129
if (isset($_POST['networkId']) && !empty($_POST['networkId']) && isset($_POST['networkAuthId']) && !empty($_POST['networkAuthId'])) {
130
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getNetworkBoardAndGroup', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => (int) $_POST['networkAuthId'], 'networkId' => (int) $_POST['networkId'], 'lang' => substr(B2S_LANGUAGE, 0, 2))));
131
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
@@ -143,7 +160,7 @@ class Ajax_Get {
143
}
144
145
public function getFaqEntries() {
146
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
147
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getFaqEntries', 'lang' => substr(B2S_LANGUAGE, 0, 2), 'token' => B2S_PLUGIN_TOKEN)));
148
if (isset($result->result) && isset($result->content) && !empty($result->content)) {
149
echo json_encode(array('result' => true, 'content' => B2S_Notice::getFaqEntriesHtml($result->content)));
@@ -157,29 +174,8 @@ class Ajax_Get {
157
}
158
}
159
160
- public function getPostMetaBox() {
161
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
162
- $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
163
- 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)) {
164
- if (!empty($result->data->auth)) {
165
- $postBox = new B2S_PostBox();
166
- echo json_encode(array('result' => true, 'content' => $postBox->getPostBoxAutoHtml($result->data->mandant, $result->data->auth)));
167
- wp_die();
168
- } else {
169
- echo json_encode(array('result' => false, 'content' => 'no_auth'));
170
- wp_die();
171
- }
172
- }
173
- echo json_encode(array('result' => false, 'content' => ''));
174
- wp_die();
175
- } else {
176
- echo json_encode(array('result' => false, 'error' => 'nonce'));
177
- wp_die();
178
- }
179
- }
180
-
181
public function getShipItemFullText() {
182
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
183
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
184
$userLang = isset($_POST['userLang']) ? trim(sanitize_text_field($_POST['userLang'])) : strtolower(substr(B2S_LANGUAGE, 0, 2));
185
$data = get_post((int) $_POST['postId']);
@@ -200,7 +196,7 @@ class Ajax_Get {
200
}
201
202
public function getShipItem() {
203
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
204
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
205
//TOS XING Group
206
if ((int) $_POST['networkId'] == 19 && isset($_POST['networkTosGroupId']) && !empty($_POST['networkTosGroupId'])) {
@@ -228,7 +224,7 @@ class Ajax_Get {
228
if (isset($_POST['b2sIsDraft']) && (int) $_POST['b2sIsDraft'] == 1) {
229
global $wpdb;
230
if ($wpdb->get_var("SHOW TABLES LIKE '{$wpdb->prefix}b2s_posts_drafts'") == $wpdb->prefix . 'b2s_posts_drafts') {
231
- $sql = $wpdb->prepare("SELECT data FROM `{$wpdb->prefix}b2s_posts_drafts` WHERE `blog_user_id` = %d AND `post_id` = %d", (int) B2S_PLUGIN_BLOG_USER_ID, (int) $_POST['postId']);
232
$sqlResult = $wpdb->get_row($sql);
233
$drafts = (isset($sqlResult->data) && !empty($sqlResult->data)) ? unserialize($sqlResult->data) : false;
234
if ($drafts !== false && isset($drafts['b2s']) && !empty($drafts['b2s']) && array_key_exists($_POST['networkAuthId'], $drafts['b2s'])) {
@@ -257,7 +253,7 @@ class Ajax_Get {
257
}
258
259
public function getPublishPostData() {
260
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
261
if ((int) $_POST['postId']) {
262
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
263
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
@@ -279,7 +275,7 @@ class Ajax_Get {
279
}
280
281
public function getApprovePostData() {
282
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
283
if ((int) $_POST['postId']) {
284
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
285
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
@@ -300,7 +296,7 @@ class Ajax_Get {
300
}
301
302
public function getSchedPostsByUserAuth() {
303
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
304
if (isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
305
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Network/Item.php');
306
$networkData = new B2S_Network_Item(false);
@@ -313,7 +309,7 @@ class Ajax_Get {
313
$data = array('action' => 'getTeamAssignUserAuth', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => (int) $_POST['networkAuthId'], 'blogUser' => $blogUserToken);
314
$networkAuthAssignment = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $data, 30), true);
315
$count = $networkData->getCountSchedPostsByUserAuth((int) $_POST['networkAuthId']);
316
- if ($networkAuthAssignment['result'] == true) {
317
$assignCount = 0;
318
$assignList = array();
319
foreach ($networkAuthAssignment['assignList'] as $k => $v) {
@@ -341,7 +337,7 @@ class Ajax_Get {
341
}
342
343
public function getSchedPostData() {
344
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
345
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0) {
346
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
347
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
@@ -364,7 +360,7 @@ class Ajax_Get {
364
}
365
366
public function getNavbarItem() {
367
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
368
if (isset($_POST['networkId']) && isset($_POST['networkAuthId']) && isset($_POST['networkType']) && isset($_POST['displayName']) && isset($_POST['mandandId'])) {
369
require_once (B2S_PLUGIN_DIR . '/includes/B2S/Ship/Navbar.php');
370
global $wpdb;
@@ -396,7 +392,7 @@ class Ajax_Get {
396
}
397
398
public function getSettingsSchedTimeDefault() {
399
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
400
$userTimes = B2S_Tools::getRandomBestTimeSettings();
401
if (!empty($userTimes) && is_array($userTimes)) {
402
echo json_encode(array('result' => true, 'times' => $userTimes));
@@ -412,7 +408,7 @@ class Ajax_Get {
412
413
//NEW V5.1.0
414
public function getUserTimeSettings() {
415
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
416
$lang = substr(B2S_LANGUAGE, 0, 2);
417
$options = new B2S_Options(get_current_user_id());
418
$userSchedData = $options->_getOption('auth_sched_time');
@@ -453,7 +449,7 @@ class Ajax_Get {
453
}
454
455
public function getShipItemReloadUrl() {
456
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
457
if (isset($_POST['networkId']) && (int) $_POST['networkId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0 && isset($_POST['url']) && !empty($_POST['url'])) {
458
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['defaultUrl']) && $_POST['defaultUrl'] == $_POST['url'] && (!isset($_POST['postType']) || $_POST['postType'] != 'ex')) {
459
$postData = get_post((int) $_POST['postId']);
@@ -466,7 +462,7 @@ class Ajax_Get {
466
} else {
467
$metaInfo = B2S_Util::getMetaTags(0, esc_url($_POST['url']), (int) $_POST['networkId']);
468
}
469
- echo json_encode(array('result' => true, 'networkId' => (int) $_POST['networkId'], 'networkAuthId' => (int) $_POST['networkAuthId'], 'title' => isset($metaInfo['title']) ? esc_attr($metaInfo['title']) : '', 'description' => isset($metaInfo['description']) ? esc_attr($metaInfo['description']) : '', 'image' => isset($metaInfo['image']) ? esc_attr($metaInfo['image']) : ''));
470
wp_die();
471
}
472
echo json_encode(array('result' => false));
@@ -478,7 +474,7 @@ class Ajax_Get {
478
}
479
480
public function getCalendarEvents() {
481
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
482
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Filter.php');
483
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Ship/Image.php');
484
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Settings/Item.php');
@@ -505,7 +501,7 @@ class Ajax_Get {
505
}
506
507
public function getCalendarFilterNetworkAuth() {
508
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
509
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Filter.php');
510
$network_id = (isset($_POST['network_id']) && (int) $_POST['network_id'] >= 1) ? (int) $_POST['network_id'] : 0; // 0=all
511
if ($network_id != 0) {
@@ -524,7 +520,7 @@ class Ajax_Get {
524
}
525
526
public function getPostEditModal() {
527
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
528
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Filter.php');
529
if (isset($_POST['id']) && (int) $_POST['id'] > 0) {
530
$item = B2S_Calendar_Filter::getById((int) $_POST['id']);
@@ -556,7 +552,7 @@ class Ajax_Get {
556
}
557
558
public function getImageModal() {
559
- if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
560
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Ship/Image.php');
561
if (isset($_POST['id']) && (int) $_POST['id'] > 0) {
562
$postData = get_post((int) $_POST['id']);
@@ -575,7 +571,7 @@ class Ajax_Get {
575
}
576
577
public function getMultiWidgetContent() {
578
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
579
$option = get_option("B2S_MULTI_WIDGET");
580
if ($option !== false) {
581
if (is_array($option) && isset($option['timestamp']) && isset($option['content']) && !empty($option['content']) && $option['timestamp'] > date('Y-m-d H:i:s', strtotime("-1 hours"))) {
@@ -593,7 +589,7 @@ class Ajax_Get {
593
}
594
595
public function getStats() {
596
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
597
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Stats.php');
598
$stats = new B2S_Stats();
599
if (isset($_GET['from']) && !empty($_GET['from']) && preg_match("#^[0-9\-.\]]+$#", $_GET['from'])) {
@@ -608,7 +604,7 @@ class Ajax_Get {
608
}
609
610
public function b2sSupportSystemRequirements() {
611
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
612
if (!current_user_can('administrator')) {
613
echo json_encode(array('result' => false, 'error' => 'admin'));
614
wp_die();
@@ -631,7 +627,7 @@ class Ajax_Get {
631
}
632
633
public function searchUser() {
634
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
635
if (isset($_GET['search_user']) && !empty($_GET['search_user'])) {
636
$options = B2S_Tools::searchUser(sanitize_text_field($_GET['search_user']));
637
echo json_encode(array('result' => true, 'options' => $options));
@@ -646,7 +642,7 @@ class Ajax_Get {
646
}
647
648
public function getSelectMandantUser() {
649
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
650
if (isset($_GET['owner']) && (int) $_GET['owner'] > 0) {
651
$owner = stripslashes(get_user_by('id', $_GET['owner'])->display_name);
652
$owner = (empty($owner) || $owner == false) ? esc_html("Unknown username", "blog2social") : esc_html($owner);
@@ -660,12 +656,11 @@ class Ajax_Get {
660
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Network/Item.php');
661
$networkItem = new B2S_Network_Item();
662
$networkAuthAssignment = $networkItem->getNetworkAuthAssignment($networkAuthId, $networkId, $networkType);
663
- if ($networkAuthAssignment['result'] !== false) {
664
- $userSelect = $networkAuthAssignment['userSelect'];
665
- $assignList = $networkAuthAssignment['assignList'];
666
-
667
- echo json_encode(array('result' => true, 'userSelect' => $userSelect, 'assignList' => $assignList));
668
- wp_die();
669
}
670
}
671
}
@@ -678,7 +673,7 @@ class Ajax_Get {
678
}
679
680
public function getEditTemplateForm() {
681
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
682
if (isset($_GET['networkId']) && (int) $_GET['networkId'] > 0) {
683
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Network/Item.php');
684
$networkItem = new B2S_Network_Item(false);
@@ -697,11 +692,11 @@ class Ajax_Get {
697
}
698
699
public function checkDraftExists() {
700
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
701
if (isset($_GET['postId']) && (int) $_GET['postId'] > 0) {
702
global $wpdb;
703
if ($wpdb->get_var("SHOW TABLES LIKE '{$wpdb->prefix}b2s_posts_drafts'") == $wpdb->prefix . 'b2s_posts_drafts') {
704
- $sqlCheckDraft = $wpdb->prepare("SELECT `id` FROM `{$wpdb->prefix}b2s_posts_drafts` WHERE `blog_user_id` = %d AND `post_id` = %d", B2S_PLUGIN_BLOG_USER_ID, (int) $_GET['postId']);
705
$draftEntry = $wpdb->get_var($sqlCheckDraft);
706
if ($draftEntry !== NULL && (int) $draftEntry > 0) {
707
echo json_encode(array('result' => true));
@@ -716,9 +711,9 @@ class Ajax_Get {
716
wp_die();
717
}
718
}
719
-
720
public function getCurationShipDetails() {
721
- if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') === 1) {
722
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
723
$curation = new B2S_Curation_View();
724
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
@@ -734,4 +729,55 @@ class Ajax_Get {
734
}
735
}
736
737
}
20
add_action('wp_ajax_b2s_sched_post_data', array($this, 'getSchedPostData'));
21
add_action('wp_ajax_b2s_approve_post_data', array($this, 'getApprovePostData'));
22
add_action('wp_ajax_b2s_ship_navbar_item', array($this, 'getNavbarItem'));
23
add_action('wp_ajax_b2s_scrape_url', array($this, 'scrapeUrl'));
24
add_action('wp_ajax_b2s_get_settings_sched_time_default', array($this, 'getSettingsSchedTimeDefault'));
25
add_action('wp_ajax_b2s_get_settings_sched_time_user', array($this, 'getUserTimeSettings'));
39
add_action('wp_ajax_b2s_get_edit_template', array($this, 'getEditTemplateForm'));
40
add_action('wp_ajax_b2s_check_draft_exists', array($this, 'checkDraftExists'));
41
add_action('wp_ajax_b2s_get_curation_ship_details', array($this, 'getCurationShipDetails'));
42
+ add_action('wp_ajax_b2s_get_network_auth_settings', array($this, 'getNetworkAuthSettings'));
43
+ add_action('wp_ajax_b2s_update_post_box', array($this, 'updatePostBox'));
44
}
45
46
public function getBlogPostStatus() {
47
+ if (isset($_GET['b2s_security_nonce']) && (int) wp_verify_nonce($_GET['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
48
$status = ((int) $_GET['post_id'] > 0) ? get_post_status((int) $_GET['post_id']) : '';
49
echo json_encode($status);
50
wp_die();
55
}
56
57
public function scrapeUrl() {
58
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
59
if (isset($_POST['url']) && !empty($_POST['url'])) {
60
$data = B2S_Util::scrapeUrl(esc_url($_POST['url']));
61
$scrapeError = ($data !== false) ? false : true;
86
}
87
88
public function getSortData() {
89
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
90
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
91
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
92
/* Sort */
108
$b2sSelectSchedDate = isset($_POST['b2sSchedDate']) ? (preg_match("#^[0-9\-.\]]+$#", trim($_POST['b2sSchedDate'])) ? trim($_POST['b2sSchedDate']) : "") : "";
109
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim(sanitize_text_field($_POST['b2sUserLang'])) : strtolower(substr(B2S_LANGUAGE, 0, 2));
110
$b2sResultsPerPage = (isset($_POST['b2sPostsPerPage']) && (int) $_POST['b2sPostsPerPage'] > 0) ? (int) $_POST['b2sPostsPerPage'] : B2S_PLUGIN_POSTPERPAGE;
111
+ $b2sSortPostSharedBy = (isset($_POST['b2sSortPostSharedBy']) && (int) $_POST['b2sSortPostSharedBy'] > 0) ? (int) $_POST['b2sSortPostSharedBy'] : 0;
112
+
113
+ require_once(B2S_PLUGIN_DIR . 'includes/Options.php');
114
+ $options = new B2S_Options((int) B2S_PLUGIN_BLOG_USER_ID);
115
+ $optionPostFilters = $options->_getOption('post_filters');
116
+ $optionPostFilters['searchPostTitle'] = $b2sSortPostTitle;
117
+ $optionPostFilters['searchAuthorId'] = $b2sSortPostAuthor;
118
+ $optionPostFilters['searchPostStatus'] = $b2sSortPostStatus;
119
+ $optionPostFilters['searchPostShareStatus'] = $b2sSortPostShareStatus;
120
+ $optionPostFilters['searchSchedDate'] = $b2sSortPostSchedDate;
121
+ $optionPostFilters['searchPostCat'] = $b2sSortPostCat;
122
+ $optionPostFilters['searchPostType'] = $b2sSortPostType;
123
+ $optionPostFilters['postsPerPage'] = $b2sResultsPerPage;
124
+ $optionPostFilters['searchPostSharedById'] = $b2sSortPostSharedBy;
125
+ $optionPostFilters = $options->_setOption('post_filters', $optionPostFilters);
126
+
127
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish', 'notice', 'approve', 'draft', 'draft-post', 'favorites'))) {
128
+ $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostShareStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sShowByNetwork, $b2sUserAuthId, $b2sPostBlogId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage, $b2sSortPostSharedBy);
129
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
130
if ($b2sShowPagination) {
131
$result['pagination'] = $postItem->getPaginationHtml();
142
}
143
144
public function getNetworkBoardAndGroup() {
145
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
146
if (isset($_POST['networkId']) && !empty($_POST['networkId']) && isset($_POST['networkAuthId']) && !empty($_POST['networkAuthId'])) {
147
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getNetworkBoardAndGroup', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => (int) $_POST['networkAuthId'], 'networkId' => (int) $_POST['networkId'], 'lang' => substr(B2S_LANGUAGE, 0, 2))));
148
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
160
}
161
162
public function getFaqEntries() {
163
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
164
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getFaqEntries', 'lang' => substr(B2S_LANGUAGE, 0, 2), 'token' => B2S_PLUGIN_TOKEN)));
165
if (isset($result->result) && isset($result->content) && !empty($result->content)) {
166
echo json_encode(array('result' => true, 'content' => B2S_Notice::getFaqEntriesHtml($result->content)));
174
}
175
}
176
177
public function getShipItemFullText() {
178
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
179
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
180
$userLang = isset($_POST['userLang']) ? trim(sanitize_text_field($_POST['userLang'])) : strtolower(substr(B2S_LANGUAGE, 0, 2));
181
$data = get_post((int) $_POST['postId']);
196
}
197
198
public function getShipItem() {
199
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
200
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
201
//TOS XING Group
202
if ((int) $_POST['networkId'] == 19 && isset($_POST['networkTosGroupId']) && !empty($_POST['networkTosGroupId'])) {
224
if (isset($_POST['b2sIsDraft']) && (int) $_POST['b2sIsDraft'] == 1) {
225
global $wpdb;
226
if ($wpdb->get_var("SHOW TABLES LIKE '{$wpdb->prefix}b2s_posts_drafts'") == $wpdb->prefix . 'b2s_posts_drafts') {
227
+ $sql = $wpdb->prepare("SELECT data FROM `{$wpdb->prefix}b2s_posts_drafts` WHERE `blog_user_id` = %d AND `post_id` = %d AND `save_origin` = %d", (int) B2S_PLUGIN_BLOG_USER_ID, (int) $_POST['postId'], 0);
228
$sqlResult = $wpdb->get_row($sql);
229
$drafts = (isset($sqlResult->data) && !empty($sqlResult->data)) ? unserialize($sqlResult->data) : false;
230
if ($drafts !== false && isset($drafts['b2s']) && !empty($drafts['b2s']) && array_key_exists($_POST['networkAuthId'], $drafts['b2s'])) {
253
}
254
255
public function getPublishPostData() {
256
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
257
if ((int) $_POST['postId']) {
258
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
259
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
275
}
276
277
public function getApprovePostData() {
278
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
279
if ((int) $_POST['postId']) {
280
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
281
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
296
}
297
298
public function getSchedPostsByUserAuth() {
299
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
300
if (isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
301
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Network/Item.php');
302
$networkData = new B2S_Network_Item(false);
309