Blog2Social: Social Media Auto Post & Scheduler - Version 5.2.0

Version Description

Usability Optimization

Download this release

Release Info

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

Code changes from version 5.1.4 to 5.2.0

Files changed (59) hide show
  1. assets/css/b2s/calendar.css +8 -1
  2. assets/css/b2s/curation.css +10 -0
  3. assets/css/b2s/network.css +4 -0
  4. assets/css/b2s/post.approve.css +7 -1
  5. assets/css/b2s/post.sched.css +7 -1
  6. assets/css/b2s/settings.css +1 -1
  7. assets/css/b2s/ship.css +7 -1
  8. assets/css/general.css +1 -1
  9. assets/images/portale/19_flat.png +0 -0
  10. assets/js/b2s/curation.js +1 -1
  11. assets/js/b2s/network.js +13 -0
  12. assets/js/b2s/network.tos.js +0 -26
  13. assets/js/b2s/post.js +4 -0
  14. assets/js/b2s/settings.js +6 -2
  15. assets/js/b2s/ship.js +95 -3
  16. assets/lib/air-datepicker/js/datepicker.js +1 -1
  17. blog2social.php +3 -2
  18. includes/Ajax/Get.php +16 -3
  19. includes/Ajax/Post.php +67 -20
  20. includes/B2S/AutoPost.php +29 -18
  21. includes/B2S/Calendar/Filter.php +5 -1
  22. includes/B2S/Calendar/ItemEdit.php +12 -0
  23. includes/B2S/Network/Item.php +63 -38
  24. includes/B2S/Post/Item.php +20 -12
  25. includes/B2S/Post/Tools.php +18 -2
  26. includes/B2S/QuickPost.php +3 -3
  27. includes/B2S/Rating.php +2 -2
  28. includes/B2S/Settings/Item.php +1 -1
  29. includes/B2S/Ship/Item.php +112 -42
  30. includes/B2S/Ship/Navbar.php +4 -2
  31. includes/B2S/Ship/Portale.php +16 -13
  32. includes/B2S/Ship/Save.php +1 -1
  33. includes/Loader.php +26 -28
  34. includes/Meta.php +22 -5
  35. includes/Options.php +66 -8
  36. includes/Tools.php +9 -18
  37. includes/Util.php +6 -4
  38. languages/blog2social-de_DE.mo +0 -0
  39. languages/blog2social-de_DE.po +455 -418
  40. languages/blog2social-pt_BR.mo +0 -0
  41. languages/blog2social-pt_BR.po +2377 -2365
  42. languages/blog2social.pot +2738 -0
  43. readme.txt +6 -2
  44. views/b2s/dashboard.php +14 -17
  45. views/b2s/howto.php +1 -3
  46. views/b2s/html/header.phtml +2 -2
  47. views/b2s/network.php +1 -4
  48. views/b2s/partials/network-tos-modal.php +0 -43
  49. views/b2s/partials/post-edit-modal.php +63 -48
  50. views/b2s/post.approve.php +0 -4
  51. views/b2s/post.calendar.php +1 -3
  52. views/b2s/post.notice.php +1 -3
  53. views/b2s/post.php +1 -3
  54. views/b2s/post.publish.php +1 -3
  55. views/b2s/post.sched.php +3 -4
  56. views/b2s/premium.php +1 -3
  57. views/b2s/settings.php +0 -2
  58. views/b2s/ship.php +18 -4
  59. views/b2s/widgets/support.php +1 -1
assets/css/b2s/calendar.css CHANGED
@@ -70,6 +70,13 @@ body .fc-time{
70
text-transform: uppercase;
71
margin: 3px 3px 3px 0px;
72
}
73
.btn-circle {
74
width: 30px;
75
height: 30px;
@@ -178,7 +185,7 @@ body .fc-day-grid-event .fc-content{
178
width: 100% !important;
179
}
180
181
- .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select{
182
margin-bottom: 8px !important;
183
}
184
70
text-transform: uppercase;
71
margin: 3px 3px 3px 0px;
72
}
73
+
74
+ .b2s-post-item-network-deprecated {
75
+ font-weight: 600;
76
+ font-size: 14px;
77
+ margin: 3px 3px 3px 0px;
78
+ }
79
+
80
.btn-circle {
81
width: 30px;
82
height: 30px;
185
width: 100% !important;
186
}
187
188
+ .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select, .b2s-select-area{
189
margin-bottom: 8px !important;
190
}
191
assets/css/b2s/curation.css CHANGED
@@ -81,10 +81,20 @@
81
margin: 3px 3px 3px 0px;
82
}
83
84
.b2s-post-item-details p {
85
font-size: 12px;
86
}
87
88
.b2s-post-item-details-message-result {
89
margin-top: 2px;
90
}
81
margin: 3px 3px 3px 0px;
82
}
83
84
+ .b2s-post-item-network-deprecated {
85
+ font-weight: 600;
86
+ font-size: 14px;
87
+ margin: 3px 3px 3px 0px;
88
+ }
89
+
90
.b2s-post-item-details p {
91
font-size: 12px;
92
}
93
94
.b2s-post-item-details-message-result {
95
margin-top: 2px;
96
+ }
97
+
98
+ .b2s-post-curation-ship-date[readonly]{
99
+ background-color: #fff !important;
100
}
assets/css/b2s/network.css CHANGED
@@ -204,6 +204,10 @@ ul.b2s-network-item-auth-list li:last-child{
204
border-left: 3px solid #FDBF45;
205
}
206
207
.b2s-label-danger-border-left{
208
border-left: 3px solid #d9534f;
209
}
204
border-left: 3px solid #FDBF45;
205
}
206
207
+ .b2s-label-info-border-left{
208
+ border-left: 3px solid #31708f;
209
+ }
210
+
211
.b2s-label-danger-border-left{
212
border-left: 3px solid #d9534f;
213
}
assets/css/b2s/post.approve.css CHANGED
@@ -145,6 +145,12 @@
145
text-transform: uppercase;
146
margin: 3px 3px 3px 0px;
147
}
148
.btn-circle {
149
width: 30px;
150
height: 30px;
@@ -231,7 +237,7 @@ textarea.form-control {
231
.b2s-post-item .label-success{
232
display: none;
233
}
234
- .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select{
235
margin-bottom: 8px !important;
236
}
237
145
text-transform: uppercase;
146
margin: 3px 3px 3px 0px;
147
}
148
+ .b2s-post-item-network-deprecated {
149
+ font-weight: 600;
150
+ font-size: 14px;
151
+ margin: 3px 3px 3px 0px;
152
+ }
153
+
154
.btn-circle {
155
width: 30px;
156
height: 30px;
237
.b2s-post-item .label-success{
238
display: none;
239
}
240
+ .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select, .b2s-select-area{
241
margin-bottom: 8px !important;
242
}
243
assets/css/b2s/post.sched.css CHANGED
@@ -145,6 +145,12 @@
145
text-transform: uppercase;
146
margin: 3px 3px 3px 0px;
147
}
148
.btn-circle {
149
width: 30px;
150
height: 30px;
@@ -231,7 +237,7 @@ textarea.form-control {
231
.b2s-post-item .label-success{
232
display: none;
233
}
234
- .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select{
235
margin-bottom: 8px !important;
236
}
237
145
text-transform: uppercase;
146
margin: 3px 3px 3px 0px;
147
}
148
+ .b2s-post-item-network-deprecated {
149
+ font-weight: 600;
150
+ font-size: 14px;
151
+ margin: 3px 3px 3px 0px;
152
+ }
153
+
154
.btn-circle {
155
width: 30px;
156
height: 30px;
237
.b2s-post-item .label-success{
238
display: none;
239
}
240
+ .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select, .b2s-select-area{
241
margin-bottom: 8px !important;
242
}
243
assets/css/b2s/settings.css CHANGED
@@ -105,7 +105,7 @@ ul.chosen-choices {
105
box-shadow: none;
106
}
107
108
- .b2s-auto-post-own-update-warning{
109
border: 1px solid #aaa !important;
110
}
111
105
box-shadow: none;
106
}
107
108
+ .b2s-auto-post-own-update-warning, .b2s-auto-post-own-general-warning{
109
border: 1px solid #aaa !important;
110
}
111
assets/css/b2s/ship.css CHANGED
@@ -80,7 +80,7 @@
80
margin-top: 5px;
81
}
82
83
- .b2s-select{
84
margin-top: 6px;
85
}
86
@@ -297,6 +297,12 @@
297
margin: 3px 3px 3px 0px;
298
}
299
300
.b2s-post-item-info-area{
301
font-size: 11px !important;
302
}
80
margin-top: 5px;
81
}
82
83
+ .b2s-select, .b2s-select-area{
84
margin-top: 6px;
85
}
86
297
margin: 3px 3px 3px 0px;
298
}
299
300
+ .b2s-post-item-network-deprecated {
301
+ font-weight: 600;
302
+ font-size: 14px;
303
+ margin: 3px 3px 3px 0px;
304
+ }
305
+
306
.b2s-post-item-info-area{
307
font-size: 11px !important;
308
}
assets/css/general.css CHANGED
@@ -6950,7 +6950,7 @@ p {
6950
margin-top:15px;
6951
}
6952
6953
- .b2s-select,.b2s-input{
6954
height: 30px !important;
6955
margin-bottom: 8px !important;
6956
}
6950
margin-top:15px;
6951
}
6952
6953
+ .b2s-select,.b2s-input,.b2s-select-area{
6954
height: 30px !important;
6955
margin-bottom: 8px !important;
6956
}
assets/images/portale/19_flat.png ADDED
Binary file
assets/js/b2s/curation.js CHANGED
@@ -79,7 +79,7 @@ jQuery(document).on('change', '#b2s-post-curation-ship-type', function () {
79
}
80
81
jQuery('#b2s-post-curation-ship-date').val(setTodayDate);
82
- jQuery('#b2s-post-curation-ship-date').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today, 'position': 'top left'});
83
84
} else {
85
jQuery('.b2s-post-curation-ship-date-area').hide();
79
}
80
81
jQuery('#b2s-post-curation-ship-date').val(setTodayDate);
82
+ jQuery('#b2s-post-curation-ship-date').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': new Date(), 'startDate': today, 'todayButton': new Date(), 'position': 'top left'});
83
84
} else {
85
jQuery('.b2s-post-curation-ship-date-area').hide();
assets/js/b2s/network.js CHANGED
@@ -34,6 +34,12 @@ function init() {
34
jQuery('.b2s-settings-sched-item-input-time[data-network-auth-id="' + networkAuthId + '"]').val(e.time.value);
35
saveTimeSettings();
36
});
37
}
38
39
var timeoutPlus;
@@ -109,6 +115,13 @@ jQuery(document).on('change', '.b2s-network-mandant-select', function () {
109
}
110
jQuery('.b2s-network-details-container-list').hide();
111
jQuery('.b2s-network-details-container-list[data-mandant-id="' + jQuery(this).val() + '"]').show();
112
});
113
114
jQuery(document).on('click', '.b2s-network-mandant-btn-delete', function () {
34
jQuery('.b2s-settings-sched-item-input-time[data-network-auth-id="' + networkAuthId + '"]').val(e.time.value);
35
saveTimeSettings();
36
});
37
+
38
+ //XING(8) - deprecated since 5.2
39
+ if (jQuery('.b2s-network-item-auth-list-li.deprecated[data-network-id="8"]').length == 0) {
40
+ jQuery('.list-group-item[data-network-id="8"]').hide();
41
+ }
42
+
43
}
44
45
var timeoutPlus;
115
}
116
jQuery('.b2s-network-details-container-list').hide();
117
jQuery('.b2s-network-details-container-list[data-mandant-id="' + jQuery(this).val() + '"]').show();
118
+
119
+ //XING(8) - deprecated since 5.2
120
+ if (jQuery('.b2s-network-item-auth-list-li.deprecated[data-network-mandant-id="' + jQuery(this).val() + '"][data-network-id="8"]').length == 0) {
121
+ jQuery('.list-group-item[data-network-id="8"]').hide();
122
+ } else {
123
+ jQuery('.list-group-item[data-network-id="8"]').show();
124
+ }
125
});
126
127
jQuery(document).on('click', '.b2s-network-mandant-btn-delete', function () {
assets/js/b2s/network.tos.js DELETED
@@ -1,26 +0,0 @@
1
- jQuery.noConflict();
2
- jQuery(window).on("load", function () {
3
- //TOS Twitter 032018
4
- var networkTos = jQuery('#b2sNetworkTosAccept').val()
5
- if (typeof networkTos !== typeof undefined && networkTos !== false) {
6
- if (networkTos == 0) {
7
- jQuery('#b2sNetworkTosAcceptModal').modal('show');
8
- }
9
- }
10
- });
11
-
12
- jQuery(document).on('click', '#b2s-network-tos-accept-btn', function () {
13
- jQuery.ajax({
14
- url: ajaxurl,
15
- type: "POST",
16
- dataType: "json",
17
- cache: false,
18
- data: {
19
- 'action': 'b2s_network_tos_accept',
20
- },
21
- success: function (data) {
22
- jQuery('#b2sNetworkTosAcceptModal').modal('hide');
23
- }
24
- });
25
- return false;
26
- });
assets/js/b2s/post.js CHANGED
@@ -170,6 +170,7 @@ jQuery(document).on('click', '#b2s-sort-reset-btn', function () {
170
jQuery('#b2sShowByDate').val("");
171
jQuery('#b2sUserAuthId').val("");
172
jQuery('#b2sPostBlogId').val("");
173
jQuery('#b2sSortPostStatus').prop('selectedIndex', 0);
174
jQuery('#b2sSortPostPublishDate').prop('selectedIndex', 0);
175
b2sSortFormSubmit();
@@ -201,6 +202,7 @@ function b2sSortFormSubmit(sched_dates) {
201
'b2sPostBlogId': jQuery('#b2sPostBlogId').val(),
202
'b2sType': jQuery('#b2sType').val(),
203
'b2sShowByDate': jQuery('#b2sShowByDate').val(),
204
'b2sPagination': jQuery('#b2sPagination').val(),
205
'b2sShowPagination': jQuery('#b2sShowPagination').length > 0 ? jQuery('#b2sShowPagination').val() : 1,
206
'b2sSortPostStatus': jQuery('#b2sSortPostStatus').val(),
@@ -259,6 +261,7 @@ function b2sSortFormSubmit(sched_dates) {
259
jQuery(document).on('click', '.b2sDetailsSchedPostBtn', function () {
260
var postId = jQuery(this).attr('data-post-id');
261
var showByDate = jQuery(this).attr('data-search-date');
262
var userAuthId = jQuery('#b2sUserAuthId').val();
263
if (!jQuery(this).find('i').hasClass('isload')) {
264
jQuery('.b2s-server-connection-fail').hide();
@@ -271,6 +274,7 @@ jQuery(document).on('click', '.b2sDetailsSchedPostBtn', function () {
271
'action': 'b2s_sched_post_data',
272
'postId': postId,
273
'showByDate': showByDate,
274
'userAuthId': userAuthId
275
},
276
error: function () {
170
jQuery('#b2sShowByDate').val("");
171
jQuery('#b2sUserAuthId').val("");
172
jQuery('#b2sPostBlogId').val("");
173
+ jQuery('#b2sShowByNetwork').val("0");
174
jQuery('#b2sSortPostStatus').prop('selectedIndex', 0);
175
jQuery('#b2sSortPostPublishDate').prop('selectedIndex', 0);
176
b2sSortFormSubmit();
202
'b2sPostBlogId': jQuery('#b2sPostBlogId').val(),
203
'b2sType': jQuery('#b2sType').val(),
204
'b2sShowByDate': jQuery('#b2sShowByDate').val(),
205
+ 'b2sShowByNetwork': jQuery('#b2sShowByNetwork').val(),
206
'b2sPagination': jQuery('#b2sPagination').val(),
207
'b2sShowPagination': jQuery('#b2sShowPagination').length > 0 ? jQuery('#b2sShowPagination').val() : 1,
208
'b2sSortPostStatus': jQuery('#b2sSortPostStatus').val(),
261
jQuery(document).on('click', '.b2sDetailsSchedPostBtn', function () {
262
var postId = jQuery(this).attr('data-post-id');
263
var showByDate = jQuery(this).attr('data-search-date');
264
+ var showByNetwork = jQuery(this).attr('data-search-network');
265
var userAuthId = jQuery('#b2sUserAuthId').val();
266
if (!jQuery(this).find('i').hasClass('isload')) {
267
jQuery('.b2s-server-connection-fail').hide();
274
'action': 'b2s_sched_post_data',
275
'postId': postId,
276
'showByDate': showByDate,
277
+ 'showByNetwork' : showByNetwork,
278
'userAuthId': userAuthId
279
},
280
error: function () {
assets/js/b2s/settings.js CHANGED
@@ -392,11 +392,15 @@ jQuery(document).on('click', '.b2s-post-type-select-btn', function () {
392
if (jQuery(this).attr('data-select-toogle-state') == "0") { //0=select
393
jQuery('.b2s-post-type-item-' + type).prop('checked', true);
394
jQuery(this).attr('data-select-toogle-state', '1');
395
- jQuery('.b2s-auto-post-own-update-warning').show();
396
} else {
397
jQuery('.b2s-post-type-item-' + type).prop('checked', false);
398
jQuery(this).attr('data-select-toogle-state', '0');
399
- jQuery('.b2s-auto-post-own-update-warning').hide();
400
}
401
jQuery(this).text(jQuery(this).attr('data-select-toogle-name'));
402
jQuery(this).attr('data-select-toogle-name', tempCurText);
392
if (jQuery(this).attr('data-select-toogle-state') == "0") { //0=select
393
jQuery('.b2s-post-type-item-' + type).prop('checked', true);
394
jQuery(this).attr('data-select-toogle-state', '1');
395
+ if (type == 'update') {
396
+ jQuery('.b2s-auto-post-own-update-warning').show();
397
+ }
398
} else {
399
jQuery('.b2s-post-type-item-' + type).prop('checked', false);
400
jQuery(this).attr('data-select-toogle-state', '0');
401
+ if (type == 'update') {
402
+ jQuery('.b2s-auto-post-own-update-warning').hide();
403
+ }
404
}
405
jQuery(this).text(jQuery(this).attr('data-select-toogle-name'));
406
jQuery(this).attr('data-select-toogle-name', tempCurText);
assets/js/b2s/ship.js CHANGED
@@ -1,5 +1,7 @@
1
jQuery.noConflict();
2
3
jQuery(document).on('heartbeat-send', function (e, data) {
4
data['b2s_heartbeat'] = 'b2s_listener';
5
});
@@ -732,11 +734,21 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
732
var networkAuthId = jQuery(this).attr('data-network-auth-id');
733
var networkId = jQuery(this).attr('data-network-id');
734
var networkType = jQuery(this).attr('data-network-type');
735
//doppelklick Schutz
736
if (!jQuery(this).hasClass('b2s-network-select-btn-deactivate')) {
737
- //aktiv?
738
if (!jQuery(this).children().hasClass('active')) {
739
- //schon vorhanden?
740
if (jQuery('.b2s-post-item[data-network-auth-id="' + networkAuthId + '"]').length > 0 && !jQuery('.b2s-post-item[data-network-auth-id="' + networkAuthId + '"]').hasClass('b2s-post-item-connection-fail-dummy')) {
741
activatePortal(networkAuthId);
742
//PostFormat
@@ -830,6 +842,9 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
830
}
831
}
832
833
//Twitter TOS 032018 - protected multiple accounts with same content to same time
834
//delete comment field one more
835
if (networkId == 2) {
@@ -863,9 +878,11 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
863
'action': 'b2s_ship_item',
864
'networkAuthId': networkAuthId,
865
'networkType': jQuery(this).attr('data-network-type'),
866
'networkId': networkId,
867
'networkDisplayName': jQuery(this).attr('data-network-display-name'),
868
'instantSharing': jQuery(this).attr('data-instant-sharing'),
869
'userLang': jQuery('#b2sUserLang').val(),
870
'postId': jQuery('#b2sPostId').val(),
871
'relayCount': jQuery('#b2sRelayCount').val(),
@@ -1083,12 +1100,38 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
1083
}
1084
1085
}
1086
}
1087
}
1088
}
1089
});
1090
}
1091
} else {
1092
deactivatePortal(networkAuthId);
1093
}
1094
}
@@ -1173,6 +1216,17 @@ jQuery(document).on('change', '.b2s-post-item-details-item-group-select', functi
1173
jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').html(label);
1174
jQuery('.b2s-post-ship-network-display-name[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val(label);
1175
}
1176
return false;
1177
});
1178
//select recurrent sched interval mode
@@ -1284,6 +1338,19 @@ jQuery(document).on('click', '.b2s-re-share-btn', function () {
1284
jQuery('.b2s-calendar-filter-area[data-network-auth-id="' + networkAuthId + '"]').addClass('hide');
1285
}
1286
});
1287
return false;
1288
});
1289
jQuery(document).on('click', '.b2s-post-item-details-release-input-add', function () {
@@ -2345,7 +2412,7 @@ function releaseChoose(choose, dataNetworkAuthId, dataNetworkCount) {
2345
if (jQuery('.b2s-post-item-details-release-input-date-select' + selectorInput).attr('data-network-customize-content') == "1") {
2346
jQuery('.b2s-post-item-details-item-message-input' + selectorInput + '[data-network-count="-1"]').removeAttr('disabled');
2347
2348
- //Facebook TOS
2349
if (jQuery('.b2s-post-item-details-item-message-input' + selectorInput + '[data-network-count="-1"]').attr('readonly')) {
2350
jQuery('.b2s-post-item-details-item-message-input' + selectorInput + '[data-network-count="-1"]').hide();
2351
} else {
@@ -2790,6 +2857,8 @@ function chooseMandant() {
2790
jQuery('.b2s-network-status-img-loading').hide();
2791
jQuery('.b2s-network-select-btn-deactivate').removeClass('b2s-network-select-btn-deactivate');
2792
//imageCheck();
2793
//expiredDate wieder setzten
2794
jQuery('.b2s-network-status-expiredDate').each(function () {
2795
if (jQuery(this).is(':visible')) {
@@ -2932,4 +3001,27 @@ function checkSchedDateTime(dataNetworkAuthId) {
2932
jQuery(dateElement).datepicker('update', enter);
2933
jQuery(timeElement).timepicker('setTime', enter);
2934
}
2935
}
1
jQuery.noConflict();
2
3
+ var b2sTosXingGroupCount = 0;
4
+
5
jQuery(document).on('heartbeat-send', function (e, data) {
6
data['b2s_heartbeat'] = 'b2s_listener';
7
});
734
var networkAuthId = jQuery(this).attr('data-network-auth-id');
735
var networkId = jQuery(this).attr('data-network-id');
736
var networkType = jQuery(this).attr('data-network-type');
737
+
738
//doppelklick Schutz
739
if (!jQuery(this).hasClass('b2s-network-select-btn-deactivate')) {
740
+ //active?
741
if (!jQuery(this).children().hasClass('active')) {
742
+ //TOS XING Groups
743
+ if ((networkId == 8 || networkId == 19) && networkType == 2) {
744
+ if ((b2sTosXingGroupCount == jQuery('#b2sTosXingGroupCrosspostingLimit').val()) || (networkId == 19 && jQuery('.b2s-network-select-btn[data-network-id="' + networkId + '"][data-network-type="' + networkType + '"][data-network-tos-group-id="' + jQuery(this).attr('data-network-tos-group-id') + '"]').children().hasClass('active'))) {
745
+ jQuery('#b2s-tos-xing-group-modal').modal('show');
746
+ return false;
747
+ } else {
748
+ b2sTosXingGroupCount++;
749
+ }
750
+ }
751
+ //schon vorhanden?
752
if (jQuery('.b2s-post-item[data-network-auth-id="' + networkAuthId + '"]').length > 0 && !jQuery('.b2s-post-item[data-network-auth-id="' + networkAuthId + '"]').hasClass('b2s-post-item-connection-fail-dummy')) {
753
activatePortal(networkAuthId);
754
//PostFormat
842
}
843
}
844
845
+ //XING TOS Group
846
+ jQuery('.b2s-content-info[data-network-auth-id="' + networkAuthId + '"').show();
847
+
848
//Twitter TOS 032018 - protected multiple accounts with same content to same time
849
//delete comment field one more
850
if (networkId == 2) {
878
'action': 'b2s_ship_item',
879
'networkAuthId': networkAuthId,
880
'networkType': jQuery(this).attr('data-network-type'),
881
+ 'networkKind': jQuery(this).attr('data-network-kind'),
882
'networkId': networkId,
883
'networkDisplayName': jQuery(this).attr('data-network-display-name'),
884
'instantSharing': jQuery(this).attr('data-instant-sharing'),
885
+ 'networkTosGroupId': jQuery(this).attr('data-network-tos-group-id'),
886
'userLang': jQuery('#b2sUserLang').val(),
887
'postId': jQuery('#b2sPostId').val(),
888
'relayCount': jQuery('#b2sRelayCount').val(),
1100
}
1101
1102
}
1103
+
1104
+ //XING Groups
1105
+ if (data.networkId == 19 && data.networkType == 2) {
1106
+ if (jQuery('.networkKind[data-network-auth-id="' + data.networkAuthId + '"]').val() == '3') {
1107
+ jQuery('.marketplace_area[data-network-auth-id="' + data.networkAuthId + '"][data-network-id="' + data.networkId + '"]').show();
1108
+ }
1109
+ }
1110
+ //XING TOS Group
1111
+ jQuery('.b2s-content-info[data-network-auth-id="' + data.networkAuthId + '"').show();
1112
+ } else {
1113
+ //TOS XING Groups
1114
+ if (typeof data.reason !== "undefined") {
1115
+ if (data.reason == 'tos_xing_group_exists') {
1116
+ b2sTosXingGroupCount--;
1117
+ deactivatePortal(data.networkAuthId);
1118
+ jQuery('.b2s-post-item-loading-dummy[data-network-auth-id="' + data.networkAuthId + '"]').remove();
1119
+ jQuery('#b2s-tos-xing-group-modal').modal('show');
1120
+ return false;
1121
+ }
1122
+
1123
+ }
1124
+
1125
}
1126
}
1127
}
1128
});
1129
}
1130
} else {
1131
+ //TOS XING Groups
1132
+ if ((networkId == 8 || networkId == 19) && networkType == 2) {
1133
+ b2sTosXingGroupCount--;
1134
+ }
1135
deactivatePortal(networkAuthId);
1136
}
1137
}
1216
jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').html(label);
1217
jQuery('.b2s-post-ship-network-display-name[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val(label);
1218
}
1219
+ //Xing groups
1220
+ if (jQuery(this).attr('data-network-id') == '19') {
1221
+ var option = jQuery('option:selected', this).attr('data-network-kind');
1222
+ if (option == '3') { //Marketplace
1223
+ jQuery('.marketplace_area[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"][data-network-id="' + jQuery(this).attr('data-network-id') + '"]').show();
1224
+ } else {
1225
+ jQuery('.marketplace_area[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"][data-network-id="' + jQuery(this).attr('data-network-id') + '"]').hide();
1226
+ }
1227
+ jQuery('.networkKind[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val(option);
1228
+ }
1229
+
1230
return false;
1231
});
1232
//select recurrent sched interval mode
1338
jQuery('.b2s-calendar-filter-area[data-network-auth-id="' + networkAuthId + '"]').addClass('hide');
1339
}
1340
});
1341
+
1342
+ //TOS XING Group
1343
+ jQuery('.b2s-network-select-btn').each(function () {
1344
+ if (jQuery(this).children().hasClass('active')) {
1345
+ if (jQuery(this).attr('data-network-id') == "19" && jQuery(this).attr('data-network-type') == "2") {
1346
+ b2sTosXingGroupCount--;
1347
+ deactivatePortal(jQuery(this).attr('data-network-auth-id'));
1348
+ jQuery('.b2s-network-select-btn[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').addClass('b2s-network-select-btn-deactivate');
1349
+ jQuery('.b2s-post-item-loading-dummy[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').remove();
1350
+ }
1351
+ }
1352
+ });
1353
+
1354
return false;
1355
});
1356
jQuery(document).on('click', '.b2s-post-item-details-release-input-add', function () {
2412
if (jQuery('.b2s-post-item-details-release-input-date-select' + selectorInput).attr('data-network-customize-content') == "1") {
2413
jQuery('.b2s-post-item-details-item-message-input' + selectorInput + '[data-network-count="-1"]').removeAttr('disabled');
2414
2415
+ //Facebook TOS
2416
if (jQuery('.b2s-post-item-details-item-message-input' + selectorInput + '[data-network-count="-1"]').attr('readonly')) {
2417
jQuery('.b2s-post-item-details-item-message-input' + selectorInput + '[data-network-count="-1"]').hide();
2418
} else {
2857
jQuery('.b2s-network-status-img-loading').hide();
2858
jQuery('.b2s-network-select-btn-deactivate').removeClass('b2s-network-select-btn-deactivate');
2859
//imageCheck();
2860
+ //TOS XING Groups
2861
+ b2sTosXingGroupCount = 0;
2862
//expiredDate wieder setzten
2863
jQuery('.b2s-network-status-expiredDate').each(function () {
2864
if (jQuery(this).is(':visible')) {
3001
jQuery(dateElement).datepicker('update', enter);
3002
jQuery(timeElement).timepicker('setTime', enter);
3003
}
3004
+
3005
+ //network deprecated
3006
+ if (jQuery(dateElement).attr('data-network-id') == '8') {
3007
+ var deprecatedDate = new Date('2019-03-30T23:59:59');
3008
+ var count = jQuery(dateElement).attr('data-network-count');
3009
+ if (enter.getTime() > deprecatedDate.getTime()) {
3010
+ jQuery('.network-tos-deprecated-warning[data-network-auth-id="' + dataNetworkAuthId + '"][data-network-count="' + count + '"]').show();
3011
+ jQuery(dateElement).datepicker('update', now);
3012
+ jQuery(timeElement).timepicker('setTime', now);
3013
+ }
3014
+ }
3015
+
3016
+ //network deprecated
3017
+ if (jQuery(dateElement).attr('data-network-id') == '10') {
3018
+ var deprecatedDate = new Date('2019-04-01T23:59:59');
3019
+ var count = jQuery(dateElement).attr('data-network-count');
3020
+ if (enter.getTime() > deprecatedDate.getTime()) {
3021
+ jQuery('.network-tos-deprecated-warning[data-network-auth-id="' + dataNetworkAuthId + '"][data-network-count="' + count + '"]').show();
3022
+ jQuery(dateElement).datepicker('update', now);
3023
+ jQuery(timeElement).timepicker('setTime', now);
3024
+ }
3025
+ }
3026
+
3027
}
assets/lib/air-datepicker/js/datepicker.js CHANGED
@@ -129,7 +129,7 @@
129
this.currentDate = this.opts.startDate;
130
this.currentView = this.opts.view;
131
this._createShortCuts();
132
- this.selectedDates = [];
133
this.views = {};
134
this.keys = [];
135
this.minRange = '';
129
this.currentDate = this.opts.startDate;
130
this.currentView = this.opts.view;
131
this._createShortCuts();
132
+ this.selectedDates = [this.opts.startDate];
133
this.views = {};
134
this.keys = [];
135
this.minRange = '';
blog2social.php CHANGED
@@ -1,4 +1,5 @@
1
<?php
2
/*
3
* Plugin Name:Blog2Social: Social Media Auto Post & Scheduler
4
* Plugin URI: https://www.blog2social.com
@@ -6,12 +7,12 @@
6
* Author: Blog2Social, Adenion
7
* Text Domain: blog2social
8
* Domain Path: /languages
9
- * Version: 5.1.4
10
* Author URI: https://www.blog2social.com
11
* License: GPL2+
12
*/
13
//B2SDefine
14
- define('B2S_PLUGIN_VERSION', '514');
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__));
1
<?php
2
+
3
/*
4
* Plugin Name:Blog2Social: Social Media Auto Post & Scheduler
5
* Plugin URI: https://www.blog2social.com
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
+ * Version: 5.2.0
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
+ define('B2S_PLUGIN_VERSION', '520');
16
define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
17
define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
18
define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
includes/Ajax/Get.php CHANGED
@@ -82,6 +82,7 @@ class Ajax_Get {
82
$b2sSortPostPublishDate = isset($_POST['b2sSortPostPublishDate']) ? trim($_POST['b2sSortPostPublishDate']) : "";
83
$b2sSortPostStatus = isset($_POST['b2sSortPostStatus']) ? trim($_POST['b2sSortPostStatus']) : "";
84
$b2sShowByDate = isset($_POST['b2sShowByDate']) ? trim($_POST['b2sShowByDate']) : ""; //YYYY-mm-dd
85
$b2sUserAuthId = isset($_POST['b2sUserAuthId']) ? (int) $_POST['b2sUserAuthId'] : 0;
86
$b2sPostBlogId = isset($_POST['b2sPostBlogId']) ? (int) $_POST['b2sPostBlogId'] : 0;
87
$b2sSortPostCat = isset($_POST['b2sSortPostCat']) ? trim($_POST['b2sSortPostCat']) : "";
@@ -90,7 +91,7 @@ class Ajax_Get {
90
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
91
$b2sResultsPerPage = isset($_POST['b2sPostsPerPage']) && intval($_POST['b2sPostsPerPage']) > 0 ? intval($_POST['b2sPostsPerPage']) : B2S_PLUGIN_POSTPERPAGE;
92
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish', 'notice', 'approve'))) {
93
- $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sUserAuthId, $b2sPostBlogId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
94
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
95
if ($b2sShowPagination) {
96
$result['pagination'] = $postItem->getPaginationHtml();
@@ -153,11 +154,22 @@ class Ajax_Get {
153
154
public function getShipItem() {
155
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
156
$userLang = isset($_POST['userLang']) ? trim($_POST['userLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
157
$relayCount = isset($_POST['relayCount']) ? (int) $_POST['relayCount'] : 0;
158
require_once B2S_PLUGIN_DIR . 'includes/B2S/Ship/Item.php';
159
$itemData = array('networkAuthId' => (int) $_POST['networkAuthId'],
160
'networkId' => (int) $_POST['networkId'],
161
'instantSharing' => (isset($_POST['instantSharing']) ? (int) $_POST['instantSharing'] : 0),
162
'network_display_name' => strip_tags(stripslashes($_POST['networkDisplayName'])),
163
'networkType' => (int) $_POST['networkType']);
@@ -224,8 +236,9 @@ class Ajax_Get {
224
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
225
$postData = new B2S_Post_Item();
226
$showByDate = isset($_POST['showByDate']) ? trim($_POST['showByDate']) : '';
227
$userAuthId = isset($_POST['userAuthId']) ? (int) $_POST['userAuthId'] : 0;
228
- $result = $postData->getSchedPostDataHtml((int) $_POST['postId'], $showByDate, $userAuthId);
229
if ($result !== false) {
230
echo json_encode(array('result' => true, 'postId' => (int) $_POST['postId'], 'content' => $result));
231
wp_die();
@@ -367,7 +380,7 @@ class Ajax_Get {
367
if ($item != null) {
368
$lock_user_id = get_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $_POST['id']);
369
if (!$lock_user_id) {
370
- update_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $_POST['id'], get_current_user_id());
371
$options = new B2S_Options(get_current_user_id());
372
$block_old = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
373
82
$b2sSortPostPublishDate = isset($_POST['b2sSortPostPublishDate']) ? trim($_POST['b2sSortPostPublishDate']) : "";
83
$b2sSortPostStatus = isset($_POST['b2sSortPostStatus']) ? trim($_POST['b2sSortPostStatus']) : "";
84
$b2sShowByDate = isset($_POST['b2sShowByDate']) ? trim($_POST['b2sShowByDate']) : ""; //YYYY-mm-dd
85
+ $b2sShowByNetwork = isset($_POST['b2sShowByNetwork']) ? (int) $_POST['b2sShowByNetwork'] : 0;
86
$b2sUserAuthId = isset($_POST['b2sUserAuthId']) ? (int) $_POST['b2sUserAuthId'] : 0;
87
$b2sPostBlogId = isset($_POST['b2sPostBlogId']) ? (int) $_POST['b2sPostBlogId'] : 0;
88
$b2sSortPostCat = isset($_POST['b2sSortPostCat']) ? trim($_POST['b2sSortPostCat']) : "";
91
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
92
$b2sResultsPerPage = isset($_POST['b2sPostsPerPage']) && intval($_POST['b2sPostsPerPage']) > 0 ? intval($_POST['b2sPostsPerPage']) : B2S_PLUGIN_POSTPERPAGE;
93
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish', 'notice', 'approve'))) {
94
+ $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sShowByNetwork, $b2sUserAuthId, $b2sPostBlogId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
95
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
96
if ($b2sShowPagination) {
97
$result['pagination'] = $postItem->getPaginationHtml();
154
155
public function getShipItem() {
156
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['networkAuthId']) && (int) $_POST['networkAuthId'] > 0) {
157
+ //TOS XING Group
158
+ if ((int) $_POST['networkId'] == 19 && isset($_POST['networkTosGroupId']) && !empty($_POST['networkTosGroupId'])) {
159
+ $options = new B2S_Options(0, 'B2S_PLUGIN_TOS_XING_GROUP_CROSSPOSTING');
160
+ if($options->existsValueByKey($_POST['postId'],$_POST['networkTosGroupId'])){
161
+ echo json_encode(array('result' => false, 'reason' => 'tos_xing_group_exists', 'networkAuthId' => (int) $_POST['networkAuthId']));
162
+ wp_die();
163
+ }
164
+ }
165
+
166
$userLang = isset($_POST['userLang']) ? trim($_POST['userLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
167
$relayCount = isset($_POST['relayCount']) ? (int) $_POST['relayCount'] : 0;
168
require_once B2S_PLUGIN_DIR . 'includes/B2S/Ship/Item.php';
169
$itemData = array('networkAuthId' => (int) $_POST['networkAuthId'],
170
'networkId' => (int) $_POST['networkId'],
171
+ 'networkKind' => (int) $_POST['networkKind'],
172
+ 'networkTosGroupId' => ((isset($_POST['networkTosGroupId']) && !empty($_POST['networkTosGroupId'])) ? trim($_POST['networkTosGroupId']) : ''),
173
'instantSharing' => (isset($_POST['instantSharing']) ? (int) $_POST['instantSharing'] : 0),
174
'network_display_name' => strip_tags(stripslashes($_POST['networkDisplayName'])),
175
'networkType' => (int) $_POST['networkType']);
236
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
237
$postData = new B2S_Post_Item();
238
$showByDate = isset($_POST['showByDate']) ? trim($_POST['showByDate']) : '';
239
+ $showByNetwork = isset($_POST['showByNetwork']) ? trim($_POST['showByNetwork']) : '';
240
$userAuthId = isset($_POST['userAuthId']) ? (int) $_POST['userAuthId'] : 0;
241
+ $result = $postData->getSchedPostDataHtml((int) $_POST['postId'], $showByDate, $showByNetwork, $userAuthId);
242
if ($result !== false) {
243
echo json_encode(array('result' => true, 'postId' => (int) $_POST['postId'], 'content' => $result));
244
wp_die();
380
if ($item != null) {
381
$lock_user_id = get_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $_POST['id']);
382
if (!$lock_user_id) {
383
+ update_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $_POST['id'], get_current_user_id(), false);
384
$options = new B2S_Options(get_current_user_id());
385
$block_old = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
386
includes/Ajax/Post.php CHANGED
@@ -33,7 +33,6 @@ class Ajax_Post {
33
add_action('wp_ajax_b2s_prg_logout', array($this, 'prgLogout'));
34
add_action('wp_ajax_b2s_prg_ship', array($this, 'prgShip'));
35
add_action('wp_ajax_b2s_notice_hide', array($this, 'noticeHide'));
36
- add_action('wp_ajax_b2s_network_tos_accept', array($this, 'networkTosAccept'));
37
add_action('wp_ajax_b2s_ship_navbar_save_settings', array($this, 'b2sShipNavbarSaveSettings'));
38
add_action('wp_ajax_b2s_post_mail_update', array($this, 'b2sPostMailUpdate'));
39
add_action('wp_ajax_b2s_calendar_move_post', array($this, 'b2sCalendarMovePost'));
@@ -65,6 +64,7 @@ class Ajax_Post {
65
$networkData = json_decode(base64_decode($_POST['profile_data_' . $profilId]));
66
if ($networkData !== false && is_array($networkData) && !empty($networkData)) {
67
$notAllowNetwork = array(4, 11, 14, 16, 18);
68
$allowNetworkOnlyImage = array(6, 7, 12);
69
//TOS Twitter 032018 - none multiple Accounts - User select once
70
$selectedTwitterProfile = (isset($_POST['twitter_select']) && !empty($_POST['twitter_select'])) ? (int) $_POST['twitter_select'] : '';
@@ -99,6 +99,46 @@ class Ajax_Post {
99
if (in_array($value->networkId, $notAllowNetwork)) {
100
continue;
101
}
102
$shareData = $quickPost->prepareShareData($value->networkAuthId, $value->networkId, $value->networkType);
103
if ($shareData !== false) {
104
$shareData['network_id'] = $value->networkId;
@@ -120,7 +160,7 @@ class Ajax_Post {
120
$schedResult = array_merge($schedRes, array('networkDisplayName' => $value->networkUserName, 'networkId' => $value->networkId, 'networkType' => $value->networkType));
121
$content = array_merge($content, array($schedResult));
122
} else {
123
- //TYPE direct share
124
$b2sShipSend->savePublishDetails($shareData, array(), true);
125
}
126
}
@@ -135,7 +175,7 @@ class Ajax_Post {
135
$sendResult = $b2sShipSend->postPublish(true);
136
$content = array_merge($content, $sendResult);
137
}
138
- //Render Ouput
139
if (is_array($content) && !empty($content)) {
140
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
141
$view = new B2S_Curation_View();
@@ -185,7 +225,7 @@ class Ajax_Post {
185
186
public function b2sPluginDeactivate() {
187
if (isset($_POST['delete_sched_post']) && (int) $_POST['delete_sched_post'] == 1) {
188
- update_option("B2S_PLUGIN_DEACTIVATE_SCHED_POST", 1);
189
} else {
190
delete_option("B2S_PLUGIN_DEACTIVATE_SCHED_POST");
191
}
@@ -245,7 +285,7 @@ class Ajax_Post {
245
246
public function lockAutoPostImport() {
247
if (isset($_POST['userId']) && (int) $_POST['userId'] > 0) {
248
- update_option('B2S_LOCK_AUTO_POST_IMPORT_' . (int) $_POST['userId'], 1);
249
}
250
echo json_encode(array('result' => true));
251
wp_die();
@@ -253,7 +293,7 @@ class Ajax_Post {
253
254
public function prgLogin() {
255
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) {
256
- $pubKey = json_decode(PRG_Api_Get::get(B2S_PLUGIN_PRG_API_ENDPOINT . 'auth.php?publicKey=true',array()));
257
if (!empty($pubKey) && is_object($pubKey) && isset($pubKey->publicKey) && !empty($pubKey->publicKey) && function_exists('openssl_public_encrypt')) {
258
$usernameCrypted = '';
259
$passwordCrypted = '';
@@ -270,7 +310,7 @@ class Ajax_Post {
270
$prgInfo = array('B2S_PRG_ID' => $result->prg_id,
271
'B2S_PRG_TOKEN' => $result->prg_token);
272
273
- update_option('B2S_PLUGIN_PRG_' . B2S_PLUGIN_BLOG_USER_ID, $prgInfo);
274
echo json_encode(array('result' => true, 'error' => 0));
275
wp_die();
276
}
@@ -309,7 +349,6 @@ class Ajax_Post {
309
delete_option('B2S_PLUGIN_POST_META_TAGES_TWITTER_' . (int) $post['post_id']);
310
delete_option('B2S_PLUGIN_POST_META_TAGES_OG_' . (int) $post['post_id']);
311
312
-
313
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
314
$optionNoCache = $options->_getOption('link_no_cache');
315
@@ -327,7 +366,7 @@ class Ajax_Post {
327
continue;
328
}
329
330
- //Change/Set MetaTags
331
if ((int) $data['network_id'] == 1 && $metaOg == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_og_meta']) && (int) $post['change_og_meta'] == 1) { //LinkPost
332
$metaOg = true;
333
$meta = B2S_Meta::getInstance();
@@ -361,6 +400,12 @@ class Ajax_Post {
361
$meta->updateMeta((int) $post['post_id']);
362
}
363
364
$sendData = array("board" => isset($data['board']) ? $data['board'] : '',
365
"group" => isset($data['group']) ? $data['group'] : '',
366
"custom_title" => isset($data['custom_title']) ? strip_tags($data['custom_title']) : '',
@@ -370,7 +415,11 @@ class Ajax_Post {
370
'tags' => isset($data['tags']) ? $data['tags'] : array(),
371
'network_id' => isset($data['network_id']) ? $data['network_id'] : '',
372
'instant_sharing' => isset($data['instant_sharing']) ? (int) $data['instant_sharing'] : 0,
373
'network_type' => isset($data['network_type']) ? $data['network_type'] : '',
374
'network_display_name' => isset($data['network_display_name']) ? $data['network_display_name'] : '',
375
'network_auth_id' => $networkAuthId,
376
'post_format' => isset($data['post_format']) ? (int) $data['post_format'] : '',
@@ -565,7 +614,7 @@ class Ajax_Post {
565
if ((int) $_POST['allow_shortcode'] == 1) {
566
delete_option('B2S_PLUGIN_USER_ALLOW_SHORTCODE_' . B2S_PLUGIN_BLOG_USER_ID);
567
} else {
568
- update_option('B2S_PLUGIN_USER_ALLOW_SHORTCODE_' . B2S_PLUGIN_BLOG_USER_ID, 1);
569
}
570
echo json_encode(array('result' => true, 'content' => (((int) $_POST['allow_shortcode'] == 1) ? 0 : 1)));
571
wp_die();
@@ -836,12 +885,6 @@ class Ajax_Post {
836
wp_die();
837
}
838
839
- public function networkTosAccept() {
840
- update_option('B2S_PLUGIN_NETWORK_TOS_ACCEPT_072018_USER_' . B2S_PLUGIN_BLOG_USER_ID, 1);
841
- echo json_encode(array('result' => true));
842
- wp_die();
843
- }
844
-
845
public function b2sShipNavbarSaveSettings() {
846
if (isset($_POST['mandantId'])) {
847
global $wpdb;
@@ -880,7 +923,7 @@ class Ajax_Post {
880
'email' => $_POST['email'],
881
'lang' => $_POST['lang']);
882
B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $post);
883
- update_option('B2S_UPDATE_MAIL_' . B2S_PLUGIN_BLOG_USER_ID, $post['email']);
884
}
885
echo json_encode(array('result' => true));
886
wp_die();
@@ -1104,6 +1147,10 @@ class Ajax_Post {
1104
'tags' => isset($data['tags']) ? $data['tags'] : array(),
1105
'network_id' => isset($data['network_id']) ? $data['network_id'] : '',
1106
'network_type' => isset($data['network_type']) ? $data['network_type'] : '',
1107
'network_display_name' => isset($data['network_display_name']) ? $data['network_display_name'] : '',
1108
'network_auth_id' => $networkAuthId,
1109
'post_format' => isset($data['post_format']) ? (int) $data['post_format'] : '',
@@ -1181,15 +1228,15 @@ class Ajax_Post {
1181
}
1182
1183
public function hidePremiumMessage() {
1184
- update_option("B2S_HIDE_PREMIUM_MESSAGE", true);
1185
}
1186
1187
public function hideTrailMessage() {
1188
- update_option("B2S_HIDE_TRAIL_MESSAGE", true);
1189
}
1190
1191
public function hideTrailEndedMessage() {
1192
- update_option("B2S_HIDE_TRAIL_ENDED", true);
1193
}
1194
1195
}
33
add_action('wp_ajax_b2s_prg_logout', array($this, 'prgLogout'));
34
add_action('wp_ajax_b2s_prg_ship', array($this, 'prgShip'));
35
add_action('wp_ajax_b2s_notice_hide', array($this, 'noticeHide'));
36
add_action('wp_ajax_b2s_ship_navbar_save_settings', array($this, 'b2sShipNavbarSaveSettings'));
37
add_action('wp_ajax_b2s_post_mail_update', array($this, 'b2sPostMailUpdate'));
38
add_action('wp_ajax_b2s_calendar_move_post', array($this, 'b2sCalendarMovePost'));
64
$networkData = json_decode(base64_decode($_POST['profile_data_' . $profilId]));
65
if ($networkData !== false && is_array($networkData) && !empty($networkData)) {
66
$notAllowNetwork = array(4, 11, 14, 16, 18);
67
+ $tosCrossPosting = unserialize(B2S_PLUGIN_NETWORK_CROSSPOSTING_LIMIT);
68
$allowNetworkOnlyImage = array(6, 7, 12);
69
//TOS Twitter 032018 - none multiple Accounts - User select once
70
$selectedTwitterProfile = (isset($_POST['twitter_select']) && !empty($_POST['twitter_select'])) ? (int) $_POST['twitter_select'] : '';
99
if (in_array($value->networkId, $notAllowNetwork)) {
100
continue;
101
}
102
+
103
+ //Filter: TOS Crossposting ignore
104
+ if (isset($tosCrossPosting[$value->networkId][$value->networkType])) {
105
+ continue;
106
+ }
107
+
108
+ //Filter: DeprecatedNetwork-8 31 march
109
+ if ($value->networkId == 8) {
110
+ if (isset($_POST['ship_type']) && (int) $_POST['ship_type'] == 1 && isset($_POST['ship_date']) && !empty($_POST['ship_date']) && strtotime($_POST['ship_date']) !== false) {
111
+ if (date('Y-m-d', strtotime($_POST['ship_date'])) >= '2019-03-31') {
112
+ //special case xing groups contains network_display_name
113
+ global $wpdb;
114
+ $networkDetailsId = 0;
115
+ if ($value->networkType == 2) {
116
+ $networkDetailsIdSelect = $wpdb->get_col($wpdb->prepare("SELECT postNetworkDetails.id FROM b2s_posts_network_details AS postNetworkDetails WHERE postNetworkDetails.network_auth_id = %s AND postNetworkDetails.network_display_name = %s", $value->networkAuthId, trim($value->networkUserName)));
117
+ } else {
118
+ $networkDetailsIdSelect = $wpdb->get_col($wpdb->prepare("SELECT postNetworkDetails.id FROM b2s_posts_network_details AS postNetworkDetails WHERE postNetworkDetails.network_auth_id = %s", $value->networkAuthId));
119
+ }
120
+ if (isset($networkDetailsIdSelect[0])) {
121
+ $networkDetailsId = (int) $networkDetailsIdSelect[0];
122
+ } else {
123
+ $wpdb->insert('b2s_posts_network_details', array(
124
+ 'network_id' => (int) $value->networkId,
125
+ 'network_type' => (int) $value->networkType,
126
+ 'network_auth_id' => (int) $value->networkAuthId,
127
+ 'network_display_name' => $value->networkUserName), array('%d', '%d', '%d', '%s'));
128
+ $networkDetailsId = $wpdb->insert_id;
129
+ }
130
+ $timeZone= (isset($_POST['b2s_user_timezone']) ? $_POST['b2s_user_timezone'] : 0 );
131
+ $wpdb->insert('b2s_posts', array(
132
+ 'post_id' => $postId,
133
+ 'blog_user_id' => B2S_PLUGIN_BLOG_USER_ID,
134
+ 'user_timezone' =>$timeZone,
135
+ 'publish_date' => date('Y-m-d H:i:s', strtotime(B2S_Util::getUTCForDate(gmdate('Y-m-d H:i:s'), $timeZone * (-1)))),
136
+ 'publish_error_code' => 'DEPRECATED_NETWORK_8',
137
+ 'network_details_id' => $networkDetailsId), array('%d', '%d', '%s', '%s', '%s', '%d'));
138
+ continue;
139
+ }
140
+ }
141
+ }
142
$shareData = $quickPost->prepareShareData($value->networkAuthId, $value->networkId, $value->networkType);
143
if ($shareData !== false) {
144
$shareData['network_id'] = $value->networkId;
160
$schedResult = array_merge($schedRes, array('networkDisplayName' => $value->networkUserName, 'networkId' => $value->networkId, 'networkType' => $value->networkType));
161
$content = array_merge($content, array($schedResult));
162
} else {
163
+ //TYPE direct share
164
$b2sShipSend->savePublishDetails($shareData, array(), true);
165
}
166
}
175
$sendResult = $b2sShipSend->postPublish(true);
176
$content = array_merge($content, $sendResult);
177
}
178
+ //Render Ouput
179
if (is_array($content) && !empty($content)) {
180
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/View.php');
181
$view = new B2S_Curation_View();
225
226
public function b2sPluginDeactivate() {
227
if (isset($_POST['delete_sched_post']) && (int) $_POST['delete_sched_post'] == 1) {
228
+ update_option("B2S_PLUGIN_DEACTIVATE_SCHED_POST", 1,false);
229
} else {
230
delete_option("B2S_PLUGIN_DEACTIVATE_SCHED_POST");
231
}
285
286
public function lockAutoPostImport() {
287
if (isset($_POST['userId']) && (int) $_POST['userId'] > 0) {
288
+ update_option('B2S_LOCK_AUTO_POST_IMPORT_' . (int) $_POST['userId'], 1,false);
289
}
290
echo json_encode(array('result' => true));
291
wp_die();
293
294
public function prgLogin() {
295
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) {
296
+ $pubKey = json_decode(PRG_Api_Get::get(B2S_PLUGIN_PRG_API_ENDPOINT . 'auth.php?publicKey=true', array()));
297
if (!empty($pubKey) && is_object($pubKey) && isset($pubKey->publicKey) && !empty($pubKey->publicKey) && function_exists('openssl_public_encrypt')) {
298
$usernameCrypted = '';
299
$passwordCrypted = '';
310
$prgInfo = array('B2S_PRG_ID' => $result->prg_id,
311
'B2S_PRG_TOKEN' => $result->prg_token);
312
313
+ update_option('B2S_PLUGIN_PRG_' . B2S_PLUGIN_BLOG_USER_ID, $prgInfo,false);
314
echo json_encode(array('result' => true, 'error' => 0));
315
wp_die();
316
}
349
delete_option('B2S_PLUGIN_POST_META_TAGES_TWITTER_' . (int) $post['post_id']);
350
delete_option('B2S_PLUGIN_POST_META_TAGES_OG_' . (int) $post['post_id']);
351
352
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
353
$optionNoCache = $options->_getOption('link_no_cache');
354
366
continue;
367
}
368
369
+ //Change/Set MetaTags
370
if ((int) $data['network_id'] == 1 && $metaOg == false && (int) $post['post_id'] > 0 && isset($data['post_format']) && (int) $data['post_format'] == 0 && isset($post['change_og_meta']) && (int) $post['change_og_meta'] == 1) { //LinkPost
371
$metaOg = true;
372
$meta = B2S_Meta::getInstance();
400
$meta->updateMeta((int) $post['post_id']);
401
}
402
403
+ //TOS XING Group
404
+ if (isset($data['network_tos_group_id']) && !empty($data['network_tos_group_id'])) {
405
+ $options = new B2S_Options(0, 'B2S_PLUGIN_TOS_XING_GROUP_CROSSPOSTING');
406
+ $options->_setOption((int) $post['post_id'], $data['network_tos_group_id'], true);
407
+ }
408
+
409
$sendData = array("board" => isset($data['board']) ? $data['board'] : '',
410
"group" => isset($data['group']) ? $data['group'] : '',
411
"custom_title" => isset($data['custom_title']) ? strip_tags($data['custom_title']) : '',
415
'tags' => isset($data['tags']) ? $data['tags'] : array(),
416
'network_id' => isset($data['network_id']) ? $data['network_id'] : '',
417
'instant_sharing' => isset($data['instant_sharing']) ? (int) $data['instant_sharing'] : 0,
418
+ 'network_tos_group_id' => (isset($data['network_tos_group_id']) && !empty($data['network_tos_group_id'])) ? $data['network_tos_group_id'] : '',
419
'network_type' => isset($data['network_type']) ? $data['network_type'] : '',
420
+ 'network_kind' => isset($data['network_kind']) ? (int) $data['network_kind'] : 0,
421
+ 'marketplace_category' => isset($data['marketplace_category']) ? (int) $data['marketplace_category'] : 0,
422
+ 'marketplace_type' => isset($data['marketplace_type']) ? (int) $data['marketplace_type'] : 0,
423
'network_display_name' => isset($data['network_display_name']) ? $data['network_display_name'] : '',
424
'network_auth_id' => $networkAuthId,
425
'post_format' => isset($data['post_format']) ? (int) $data['post_format'] : '',
614
if ((int) $_POST['allow_shortcode'] == 1) {
615
delete_option('B2S_PLUGIN_USER_ALLOW_SHORTCODE_' . B2S_PLUGIN_BLOG_USER_ID);
616
} else {
617
+ update_option('B2S_PLUGIN_USER_ALLOW_SHORTCODE_' . B2S_PLUGIN_BLOG_USER_ID, 1,false);
618
}
619
echo json_encode(array('result' => true, 'content' => (((int) $_POST['allow_shortcode'] == 1) ? 0 : 1)));
620
wp_die();
885
wp_die();
886
}
887
888
public function b2sShipNavbarSaveSettings() {
889
if (isset($_POST['mandantId'])) {
890
global $wpdb;
923
'email' => $_POST['email'],
924
'lang' => $_POST['lang']);
925
B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $post);
926
+ update_option('B2S_UPDATE_MAIL_' . B2S_PLUGIN_BLOG_USER_ID, $post['email'],false);
927
}
928
echo json_encode(array('result' => true));
929
wp_die();
1147
'tags' => isset($data['tags']) ? $data['tags'] : array(),
1148
'network_id' => isset($data['network_id']) ? $data['network_id'] : '',
1149
'network_type' => isset($data['network_type']) ? $data['network_type'] : '',
1150
+ 'network_tos_group_id' => (isset($data['network_tos_group_id']) && !empty($data['network_tos_group_id'])) ? $data['network_tos_group_id'] : '',
1151
+ 'network_kind' => isset($data['network_kind']) ? (int) $data['network_kind'] : 0,
1152
+ 'marketplace_category' => isset($data['marketplace_category']) ? (int) $data['marketplace_category'] : 0,
1153
+ 'marketplace_type' => isset($data['marketplace_type']) ? (int) $data['marketplace_type'] : 0,
1154
'network_display_name' => isset($data['network_display_name']) ? $data['network_display_name'] : '',
1155
'network_auth_id' => $networkAuthId,
1156
'post_format' => isset($data['post_format']) ? (int) $data['post_format'] : '',
1228
}
1229
1230
public function hidePremiumMessage() {
1231
+ update_option("B2S_HIDE_PREMIUM_MESSAGE", true,false);
1232
}
1233
1234
public function hideTrailMessage() {
1235
+ update_option("B2S_HIDE_TRAIL_MESSAGE", true,false);
1236
}
1237
1238
public function hideTrailEndedMessage() {
1239
+ update_option("B2S_HIDE_TRAIL_ENDED", true,false);
1240
}
1241
1242
}
includes/B2S/AutoPost.php CHANGED
@@ -31,8 +31,8 @@ class B2S_AutoPost {
31
$this->optionPostFormat = $optionPostFormat;
32
$this->allowHashTag = $allowHashTag;
33
$this->optionContentTwitter = $optionContentTwitter;
34
- $this->setPreFillText = array(0 => array(1 => 239, 2 => 255, 3 => 239, 6 => 300, 8 => 239, 9 => 200, 10 => 442, 12 => 240, 16 => 250, 17 => 442, 18 => 800), 1 => array(1 => 239, 3 => 239, 8 => 1200, 10 => 442, 17 => 442), 2 => array(1 => 239, 8 => 239, 10 => 442, 17 => 442));
35
- $this->setPreFillTextLimit = array(0 => array(1 => 400, 2 => 256, 3 => 400, 6 => 400, 8 => 400, 9 => 200, 10 => 500, 12 => 400, 18 => 1000), 1 => array(1 => 400, 3 => 400, 8 => 1200, 10 => 500), 2 => array(1 => 400, 8 => 400, 10 => 500));
36
}
37
38
public function prepareShareData($networkAuthId = 0, $networkId = 0, $networkType = 0) {
@@ -101,7 +101,7 @@ class B2S_AutoPost {
101
return false;
102
}
103
}
104
- if ($networkId == 8) {
105
$postData['content'] = (isset($this->setPreFillText[$networkType][$networkId])) ? B2S_Util::getExcerpt($this->content, (int) $this->setPreFillText[$networkType][$networkId], (int) $this->setPreFillTextLimit[$networkType][$networkId]) : $this->content;
106
if ($networkType != 0) {
107
$postData['custom_title'] = strip_tags($this->title);
@@ -228,21 +228,32 @@ class B2S_AutoPost {
228
}
229
230
if ($networkDetailsId > 0) {
231
- $wpdb->insert('b2s_posts_sched_details', array('sched_data' => serialize($shareData), 'image_url' => (isset($shareData['image_url']) ? $shareData['image_url'] : '')), array('%s', '%s'));
232
- $schedDetailsId = $wpdb->insert_id;
233
- $wpdb->insert('b2s_posts', array(
234
- 'post_id' => $this->postId,
235
- 'blog_user_id' => $this->blogPostData['blog_user_id'],
236
- 'user_timezone' => $this->blogPostData['user_timezone'],
237
- 'publish_date' => (($sched_type == 3) ? $sched_date : "0000-00-00 00:00:00"),
238
- 'sched_details_id' => $schedDetailsId,
239
- 'sched_type' => $sched_type,
240
- 'sched_date' => $sched_date,
241
- 'sched_date_utc' => $sched_date_utc,
242
- 'network_details_id' => $networkDetailsId,
243
- 'post_for_approve' => (int) $shareApprove,
244
- 'hook_action' => (((int) $shareApprove == 0) ? 1 : 0)), array('%d', '%d', '%s', '%s', '%d', '%d', '%s', '%s', '%d', '%d', '%d'));
245
- B2S_Rating::trigger();
246
}
247
}
248
31
$this->optionPostFormat = $optionPostFormat;
32
$this->allowHashTag = $allowHashTag;
33
$this->optionContentTwitter = $optionContentTwitter;
34
+ $this->setPreFillText = array(0 => array(1 => 239, 2 => 255, 3 => 239, 6 => 300, 8 => 239, 9 => 200, 10 => 442, 12 => 240, 16 => 250, 17 => 442, 18 => 800, 19 => 239), 1 => array(1 => 239, 3 => 239, 8 => 1200, 10 => 442, 17 => 442, 19 => 239), 2 => array(1 => 239, 8 => 239, 10 => 442, 17 => 442, 19 => 239));
35
+ $this->setPreFillTextLimit = array(0 => array(1 => 400, 2 => 256, 3 => 400, 6 => 400, 8 => 400, 9 => 200, 10 => 500, 12 => 400, 18 => 1000), 1 => array(1 => 400, 3 => 400, 8 => 1200, 10 => 500, 19 => 400), 2 => array(1 => 400, 8 => 400, 10 => 500, 19 => 9000));
36
}
37
38
public function prepareShareData($networkAuthId = 0, $networkId = 0, $networkType = 0) {
101
return false;
102
}
103
}
104
+ if ($networkId == 8 && $networkId == 19) {
105
$postData['content'] = (isset($this->setPreFillText[$networkType][$networkId])) ? B2S_Util::getExcerpt($this->content, (int) $this->setPreFillText[$networkType][$networkId], (int) $this->setPreFillTextLimit[$networkType][$networkId]) : $this->content;
106
if ($networkType != 0) {
107
$postData['custom_title'] = strip_tags($this->title);
228
}
229
230
if ($networkDetailsId > 0) {
231
+ //DeprecatedNetwork-8 31 march
232
+ if ($network_id == 8 && $sched_date_utc >= '2019-03-30 23:59:59') {
233
+ $wpdb->insert('b2s_posts', array(
234
+ 'post_id' => $this->postId,
235
+ 'blog_user_id' => $this->blogPostData['blog_user_id'],
236
+ 'user_timezone' => $this->blogPostData['user_timezone'],
237
+ 'publish_date' => date('Y-m-d H:i:s', strtotime(B2S_Util::getUTCForDate(gmdate('Y-m-d H:i:s'), $this->blogPostData['user_timezone'] * (-1)))),
238
+ 'publish_error_code' => 'DEPRECATED_NETWORK_8',
239
+ 'network_details_id' => $networkDetailsId), array('%d', '%d', '%s', '%s', '%s', '%d'));
240
+ } else {
241
+ $wpdb->insert('b2s_posts_sched_details', array('sched_data' => serialize($shareData), 'image_url' => (isset($shareData['image_url']) ? $shareData['image_url'] : '')), array('%s', '%s'));
242
+ $schedDetailsId = $wpdb->insert_id;
243
+ $wpdb->insert('b2s_posts', array(
244
+ 'post_id' => $this->postId,
245
+ 'blog_user_id' => $this->blogPostData['blog_user_id'],
246
+ 'user_timezone' => $this->blogPostData['user_timezone'],
247
+ 'publish_date' => (($sched_type == 3) ? $sched_date : "0000-00-00 00:00:00"),
248
+ 'sched_details_id' => $schedDetailsId,
249
+ 'sched_type' => $sched_type,
250
+ 'sched_date' => $sched_date,
251
+ 'sched_date_utc' => $sched_date_utc,
252
+ 'network_details_id' => $networkDetailsId,
253
+ 'post_for_approve' => (int) $shareApprove,
254
+ 'hook_action' => (((int) $shareApprove == 0) ? 1 : 0)), array('%d', '%d', '%s', '%s', '%d', '%d', '%s', '%s', '%d', '%d', '%d'));
255
+ B2S_Rating::trigger();
256
+ }
257
}
258
}
259
includes/B2S/Calendar/Filter.php CHANGED
@@ -106,7 +106,7 @@ class B2S_Calendar_Filter {
106
public static function getFilterNetworkAuthHtml($network_id = 0) {
107
global $wpdb;
108
$addNotAdminPosts = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND b2s_posts.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
109
- $addNetwork = $wpdb->prepare(' AND b2s_posts_network_details.`network_id` = %d', $network_id);
110
$approvePosts = " AND ((b2s_posts.`sched_date_utc` != '0000-00-00 00:00:00' AND b2s_posts.`post_for_approve` = 0)OR (b2s_posts.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND b2s_posts.`post_for_approve` = 1))";
111
112
$sql = "SELECT b2s_posts_network_details.network_type, "
@@ -286,11 +286,15 @@ class B2S_Calendar_Filter {
286
287
public function getNetworkHtml() {
288
$content = '';
289
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getNetwork', 'token' => B2S_PLUGIN_TOKEN, 'version' => B2S_PLUGIN_VERSION)));
290
if (is_object($result) && isset($result->result) && (int) $result->result == 1 && isset($result->portale) && is_array($result->portale)) {
291
$content = '<label><input type="radio" class="b2s-calendar-filter-network-btn" checked name="b2s-calendar-filter-network-btn" value="all" /><span>all</span></label>';
292
293
foreach ($result->portale as $k => $v) {
294
$content .='<label><input type="radio" class="b2s-calendar-filter-network-btn" name="b2s-calendar-filter-network-btn" value="' . $v->id . '" /><span>';
295
$content .='<img class="b2s-calendar-filter-img" alt="' . $v->name . '" src="' . plugins_url('/assets/images/portale/' . $v->id . '_flat.png', B2S_PLUGIN_FILE) . '">';
296
$content .='</span></label>';
106
public static function getFilterNetworkAuthHtml($network_id = 0) {
107
global $wpdb;
108
$addNotAdminPosts = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND b2s_posts.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
109
+ $addNetwork = ($network_id != 19) ? $wpdb->prepare(' AND b2s_posts_network_details.`network_id` = %d', $network_id) : ' AND (b2s_posts_network_details.`network_id` = '.$network_id.' OR b2s_posts_network_details.`network_id` = 8)' ; //combine XING old and new
110
$approvePosts = " AND ((b2s_posts.`sched_date_utc` != '0000-00-00 00:00:00' AND b2s_posts.`post_for_approve` = 0)OR (b2s_posts.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND b2s_posts.`post_for_approve` = 1))";
111
112
$sql = "SELECT b2s_posts_network_details.network_type, "
286
287
public function getNetworkHtml() {
288
$content = '';
289
+ $deprecatedNetwork = 8;
290
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getNetwork', 'token' => B2S_PLUGIN_TOKEN, 'version' => B2S_PLUGIN_VERSION)));
291
if (is_object($result) && isset($result->result) && (int) $result->result == 1 && isset($result->portale) && is_array($result->portale)) {
292
$content = '<label><input type="radio" class="b2s-calendar-filter-network-btn" checked name="b2s-calendar-filter-network-btn" value="all" /><span>all</span></label>';
293
294
foreach ($result->portale as $k => $v) {
295
+ if($v->id == $deprecatedNetwork){
296
+ continue;
297
+ }
298
$content .='<label><input type="radio" class="b2s-calendar-filter-network-btn" name="b2s-calendar-filter-network-btn" value="' . $v->id . '" /><span>';
299
$content .='<img class="b2s-calendar-filter-img" alt="' . $v->name . '" src="' . plugins_url('/assets/images/portale/' . $v->id . '_flat.png', B2S_PLUGIN_FILE) . '">';
300
$content .='</span></label>';
includes/B2S/Calendar/ItemEdit.php CHANGED
@@ -51,6 +51,18 @@ class B2S_Calendar_ItemEdit extends B2S_Ship_Item {
51
52
return $message;
53
}
54
55
protected function hook_meta(array $meta)
56
{
51
52
return $message;
53
}
54
+
55
+ protected function hook_sched_data(array $schedData)
56
+ {
57
+ if($this->getCalendarItem())
58
+ {
59
+ $schedData = $this->getCalendarItem()->getSchedData();
60
+
61
+ }
62
+
63
+ return $schedData;
64
+ }
65
+
66
67
protected function hook_meta(array $meta)
68
{
includes/B2S/Network/Item.php CHANGED
@@ -7,6 +7,7 @@ class B2S_Network_Item {
7
private $allowPage;
8
private $allowGroup;
9
private $modifyBoardAndGroup;
10
private $oAuthPortal;
11
private $mandantenId;
12
private $bestTimeInfo;
@@ -30,6 +31,7 @@ class B2S_Network_Item {
30
$this->oAuthPortal = unserialize(B2S_PLUGIN_NETWORK_OAUTH);
31
$this->bestTimeInfo = unserialize(B2S_PLUGIN_SCHED_DEFAULT_TIMES_INFO);
32
$this->modifyBoardAndGroup = unserialize(B2S_PLUGIN_NETWORK_ALLOW_MODIFY_BOARD_AND_GROUP);
33
$this->lang = substr(B2S_LANGUAGE, 0, 2);
34
}
35
}
@@ -111,41 +113,59 @@ class B2S_Network_Item {
111
$containerMandantId = $mandantId;
112
$mandantId = ($mandantId == -1) ? 0 : $mandantId;
113
$sprache = substr(B2S_LANGUAGE, 0, 2);
114
- $html = '<li class="list-group-item">';
115
$html .='<div class="media">';
116
- $html .='<img class="pull-left hidden-xs b2s-img-network" alt="' . $networkName . '" src="' . plugins_url('/assets/images/portale/' . $networkId . '_flat.png', B2S_PLUGIN_FILE) . '">';
117
$html .='<div class="media-body network">';
118
- $html .= '<h4>' . ucfirst($networkName);
119
- if ($maxNetworkAccount !== false) {
120
- if ($networkId == 18) {
121
- $html .=' <a class="b2s-info-btn" data-target="#b2sInfoNetwork18" data-toggle="modal" href="#">Info</a>';
122
}
123
- }
124
- if (isset($this->bestTimeInfo[$networkId]) && !empty($this->bestTimeInfo[$networkId]) && is_array($this->bestTimeInfo[$networkId])) {
125
- $time = '';
126
- $slug = ($this->lang == 'de') ? __('Uhr', 'blog2social') : '';
127
- foreach ($this->bestTimeInfo[$networkId] as $k => $v) {
128
- $time .= B2S_Util::getTimeByLang($v[0], $this->lang) . '-' . B2S_Util::getTimeByLang($v[1], $this->lang) . $slug . ', ';
129
}
130
- $html .= '<span class="hidden-xs hidden-sm b2s-sched-manager-best-time-info">(' . __('Best times', 'blog2social') . ': ' . substr($time, 0, -2) . ')</span>';
131
- }
132
133
- $html .= '<span class="pull-right">';
134
135
- $b2sAuthUrl = $this->authurl . '&portal_id=' . $networkId . '&transfer=' . (in_array($networkId, $this->oAuthPortal) ? 'oauth' : 'form' ) . '&mandant_id=' . $mandantId . '&version=3&affiliate_id=' . B2S_Tools::getAffiliateId();
136
137
- if (in_array($networkId, $this->allowProfil)) {
138
- $html .= ($networkId != 18 || (B2S_PLUGIN_USER_VERSION >= 2 && $networkId == 18)) ? '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=profile\', \'Blog2Social Network\'); return false;" class="btn btn-primary btn-sm b2s-network-auth-btn">+ ' . __('Profile', 'blog2social') . '</a>' : '<a href="#" class="btn btn-primary btn-sm b2s-network-auth-btn b2s-btn-disabled" data-title="' . __('You want to connect a network profile?', 'blog2social') . '" data-toggle="modal" data-type="auth-network" data-target="#b2sProFeatureModal">+ ' . __('Profile', 'blog2social') . ' <span class="label label-success">' . __("PREMIUM", "blog2social") . '</a>';
139
}
140
- if (in_array($networkId, $this->allowPage)) {
141
- $html .= (B2S_PLUGIN_USER_VERSION > 1 || (B2S_PLUGIN_USER_VERSION == 0 && $networkId == 1) || (B2S_PLUGIN_USER_VERSION == 1 && ($networkId == 1 || $networkId == 10))) ? '<button onclick="wop(\'' . $b2sAuthUrl . '&choose=page\', \'Blog2Social Network\'); return false;" class="btn btn-primary btn-sm b2s-network-auth-btn">+ ' . __('Page', 'blog2social') . '</button>' : '<a href="#" class="btn btn-primary btn-sm b2s-network-auth-btn b2s-btn-disabled" data-title="' . __('You want to connect a network page?', 'blog2social') . '" data-toggle="modal" data-type="auth-network" data-target="#' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'b2sPreFeatureModal' : 'b2sProFeatureModal') . '">+ ' . __('Page', 'blog2social') . ' <span class="label label-success">' . __("PREMIUM", "blog2social") . '</a>';
142
}
143
- if (in_array($networkId, $this->allowGroup)) {
144
- $html .= (B2S_PLUGIN_USER_VERSION > 1 || (B2S_PLUGIN_USER_VERSION == 1 && $networkId != 8)) ? '<button onclick="wop(\'' . $b2sAuthUrl . '&choose=group\', \'Blog2Social Network\'); return false;" class="btn btn-primary btn-sm b2s-network-auth-btn">+ ' . __('Group', 'blog2social') . '</button>' : '<a href="#" class="btn btn-primary btn-sm b2s-network-auth-btn b2s-btn-disabled" data-toggle="modal" data-title="' . __('You want to connect a social media group?', 'blog2social') . '" data-type="auth-network" data-target="#' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'b2sPreFeatureModal' : 'b2sProFeatureModal') . '">+ ' . __('Group', 'blog2social') . ' <span class="label label-success">' . __("PREMIUM", "blog2social") . '</span></a>';
145
}
146
-
147
- $html .= '</span></h4>';
148
$html .= '<div class="clearfix"></div>';
149
$html .= '<ul class="b2s-network-item-auth-list" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" ' . (($showAllAuths) ? 'data-network-count="true"' : '') . '>';
150
151
//First Line
@@ -179,10 +199,12 @@ class B2S_Network_Item {
179
if (isset($networkData[0])) {
180
foreach ($networkData[0] as $k => $v) {
181
182
- $isInterrupted = ($v['expiredDate'] != '0000-00-00' && $v['expiredDate'] <= date('Y-m-d')) ? true : false;
183
$notAllow = ($v['notAllow'] !== false) ? true : false;
184
185
- $html .= '<li class="b2s-network-item-auth-list-li ' . (($notAllow) ? 'b2s-label-warning-border-left' : (($isInterrupted) ? 'b2s-label-danger-border-left' : '')) . ' " data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="0">';
186
$html .='<div class="pull-left">';
187
188
if ($notAllow) {
@@ -193,7 +215,7 @@ class B2S_Network_Item {
193
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
194
}
195
196
- $html .= '<span class="b2s-network-item-auth-type">' . __('Profile', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
197
198
if (!empty($mandantName)) {
199
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
@@ -202,7 +224,7 @@ class B2S_Network_Item {
202
203
$html .='<div class="pull-right">';
204
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="0" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
205
- if (!$notAllow) {
206
$html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=profil&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
207
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
208
if (isset($this->modifyBoardAndGroup[$networkId])) {
@@ -231,10 +253,11 @@ class B2S_Network_Item {
231
if (isset($networkData[1])) {
232
foreach ($networkData[1] as $k => $v) {
233
234
- $isInterrupted = ($v['expiredDate'] != '0000-00-00' && $v['expiredDate'] <= date('Y-m-d')) ? true : false;
235
$notAllow = ($v['notAllow'] !== false) ? true : false;
236
237
- $html .= '<li class="b2s-network-item-auth-list-li ' . (($notAllow) ? 'b2s-label-warning-border-left' : (($isInterrupted) ? 'b2s-label-danger-border-left' : '')) . '" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="1">';
238
$html .='<div class="pull-left">';
239
240
if ($notAllow) {
@@ -245,7 +268,7 @@ class B2S_Network_Item {
245
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
246
}
247
248
- $html .= '<span class="b2s-network-item-auth-type">' . __('Page', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
249
250
if (!empty($mandantName)) {
251
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
@@ -253,7 +276,7 @@ class B2S_Network_Item {
253
$html .='</div>';
254
$html .='<div class="pull-right">';
255
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="1" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
256
- if (!$notAllow) {
257
$html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=page&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
258
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
259
if (isset($this->modifyBoardAndGroup[$networkId])) {
@@ -283,10 +306,11 @@ class B2S_Network_Item {
283
if (isset($networkData[2])) {
284
foreach ($networkData[2] as $k => $v) {
285
286
- $isInterrupted = ($v['expiredDate'] != '0000-00-00' && $v['expiredDate'] <= date('Y-m-d')) ? true : false;
287
$notAllow = ($v['notAllow'] !== false) ? true : false;
288
289
- $html .= '<li class="b2s-network-item-auth-list-li ' . (($notAllow) ? 'b2s-label-warning-border-left' : (($isInterrupted) ? 'b2s-label-danger-border-left' : '')) . '" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="2">';
290
291
$html .='<div class="pull-left">';
292
@@ -298,7 +322,7 @@ class B2S_Network_Item {
298
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
299
}
300
301
- $html .= '<span class="b2s-network-item-auth-type">' . __('Group', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
302
303
if (!empty($mandantName)) {
304
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
@@ -306,7 +330,7 @@ class B2S_Network_Item {
306
$html .='</div>';
307
$html .='<div class="pull-right">';
308
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="2" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
309
- if (!$notAllow) {
310
$html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=group&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
311
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
312
if (isset($this->modifyBoardAndGroup[$networkId])) {
@@ -343,13 +367,14 @@ class B2S_Network_Item {
343
'networkAuthId' => $value->networkAuthId,
344
'networkUserName' => $value->networkUserName,
345
'expiredDate' => $value->expiredDate,
346
'notAllow' => (isset($value->notAllow) ? $value->notAllow : false)
347
);
348
}
349
return $convertAuth;
350
}
351
352
- //New >V5.1.0 Seeding
353
private function getUserSchedTime($network_auth_id = 0, $network_id = 0, $network_type = 0, $type = 'time') { //type = time,day
354
//new > v5.1.0
355
if ($this->userSchedData !== false) {
@@ -380,7 +405,7 @@ class B2S_Network_Item {
380
return null;
381
}
382
383
- //Old < 5.1.0
384
private function getSchedDataByUser() {
385
global $wpdb;
386
$saveSchedData = null;
7
private $allowPage;
8
private $allowGroup;
9
private $modifyBoardAndGroup;
10
+ private $networkKindName;
11
private $oAuthPortal;
12
private $mandantenId;
13
private $bestTimeInfo;
31
$this->oAuthPortal = unserialize(B2S_PLUGIN_NETWORK_OAUTH);
32
$this->bestTimeInfo = unserialize(B2S_PLUGIN_SCHED_DEFAULT_TIMES_INFO);
33
$this->modifyBoardAndGroup = unserialize(B2S_PLUGIN_NETWORK_ALLOW_MODIFY_BOARD_AND_GROUP);
34
+ $this->networkKindName = unserialize(B2S_PLUGIN_NETWORK_KIND);
35
$this->lang = substr(B2S_LANGUAGE, 0, 2);
36
}
37
}
113
$containerMandantId = $mandantId;
114
$mandantId = ($mandantId == -1) ? 0 : $mandantId;
115
$sprache = substr(B2S_LANGUAGE, 0, 2);
116
+ $html = '<li class="list-group-item" data-network-id="' . $networkId . '">';
117
$html .='<div class="media">';
118
+ if ($networkId != 8) {
119
+ $html .='<img class="pull-left hidden-xs b2s-img-network" alt="' . $networkName . '" src="' . plugins_url('/assets/images/portale/' . $networkId . '_flat.png', B2S_PLUGIN_FILE) . '">';
120
+ } else {
121
+ $html .='<span class="pull-left hidden-xs b2s-img-network"></span>';
122
+ }
123
$html .='<div class="media-body network">';
124
+
125
+ if ($networkId != 8) {
126
+ $html .= '<h4>' . ucfirst($networkName);
127
+
128
+ if ($maxNetworkAccount !== false) {
129
+ if ($networkId == 18) {
130
+ $html .=' <a class="b2s-info-btn" data-target="#b2sInfoNetwork18" data-toggle="modal" href="#">Info</a>';
131
+ }
132
}
133
+ if (isset($this->bestTimeInfo[$networkId]) && !empty($this->bestTimeInfo[$networkId]) && is_array($this->bestTimeInfo[$networkId]) && $networkId != 8) {
134
+ $time = '';
135
+ $slug = ($this->lang == 'de') ? __('Uhr', 'blog2social') : '';
136
+ foreach ($this->bestTimeInfo[$networkId] as $k => $v) {
137
+ $time .= B2S_Util::getTimeByLang($v[0], $this->lang) . '-' . B2S_Util::getTimeByLang($v[1], $this->lang) . $slug . ', ';
138
+ }
139
+ $html .= '<span class="hidden-xs hidden-sm b2s-sched-manager-best-time-info">(' . __('Best times', 'blog2social') . ': ' . substr($time, 0, -2) . ')</span>';
140
}
141
142
+ $html .= '<span class="pull-right">';
143
+
144
+ $b2sAuthUrl = $this->authurl . '&portal_id=' . $networkId . '&transfer=' . (in_array($networkId, $this->oAuthPortal) ? 'oauth' : 'form' ) . '&mandant_id=' . $mandantId . '&version=3&affiliate_id=' . B2S_Tools::getAffiliateId();
145
146
+ if (in_array($networkId, $this->allowProfil)) {
147
+ $html .= ($networkId != 18 || (B2S_PLUGIN_USER_VERSION >= 2 && $networkId == 18)) ? '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=profile\', \'Blog2Social Network\'); return false;" class="btn btn-primary btn-sm b2s-network-auth-btn">+ ' . __('Profile', 'blog2social') . '</a>' : '<a href="#" class="btn btn-primary btn-sm b2s-network-auth-btn b2s-btn-disabled" data-title="' . __('You want to connect a network profile?', 'blog2social') . '" data-toggle="modal" data-type="auth-network" data-target="#b2sProFeatureModal">+ ' . __('Profile', 'blog2social') . ' <span class="label label-success">' . __("PREMIUM", "blog2social") . '</a>';
148
+ }
149
+ if (in_array($networkId, $this->allowPage)) {
150
+ $html .= (B2S_PLUGIN_USER_VERSION > 1 || (B2S_PLUGIN_USER_VERSION == 0 && $networkId == 1) || (B2S_PLUGIN_USER_VERSION == 1 && ($networkId == 1 || $networkId == 10))) ? '<button onclick="wop(\'' . $b2sAuthUrl . '&choose=page\', \'Blog2Social Network\'); return false;" class="btn btn-primary btn-sm b2s-network-auth-btn">+ ' . __('Page', 'blog2social') . '</button>' : '<a href="#" class="btn btn-primary btn-sm b2s-network-auth-btn b2s-btn-disabled" data-title="' . __('You want to connect a network page?', 'blog2social') . '" data-toggle="modal" data-type="auth-network" data-target="#' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'b2sPreFeatureModal' : 'b2sProFeatureModal') . '">+ ' . __('Page', 'blog2social') . ' <span class="label label-success">' . __("PREMIUM", "blog2social") . '</a>';
151
+ }
152
+ if (in_array($networkId, $this->allowGroup)) {
153
+ $html .= (B2S_PLUGIN_USER_VERSION > 1 || (B2S_PLUGIN_USER_VERSION == 1 && $networkId != 8)) ? '<button onclick="wop(\'' . $b2sAuthUrl . '&choose=group\', \'Blog2Social Network\'); return false;" class="btn btn-primary btn-sm b2s-network-auth-btn">+ ' . __('Group', 'blog2social') . '</button>' : '<a href="#" class="btn btn-primary btn-sm b2s-network-auth-btn b2s-btn-disabled" data-toggle="modal" data-title="' . __('You want to connect a social media group?', 'blog2social') . '" data-type="auth-network" data-target="#' . ((B2S_PLUGIN_USER_VERSION == 0) ? 'b2sPreFeatureModal' : 'b2sProFeatureModal') . '">+ ' . __('Group', 'blog2social') . ' <span class="label label-success">' . __("PREMIUM", "blog2social") . '</span></a>';
154
+ }
155
156
+ $html .= '</span></h4>';
157
}
158
+ $html .= '<div class="clearfix"></div>';
159
+
160
+ if ($networkId == 8) { //is deprecated since in 5.2.0
161
+ $html.='<div class="alert alert-info"><span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> <span class="b2s-text-bold">' . __('Action required', 'blog2social') . '</span> <br>' . __('The current XING API will be replaced by the new XING interface. Please connect your XING profile, as well as your XING company pages (Employer branding profiles) and business pages with the new XING interface in the Blog2Social network settings.', 'blog2social') . '</div>';
162
}
163
+ if ($networkId == 10) { //is deprecated since in 5.2.0
164
+ $html.='<br><div class="alert alert-info"><span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> <span class="b2s-text-bold">' . __('Please notice', 'blog2social') . '</span> <br>' . __('Google will shut down Google+ for all private accounts (profiles, pages, groups) on 2nd April 2019. You can find further information and the next steps, including how to download your photos and other content here:', 'blog2social') . ' <a target="_blank" href="https://support.google.com/plus/answer/9195133">https://support.google.com/plus/answer/9195133</a><br>'.__('Please check whether you have scheduled social media posts for Google+ beyond 2nd April 2019. Consider to reschedule these posts for other social networks.','blog2social').'<br><a href="admin.php?page=blog2social-sched&b2sShowByNetwork=10">'.__('Click here to find all posts for your Google+ accounts that are scheduled beyond 2nd April 2019','blog2social').'</a></div>';
165
}
166
+
167
$html .= '<div class="clearfix"></div>';
168
+
169
$html .= '<ul class="b2s-network-item-auth-list" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" ' . (($showAllAuths) ? 'data-network-count="true"' : '') . '>';
170
171
//First Line
199
if (isset($networkData[0])) {
200
foreach ($networkData[0] as $k => $v) {
201
202
+ $isDeprecated = ($networkId == 8 || $networkId == 10) ? true : false;
203
$notAllow = ($v['notAllow'] !== false) ? true : false;
204
+ $isInterrupted = ($v['expiredDate'] != '0000-00-00' && $v['expiredDate'] <= date('Y-m-d')) ? true : false;
205
206
+
207
+ $html .= '<li class="b2s-network-item-auth-list-li ' . (($isDeprecated) ? 'b2s-label-info-border-left deprecated' : (($notAllow) ? 'b2s-label-warning-border-left' : (($isInterrupted) ? 'b2s-label-danger-border-left' : ''))) . ' " data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="0">';
208
$html .='<div class="pull-left">';
209
210
if ($notAllow) {
215
$html.= '<div class="b2s-network-auth-list-info"><span class="glyphicon glyphicon-remove-circle"></span> ' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
216
}
217
218
+ $html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . __('Profile', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
219
220
if (!empty($mandantName)) {
221
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
224
225
$html .='<div class="pull-right">';
226
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="0" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
227
+ if (!$notAllow && !$isDeprecated) {
228
$html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=profil&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
229
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
230
if (isset($this->modifyBoardAndGroup[$networkId])) {
253
if (isset($networkData[1])) {
254
foreach ($networkData[1] as $k => $v) {
255
256
+ $isDeprecated = ($networkId == 8 || $networkId == 10) ? true : false;
257
$notAllow = ($v['notAllow'] !== false) ? true : false;
258
+ $isInterrupted = ($v['expiredDate'] != '0000-00-00' && $v['expiredDate'] <= date('Y-m-d')) ? true : false;
259
260
+ $html .= '<li class="b2s-network-item-auth-list-li ' . (($isDeprecated) ? 'b2s-label-info-border-left deprecated' : (($notAllow) ? 'b2s-label-warning-border-left' : (($isInterrupted) ? 'b2s-label-danger-border-left' : ''))) . '" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="1">';
261
$html .='<div class="pull-left">';
262
263
if ($notAllow) {
268
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
269
}
270
271
+ $html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . ($networkId == 19 && isset($this->networkKindName[$v['networkKind']]) ? $this->networkKindName[$v['networkKind']].'-' :'') . __('Page', 'blog2social') . (($networkId == 19 && (int) $v['networkKind'] == 0) ? ' <span class="hidden-xs">('.__('Employer Branding','blog2social').')</span>' : '').'</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
272
273
if (!empty($mandantName)) {
274
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
276
$html .='</div>';
277
$html .='<div class="pull-right">';
278
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="1" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
279
+ if (!$notAllow && !$isDeprecated) {
280
$html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=page&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
281
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
282
if (isset($this->modifyBoardAndGroup[$networkId])) {
306
if (isset($networkData[2])) {
307
foreach ($networkData[2] as $k => $v) {
308
309
+ $isDeprecated = ($networkId == 8 || $networkId == 10) ? true : false;
310
$notAllow = ($v['notAllow'] !== false) ? true : false;
311
+ $isInterrupted = ($v['expiredDate'] != '0000-00-00' && $v['expiredDate'] <= date('Y-m-d')) ? true : false;
312
313
+ $html .= '<li class="b2s-network-item-auth-list-li ' . (($isDeprecated) ? 'b2s-label-info-border-left deprecated' : (($notAllow) ? 'b2s-label-warning-border-left' : (($isInterrupted) ? 'b2s-label-danger-border-left' : ''))) . '" data-network-auth-id="' . $v['networkAuthId'] . '" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" data-network-type="2">';
314
315
$html .='<div class="pull-left">';
316
322
$html.= '<div class="b2s-network-auth-list-info">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</div>';
323
}
324
325
+ $html .= '<span class="b2s-network-item-auth-type">' . (($isDeprecated) ? '<span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' : '') . __('Group', 'blog2social') . '</span>: <span class="b2s-network-item-auth-user-name">' . stripslashes($v['networkUserName']) . '</span> ';
326
327
if (!empty($mandantName)) {
328
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
330
$html .='</div>';
331
$html .='<div class="pull-right">';
332
$html .= '<a class="b2s-network-item-auth-list-btn-delete b2s-add-padding-network-delete pull-right" data-network-type="2" data-network-id="' . $networkId . '" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
333
+ if (!$notAllow && !$isDeprecated) {
334
$html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=group&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn b2s-add-padding-network-refresh pull-right" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
335
if ($v['expiredDate'] == '0000-00-00' || $v['expiredDate'] > date('Y-m-d')) {
336
if (isset($this->modifyBoardAndGroup[$networkId])) {
367
'networkAuthId' => $value->networkAuthId,
368
'networkUserName' => $value->networkUserName,
369
'expiredDate' => $value->expiredDate,
370
+ 'networkKind' => $value->networkKind,
371
'notAllow' => (isset($value->notAllow) ? $value->notAllow : false)
372
);
373
}
374
return $convertAuth;
375
}
376
377
+ //New >V5.1.0 Seeding
378
private function getUserSchedTime($network_auth_id = 0, $network_id = 0, $network_type = 0, $type = 'time') { //type = time,day
379
//new > v5.1.0
380
if ($this->userSchedData !== false) {
405
return null;
406
}
407
408
+ //Old < 5.1.0
409
private function getSchedDataByUser() {
410
global $wpdb;
411
$saveSchedData = null;
includes/B2S/Post/Item.php CHANGED
@@ -10,6 +10,7 @@ class B2S_Post_Item {
10
protected $searchAuthorId;
11
protected $searchPostStatus;
12
protected $searchShowByDate;
13
protected $searchPublishDate;
14
protected $searchSchedDate;
15
protected $searchPostTitle;
@@ -23,7 +24,7 @@ class B2S_Post_Item {
23
public $currentPage = 0;
24
public $type;
25
26
- function __construct($type = 'all', $title = "", $authorId = "", $postStatus = "", $publishDate = '', $schedDate = '', $showByDate = '', $userAuthId = 0, $blogPostId = 0, $currentPage = 0, $postCat = "", $postType = "", $userLang = "en", $results_per_page = B2S_PLUGIN_POSTPERPAGE) {
27
$this->type = $type;
28
$this->searchPostTitle = $title;
29
$this->searchAuthorId = $authorId;
@@ -31,6 +32,7 @@ class B2S_Post_Item {
31
$this->searchPublishDate = $publishDate;
32
$this->searchSchedDate = $schedDate;
33
$this->searchShowByDate = $showByDate;
34
$this->searchUserAuthId = $userAuthId;
35
$this->searchBlogPostId = $blogPostId;
36
$this->currentPage = $currentPage;
@@ -74,8 +76,6 @@ class B2S_Post_Item {
74
$leftJoinWhere = "AND $wpdb->term_taxonomy.`term_id` = " . $this->searchPostCat;
75
}
76
77
-
78
-
79
if (!empty($this->searchPostStatus)) {
80
$addSearchType = $wpdb->prepare(' posts.`post_status` = %s', $this->searchPostStatus);
81
} else {
@@ -147,17 +147,22 @@ class B2S_Post_Item {
147
$addInnerJoinLeftJoin = ((int) $this->searchUserAuthId != 0) ? ' LEFT JOIN b2s_posts_network_details b ON b.`id` = a.`network_details_id` ' : '';
148
$addInnnerJoinLeftJoinWhere = ((int) $this->searchUserAuthId != 0) ? ' b.`network_auth_id` =' . $this->searchUserAuthId . ' AND ' : '';
149
150
$sqlPosts = "SELECT posts.`ID`, posts.`post_author`,posts.`post_type`,posts.`post_title`, " . $select . ", filter.`id`
151
FROM `$wpdb->posts` posts $leftJoin $leftJoin2
152
INNER JOIN(
153
SELECT a.`id`,$selectInnerJoin, a.`blog_user_id`, a.`post_id`
154
- FROM `b2s_posts` a $addInnerJoinLeftJoin
155
- WHERE $addInnnerJoinLeftJoinWhere $addSearchBlogPostId $addSearchShowByDate $where
156
) filter
157
ON posts.`ID` = filter.`post_id`
158
WHERE $addSearchType $addSearchAuthorId $addSearchPostTitle AND $postTypes $leftJoinWhere $orderBy
159
LIMIT " . (($this->currentPage - 1) * $this->results_per_page) . "," . $this->results_per_page;
160
161
$this->postData = $wpdb->get_results($sqlPosts);
162
163
if ($this->type == 'publish' || $this->type == 'notice' || $this->type == 'approve') {
@@ -178,8 +183,8 @@ class B2S_Post_Item {
178
FROM `$wpdb->posts` posts $leftJoin $leftJoin2
179
INNER JOIN(
180
SELECT a.`post_id`, a.`sched_date`
181
- FROM `b2s_posts` a $addInnerJoinLeftJoin
182
- WHERE $addInnnerJoinLeftJoinWhere $addSearchShowByDate $where
183
) filter
184
ON posts.`ID` = filter.`post_id`
185
WHERE $addSearchType $addSearchAuthorId $addSearchPostTitle AND $postTypes $leftJoinWhere";
@@ -287,7 +292,7 @@ class B2S_Post_Item {
287
<div class="pull-left media-head">
288
<strong><a target="_blank" href="' . get_permalink($var->ID) . '">' . $postTitle . '</a></strong>' . $curated . '
289
<span class="pull-right">
290
- <button type="button" class="btn btn-primary btn-sm b2sDetailsSchedPostBtn" data-search-date="' . $this->searchShowByDate . '" data-post-id="' . $var->ID . '"><i class="glyphicon glyphicon-chevron-down"></i> ' . __('Details', 'blog2social') . '</button>
291
</span>
292
<p class="info hidden-xs"><a class="b2sDetailsSchedPostTriggerLink" href="#"><span class="b2s-sched-count" data-post-id="' . $var->ID . '">' . $schedPublish . '</span> ' . __('scheduled social media posts', 'blog2social') . '</a> | ' . __('next share by', 'blog2social') . ' <a href="' . get_author_posts_url($var->blog_user_id) . '">' . (isset($userInfo['nickname'][0]) ? $userInfo['nickname'][0] : '-') . '</a> ' . B2S_Util::getCustomDateFormat($nextSched, substr(B2S_LANGUAGE, 0, 2)) . '</p>
293
</div>
@@ -331,6 +336,8 @@ class B2S_Post_Item {
331
$addNotAdmin = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND posts.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
332
$addLeftJoin = ((int) $this->searchUserAuthId != 0) ? ' LEFT JOIN b2s_posts_network_details details ON details.`id` = posts.`network_details_id` ' : '';
333
$addLeftJoinWhere = ((int) $this->searchUserAuthId != 0) ? ' details.`network_auth_id` =' . $this->searchUserAuthId . ' AND ' : '';
334
335
if ($this->type == 'approve') {
336
$addSearchShowByDate = (!empty($this->searchShowByDate)) ? " (DATE_FORMAT(posts.publish_date,'%Y-%m-%d') = '" . $this->searchShowByDate . "' OR DATE_FORMAT(posts.sched_date,'%Y-%m-%d') = '" . $this->searchShowByDate . "') AND " : '';
@@ -340,8 +347,7 @@ class B2S_Post_Item {
340
$addWhere = ($this->type == 'notice') ? ' AND posts.`publish_error_code` != "" ' : ' AND posts.`publish_error_code` = "" ';
341
$where = ($this->type == 'publish' || $this->type == 'notice') ? " (posts.`sched_date` = '0000-00-00 00:00:00' OR posts.`sched_type` = 3) AND posts.`post_for_approve`= 0 " . $addWhere : " posts.`sched_type` != 3 AND posts.`publish_date` = '0000-00-00 00:00:00' AND ((posts.`sched_date_utc` != '0000-00-00 00:00:00' AND posts.`post_for_approve` = 0) OR (posts.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND posts.`post_for_approve` = 1)) ";
342
}
343
-
344
- $sqlPostsTotal = "SELECT COUNT(posts.`post_id`) FROM `b2s_posts` posts $addLeftJoin WHERE $addLeftJoinWhere $where $addNotAdmin $addSearchShowByDate AND posts.`hide` = 0 AND posts.`post_id` = " . $post_id;
345
return $wpdb->get_var($sqlPostsTotal);
346
}
347
return 0;
@@ -549,13 +555,15 @@ class B2S_Post_Item {
549
return false;
550
}
551
552
- public function getSchedPostDataHtml($post_id = 0, $showByDate = '', $userAuthId = 0) {
553
if ($post_id > 0) {
554
global $wpdb;
555
$addNotAdminPosts = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND `b2s_posts`.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
556
$addSearchShowByDate = (!empty($showByDate)) ? " AND DATE_FORMAT(`b2s_posts`.`sched_date`,'%%Y-%%m-%%d') = '" . $showByDate . "' " : '';
557
$addSearchUserAuthId = ($userAuthId != 0) ? " AND `b2s_posts_network_details`.`network_auth_id` =" . $userAuthId . " " : '';
558
- $sqlData = $wpdb->prepare("SELECT `b2s_posts`.`id`, `b2s_posts`.`post_id`,`blog_user_id`,`last_edit_blog_user_id`,`v2_id`, `sched_date`, `sched_date_utc`, `sched_type`, `relay_primary_post_id`, `b2s_posts_network_details`.`network_id`,`b2s_posts_network_details`.`network_auth_id`,`b2s_posts_network_details`.`network_type`,`b2s_posts_network_details`.`network_display_name` FROM `b2s_posts` LEFT JOIN `b2s_posts_network_details` ON `b2s_posts`.`network_details_id` = `b2s_posts_network_details`.`id` WHERE `b2s_posts`.`hide` = 0 AND ((`b2s_posts`.`sched_date_utc` != '0000-00-00 00:00:00' AND `b2s_posts`.`post_for_approve` = 0) OR (`b2s_posts`.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND `b2s_posts`.`post_for_approve` = 1)) AND `b2s_posts`.`sched_type` != 3 AND `b2s_posts`.`publish_date` = '0000-00-00 00:00:00' $addNotAdminPosts $addSearchShowByDate $addSearchUserAuthId AND `b2s_posts`.`post_id` = %d ORDER BY `b2s_posts`.`sched_date` ASC ", $post_id);
559
$result = $wpdb->get_results($sqlData);
560
$specialPostingData = array(4 => __('Retweet', 'blog2social'));
561
if (!empty($result) && is_array($result)) {
10
protected $searchAuthorId;
11
protected $searchPostStatus;
12
protected $searchShowByDate;
13
+ protected $searchShowByNetwork;
14
protected $searchPublishDate;
15
protected $searchSchedDate;
16
protected $searchPostTitle;
24
public $currentPage = 0;
25
public $type;
26
27
+ function __construct($type = 'all', $title = "", $authorId = "", $postStatus = "", $publishDate = '', $schedDate = '', $showByDate = '', $showByNetwork = 0, $userAuthId = 0, $blogPostId = 0, $currentPage = 0, $postCat = "", $postType = "", $userLang = "en", $results_per_page = B2S_PLUGIN_POSTPERPAGE) {
28
$this->type = $type;
29
$this->searchPostTitle = $title;
30
$this->searchAuthorId = $authorId;
32
$this->searchPublishDate = $publishDate;
33
$this->searchSchedDate = $schedDate;
34
$this->searchShowByDate = $showByDate;
35
+ $this->searchShowByNetwork = $showByNetwork;
36
$this->searchUserAuthId = $userAuthId;
37
$this->searchBlogPostId = $blogPostId;
38
$this->currentPage = $currentPage;
76
$leftJoinWhere = "AND $wpdb->term_taxonomy.`term_id` = " . $this->searchPostCat;
77
}
78
79
if (!empty($this->searchPostStatus)) {
80
$addSearchType = $wpdb->prepare(' posts.`post_status` = %s', $this->searchPostStatus);
81
} else {
147
$addInnerJoinLeftJoin = ((int) $this->searchUserAuthId != 0) ? ' LEFT JOIN b2s_posts_network_details b ON b.`id` = a.`network_details_id` ' : '';
148
$addInnnerJoinLeftJoinWhere = ((int) $this->searchUserAuthId != 0) ? ' b.`network_auth_id` =' . $this->searchUserAuthId . ' AND ' : '';
149
150
+ $addInnerJoinLeftJoinNetwork = ((int) $this->searchShowByNetwork != 0 && empty($addInnerJoinLeftJoin)) ? ' LEFT JOIN b2s_posts_network_details b ON b.`id` = a.`network_details_id` ' : '';
151
+ $addInnnerJoinLeftJoinWhereNetwork = ((int) $this->searchShowByNetwork != 0) ? ' b.`network_id` =' . $this->searchShowByNetwork . ' AND ' : '';
152
+
153
+
154
$sqlPosts = "SELECT posts.`ID`, posts.`post_author`,posts.`post_type`,posts.`post_title`, " . $select . ", filter.`id`
155
FROM `$wpdb->posts` posts $leftJoin $leftJoin2
156
INNER JOIN(
157
SELECT a.`id`,$selectInnerJoin, a.`blog_user_id`, a.`post_id`
158
+ FROM `b2s_posts` a $addInnerJoinLeftJoin $addInnerJoinLeftJoinNetwork
159
+ WHERE $addInnnerJoinLeftJoinWhere $addInnnerJoinLeftJoinWhereNetwork $addSearchBlogPostId $addSearchShowByDate $where
160
) filter
161
ON posts.`ID` = filter.`post_id`
162
WHERE $addSearchType $addSearchAuthorId $addSearchPostTitle AND $postTypes $leftJoinWhere $orderBy
163
LIMIT " . (($this->currentPage - 1) * $this->results_per_page) . "," . $this->results_per_page;
164
165
+
166
$this->postData = $wpdb->get_results($sqlPosts);
167
168
if ($this->type == 'publish' || $this->type == 'notice' || $this->type == 'approve') {
183
FROM `$wpdb->posts` posts $leftJoin $leftJoin2
184
INNER JOIN(
185
SELECT a.`post_id`, a.`sched_date`
186
+ FROM `b2s_posts` a $addInnerJoinLeftJoin $addInnerJoinLeftJoinNetwork
187
+ WHERE $addInnnerJoinLeftJoinWhere $addInnnerJoinLeftJoinWhereNetwork $addSearchShowByDate $where
188
) filter
189
ON posts.`ID` = filter.`post_id`
190
WHERE $addSearchType $addSearchAuthorId $addSearchPostTitle AND $postTypes $leftJoinWhere";
292
<div class="pull-left media-head">
293
<strong><a target="_blank" href="' . get_permalink($var->ID) . '">' . $postTitle . '</a></strong>' . $curated . '
294
<span class="pull-right">
295
+ <button type="button" class="btn btn-primary btn-sm b2sDetailsSchedPostBtn" data-search-network="'.$this->searchShowByNetwork.'" data-search-date="' . $this->searchShowByDate . '" data-post-id="' . $var->ID . '"><i class="glyphicon glyphicon-chevron-down"></i> ' . __('Details', 'blog2social') . '</button>
296
</span>
297
<p class="info hidden-xs"><a class="b2sDetailsSchedPostTriggerLink" href="#"><span class="b2s-sched-count" data-post-id="' . $var->ID . '">' . $schedPublish . '</span> ' . __('scheduled social media posts', 'blog2social') . '</a> | ' . __('next share by', 'blog2social') . ' <a href="' . get_author_posts_url($var->blog_user_id) . '">' . (isset($userInfo['nickname'][0]) ? $userInfo['nickname'][0] : '-') . '</a> ' . B2S_Util::getCustomDateFormat($nextSched, substr(B2S_LANGUAGE, 0, 2)) . '</p>
298
</div>
336
$addNotAdmin = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND posts.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
337
$addLeftJoin = ((int) $this->searchUserAuthId != 0) ? ' LEFT JOIN b2s_posts_network_details details ON details.`id` = posts.`network_details_id` ' : '';
338
$addLeftJoinWhere = ((int) $this->searchUserAuthId != 0) ? ' details.`network_auth_id` =' . $this->searchUserAuthId . ' AND ' : '';
339
+ $addLeftJoinNetwork = ((int) $this->searchShowByNetwork != 0 && empty($addLeftJoin)) ? ' LEFT JOIN b2s_posts_network_details details ON details.`id` = posts.`network_details_id` ' : '';
340
+ $addLeftJoinWhereNetwork = ((int) $this->searchShowByNetwork != 0) ? ' details.`network_id` =' . $this->searchShowByNetwork . ' AND ' : '';
341
342
if ($this->type == 'approve') {
343
$addSearchShowByDate = (!empty($this->searchShowByDate)) ? " (DATE_FORMAT(posts.publish_date,'%Y-%m-%d') = '" . $this->searchShowByDate . "' OR DATE_FORMAT(posts.sched_date,'%Y-%m-%d') = '" . $this->searchShowByDate . "') AND " : '';
347
$addWhere = ($this->type == 'notice') ? ' AND posts.`publish_error_code` != "" ' : ' AND posts.`publish_error_code` = "" ';
348
$where = ($this->type == 'publish' || $this->type == 'notice') ? " (posts.`sched_date` = '0000-00-00 00:00:00' OR posts.`sched_type` = 3) AND posts.`post_for_approve`= 0 " . $addWhere : " posts.`sched_type` != 3 AND posts.`publish_date` = '0000-00-00 00:00:00' AND ((posts.`sched_date_utc` != '0000-00-00 00:00:00' AND posts.`post_for_approve` = 0) OR (posts.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND posts.`post_for_approve` = 1)) ";
349
}
350
+ $sqlPostsTotal = "SELECT COUNT(posts.`post_id`) FROM `b2s_posts` posts $addLeftJoin $addLeftJoinNetwork WHERE $addLeftJoinWhere $addLeftJoinWhereNetwork $where $addNotAdmin $addSearchShowByDate AND posts.`hide` = 0 AND posts.`post_id` = " . $post_id;
351
return $wpdb->get_var($sqlPostsTotal);
352
}
353
return 0;
555
return false;
556
}
557
558
+ public function getSchedPostDataHtml($post_id = 0, $showByDate = '',$showByNetwork =0, $userAuthId = 0) {
559
if ($post_id > 0) {
560
global $wpdb;
561
$addNotAdminPosts = (B2S_PLUGIN_ADMIN == false) ? $wpdb->prepare(' AND `b2s_posts`.`blog_user_id` = %d', B2S_PLUGIN_BLOG_USER_ID) : '';
562
$addSearchShowByDate = (!empty($showByDate)) ? " AND DATE_FORMAT(`b2s_posts`.`sched_date`,'%%Y-%%m-%%d') = '" . $showByDate . "' " : '';
563
+ $addSearchShowByNetwork = ((int) $showByNetwork > 0) ? " AND `b2s_posts_network_details`.`network_id` = '" . $showByNetwork . "' " : '';
564
$addSearchUserAuthId = ($userAuthId != 0) ? " AND `b2s_posts_network_details`.`network_auth_id` =" . $userAuthId . " " : '';
565
+
566
+ $sqlData = $wpdb->prepare("SELECT `b2s_posts`.`id`, `b2s_posts`.`post_id`,`blog_user_id`,`last_edit_blog_user_id`,`v2_id`, `sched_date`, `sched_date_utc`, `sched_type`, `relay_primary_post_id`, `b2s_posts_network_details`.`network_id`,`b2s_posts_network_details`.`network_auth_id`,`b2s_posts_network_details`.`network_type`,`b2s_posts_network_details`.`network_display_name` FROM `b2s_posts` LEFT JOIN `b2s_posts_network_details` ON `b2s_posts`.`network_details_id` = `b2s_posts_network_details`.`id` WHERE `b2s_posts`.`hide` = 0 AND ((`b2s_posts`.`sched_date_utc` != '0000-00-00 00:00:00' AND `b2s_posts`.`post_for_approve` = 0) OR (`b2s_posts`.`sched_date_utc` >= '" . gmdate('Y-m-d H:i:s') . "' AND `b2s_posts`.`post_for_approve` = 1)) AND `b2s_posts`.`sched_type` != 3 AND `b2s_posts`.`publish_date` = '0000-00-00 00:00:00' $addNotAdminPosts $addSearchShowByDate $addSearchShowByNetwork $addSearchUserAuthId AND `b2s_posts`.`post_id` = %d ORDER BY `b2s_posts`.`sched_date` ASC ", $post_id);
567
$result = $wpdb->get_results($sqlData);
568
$specialPostingData = array(4 => __('Retweet', 'blog2social'));
569
if (!empty($result) && is_array($result)) {
includes/B2S/Post/Tools.php CHANGED
@@ -22,14 +22,30 @@ class B2S_Post_Tools {
22
global $wpdb;
23
$resultPostIds = array();
24
$blogPostId = 0;
25
26
foreach ($postIds as $v) {
27
- $sql = $wpdb->prepare("SELECT id,post_id,post_for_relay,post_for_approve FROM b2s_posts WHERE id =%d AND publish_date = %s", (int) $v, "0000-00-00 00:00:00");
28
$row = $wpdb->get_row($sql);
29
if (isset($row->id) && (int) $row->id == $v) {
30
- if ((int)$row->post_for_approve == 1) {
31
$wpdb->update('b2s_posts', array('hide' => 1), array('id' => $v));
32
} else {
33
$wpdb->update('b2s_posts', array('hook_action' => 3, 'hide' => 1), array('id' => $v));
34
}
35
$resultPostIds[] = $v;
22
global $wpdb;
23
$resultPostIds = array();
24
$blogPostId = 0;
25
+ $tosCrossPosting = unserialize(B2S_PLUGIN_NETWORK_CROSSPOSTING_LIMIT);
26
27
foreach ($postIds as $v) {
28
+ $sql = $wpdb->prepare("SELECT b.id,b.post_id,b.post_for_relay,b.post_for_approve,b.sched_details_id,d.network_id,d.network_type FROM b2s_posts b LEFT JOIN b2s_posts_network_details d ON (d.id = b.network_details_id) WHERE b.id =%d AND b.publish_date = %s", (int) $v, "0000-00-00 00:00:00");
29
$row = $wpdb->get_row($sql);
30
if (isset($row->id) && (int) $row->id == $v) {
31
+ if ((int) $row->post_for_approve == 1) {
32
$wpdb->update('b2s_posts', array('hide' => 1), array('id' => $v));
33
} else {
34
+ //TOS Crossposting delete entry
35
+ if ($row->network_id != null && $row->network_type != null && (int) $row->sched_details_id > 0) {
36
+ if (isset($tosCrossPosting[$row->network_id][$row->network_type])) {
37
+ //get network_tos_group_id form sched_data
38
+ $sql = $wpdb->prepare("SELECT sched_data FROM b2s_posts_sched_details WHERE id =%d", (int) $row->sched_details_id);
39
+ $schedData = $wpdb->get_col($sql);
40
+ if (isset($schedData[0]) && !empty($schedData[0])) {
41
+ $schedData = unserialize($schedData[0]);
42
+ if ($schedData !== false && isset($schedData['network_tos_group_id']) && !empty($schedData['network_tos_group_id'])) {
43
+ $options = new B2S_Options(0, 'B2S_PLUGIN_TOS_XING_GROUP_CROSSPOSTING');
44
+ $options->deleteValueByKey($row->post_id, $schedData['network_tos_group_id']);
45
+ }
46
+ }
47
+ }
48
+ }
49
$wpdb->update('b2s_posts', array('hook_action' => 3, 'hide' => 1), array('id' => $v));
50
}
51
$resultPostIds[] = $v;
includes/B2S/QuickPost.php CHANGED
@@ -2,8 +2,8 @@
2
3
class B2S_QuickPost {
4
5
- private $setPreFillText = array(0 => array(1 => 239, 2 => 255, 3 => 239, 6 => 300, 8 => 239, 9 => 200, 10 => 442, 12 => 240, 17 => 442), 1 => array(1 => 239, 3 => 239, 8 => 1200, 10 => 442, 17 => 442), 2 => array(1 => 239, 8 => 239, 10 => 442, 17 => 442));
6
- private $setPreFillTextLimit = array(0 => array(1 => 400, 2 => 256, 3 => 400, 6 => 400, 8 => 400, 9 => 200, 10 => 500, 12 => 400), 1 => array(1 => 400, 3 => 400, 8 => 1200, 10 => 500), 2 => array(1 => 400, 8 => 400, 10 => 500));
7
private $content;
8
private $title;
9
@@ -21,7 +21,7 @@ class B2S_QuickPost {
21
}
22
//Content
23
$postData['content'] = (isset($this->setPreFillText[$networkType][$networkId])) ? B2S_Util::getExcerpt($this->content, (int) $this->setPreFillText[$networkType][$networkId], (isset($this->setPreFillTextLimit[$networkType][$networkId]) ? (int) $this->setPreFillTextLimit[$networkType][$networkId] : false)) : $this->content;
24
- if ($networkId == 7 || $networkId == 9 || ($networkId == 8 && $networkType != 0)) {
25
$postData['custom_title'] = $this->title;
26
}
27
if ($networkId == 15) {
2
3
class B2S_QuickPost {
4
5
+ private $setPreFillText = array(0 => array(1 => 239, 2 => 255, 3 => 239, 6 => 300, 8 => 239, 9 => 200, 10 => 442, 12 => 240, 17 => 442, 19=> 239), 1 => array(1 => 239, 3 => 239, 8 => 1200, 10 => 442, 17 => 442, 19 => 239), 2 => array(1 => 239, 8 => 239, 10 => 442, 17 => 442, 19 => 239));
6
+ private $setPreFillTextLimit = array(0 => array(1 => 400, 2 => 256, 3 => 400, 6 => 400, 8 => 400, 9 => 200, 10 => 500, 12 => 400, 19 => 400), 1 => array(1 => 400, 3 => 400, 8 => 1200, 10 => 500, 19 => 400), 2 => array(1 => 400, 8 => 400, 10 => 500, 19 => 9000));
7
private $content;
8
private $title;
9
21
}
22
//Content
23
$postData['content'] = (isset($this->setPreFillText[$networkType][$networkId])) ? B2S_Util::getExcerpt($this->content, (int) $this->setPreFillText[$networkType][$networkId], (isset($this->setPreFillTextLimit[$networkType][$networkId]) ? (int) $this->setPreFillTextLimit[$networkType][$networkId] : false)) : $this->content;
24
+ if ($networkId == 7 || $networkId == 9 || ($networkId == 8 && $networkType != 0) | ($networkId == 19 && $networkType != 0)) {
25
$postData['custom_title'] = $this->title;
26
}
27
if ($networkId == 15) {
includes/B2S/Rating.php CHANGED
@@ -8,7 +8,7 @@
8
$count = $wpdb->get_var("SELECT COUNT(distinct post_id) FROM b2s_posts");
9
10
if(in_array($count, array(5,10,15,50,75,100,120,150)) || ($count > 150 && $count % 25 == 0)) {
11
- update_option("B2S_SHOW_RATING",array("count" => $count));
12
}
13
}
14
}
@@ -27,7 +27,7 @@
27
delete_option("B2S_SHOW_RATING");
28
if($forever)
29
{
30
- update_option("B2S_HIDE_RATING",true);
31
}
32
}
33
}
8
$count = $wpdb->get_var("SELECT COUNT(distinct post_id) FROM b2s_posts");
9
10
if(in_array($count, array(5,10,15,50,75,100,120,150)) || ($count > 150 && $count % 25 == 0)) {
11
+ update_option("B2S_SHOW_RATING",array("count" => $count),false);
12
}
13
}
14
}
27
delete_option("B2S_SHOW_RATING");
28
if($forever)
29
{
30
+ update_option("B2S_HIDE_RATING",true,false);
31
}
32
}
33
}
includes/B2S/Settings/Item.php CHANGED
@@ -118,7 +118,7 @@ class B2S_Settings_Item {
118
$limit = unserialize(B2S_PLUGIN_AUTO_POST_LIMIT);
119
120
$content = '';
121
- $content .='<div class="panel panel-group b2s-auto-post-own-update-warning"><div class="panel-body"><span class="glyphicon glyphicon-exclamation-sign glyphicon-warning"></span> ' . __('Auto-posts for Facebook Profiles will be shown in the "Instant Sharing" tab on your "Posts & Sharing" navigation bar and can be shared on your Facebook Profile by clicking on the "Share" button next to your auto-post.', 'blog2social') . '</div>';
122
$content .='</div>';
123
$content .='<h4>' . __('Auto-post your own created posts', 'blog2social') . ' ' . $isPremium . ' <a href="#" data-toggle="modal" data-target="#b2sInfoAutoShareModal" class="b2s-info-btn del-padding-left">' . __('Info', 'Blog2Social') . '</a>';
124
$content .='<br><div class="b2s-text-sm">' . __('Define by default to automatically post your posts on social media:', 'blog2social') . '</div>';
118
$limit = unserialize(B2S_PLUGIN_AUTO_POST_LIMIT);
119
120
$content = '';
121
+ $content .='<div class="panel panel-group b2s-auto-post-own-general-warning"><div class="panel-body"><span class="glyphicon glyphicon-exclamation-sign glyphicon-warning"></span> ' . __('Auto-posts for Facebook Profiles will be shown in the "Instant Sharing" tab on your "Posts & Sharing" navigation bar and can be shared on your Facebook Profile by clicking on the "Share" button next to your auto-post.', 'blog2social') . '</div>';
122
$content .='</div>';
123
$content .='<h4>' . __('Auto-post your own created posts', 'blog2social') . ' ' . $isPremium . ' <a href="#" data-toggle="modal" data-target="#b2sInfoAutoShareModal" class="b2s-info-btn del-padding-left">' . __('Info', 'Blog2Social') . '</a>';
124
$content .='<br><div class="b2s-text-sm">' . __('Define by default to automatically post your posts on social media:', 'blog2social') . '</div>';
includes/B2S/Ship/Item.php CHANGED
@@ -6,53 +6,59 @@ class B2S_Ship_Item {
6
private $allowTitlePage = array();
7
private $allowTitleGroup = array();
8
private $setPostFormat = array(1, 2, 10, 12);
9
- private $isCommentProfile = array(1, 3, 8, 10, 17);
10
private $isCommentPage = array(1);
11
private $isCommentGroup = array(1);
12
private $allowTag = array(4, 9, 11, 16);
13
private $allowHtml = array(4, 11, 14);
14
private $showTitleProfile = array(4, 9, 11, 14, 16);
15
- private $showTitlePage = array(8);
16
- private $showTitleGroup = array(8, 11);
17
private $onlyImage = array(6, 7, 12);
18
private $allowNoImageProfile = array(5, 9);
19
- private $allowNoCustomImageProfile = array(8, 15);
20
private $allowNoEmoji = array(9, 13, 14, 15, 16, 18);
21
private $allowNoImagePage = array(8);
22
- private $allowEditUrl = array(1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18);
23
private $showBoards = array(6);
24
private $showRelay = array(2);
25
private $showBoardsGroup = array(10);
26
- private $showGroups = array(8, 15);
27
private $changeDisplayName = array(8);
28
- private $setShortTextProfile = array(1 => 239, 2 => 255, 3 => 239, 6 => 300, 8 => 239, 10 => 442, 12 => 240, 9 => 200, 16 => 250, 17 => 442, 18 => 800);
29
- private $setShortTextProfileLimit = array(1 => 400, 2 => 256, 3 => 400, 6 => 400, 8 => 400, 10 => 500, 12 => 400, 9 => 200, 18 => 1000);
30
- private $setShortTextPage = array(1 => 239, 3 => 239, 8 => 1200, 10 => 442, 17 => 442);
31
- private $setShortTextPageLimit = array(1 => 400, 3 => 400, 8 => 1200, 10 => 500);
32
- private $setShortTextGroup = array(1 => 239, 8 => 239, 10 => 442, 17 => 442);
33
private $setShortTextGroupLimit = array(1 => 400, 8 => 400, 10 => 500);
34
private $allowHashTags = array(1, 2, 3, 6, 10, 12, 17);
35
- private $limitCharacterProfile = array(2 => 280, 3 => 1300, 6 => 500, 8 => 420, 9 => 250, 15 => 300, 12 => 2000, 18 => 1500);
36
private $showImageAreaProfile = array(6, 7, 10, 12, 16, 17, 18);
37
- private $showImageAreaPage = array(10, 17);
38
- private $showImageAreaGroup = array(8, 10, 17);
39
- private $limitCharacterPage = array(3 => 1300, 8 => 1200);
40
- private $requiredUrl = array(1, 3, 8, 9, 10, 15);
41
private $getText = array(1, 7, 10, 12, 16, 17, 18);
42
- private $allowSchedCustomizeContent = array(1, 2, 3, 6, 7, 8, 9, 10, 12, 15, 17, 18);
43
private $maxWeekTimeSelect = 52;
44
private $networkTosProfile = array(2);
45
- private $networkTosGroup = array(8);
46
private $maxMonthTimeSelect = 12;
47
private $maxTimeSelect = 50;
48
private $maxSchedCount = 3;
49
//private $maxReplayCount = 3;
50
private $setRelayCount = 0;
51
private $maxDaySelect = 31;
52
private $noScheduleRegularly = array(2, 4, 11, 14, 15, 18);
53
- private $noScheduleRegularlyPage = array(8);
54
- private $addNoMoreSchedPage = array(8);
55
- private $addNoMoreSchedGroup = array(8);
56
private $defaultImage;
57
private $postData;
58
private $postUrl;
@@ -84,12 +90,36 @@ class B2S_Ship_Item {
84
public function getItemHtml($data, $show_time = true) {
85
86
$this->viewMode = (isset($data->view) && !empty($data->view)) ? $data->view : null; //normal or modal(Kalendar)
87
88
$userOptions = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
89
$allowUserHashTag = $userOptions->_getOption('user_allow_hashtag');
90
$contentTwitter = $userOptions->_getOption('content_network_twitter');
91
$networkName = unserialize(B2S_PLUGIN_NETWORK);
92
$networkTypeName = unserialize(B2S_PLUGIN_NETWORK_TYPE);
93
$limit = false;
94
$limitValue = 0;
95
$textareaLimitInfo = "";
@@ -162,8 +192,8 @@ class B2S_Ship_Item {
162
break;
163
case '1':
164
//page
165
- if (isset($this->limitCharacterPage[$data->networkId]) && (int) $this->limitCharacterPage[$data->networkId] > 0) {
166
- $limitValue = $this->limitCharacterPage[$data->networkId];
167
$limit = true;
168
}
169
$infoImage = (in_array($data->networkId, $this->allowNoImagePage)) ? __('Network does not support image for pages', 'blog2social') . '!' : '';
@@ -174,7 +204,7 @@ class B2S_Ship_Item {
174
if ($data->networkId == 8) { //Xing -1 Leerzeichen
175
$this->setShortTextPage[$data->networkId] = (int) $this->setShortTextPage[$data->networkId] - mb_strlen($this->postUrl, 'UTF-8') - 1;
176
}
177
- $message = B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, false, (in_array($data->networkId, $this->allowNoEmoji) ? false : true), $this->userLang), (isset($this->setShortTextPage[$data->networkId]) ? (int) $this->setShortTextPage[$data->networkId] : false), (isset($this->setShortTextPageLimit[$data->networkId]) ? (int) $this->setShortTextPageLimit[$data->networkId] : false));
178
} else {
179
$message = (in_array($data->networkId, $this->allowTitlePage) ? (in_array($data->networkId, $this->allowNoEmoji) ? B2S_Util::remove4byte(B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang)) : B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang)) : B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, (in_array($data->networkId, $this->allowHtml) ? '<p><h1><h2><br><i><b><a><img>' : false), (in_array($data->networkId, $this->allowNoEmoji) ? false : true), $this->userLang));
180
}
@@ -238,9 +268,17 @@ class B2S_Ship_Item {
238
$content .= '<img alt="" data-network-auth-id="' . $data->networkAuthId . '" class="img-responsive b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/' . $data->networkId . '_flat.png', B2S_PLUGIN_FILE) . '">';
239
$content .= '</div>';
240
$content .= '<div class="b2s-post-item-details">';
241
$content .= '<h4 class="pull-left b2s-post-item-details-network-display-name" data-network-auth-id="' . $data->networkAuthId . '">' . stripslashes($network_display_name) . '</h4>';
242
$content .= '<div class="clearfix"></div>';
243
- $content .= '<p class="pull-left">' . $networkTypeName[$data->networkType] . ' | ' . $networkName[$data->networkId];
244
$content .= '<div class="b2s-post-item-details-message-result" data-network-auth-id="' . $data->networkAuthId . '" style="display:none;"></div>';
245
$content .= '<span class="hidden-xs b2s-post-item-details-message-info" data-network-auth-id="' . $data->networkAuthId . '">' . $messageInfo . '</span></span>';
246
@@ -286,11 +324,12 @@ class B2S_Ship_Item {
286
$content .= '<div class="b2s-post-item-details-edit-area" data-network-auth-id="' . $data->networkAuthId . '">';
287
$content .= (in_array($data->networkId, $this->showBoards) || ($data->networkType == 2 && in_array($data->networkId, $this->showBoardsGroup))) ? $this->getBoardHtml($data->networkAuthId, $data->networkId) : '';
288
$content .= (in_array($data->networkId, $this->showGroups) && ($data->networkType == 2 || $data->networkId == 15)) ? $this->getGroupsHtml($data->networkAuthId, $data->networkId) : '';
289
- $content .= ((in_array($data->networkId, $this->showTitleProfile) && $data->networkType == 0) || (in_array($data->networkId, $this->showTitlePage) && $data->networkType == 1) || (in_array($data->networkId, $this->showTitleGroup) && $data->networkType == 2)) ? $this->getTitleHtml($data->networkId, $data->networkAuthId, $this->postData->post_title) : '';
290
$content .= $this->getCustomEditArea($data->networkId, $data->networkAuthId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
291
$content .= (in_array($data->networkId, $this->allowTag) && $data->networkType == 0) ? $this->getTagsHtml($data->networkAuthId, (($allowUserHashTag === false || $allowUserHashTag == 1) ? true : false)) : '';
292
293
- //Calendar
294
if (!(isset($this->viewMode) && $this->viewMode == 'modal')) {
295
$content .='<br>';
296
$content .='<div class="b2s-calendar-filter-area col-xs-2 pull-right del-padding-right hide" data-network-auth-id="' . $data->networkAuthId . '">';
@@ -310,6 +349,7 @@ class B2S_Ship_Item {
310
if ($show_time) {
311
$content .= $this->getShippingTimeHtml($data->networkAuthId, $data->networkType, $data->networkId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
312
}
313
$content .= '</div>';
314
315
$content .= '</div>';
@@ -319,7 +359,8 @@ class B2S_Ship_Item {
319
$content .= '<input type="hidden" class="form-control" name="b2s[' . $data->networkAuthId . '][network_id]" value="' . $data->networkId . '">';
320
$content .= '<input type="hidden" class="form-control" name="b2s[' . $data->networkAuthId . '][network_type]" value="' . $data->networkType . '">';
321
$content .= '<input type="hidden" class="form-control" name="b2s[' . $data->networkAuthId . '][instant_sharing]" value="' . $data->instantSharing . '">';
322
-
323
$content .= '<input type="hidden" data-network-auth-id="' . $data->networkAuthId . '" class="form-control b2s-post-ship-network-display-name" name="b2s[' . $data->networkAuthId . '][network_display_name]" value="' . $data->network_display_name . '">';
324
325
$content .= '</div>';
@@ -328,7 +369,7 @@ class B2S_Ship_Item {
328
329
public function getCustomEditArea($networkId, $networkAuthId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $imageUrl = null) {
330
$meta = array();
331
- if ($networkId == 1 || ($networkId == 8 && $networkType == 0) || $networkId == 3 || $networkId == 2) {
332
if (trim(strtolower($this->postStatus)) == 'publish' || $this->b2sPostType == 'ex') {
333
//is calendar edit => scrape post url and not custom post url by override from edit function for meta tags!
334
//$editPostUrl = $this->viewMode == 'modal') ? (get_permalink($this->postData->ID) !== false ? get_permalink($this->postData->ID) : $this->postData->guid) : $this->postUrl;
@@ -417,7 +458,7 @@ class B2S_Ship_Item {
417
$edit .= '</div>';
418
}
419
420
- if ($networkId == 8 && $networkType == 0) {
421
$edit = '<textarea class="form-control xing-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
422
$edit .= '<div class="row">';
423
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
@@ -447,7 +488,7 @@ class B2S_Ship_Item {
447
}
448
449
public function getCustomEditSchedArea($schedCount = 0, $networkId, $networkAuthId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $infoArea, $imageUrl = null) {
450
- if ($networkId == 1 || ($networkId == 8 && $networkType == 0) || $networkId == 3 || $networkId == 2) {
451
if ($networkId == 1) {
452
$edit = '<div class="row"><br>';
453
$edit .= '<div class="col-xs-12 col-sm-5 col-lg-3">';
@@ -498,7 +539,7 @@ class B2S_Ship_Item {
498
$edit .= '</div>';
499
}
500
501
- if ($networkId == 8 && $networkType == 0) {
502
$edit = '<div class="row"><br>';
503
$edit .= '<div class="col-xs-12 col-sm-5 col-lg-3">';
504
$edit .= '<img src="' . $this->defaultImage . '" class="xing-url-image b2s-post-item-details-url-image center-block img-responsive" data-network-count="' . $schedCount . '" data-network-id="' . $networkId . '" data-network-image-change="0" data-network-auth-id="' . $networkAuthId . '">';
@@ -584,6 +625,10 @@ class B2S_Ship_Item {
584
return $meta;
585
}
586
587
private function getHashTagsString($add = "\n\n") {
588
$hashTagsData = get_the_tags($this->postId);
589
$hashTags = '';
@@ -597,9 +642,9 @@ class B2S_Ship_Item {
597
598
private function getBoardHtml($networkAuthId, $networkId) {
599
$board = '';
600
- $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getBoards', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $networkAuthId, 'networkId' => $networkId)));
601
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
602
- $board = '<select class="form-control b2s-select" name="b2s[' . $networkAuthId . '][board]">';
603
$board .= $result->data;
604
$board .= '</select>';
605
}
@@ -608,19 +653,35 @@ class B2S_Ship_Item {
608
609
private function getGroupsHtml($networkAuthId, $networkId) {
610
$group = '';
611
- $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getGroups', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $networkAuthId, 'networkId' => $networkId, 'lang' => B2S_LANGUAGE)));
612
$changeDisplayName = in_array($networkId, $this->changeDisplayName) ? 'true' : 'false';
613
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
614
- $group = '<select class="form-control b2s-select b2s-post-item-details-item-group-select" data-change-network-display-name="' . $changeDisplayName . '" data-network-auth-id="' . $networkAuthId . '" data-network-id="' . $networkId . '" name="b2s[' . $networkAuthId . '][group]">';
615
$group .= $result->data;
616
$group .= '</select>';
617
}
618
return $group;
619
}
620
621
- private function getTitleHtml($networkId, $networkdAutId, $title) {
622
$title = in_array($networkId, $this->allowNoEmoji) ? B2S_Util::remove4byte(B2S_Util::getTitleByLanguage($title, $this->userLang)) : B2S_Util::getTitleByLanguage($title, $this->userLang);
623
- return '<input type="text" name="b2s[' . $networkdAutId . '][custom_title]" class="form-control b2s-post-item-details-item-title-input" data-network-auth-id="' . $networkdAutId . '" placeholder="' . __('The Headline...', 'blog2social') . '" required="required" maxlength="254" value="' . $title . '" />';
624
}
625
626
private function getTagsHtml($networkAuthId, $allowTags = true) {
@@ -749,17 +810,26 @@ class B2S_Ship_Item {
749
750
$shipping .= $schedcount != 0 ? '<div class="clearfix"></div><hr class="b2s-hr-small">' : '';
751
752
- $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-interval" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Interval', 'blog2social') . '</label>';
753
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-duration" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Duration', 'blog2social') . '</label>';
754
755
//new since 4.5.0
756
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-duration-month" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Duration', 'blog2social') . '</label>';
757
- $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-duration-time" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Repeat', 'blog2social') . '</label>';
758
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-select-day" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Day of month', 'blog2social') . '</label>';
759
- $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-select-timespan" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Duration in days', 'blog2social') . '</label>';
760
761
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-date" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Start date', 'blog2social') . '</label>';
762
- $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-time" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Time', 'blog2social') . '</label>';
763
$shipping .= '<label class="hidden-sm hidden-xs col-md-4 del-padding-left b2s-post-item-details-release-area-label-day" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Days', 'blog2social') . '</label>';
764
765
$shipping .= '<div class="clearfix"></div>';
6
private $allowTitlePage = array();
7
private $allowTitleGroup = array();
8
private $setPostFormat = array(1, 2, 10, 12);
9
+ private $isCommentProfile = array(1, 3, 8, 10, 17, 19);
10
private $isCommentPage = array(1);
11
private $isCommentGroup = array(1);
12
private $allowTag = array(4, 9, 11, 16);
13
private $allowHtml = array(4, 11, 14);
14
private $showTitleProfile = array(4, 9, 11, 14, 16);
15
+ private $showTitlePage = array(8, 19 => array(1)); //Xing Business Page
16
+ private $showTitleGroup = array(8, 11, 19);
17
private $onlyImage = array(6, 7, 12);
18
private $allowNoImageProfile = array(5, 9);
19
+ private $allowNoCustomImageProfile = array(8, 15, 19);
20
private $allowNoEmoji = array(9, 13, 14, 15, 16, 18);
21
private $allowNoImagePage = array(8);
22
+ private $allowEditUrl = array(1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19);
23
private $showBoards = array(6);
24
private $showRelay = array(2);
25
private $showBoardsGroup = array(10);
26
+ private $showGroups = array(8, 15, 19);
27
private $changeDisplayName = array(8);
28
+ private $setShortTextProfile = array(1 => 239, 2 => 255, 3 => 239, 6 => 300, 8 => 239, 10 => 442, 12 => 240, 9 => 200, 16 => 250, 17 => 442, 18 => 800, 19 => 239);
29
+ private $setShortTextProfileLimit = array(1 => 400, 2 => 256, 3 => 400, 6 => 400, 8 => 400, 10 => 500, 12 => 400, 9 => 200, 18 => 1000, 19 => 400);
30
+ private $setShortTextPage = array(1 => 239, 3 => 239, 8 => 400, 10 => 442, 17 => 442, 19 => 239);
31
+ private $setShortTextPageLimit = array(1 => 400, 3 => 400, 8 => 400, 10 => 500, 19 => array(0 => 400, 1 => 2000)); // XING Company Page, Business Page
32
+ private $limitCharacterTitlePage = array(19 => array(1 => 150)); //XING Business Page selected over networkKind
33
+ private $setShortTextGroup = array(1 => 239, 8 => 239, 10 => 442, 17 => 442, 19 => 239);
34
private $setShortTextGroupLimit = array(1 => 400, 8 => 400, 10 => 500);
35
private $allowHashTags = array(1, 2, 3, 6, 10, 12, 17);
36
+ private $limitCharacterProfile = array(2 => 280, 3 => 1300, 6 => 500, 8 => 420, 9 => 250, 15 => 300, 12 => 2000, 18 => 1500, 19 => 420);
37
private $showImageAreaProfile = array(6, 7, 10, 12, 16, 17, 18);
38
+ private $showImageAreaPage = array(10, 17, 19);
39
+ private $showImageAreaGroup = array(8, 10, 17, 19);
40
+ private $showMarketplace = array(19);
41
+ private $limitCharacterPage = array(3 => 1300, 8 => 1200, 19 => array(0 => 400, 1 => 2000)); // XING Company Page, Business Page
42
+ private $requiredUrl = array(1, 3, 8, 9, 10, 15, 19);
43
private $getText = array(1, 7, 10, 12, 16, 17, 18);
44
+ private $allowSchedCustomizeContent = array(1, 2, 3, 6, 7, 8, 9, 10, 12, 15, 17, 18, 19);
45
private $maxWeekTimeSelect = 52;
46
private $networkTosProfile = array(2);
47
+ private $networkTosGroup = array(8, 19);
48
private $maxMonthTimeSelect = 12;
49
private $maxTimeSelect = 50;
50
private $maxSchedCount = 3;
51
+ private $selMarketplaceCategory = 3;
52
+ private $selMarketplaceType = 1;
53
+ private $selGroup = null;
54
+ private $selBoard = null;
55
//private $maxReplayCount = 3;
56
private $setRelayCount = 0;
57
private $maxDaySelect = 31;
58
private $noScheduleRegularly = array(2, 4, 11, 14, 15, 18);
59
+ private $noScheduleRegularlyPage = array(8, 19);
60
+ private $addNoMoreSchedPage = array(8, 19);
61
+ private $addNoMoreSchedGroup = array(8, 19);
62
private $defaultImage;
63
private $postData;
64
private $postUrl;
90
public function getItemHtml($data, $show_time = true) {
91
92
$this->viewMode = (isset($data->view) && !empty($data->view)) ? $data->view : null; //normal or modal(Kalendar)
93
+ //Override data values from edit modus
94
+ $schedMetaData = ($this->viewMode == 'modal') ? $this->hook_sched_data(array()) : array();
95
+ if (!empty($schedMetaData) && is_array($schedMetaData)) {
96
+ $data->instantSharing = 0;
97
+ if (isset($schedMetaData['network_kind'])) {
98
+ $data->networkKind = $schedMetaData['network_kind'];
99
+ }
100
+ if (isset($schedMetaData['network_tos_group_id'])) {
101
+ $data->networkTosGroupId = $schedMetaData['network_tos_group_id'];
102
+ }
103
+ if (isset($schedMetaData['marketplace_category'])) {
104
+ $this->selMarketplaceCategory = (int) $schedMetaData['marketplace_category'];
105
+ }
106
+ if (isset($schedMetaData['marketplace_type'])) {
107
+ $this->selMarketplaceType = (int) $schedMetaData['marketplace_type'];
108
+ }
109
+ if (isset($schedMetaData['group'])) {
110
+ $this->selGroup = $schedMetaData['group'];
111
+ }
112
+ if (isset($schedMetaData['board'])) {
113
+ $this->selBoard = $schedMetaData['board'];
114
+ }
115
+ }
116
117
$userOptions = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
118
$allowUserHashTag = $userOptions->_getOption('user_allow_hashtag');
119
$contentTwitter = $userOptions->_getOption('content_network_twitter');
120
$networkName = unserialize(B2S_PLUGIN_NETWORK);
121
$networkTypeName = unserialize(B2S_PLUGIN_NETWORK_TYPE);
122
+ $networkKindName = unserialize(B2S_PLUGIN_NETWORK_KIND);
123
$limit = false;
124
$limitValue = 0;
125
$textareaLimitInfo = "";
192
break;
193
case '1':
194
//page
195
+ if (isset($this->limitCharacterPage[$data->networkId]) && ((int) $this->limitCharacterPage[$data->networkId] > 0) || isset($this->limitCharacterPage[$data->networkId][$data->networkKind])) {
196
+ $limitValue = (isset($this->limitCharacterPage[$data->networkId][$data->networkKind])) ? $this->limitCharacterPage[$data->networkId][$data->networkKind] : $this->limitCharacterPage[$data->networkId];
197
$limit = true;
198
}
199
$infoImage = (in_array($data->networkId, $this->allowNoImagePage)) ? __('Network does not support image for pages', 'blog2social') . '!' : '';
204
if ($data->networkId == 8) { //Xing -1 Leerzeichen
205
$this->setShortTextPage[$data->networkId] = (int) $this->setShortTextPage[$data->networkId] - mb_strlen($this->postUrl, 'UTF-8') - 1;
206
}
207
+ $message = B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, false, (in_array($data->networkId, $this->allowNoEmoji) ? false : true), $this->userLang), (isset($this->setShortTextPage[$data->networkId]) ? (int) $this->setShortTextPage[$data->networkId] : false), (isset($this->setShortTextPageLimit[$data->networkId]) ? (( is_array($this->setShortTextPageLimit[$data->networkId]) && isset($this->setShortTextPageLimit[$data->networkId][$data->networkKind])) ? (int) $this->setShortTextPageLimit[$data->networkId][$data->networkKind] : (int) $this->setShortTextPageLimit[$data->networkId] ) : false));
208
} else {
209
$message = (in_array($data->networkId, $this->allowTitlePage) ? (in_array($data->networkId, $this->allowNoEmoji) ? B2S_Util::remove4byte(B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang)) : B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang)) : B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, (in_array($data->networkId, $this->allowHtml) ? '<p><h1><h2><br><i><b><a><img>' : false), (in_array($data->networkId, $this->allowNoEmoji) ? false : true), $this->userLang));
210
}
268
$content .= '<img alt="" data-network-auth-id="' . $data->networkAuthId . '" class="img-responsive b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/' . $data->networkId . '_flat.png', B2S_PLUGIN_FILE) . '">';
269
$content .= '</div>';
270
$content .= '<div class="b2s-post-item-details">';
271
+ //XING deprecated
272
+ if ($data->networkId == 8) {
273
+ $content .='<div class="b2s-post-item-network-deprecated"><span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' . __('Connection expires on 31 March 2019', 'blog2social') . '</div>';
274
+ }
275
+ // G+ deprecated
276
+ if ($data->networkId == 10) {
277
+ $content .='<div class="b2s-post-item-network-deprecated"><span class="glyphicon glyphicon-exclamation-sign glyphicon-info"></span> ' . __('Connection expires on 2 April 2019', 'blog2social') . '</div>';
278
+ }
279
$content .= '<h4 class="pull-left b2s-post-item-details-network-display-name" data-network-auth-id="' . $data->networkAuthId . '">' . stripslashes($network_display_name) . '</h4>';
280
$content .= '<div class="clearfix"></div>';
281
+ $content .= '<p class="pull-left">' . ($data->networkId == 19 && $data->networkType == 1 && isset($networkKindName[$data->networkKind]) ? $networkKindName[$data->networkKind] . '-' : '') . $networkTypeName[$data->networkType] . (($data->networkId == 19 && (int) $data->networkType == 1 && (int) $data->networkKind == 0) ? ' (' . __('Employer Branding', 'blog2social') . ')' : '') . ' | ' . $networkName[$data->networkId];
282
$content .= '<div class="b2s-post-item-details-message-result" data-network-auth-id="' . $data->networkAuthId . '" style="display:none;"></div>';
283
$content .= '<span class="hidden-xs b2s-post-item-details-message-info" data-network-auth-id="' . $data->networkAuthId . '">' . $messageInfo . '</span></span>';
284
324
$content .= '<div class="b2s-post-item-details-edit-area" data-network-auth-id="' . $data->networkAuthId . '">';
325
$content .= (in_array($data->networkId, $this->showBoards) || ($data->networkType == 2 && in_array($data->networkId, $this->showBoardsGroup))) ? $this->getBoardHtml($data->networkAuthId, $data->networkId) : '';
326
$content .= (in_array($data->networkId, $this->showGroups) && ($data->networkType == 2 || $data->networkId == 15)) ? $this->getGroupsHtml($data->networkAuthId, $data->networkId) : '';
327
+ $content .= (in_array($data->networkId, $this->showMarketplace) && $data->networkType == 2) ? $this->getMarketplaceAreaHtml($data->networkAuthId, $data->networkId, $data->networkType, $data->networkKind) : '';
328
+ $content .= ((in_array($data->networkId, $this->showTitleProfile) && $data->networkType == 0) || (((in_array($data->networkId, $this->showTitlePage) && !is_array($this->showTitlePage[$data->networkId])) || (is_array($this->showTitlePage[$data->networkId]) && in_array($data->networkKind, $this->showTitlePage[$data->networkId]))) && $data->networkType == 1) || (in_array($data->networkId, $this->showTitleGroup) && $data->networkType == 2)) ? $this->getTitleHtml($data->networkId, $data->networkAuthId, $data->networkKind, $data->networkType, $this->postData->post_title) : '';
329
$content .= $this->getCustomEditArea($data->networkId, $data->networkAuthId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
330
$content .= (in_array($data->networkId, $this->allowTag) && $data->networkType == 0) ? $this->getTagsHtml($data->networkAuthId, (($allowUserHashTag === false || $allowUserHashTag == 1) ? true : false)) : '';
331
332
+ //Calendar
333
if (!(isset($this->viewMode) && $this->viewMode == 'modal')) {
334
$content .='<br>';
335
$content .='<div class="b2s-calendar-filter-area col-xs-2 pull-right del-padding-right hide" data-network-auth-id="' . $data->networkAuthId . '">';
349
if ($show_time) {
350
$content .= $this->getShippingTimeHtml($data->networkAuthId, $data->networkType, $data->networkId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
351
}
352
+
353
$content .= '</div>';
354
355
$content .= '</div>';
359
$content .= '<input type="hidden" class="form-control" name="b2s[' . $data->networkAuthId . '][network_id]" value="' . $data->networkId . '">';
360
$content .= '<input type="hidden" class="form-control" name="b2s[' . $data->networkAuthId . '][network_type]" value="' . $data->networkType . '">';
361
$content .= '<input type="hidden" class="form-control" name="b2s[' . $data->networkAuthId . '][instant_sharing]" value="' . $data->instantSharing . '">';
362
+ $content .= '<input type="hidden" class="form-control" name="b2s[' . $data->networkAuthId . '][network_tos_group_id]" value="' . $data->networkTosGroupId . '">';
363
+ $content .= '<input type="hidden" class="form-control networkKind" data-network-auth-id="' . $data->networkAuthId . '" name="b2s[' . $data->networkAuthId . '][network_kind]" value="' . $data->networkKind . '">';
364
$content .= '<input type="hidden" data-network-auth-id="' . $data->networkAuthId . '" class="form-control b2s-post-ship-network-display-name" name="b2s[' . $data->networkAuthId . '][network_display_name]" value="' . $data->network_display_name . '">';
365
366
$content .= '</div>';
369
370
public function getCustomEditArea($networkId, $networkAuthId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $imageUrl = null) {
371
$meta = array();
372
+ if ($networkId == 1 || ($networkId == 8 && $networkType == 0) || ($networkId == 19 && $networkType == 0) || $networkId == 3 || $networkId == 2) {
373
if (trim(strtolower($this->postStatus)) == 'publish' || $this->b2sPostType == 'ex') {
374
//is calendar edit => scrape post url and not custom post url by override from edit function for meta tags!
375
//$editPostUrl = $this->viewMode == 'modal') ? (get_permalink($this->postData->ID) !== false ? get_permalink($this->postData->ID) : $this->postData->guid) : $this->postUrl;
458
$edit .= '</div>';
459
}
460
461
+ if (($networkId == 8 || $networkId == 19) && $networkType == 0) {
462
$edit = '<textarea class="form-control xing-textarea-input b2s-post-item-details-item-message-input ' . (in_array($networkId, $this->allowHtml) ? 'b2s-post-item-details-item-message-input-allow-html' : '') . '"data-network-count="-1" data-network-text-limit="' . $limitValue . '" data-network-auth-id="' . $networkAuthId . '" placeholder="' . __('Write something about your post...', 'blog2social') . '" name="b2s[' . $networkAuthId . '][content]" ' . $isRequiredTextarea . ' ' . $textareaOnKeyUp . '>' . $message . '</textarea>';
463
$edit .= '<div class="row">';
464
$edit .= '<div class="' . ((isset($this->viewMode) && $this->viewMode == 'modal') ? 'col-xs-12' : 'col-xs-12 col-sm-5 col-lg-3') . '">';
488
}
489
490
public function getCustomEditSchedArea($schedCount = 0, $networkId, $networkAuthId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $infoArea, $imageUrl = null) {
491
+ if ($networkId == 1 || ($networkId == 8 && $networkType == 0) || ($networkId == 19 && $networkType == 0) || $networkId == 3 || $networkId == 2) {
492
if ($networkId == 1) {
493
$edit = '<div class="row"><br>';
494
$edit .= '<div class="col-xs-12 col-sm-5 col-lg-3">';
539
$edit .= '</div>';
540
}
541
542
+ if (($networkId == 8 || $networkId == 19) && $networkType == 0) {
543
$edit = '<div class="row"><br>';
544
$edit .= '<div class="col-xs-12 col-sm-5 col-lg-3">';
545
$edit .= '<img src="' . $this->defaultImage . '" class="xing-url-image b2s-post-item-details-url-image center-block img-responsive" data-network-count="' . $schedCount . '" data-network-id="' . $networkId . '" data-network-image-change="0" data-network-auth-id="' . $networkAuthId . '">';
625
return $meta;
626
}
627
628
+ protected function hook_sched_data(array $schedData) {
629
+ return $schedData;
630
+ }
631
+
632
private function getHashTagsString($add = "\n\n") {
633
$hashTagsData = get_the_tags($this->postId);
634
$hashTags = '';
642
643
private function getBoardHtml($networkAuthId, $networkId) {
644
$board = '';
645
+ $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getBoards', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $networkAuthId, 'selBoard' => $this->selBoard, 'networkId' => $networkId)));
646
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
647
+ $board = '<select class="form-control b2s-select-area" name="b2s[' . $networkAuthId . '][board]">';
648
$board .= $result->data;
649
$board .= '</select>';
650
}
653
654
private function getGroupsHtml($networkAuthId, $networkId) {
655
$group = '';
656
+ $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getGroups', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $networkAuthId, 'selGroup' => $this->selGroup, 'networkId' => $networkId, 'lang' => B2S_LANGUAGE)));
657
$changeDisplayName = in_array($networkId, $this->changeDisplayName) ? 'true' : 'false';
658
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
659
+ $group = '<select class="form-control b2s-select-area b2s-post-item-details-item-group-select" data-change-network-display-name="' . $changeDisplayName . '" data-network-auth-id="' . $networkAuthId . '" data-network-id="' . $networkId . '" name="b2s[' . $networkAuthId . '][group]">';
660
$group .= $result->data;
661
$group .= '</select>';
662
}
663
return $group;
664
}
665
666
+ private function getMarketplaceAreaHtml($networkAuthId = 0, $networkId = 0, $networkType = 0, $networkKind = 0) {
667
+ $marketplace = '<div class="marketplace_area" data-network-id="' . $networkId . '" data-network-type="' . $networkType . '" data-network-auth-id="' . $networkAuthId . '" style="display:' . (($networkKind == 3) ? 'block' : 'none') . ';">';
668
+ $marketplace .='<input type="radio" id="marketplace_category_1" class="form-control marketplace_category" ' . (($this->selMarketplaceCategory == 1) ? 'checked=""' : '') . ' name="b2s[' . $networkAuthId . '][marketplace_category]" value="1"> <label class="" for="marketplace_category_1">' . __('Jobs & Projects', 'blog2social') . '</label> ';
669
+ $marketplace .='<input type="radio" id="marketplace_category_2" class="form-control marketplace_category" ' . (($this->selMarketplaceCategory == 2) ? 'checked=""' : '') . ' name="b2s[' . $networkAuthId . '][marketplace_category]" value="2"> <label class="" for="marketplace_category_2">' . __('Events', 'blog2social') . '</label> ';
670
+ $marketplace .='<input type="radio" id="marketplace_category_3" class="form-control marketplace_category" ' . (($this->selMarketplaceCategory == 3) ? 'checked=""' : '') . ' name="b2s[' . $networkAuthId . '][marketplace_category]" value="3"> <label class="" for="marketplace_category_3">' . __('Classified Ads', 'blog2social') . '</label> ';
671
+ $marketplace .='<div class="clearfix"></div>';
672
+ $marketplace .='<input type="radio" id="marketplace_type_1" class="form-control marketplace_type" ' . (($this->selMarketplaceType == 1) ? 'checked=""' : '') . ' name="b2s[' . $networkAuthId . '][marketplace_type]" value="1"> <label class="" for="marketplace_type_1">' . __('Offer', 'blog2social') . '</label> ';
673
+ $marketplace .='<input type="radio" id="marketplace_type_2" class="form-control marketplace_type" ' . (($this->selMarketplaceType == 2) ? 'checked=""' : '') . ' name="b2s[' . $networkAuthId . '][marketplace_type]" value="2"> <label class="" for="marketplace_type_2">' . __('Request', 'blog2social') . '</label>';
674
+ $marketplace .='<div class="clearfix"></div><br/>';
675
+ $marketplace .='</div>';
676
+ return $marketplace;
677
+
678
+ //<input type="radio" id="type[0]-1-2" checked="" name="b2s['.$networkAuthId.'][marketplace_type]" value="1"> <label class="" for="type[0]-1-2">Profil</label>
679
+ }
680
+
681
+ private function getTitleHtml($networkId = 0, $networkdAutId = 0, $networkKind = 0, $networkType = 0, $title = '') {
682
$title = in_array($networkId, $this->allowNoEmoji) ? B2S_Util::remove4byte(B2S_Util::getTitleByLanguage($title, $this->userLang)) : B2S_Util::getTitleByLanguage($title, $this->userLang);
683
+ $maxLength = ($networkType == 1 && isset($this->limitCharacterTitlePage[$networkId][$networkKind])) ? (int) $this->limitCharacterTitlePage[$networkId][$networkKind] : 254;
684
+ return '<input type="text" name="b2s[' . $networkdAutId . '][custom_title]" class="form-control b2s-post-item-details-item-title-input" data-network-auth-id="' . $networkdAutId . '" placeholder="' . __('The Headline...', 'blog2social') . '" required="required" maxlength="' . $maxLength . '" value="' . $title . '" />';
685
}
686
687
private function getTagsHtml($networkAuthId, $allowTags = true) {
810
811
$shipping .= $schedcount != 0 ? '<div class="clearfix"></div><hr class="b2s-hr-small">' : '';
812
813
+ //deprecated Network
814
+ if ($networkId == 8) {
815
+ $shipping.='<div class="network-tos-deprecated-warning alert alert-danger" style="display: none;" data-network-id="' . $networkId . '" data-network-count="' . $schedcount . '" data-network-auth-id="' . $networkAuthId . '">' . __("Please note: Your account is connected via an old XING API that is no longer supported by XING after March 31. Please connect your XING profile, as well as your XING company pages (Employer branding profiles) and business pages with the new XING interface in the Blog2Social network settings. To do this, go to the Blog2Social Networks section and connect your XING accounts with the new XING.", "blog2social") . ' <a href="' . B2S_Tools::getSupportLink('network_tos_blog_032019') . '" target="_blank">' . __('Learn more', 'blog2social') . '</a></div>';
816
+ }
817
+ //deprecated Network
818
+ if ($networkId == 10) {
819
+ $shipping.='<div class="network-tos-deprecated-warning alert alert-danger" style="display: none;" data-network-id="' . $networkId . '" data-network-count="' . $schedcount . '" data-network-auth-id="' . $networkAuthId . '">' . __("Please note: Google will shut down Google+ for all private accounts (profiles, pages, groups) on 2nd April 2019. You can find further information and the next steps, including how to download your photos and other content here:", "blog2social") . ' <a href="https://support.google.com/plus/answer/9195133" target="_blank">https://support.google.com/plus/answer/9195133</a></div>';
820
+ }
821
+
822
+ $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-interval" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Repeats', 'blog2social') . '</label>';
823
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-duration" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Duration', 'blog2social') . '</label>';
824
825
//new since 4.5.0
826
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-duration-month" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Duration', 'blog2social') . '</label>';
827
+ $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-duration-time" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Number of repeats', 'blog2social') . '</label>';
828
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-select-day" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Day of month', 'blog2social') . '</label>';
829
+ $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-select-timespan" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '" style="display:none;">' . __('Repeats every (days)', 'blog2social') . '</label>';
830
831
$shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-date" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Start date', 'blog2social') . '</label>';
832
+ $shipping .= '<label class="hidden-sm hidden-xs col-md-2 del-padding-left b2s-post-item-details-release-area-label-time" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Time to publish', 'blog2social') . '</label>';
833
$shipping .= '<label class="hidden-sm hidden-xs col-md-4 del-padding-left b2s-post-item-details-release-area-label-day" data-network-auth-id="' . $networkAuthId . '" data-network-count="' . $schedcount . '">' . __('Days', 'blog2social') . '</label>';
834
835
$shipping .= '<div class="clearfix"></div>';
includes/B2S/Ship/Navbar.php CHANGED
@@ -4,6 +4,7 @@ class B2S_Ship_Navbar {
4