Blog2Social: Social Media Auto Post & Scheduler - Version 4.6.0

Version Description

Usability Optimization, facebook member groups, new network vkontakte, more flexible scheduling

Download this release

Release Info

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

Code changes from version 4.5.1 to 4.6.0

assets/css/b2s/settings.css CHANGED
@@ -121,3 +121,7 @@ ul.chosen-choices {
121
border: 1px solid #d7d7d7 !important;
122
box-shadow: none;
123
}
121
border: 1px solid #d7d7d7 !important;
122
box-shadow: none;
123
}
124
+
125
+ .b2s-auto-post-own-update-warning{
126
+ border: 1px solid #aaa !important;
127
+ }
assets/css/b2s/start.css CHANGED
@@ -194,4 +194,8 @@ ul.b2s-sort-result-item-area{
194
195
.b2sSortForm.form-inline{
196
margin-bottom: 0px !important;
197
}
194
195
.b2sSortForm.form-inline{
196
margin-bottom: 0px !important;
197
+ }
198
+
199
+ .fc-day-grid-event{
200
+ cursor: pointer;
201
}
assets/css/b2s/wp/plugin-deactivate.css ADDED
@@ -0,0 +1,145 @@
1
+ .b2s-plugin-modal {
2
+ overflow-x: hidden;
3
+ overflow-y: auto;
4
+ content: "";
5
+ display: none;
6
+ background: rgba(0, 0, 0, 0.6);
7
+ position: fixed;
8
+ top: 0;
9
+ left: 0;
10
+ right: 0;
11
+ bottom: 0;
12
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
13
+ z-index: 1050;
14
+ }
15
+ .b2s-plugin-modal-btn-close{
16
+ color: #000;
17
+ float: right;
18
+ font-size: 24px;
19
+ font-weight: bold;
20
+ text-decoration: none;
21
+ opacity: 0.4;
22
+ text-shadow: 0 1px 0 #fff;
23
+ background: transparent none repeat scroll 0 0;
24
+ border: 0 none;
25
+ cursor: pointer;
26
+ padding: 0;
27
+ }
28
+ .b2s-plugin-modal-dialog{
29
+ background: #fefefe none repeat scroll 0 0;
30
+ border-radius: 5px;
31
+ width: auto;
32
+ top:10%;
33
+ max-width: 600px;
34
+ position: relative;
35
+ }
36
+ @media(max-width: 420px) {
37
+ .b2s-plugin-modal-dialog{
38
+ margin: 10px;
39
+
40
+ }
41
+ }
42
+ @media(min-width: 421px) {
43
+ .b2s-plugin-modal-dialog{
44
+ margin: 30px auto;
45
+ }
46
+ }
47
+ .b2s-plugin-modal-body {
48
+ padding: 0px 15px;
49
+ }
50
+ .b2s-plugin-modal-header {
51
+ padding: 10px 20px;
52
+ }
53
+ .b2s-plugin-modal-header {
54
+ border-bottom: 1px solid #e5e5e5;
55
+ padding: 10px;
56
+ }
57
+ .b2s-plugin-modal-footer {
58
+ border-top: 1px solid #e5e5e5;
59
+ padding: 15px;
60
+ }
61
+ .b2s-plugin-modal-title {
62
+ line-height: 1.42857;
63
+ font-size: 20px;
64
+ margin: 0;
65
+ }
66
+ .b2s-plugin-modal-h4 {
67
+ line-height: 1.42857;
68
+ font-size: 20px;
69
+ margin: 0;
70
+ }
71
+ #b2s-meta-box-close {
72
+ display: none;
73
+ }
74
+ .b2s-btn-success, .b2s-label-success {
75
+ background-color: #79B232 !important;
76
+ }
77
+ .b2s-center-block {
78
+ display: block !important;
79
+ margin-left: auto;
80
+ margin-right: auto;
81
+ }
82
+ .b2s-btn-success {
83
+ background-color: #79B232 !important;
84
+ border-color: #398439 !important;
85
+ color: #fff !important;
86
+ }
87
+ .b2s-btn-primary {
88
+ color: #fff !important;
89
+ background-color: #337ab7 !important;
90
+ border-color: #2e6da4 !important;
91
+ }
92
+ .b2s-btn-none-underline{
93
+ text-decoration: none !important;
94
+ }
95
+ .b2s-btn {
96
+ -moz-user-select: none;
97
+ background-image: none;
98
+ border: 1px solid transparent;
99
+ border-radius: 4px;
100
+ cursor: pointer;
101
+ display: inline-block;
102
+ font-size: 12px;
103
+ font-weight: normal;
104
+ line-height: 1.42857;
105
+ margin-bottom: 0;
106
+ padding: 6px 12px;
107
+ text-align: center;
108
+ vertical-align: middle;
109
+ white-space: nowrap;
110
+ }
111
+ .b2s-btn-margin-bottom-15{
112
+ margin-bottom: 1.5em;
113
+ }
114
+ .b2s-info-btn{
115
+ font-size: 12px;
116
+ }
117
+ .b2s-btn-sm{
118
+ padding: 4px 12px !important;
119
+ }
120
+ .b2s-btn-close-meta-box{
121
+ padding: 0px !important;
122
+ float:right;
123
+ position: relative !important;
124
+ }
125
+ .b2s-close-icon::before {
126
+ background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
127
+ color: #b4b9be;
128
+ content: "";
129
+ display: block;
130
+ font: 16px/20px dashicons;
131
+ height: 20px;
132
+ text-align: center;
133
+ width: 20px;
134
+ }
135
+ .b2s-close-icon{
136
+ background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
137
+ border: medium none;
138
+ color: #b4b9be;
139
+ cursor: pointer;
140
+ margin: 0;
141
+ padding: 9px;
142
+ position: absolute;
143
+ right: 1px;
144
+ top: 0;
145
+ }
assets/css/general.css CHANGED
@@ -7196,4 +7196,7 @@ input[type="checkbox"].error + label{
7196
color: #79B232;
7197
font-weight: 700;
7198
}
7199
7196
color: #79B232;
7197
font-weight: 700;
7198
}
7199
+ .b2s-disabled-div{
7200
+ opacity: 0.5;
7201
+ }
7202
assets/images/portale/17_flat.png ADDED
Binary file
assets/js/b2s/calendar.js CHANGED
@@ -13,7 +13,7 @@ jQuery(document).ready(function () {
13
eventSources: [curSource[0]],
14
eventRender: function (event, element) {
15
show = true;
16
- $header = jQuery("<div>").addClass("b2s-calendar-header");
17
$network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
18
element.find(".fc-time").after($network_name);
19
element.html(element.html());
@@ -36,7 +36,7 @@ jQuery(document).ready(function () {
36
if (!jQuery(element[0]).hasClass('fc-past')) {
37
var date = jQuery(element[0]).attr('data-date');
38
var sel_element = jQuery(element[0]).closest('div').next('div').find('td[data-date="' + date + '"]');
39
- $header = jQuery("<a>").html("+ <span class=\"hidden-sm hidden-xs\">"+jQuery("#b2sJSTextAddPost").val()+"</span>").addClass("b2s-calendar-sched-new-post-btn").attr('href', '#');
40
sel_element.append($header);
41
}
42
},
@@ -61,126 +61,142 @@ jQuery(document).ready(function () {
61
return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
62
},
63
eventClick: function (calEvent, jsEvent, view) {
64
-
65
- if (jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).length == 1)
66
- {
67
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).remove();
68
- }
69
- b2s_current_post_id = calEvent.post_id;
70
- var $modal = jQuery("<div>");
71
- jQuery.ajax({
72
- url: ajaxurl,
73
- type: "POST",
74
- cache: false,
75
- async: false,
76
- data: {
77
- 'action': 'b2s_get_calendar_edit_modal',
78
- 'id': calEvent.b2s_id
79
- },
80
- success: function (data) {
81
- $modal = $modal.html(data);
82
- }
83
- });
84
- jQuery("body").append($modal);
85
- jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
86
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).modal('show');
87
- activatePortal(calEvent.network_auth_id);
88
- initSceditor(calEvent.network_auth_id);
89
- networkCount(calEvent.network_auth_id);
90
- if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').length > 0) {
91
- var postFormatText = b2s_calendar_formats;
92
- var isSetPostFormat = false;
93
- var postFormatType = jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').attr('data-post-format-type');
94
- //is set post format => override current condidtions by user settings for this post
95
- if (calEvent.post_format !== null) {
96
- jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val(calEvent.post_format);
97
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[postFormatType][calEvent.post_format]);
98
- jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(calEvent.post_format);
99
- //edit modal select post format
100
- jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').removeClass('b2s-settings-checked');
101
- jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"][data-post-format="' + calEvent.post_format + '"]').addClass('b2s-settings-checked');
102
- } else {
103
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val()]);
104
- jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val());
105
}
106
107
- //if linkpost then show btn meta tags
108
- var isMetaChecked = false;
109
- if (calEvent.network_id == "1" && jQuery('#isOgMetaChecked').val() == "1") {
110
- isMetaChecked = true;
111
- }
112
- if (calEvent.network_id == "2" && jQuery('#isCardMetaChecked').val() == "1") {
113
- isMetaChecked = true;
114
- }
115
- if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val() == "0") {
116
- jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
117
- jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
118
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').hide();
119
- var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').attr("data-meta-type");
120
- if (dataMetaType == "og") {
121
- jQuery('.b2sChangeOgMeta[data-network-auth-id="' + calEvent.network_auth_id + '"]').val("1");
122
- } else {
123
- jQuery('.b2sChangeCardMeta[data-network-auth-id="' + calEvent.network_auth_id + '"]').val("1");
124
- }
125
-
126
- } else {
127
- jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
128
- jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
129
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').show();
130
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').trigger("click");
131
- }
132
133
134
- }
135
136
- jQuery("#b2sPostId").val(calEvent.post_id);
137
- var today = new Date();
138
- var dateFormat = "yyyy-mm-dd";
139
- var language = "en";
140
- var showMeridian = true;
141
- if (jQuery('#b2sUserLang').val() == "de") {
142
- dateFormat = "dd.mm.yyyy";
143
- language = "de";
144
- showMeridian = false;
145
}
146
147
- jQuery(".b2s-post-item-details-release-input-date").datepicker({
148
- format: dateFormat,
149
- language: language,
150
- maxViewMode: 2,
151
- todayHighlight: true,
152
- startDate: today,
153
- calendarWeeks: true,
154
- autoclose: true
155
- });
156
- jQuery('.b2s-post-item-details-release-input-time').timepicker({
157
- minuteStep: 15,
158
- appendWidgetTo: 'body',
159
- showSeconds: false,
160
- showMeridian: showMeridian,
161
- defaultTime: 'current',
162
- snapToStep: true
163
- });
164
- jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
165
- checkSchedDateTime(calEvent.network_auth_id);
166
- });
167
- jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
168
- checkSchedDateTime(calEvent.network_auth_id);
169
- });
170
- init();
171
- if (!b2s_has_premium)
172
- {
173
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).find("input, textarea, button").each(function () {
174
- if (!jQuery(this).hasClass('b2s-modal-close')) {
175
- jQuery(this).prop("disabled", true);
176
- }
177
- });
178
- }
179
}
180
181
});
182
- jQuery(".b2s-loading-area").hide();
183
- });
184
185
jQuery(document).on('change', '.b2s-calendar-filter-network-btn', function () {
186
newSource[0] = ajaxurl + '?action=b2s_get_calendar_events&filter_network_auth=all&filter_network=' + jQuery(this).val();
@@ -272,7 +288,12 @@ jQuery(document).on('click', '.b2s-calendar-sched-new-post-btn', function () {
272
}
273
jQuery('#b2s-show-post-all-modal').modal('show');
274
var selSchedDate = jQuery(this).parent('td').attr('data-date');
275
- b2sSortFormSubmit(selSchedDate);
276
return false;
277
});
278
@@ -289,7 +310,9 @@ function showFilter(typ) {
289
}
290
}
291
292
- function b2sSortFormSubmit(selSchedDate) {
293
jQuery(".b2s-loading-area").show();
294
jQuery('.b2s-sort-result-item-area').html('');
295
jQuery('.b2s-sort-pagination-area').html('');
@@ -309,7 +332,7 @@ function b2sSortFormSubmit(selSchedDate) {
309
'b2sSortPostStatus': jQuery('#b2sSortPostStatus').val(),
310
'b2sSortPostPublishDate': jQuery('#b2sSortPostPublishDate').val(),
311
'b2sUserLang': jQuery('#b2sUserLang').val(),
312
- 'b2sSchedDate': selSchedDate
313
};
314
315
if (jQuery('#b2sPostsPerPage').length > 0) {
13
eventSources: [curSource[0]],
14
eventRender: function (event, element) {
15
show = true;
16
+ $header = jQuery("<div>").addClass("b2s-calendar-header").attr('data-b2s-id', event.b2s_id);
17
$network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
18
element.find(".fc-time").after($network_name);
19
element.html(element.html());
36
if (!jQuery(element[0]).hasClass('fc-past')) {
37
var date = jQuery(element[0]).attr('data-date');
38
var sel_element = jQuery(element[0]).closest('div').next('div').find('td[data-date="' + date + '"]');
39
+ $header = jQuery("<a>").html("+ <span class=\"hidden-sm hidden-xs\">" + jQuery("#b2sJSTextAddPost").val() + "</span>").addClass("b2s-calendar-sched-new-post-btn").attr('href', '#');
40
sel_element.append($header);
41
}
42
},
61
return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
62
},
63
eventClick: function (calEvent, jsEvent, view) {
64
+ showEditPostPreview(calEvent.b2s_id, calEvent.post_id, calEvent.network_auth_id, calEvent.network_type, calEvent.network_id, calEvent.post_format);
65
+ },
66
+ loading: function (bool) {
67
+ if (!bool) {
68
+ //Routing from Dashboard - loading edit post preview
69
+ var rfd = jQuery('#b2s_rfd').val();
70
+ if (rfd == 1) {
71
+ jQuery('#b2s_rfd').val("0");
72
+ jQuery('.b2s-calendar-header[data-b2s-id="' + jQuery('#b2s_rfd_b2s_id').val() + '"]').parent().trigger('click');
73
}
74
+ }
75
+ }
76
77
+ });
78
+ jQuery(".b2s-loading-area").hide();
79
+ });
80
81
82
+ function showEditPostPreview(b2s_id, post_id, network_auth_id, network_type, network_id, post_format) {
83
+ if (jQuery('#b2s-edit-event-modal-' + b2s_id).length == 1)
84
+ {
85
+ jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
86
+ }
87
+ b2s_current_post_id = post_id;
88
+ var $modal = jQuery("<div>");
89
+ jQuery.ajax({
90
+ url: ajaxurl,
91
+ type: "POST",
92
+ cache: false,
93
+ async: false,
94
+ data: {
95
+ 'action': 'b2s_get_calendar_edit_modal',
96
+ 'id': b2s_id
97
+ },
98
+ success: function (data) {
99
+ $modal = $modal.html(data);
100
+ }
101
+ });
102
+ jQuery("body").append($modal);
103
+ jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
104
+ jQuery('#b2s-edit-event-modal-' + b2s_id).modal('show');
105
+ activatePortal(network_auth_id);
106
+ initSceditor(network_auth_id);
107
+ networkCount(network_auth_id);
108
+ if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').length > 0) {
109
+ var postFormatText = b2s_calendar_formats;
110
+ var isSetPostFormat = false;
111
+ var postFormatType = jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').attr('data-post-format-type');
112
+ //is set post format => override current condidtions by user settings for this post
113
+ if (post_format !== null) {
114
+ jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val(post_format);
115
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + network_auth_id + '"]').html(postFormatText[postFormatType][post_format]);
116
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + network_auth_id + '"]').val(post_format);
117
+ //edit modal select post format
118
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').removeClass('b2s-settings-checked');
119
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"][data-post-format="' + post_format + '"]').addClass('b2s-settings-checked');
120
+ } else {
121
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val()]);
122
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val());
123
+ }
124
125
+ //if linkpost then show btn meta tags
126
+ var isMetaChecked = false;
127
+ if (network_id == "1" && jQuery('#isOgMetaChecked').val() == "1") {
128
+ isMetaChecked = true;
129
+ }
130
+ if (network_id == "2" && jQuery('#isCardMetaChecked').val() == "1") {
131
+ isMetaChecked = true;
132
+ }
133
+ if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val() == "0") {
134
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
135
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
136
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').hide();
137
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').attr("data-meta-type");
138
+ if (dataMetaType == "og") {
139
+ jQuery('.b2sChangeOgMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
140
+ } else {
141
+ jQuery('.b2sChangeCardMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
142
}
143
144
+ } else {
145
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
146
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
147
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').show();
148
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').trigger("click");
149
}
150
151
+
152
+ }
153
+
154
+ jQuery("#b2sPostId").val(post_id);
155
+ var today = new Date();
156
+ var dateFormat = "yyyy-mm-dd";
157
+ var language = "en";
158
+ var showMeridian = true;
159
+ if (jQuery('#b2sUserLang').val() == "de") {
160
+ dateFormat = "dd.mm.yyyy";
161
+ language = "de";
162
+ showMeridian = false;
163
+ }
164
+
165
+ jQuery(".b2s-post-item-details-release-input-date").datepicker({
166
+ format: dateFormat,
167
+ language: language,
168
+ maxViewMode: 2,
169
+ todayHighlight: true,
170
+ startDate: today,
171
+ calendarWeeks: true,
172
+ autoclose: true
173
});
174
+ jQuery('.b2s-post-item-details-release-input-time').timepicker({
175
+ minuteStep: 15,
176
+ appendWidgetTo: 'body',
177
+ showSeconds: false,
178
+ showMeridian: showMeridian,
179
+ defaultTime: 'current',
180
+ snapToStep: true
181
+ });
182
+ jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
183
+ checkSchedDateTime(network_auth_id);
184
+ });
185
+ jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
186
+ checkSchedDateTime(network_auth_id);
187
+ });
188
+ init();
189
+ if (!b2s_has_premium)
190
+ {
191
+ jQuery('#b2s-edit-event-modal-' + b2s_id).find("input, textarea, button").each(function () {
192
+ if (!jQuery(this).hasClass('b2s-modal-close')) {
193
+ jQuery(this).prop("disabled", true);
194
+ }
195
+ });
196
+ }
197
+ }
198
+
199
+
200
201
jQuery(document).on('change', '.b2s-calendar-filter-network-btn', function () {
202
newSource[0] = ajaxurl + '?action=b2s_get_calendar_events&filter_network_auth=all&filter_network=' + jQuery(this).val();
288
}
289
jQuery('#b2s-show-post-all-modal').modal('show');
290
var selSchedDate = jQuery(this).parent('td').attr('data-date');
291
+ if (!jQuery('#b2sSelSchedDate').length > 0) {
292
+ jQuery('.b2sSortForm input:first').after('<input value="' + selSchedDate + '" id="b2sSelSchedDate" name="b2sSelSchedDate" type="hidden">');
293
+ } else {
294
+ jQuery('#b2sSelSchedDate').val(selSchedDate);
295
+ }
296
+ b2sSortFormSubmit();
297
return false;
298
});
299
310
}
311
}
312
313
+ //b2sSortForm
314
+
315
+ function b2sSortFormSubmit() {
316
jQuery(".b2s-loading-area").show();
317
jQuery('.b2s-sort-result-item-area').html('');
318
jQuery('.b2s-sort-pagination-area').html('');
332
'b2sSortPostStatus': jQuery('#b2sSortPostStatus').val(),
333
'b2sSortPostPublishDate': jQuery('#b2sSortPostPublishDate').val(),
334
'b2sUserLang': jQuery('#b2sUserLang').val(),
335
+ 'b2sSchedDate': jQuery('#b2sSelSchedDate').val()
336
};
337
338
if (jQuery('#b2sPostsPerPage').length > 0) {
assets/js/b2s/network.js CHANGED
@@ -228,16 +228,15 @@ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandan
228
success: function (data) {}
229
});
230
231
232
-
233
- if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"').length == 0) {
234
- var typ = new Array('Profile', 'Page', 'Group');
235
- if (jQuery('#b2sUserLang').val() == 'de') {
236
- typ = new Array('Profil', 'Seite', 'Gruppe');
237
- }
238
var html = "<li class='b2s-network-item-auth-list-li' data-network-auth-id='" + networkAuthId + "' data-network-id='" + networkId + "' data-network-type='" + networkType + "'>";
239
- html += typ[networkType] + ': ';
240
- html += displayName + ' <a class="b2s-network-item-auth-list-btn-delete" data-network-auth-id="' + networkAuthId + '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a></li>';
241
242
if (jQuery('[class~="b2s-network-item-auth-list-li"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]').length > 0) {
243
jQuery(html).insertBefore('[class~="b2s-network-item-auth-list-li"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]:first');
@@ -252,6 +251,10 @@ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandan
252
} else {
253
jQuery('.b2s-network-auth-update-btn[data-network-auth-id="' + networkAuthId + '"').hide();
254
jQuery('.b2s-network-auth-update-label[data-network-auth-id="' + networkAuthId + '"]').hide();
255
}
256
}
257
228
success: function (data) {}
229
});
230
231
+ var typ = new Array('Profile', 'Page', 'Group');
232
+ if (jQuery('#b2sUserLang').val() == 'de') {
233
+ typ = new Array('Profil', 'Seite', 'Gruppe');
234
+ }
235
236
+ if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"]').length == 0) {
237
var html = "<li class='b2s-network-item-auth-list-li' data-network-auth-id='" + networkAuthId + "' data-network-id='" + networkId + "' data-network-type='" + networkType + "'>";
238
+ html += '<span>' + typ[networkType] + ': ';
239
+ html += displayName + '</span> <a class="b2s-network-item-auth-list-btn-delete" data-network-auth-id="' + networkAuthId + '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a></li>';
240
241
if (jQuery('[class~="b2s-network-item-auth-list-li"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]').length > 0) {
242
jQuery(html).insertBefore('[class~="b2s-network-item-auth-list-li"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]:first');
251
} else {
252
jQuery('.b2s-network-auth-update-btn[data-network-auth-id="' + networkAuthId + '"').hide();
253
jQuery('.b2s-network-auth-update-label[data-network-auth-id="' + networkAuthId + '"]').hide();
254
+ if (jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"]').length > 0) {
255
+ var html = typ[networkType] + ': ' + displayName;
256
+ jQuery('.b2s-network-item-auth-list-li[data-network-auth-id="' + networkAuthId + '"][data-network-mandant-id="' + mandandId + '"][data-network-id="' + networkId + '"][data-network-type="' + networkType + '"] span:first').html(html);
257
+ }
258
}
259
}
260
assets/js/b2s/post.js CHANGED
@@ -9,14 +9,13 @@ if (typeof wp.heartbeat !== "undefined") {
9
jQuery(window).on("load", function () {
10
jQuery('#b2sPagination').val("1");
11
b2sSortFormSubmit();
12
- if (jQuery('#b2sType').val() != "sched") {
13
- jQuery('.b2s-sched-calendar-btn').hide();
14
15
- }
16
jQuery('#b2s-sched-calendar-area').hide();
17
});
18
19
-
20
jQuery(document).on('click', '.b2s-sched-calendar-btn', function () {
21
if (jQuery('#b2s-sched-calendar-area').is(":visible")) {
22
jQuery('#b2s-sched-calendar-btn-text').text(jQuery(this).attr('data-show-calendar-btn-title'));
@@ -100,6 +99,7 @@ jQuery(document).on('click', '#b2s-sort-reset-btn', function () {
100
jQuery('#b2sSortPostSchedDate').prop('selectedIndex', 0);
101
jQuery('#b2sShowByDate').val("");
102
jQuery('#b2sUserAuthId').val("");
103
jQuery('#b2sSortPostStatus').prop('selectedIndex', 0);
104
jQuery('#b2sSortPostPublishDate').prop('selectedIndex', 0);
105
b2sSortFormSubmit();
@@ -128,6 +128,7 @@ function b2sSortFormSubmit(sched_dates) {
128
'b2sSortPostType': jQuery('#b2sSortPostType').val(),
129
'b2sSortPostSchedDate': jQuery('#b2sSortPostSchedDate').val(),
130
'b2sUserAuthId': jQuery('#b2sUserAuthId').val(),
131
'b2sType': jQuery('#b2sType').val(),
132
'b2sShowByDate': jQuery('#b2sShowByDate').val(),
133
'b2sPagination': jQuery('#b2sPagination').val(),
@@ -141,10 +142,19 @@ function b2sSortFormSubmit(sched_dates) {
141
data['b2sPostsPerPage'] = jQuery('#b2sPostsPerPage').val();
142
}
143
144
jQuery.ajax({
145
url: ajaxurl,
146
type: "POST",
147
dataType: "json",
148
cache: false,
149
data: data,
150
error: function () {
@@ -161,6 +171,14 @@ function b2sSortFormSubmit(sched_dates) {
161
jQuery('.b2s-sort-result-area').show();
162
jQuery('.b2s-sort-result-item-area').html(data.content).show();
163
jQuery('.b2s-sort-pagination-area').html(data.pagination).show();
164
if (jQuery('#b2sType').val() == "sched") {
165
if (sched_dates != false) {
166
jQuery('#b2sCalendarSchedDates').val(data.schedDates);
@@ -224,7 +242,15 @@ jQuery(document).on('click', '.b2sDetailsPublishPostTriggerLink', function () {
224
return false;
225
});
226
jQuery(document).on('click', '.b2sDetailsSchedPostTriggerLink', function () {
227
- jQuery(this).parent().prev().find('button').trigger('click');
228
return false;
229
});
230
jQuery(document).on('click', '.checkbox-all', function () {
9
jQuery(window).on("load", function () {
10
jQuery('#b2sPagination').val("1");
11
b2sSortFormSubmit();
12
13
+ /*if (jQuery('#b2sType').val() != "sched") {
14
+ jQuery('.b2s-sched-calendar-btn').hide();
15
+ }*/
16
jQuery('#b2s-sched-calendar-area').hide();
17
});
18
19
jQuery(document).on('click', '.b2s-sched-calendar-btn', function () {
20
if (jQuery('#b2s-sched-calendar-area').is(":visible")) {
21
jQuery('#b2s-sched-calendar-btn-text').text(jQuery(this).attr('data-show-calendar-btn-title'));
99
jQuery('#b2sSortPostSchedDate').prop('selectedIndex', 0);
100
jQuery('#b2sShowByDate').val("");
101
jQuery('#b2sUserAuthId').val("");
102
+ jQuery('#b2sPostBlogId').val("");
103
jQuery('#b2sSortPostStatus').prop('selectedIndex', 0);
104
jQuery('#b2sSortPostPublishDate').prop('selectedIndex', 0);
105
b2sSortFormSubmit();
128
'b2sSortPostType': jQuery('#b2sSortPostType').val(),
129
'b2sSortPostSchedDate': jQuery('#b2sSortPostSchedDate').val(),
130
'b2sUserAuthId': jQuery('#b2sUserAuthId').val(),
131
+ 'b2sPostBlogId': jQuery('#b2sPostBlogId').val(),
132
'b2sType': jQuery('#b2sType').val(),
133
'b2sShowByDate': jQuery('#b2sShowByDate').val(),
134
'b2sPagination': jQuery('#b2sPagination').val(),
142
data['b2sPostsPerPage'] = jQuery('#b2sPostsPerPage').val();
143
}
144
145
+ var legacyMode = true;
146
+ if (jQuery('#isLegacyMode').val() !== undefined) {
147
+ if (jQuery('#isLegacyMode').val() == "1") {
148
+ legacyMode = false; // loading is sync (stack)
149
+ }
150
+ }
151
+
152
+
153
jQuery.ajax({
154
url: ajaxurl,
155
type: "POST",
156
dataType: "json",
157
+ async: legacyMode,
158
cache: false,
159
data: data,
160
error: function () {
171
jQuery('.b2s-sort-result-area').show();
172
jQuery('.b2s-sort-result-item-area').html(data.content).show();
173
jQuery('.b2s-sort-pagination-area').html(data.pagination).show();
174
+
175
+ //extern - Routing from dashboard
176
+ if (jQuery('#b2sPostBlogId').val() !== undefined) {
177
+ if (jQuery('#b2sPostBlogId').val() != "") {
178
+ jQuery('.b2sDetailsSchedPostBtn[data-post-id="' + jQuery('#b2sPostBlogId').val() + '"]').trigger('click');
179
+ }
180
+ }
181
+
182
if (jQuery('#b2sType').val() == "sched") {
183
if (sched_dates != false) {
184
jQuery('#b2sCalendarSchedDates').val(data.schedDates);
242
return false;
243
});
244
jQuery(document).on('click', '.b2sDetailsSchedPostTriggerLink', function () {
245
+ if (jQuery('#b2s-redirect-url-sched-post').val() == undefined || jQuery('#b2s-redirect-url-sched-post').val() === null) {
246
+ //self page blog2social-sched
247
+ jQuery(this).parent().prev().find('button').trigger('click');
248
+ } else {
249
+ //extern - routing from dashboard
250
+ if (jQuery(this).children('span').attr('data-post-id').length > 0) {
251
+ window.location.href = jQuery('#b2s-redirect-url-sched-post').val() + "&b2sPostBlogId=" + jQuery(this).children('span').attr('data-post-id');
252
+ }
253
+ }
254
return false;
255
});
256
jQuery(document).on('click', '.checkbox-all', function () {
assets/js/b2s/settings.js CHANGED
@@ -22,6 +22,10 @@ jQuery(window).on("load", function () {
22
jQuery('.b2s-network-auth-count-current[data-network-id="' + jQuery(this).attr("data-network-id") + '"').text(jQuery(this).children('li').length);
23
});
24
25
});
26
27
jQuery('.b2sSaveSocialMetaTagsSettings').validate({
@@ -74,6 +78,17 @@ jQuery('.b2sSaveSocialMetaTagsSettings').validate({
74
});
75
76
77
jQuery(document).on('click', '.b2sClearSocialMetaTags', function () {
78
79
jQuery('.b2s-settings-user-success').hide();
@@ -213,6 +228,46 @@ jQuery(document).on('click', '#b2s-user-network-settings-short-url', function ()
213
return false;
214
});
215
216
jQuery('#b2s-user-network-settings-auto-post-own').validate({
217
ignore: "",
218
errorPlacement: function () {
@@ -300,9 +355,11 @@ jQuery(document).on('click', '.b2s-post-type-select-btn', function () {
300
if (jQuery(this).attr('data-select-toogle-state') == "0") { //0=select
301
jQuery('.b2s-post-type-item-' + type).prop('checked', true);
302
jQuery(this).attr('data-select-toogle-state', '1');
303
} else {
304
jQuery('.b2s-post-type-item-' + type).prop('checked', false);
305
jQuery(this).attr('data-select-toogle-state', '0');
306
}
307
jQuery(this).text(jQuery(this).attr('data-select-toogle-name'));
308
jQuery(this).attr('data-select-toogle-name', tempCurText);
@@ -402,16 +459,49 @@ jQuery(document).on('click', '#b2s-user-network-settings-allow-hashtag', functio
402
jQuery('.b2s-server-connection-fail').show();
403
return false;
404
},
405
success: function (data) {
406
jQuery(".b2s-loading-area").hide();
407
jQuery(".b2s-user-settings-area").show();
408
if (data.result == true) {
409
jQuery('.b2s-settings-user-success').show();
410
- jQuery('#b2s-user-network-settings-allow-hashtag').val(data.content);
411
- if (jQuery("#b2s-user-network-settings-allow-hashtag").is(":checked")) {
412
- jQuery('#b2s-user-network-settings-allow-hashtag').prop('checked', false);
413
} else {
414
- jQuery('#b2s-user-network-settings-allow-hashtag').prop('checked', true);
415
}
416
} else {
417
jQuery('.b2s-settings-user-error').show();
@@ -421,6 +511,7 @@ jQuery(document).on('click', '#b2s-user-network-settings-allow-hashtag', functio
421
return false;
422
});
423
424
jQuery('#b2s-save-time-settings-btn-trigger').on('click', function () {
425
jQuery('#b2s-save-time-settings-btn').trigger('click');
426
});
22
jQuery('.b2s-network-auth-count-current[data-network-id="' + jQuery(this).attr("data-network-id") + '"').text(jQuery(this).children('li').length);
23
});
24
25
+ var length = jQuery('.b2s-post-type-item-update').filter(':checked').length;
26
+ if (length > 0) {
27
+ jQuery('.b2s-auto-post-own-update-warning').show();
28
+ }
29
});
30
31
jQuery('.b2sSaveSocialMetaTagsSettings').validate({
78
});
79
80
81
+ jQuery(document).on('change', '.b2s-post-type-item-update', function () {
82
+ var length = jQuery('.b2s-post-type-item-update').filter(':checked').length;
83
+ if (length == 0) {
84
+ jQuery('.b2s-auto-post-own-update-warning').hide();
85
+ } else {
86
+ jQuery('.b2s-auto-post-own-update-warning').show();
87
+ }
88
+ return false;
89
+ });
90
+
91
+
92
jQuery(document).on('click', '.b2sClearSocialMetaTags', function () {
93
94
jQuery('.b2s-settings-user-success').hide();
228
return false;
229
});
230
231
+
232
+ jQuery(document).on('change', '#b2s-user-network-twitter-content', function () {
233
+
234
+ if (jQuery('#b2s_user_version').val() == 0) {
235
+ jQuery('#b2s-user-network-twitter-content').val("0");
236
+ jQuery('#b2sPreFeatureModal').modal('show');
237
+ return false;
238
+ } else {
239
+ jQuery('.b2s-settings-user-success').hide();
240
+ jQuery('.b2s-settings-user-error').hide();
241
+ jQuery(".b2s-loading-area").show();
242
+ jQuery(".b2s-user-settings-area").hide();
243
+ jQuery('.b2s-server-connection-fail').hide();
244
+ jQuery.ajax({
245
+ url: ajaxurl,
246
+ type: "POST",
247
+ dataType: "json",
248
+ cache: false,
249
+ data: {
250
+ 'action': 'b2s_user_network_settings',
251
+ 'content_network_twitter': jQuery('#b2s-user-network-twitter-content').val(),
252
+ },
253
+ error: function () {
254
+ jQuery('.b2s-server-connection-fail').show();
255
+ return false;
256
+ },
257
+ success: function (data) {
258
+ jQuery(".b2s-loading-area").hide();
259
+ jQuery(".b2s-user-settings-area").show();
260
+ if (data.result == true) {
261
+ jQuery('.b2s-settings-user-success').show();
262
+ } else {
263
+ jQuery('.b2s-settings-user-error').show();
264
+ }
265
+ }
266
+ });
267
+ }
268
+ return false;
269
+ });
270
+
271
jQuery('#b2s-user-network-settings-auto-post-own').validate({
272
ignore: "",
273
errorPlacement: function () {
355
if (jQuery(this).attr('data-select-toogle-state') == "0") { //0=select
356
jQuery('.b2s-post-type-item-' + type).prop('checked', true);
357
jQuery(this).attr('data-select-toogle-state', '1');
358
+ jQuery('.b2s-auto-post-own-update-warning').show();
359
} else {
360
jQuery('.b2s-post-type-item-' + type).prop('checked', false);
361
jQuery(this).attr('data-select-toogle-state', '0');
362
+ jQuery('.b2s-auto-post-own-update-warning').hide();
363
}
364
jQuery(this).text(jQuery(this).attr('data-select-toogle-name'));
365
jQuery(this).attr('data-select-toogle-name', tempCurText);
459
jQuery('.b2s-server-connection-fail').show();
460
return false;
461
},
462
+ success: function (data) {
463
+ if (data.result == true) {
464
+ window.location.href = window.location.pathname + "?page=blog2social-settings&b2s-settings-user-success=true";
465
+ } else {
466
+ jQuery(".b2s-loading-area").hide();
467
+ jQuery(".b2s-user-settings-area").show();
468
+ jQuery('.b2s-settings-user-error').show();
469
+ }
470
+ }
471
+ });
472
+ return false;
473
+ });
474
+
475
+
476
+ jQuery(document).on('click', '#b2s-general-settings-legacy-mode', function () {
477
+ jQuery('.b2s-settings-user-success').hide();
478
+ jQuery('.b2s-settings-user-error').hide();
479
+ jQuery(".b2s-loading-area").show();
480
+ jQuery(".b2s-user-settings-area").hide();
481
+ jQuery('.b2s-server-connection-fail').hide();
482
+ jQuery.ajax({
483
+ url: ajaxurl,
484
+ type: "POST",
485
+ dataType: "json",
486
+ cache: false,
487
+ data: {
488
+ 'action': 'b2s_user_network_settings',
489
+ 'legacy_mode': jQuery('#b2s-general-settings-legacy-mode').val(),
490
+ },
491
+ error: function () {
492
+ jQuery('.b2s-server-connection-fail').show();
493
+ return false;
494
+ },
495
success: function (data) {
496
jQuery(".b2s-loading-area").hide();
497
jQuery(".b2s-user-settings-area").show();
498
if (data.result == true) {
499
jQuery('.b2s-settings-user-success').show();
500
+ jQuery('#b2s-general-settings-legacy-mode').val(data.content);
501
+ if (jQuery("#b2s-general-settings-legacy-mode").is(":checked")) {
502
+ jQuery('#b2s-general-settings-legacy-mode').prop('checked', false);
503
} else {
504
+ jQuery('#b2s-general-settings-legacy-mode').prop('checked', true);
505
}
506
} else {
507
jQuery('.b2s-settings-user-error').show();
511
return false;
512
});
513
514
+
515
jQuery('#b2s-save-time-settings-btn-trigger').on('click', function () {
516
jQuery('#b2s-save-time-settings-btn').trigger('click');
517
});
assets/js/b2s/ship.js CHANGED
@@ -148,7 +148,7 @@ jQuery(document).on('click', '.b2s-toogle-calendar-btn', function () {
148
if (!jQuery(element[0]).hasClass('fc-past')) {
149
var date = jQuery(element[0]).attr('data-date');
150
var sel_element = jQuery(element[0]).closest('div').next('div').find('td[data-date="' + date + '"]');
151
- $header = jQuery("<a>").html("+ <span class=\"hidden-sm hidden-xs\">"+jQuery("#b2sJSTextAddSchedule").val()+"</span>").addClass("b2s-calendar-add-schedule-btn").attr('href', '#').attr('data-network-auth-id', networkAuthId);
152
sel_element.append($header);
153
}
154
}
@@ -698,11 +698,17 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
698
loadingDummyShow(networkAuthId, jQuery(this).attr('data-network-id'));
699
jQuery('.b2s-server-connection-fail').hide();
700
var networkId = jQuery(this).attr('data-network-id');
701
jQuery.ajax({
702
url: ajaxurl,
703
type: "POST",
704
dataType: "json",
705
- //async: false,
706
cache: false,
707
data: {
708
'action': 'b2s_ship_item',
@@ -1996,7 +2002,7 @@ function deactivatePortal(networkAuthId) {
1996
}
1997
1998
function activatePortal(networkAuthId, check) {
1999
- var selector = '.b2s-post-item[data-network-auth-id="' + networkAuthId + '"]'
2000
//jQuery(selector).prependTo(".b2s-post-list");
2001
jQuery(selector).show();
2002
jQuery(selector).find('.form-control').each(function () {
148
if (!jQuery(element[0]).hasClass('fc-past')) {
149
var date = jQuery(element[0]).attr('data-date');
150
var sel_element = jQuery(element[0]).closest('div').next('div').find('td[data-date="' + date + '"]');
151
+ $header = jQuery("<a>").html("+ <span class=\"hidden-sm hidden-xs\">" + jQuery("#b2sJSTextAddSchedule").val() + "</span>").addClass("b2s-calendar-add-schedule-btn").attr('href', '#').attr('data-network-auth-id', networkAuthId);
152
sel_element.append($header);
153
}
154
}
698
loadingDummyShow(networkAuthId, jQuery(this).attr('data-network-id'));
699
jQuery('.b2s-server-connection-fail').hide();
700
var networkId = jQuery(this).attr('data-network-id');
701
+ var legacyMode = jQuery('#isLegacyMode').val();
702
+ if (legacyMode == "1") {
703
+ legacyMode = false; // loading is sync (stack)
704
+ } else {
705
+ legacyMode = true; // loading is async (parallel)
706
+ }
707
jQuery.ajax({
708
url: ajaxurl,
709
type: "POST",
710
dataType: "json",
711
+ async: legacyMode,
712
cache: false,
713
data: {
714
'action': 'b2s_ship_item',
2002
}
2003
2004
function activatePortal(networkAuthId, check) {
2005
+ var selector = '.b2s-post-item[data-network-auth-id="' + networkAuthId + '"]';
2006
//jQuery(selector).prependTo(".b2s-post-list");
2007
jQuery(selector).show();
2008
jQuery(selector).find('.form-control').each(function () {
assets/js/b2s/start.js CHANGED
@@ -1,5 +1,60 @@
1
jQuery.noConflict();
2
3
jQuery(document).on('click', '.b2s-mail-btn', function () {
4
if (isMail(jQuery('#b2s-mail-update-input').val())) {
5
jQuery.ajax({
@@ -21,19 +76,39 @@ jQuery(document).on('click', '.b2s-mail-btn', function () {
21
return false;
22
});
23
24
25
- jQuery(window).on("load", function () {
26
jQuery('.b2s-faq-area').show();
27
if (typeof wp.heartbeat == "undefined") {
28
jQuery('#b2s-heartbeat-fail').show();
29
}
30
jQuery.ajax({
31
url: ajaxurl,
32
type: "POST",
33
dataType: "json",
34
cache: false,
35
- data:{
36
- 'action' : 'b2s_get_faq_entries'
37
},
38
error: function () {
39
jQuery('.b2s-faq-area').hide();
@@ -48,191 +123,181 @@ jQuery(window).on("load", function () {
48
}
49
}
50
});
51
-
52
- });
53
54
/* Content-Widget */
55
- (function (){
56
- if(jQuery('.b2s-dashboard-multi-widget').length > 0)
57
{
58
var data = [];
59
60
jQuery.ajax({
61
url: ajaxurl,
62
type: "GET",
63
dataType: "json",
64
data: {
65
'action': 'b2s_get_multi_widget_content',
66
},
67
success: function (content) {
68
data = content;
69
-
70
- widget.data('position',new Date().getSeconds() % data.length);
71
show();
72
-
73
- setInterval(function(){
74
jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').trigger("click");
75
- },30000);
76
}
77
78
});
79
-
80
- var widget = jQuery('.b2s-dashboard-multi-widget');
81
-
82
- jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-right').on("click",function(){
83
- widget.data('position',widget.data('position')*1+1);
84
show(widget);
85
});
86
-
87
- jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').on("click",function(){
88
- widget.data('position',widget.data('position')*1-1);
89
show(widget);
90
});
91
-
92
function show()
93
{
94
- if(widget.data('position') <0)
95
{
96
- widget.data('position',data.length - 1);
97
- }
98
- else if(widget.data('position') > data.length-1)
99
{
100
- widget.data('position',0);
101
}
102
-
103
var id = widget.data('position');
104
-
105
widget.find('.b2s-dashboard-multi-widget-content').html(data[id]['content']);
106
widget.find('.b2s-dashboard-h5').text(data[id]['title']);
107
}
108
}
109
- })();
110
111
/* Aktivity-Chart*/
112
- jQuery(document).ready(function(){
113
- function drawBasic() {
114
- jQuery('#chart_div').html("<div class=\"b2s-loading-area\">\n" +
115
- " <br>\n" +
116
- " <div class=\"b2s-loader-impulse b2s-loader-impulse-md\"></div>\n" +
117
- " <div class=\"clearfix\"></div>\n" +
118
- " </div>");
119
- jQuery.ajax({
120
- url: ajaxurl,
121
- type: "GET",
122
- dataType: "json",
123
- data: {
124
- 'action': 'b2s_get_stats',
125
- 'from': jQuery('#b2s-activity-date-picker').val()
126
- },
127
- success: function (content) {
128
- jQuery('#chart_div').html("<canvas id=\"b2s_activity_chart\" style=\"max-width:690px !important; max-height:320px !important;\"></canvas>");
129
- var ctx = document.getElementById("b2s_activity_chart").getContext('2d');
130
- var published = [];
131
- var published_colors = [];
132
- var scheduled = [];
133
- var scheduled_colors = [];
134
-
135
- function dateToYMD(date) {
136
- var d = date.getDate();
137
- var m = date.getMonth() + 1;
138
- var y = date.getFullYear();
139
- return '' + y + '-' + (m <= 9 ? '0' + m : m) + '-' + (d <= 9 ? '0' + d : d);
140
- }
141
-
142
- function dateToDMY(date) {
143
- var d = date.getDate();
144
- var m = date.getMonth() + 1;
145
- var y = date.getFullYear();
146
- return '' + (d <= 9 ? '0' + d : d) + '.' + (m <= 9 ? '0' + m : m) + '.' + y;
147
- }
148
-
149
- jQuery(Object.keys(content)).each(function () {
150
- if (published.length > 0) {
151
- var diff = parseInt((new Date(published[published.length - 1].x).getTime() - new Date(this).getTime()) / (24 * 3600 * 1000));
152
153
- while (diff < -1) {
154
- var date = new Date(published[published.length - 1].x.toString());
155
- var newDate = new Date(date.setTime(date.getTime() + 86400000));
156
- published.push({x: dateToYMD(newDate), y: 0});
157
- published_colors.push('rgba(121,178,50,0.8)');
158
- scheduled_colors.push('rgba(192,192,192,0.8)');
159
- scheduled.push({x: dateToYMD(newDate), y: 0});
160
161
- diff = parseInt((new Date(published[published.length - 1].x).getTime() - new Date(this).getTime()) / (24 * 3600 * 1000));
162
- }
163
- }
164
165
- published.push({x: this.toString(), y: content[this][0]});
166
published_colors.push('rgba(121,178,50,0.8)');
167
scheduled_colors.push('rgba(192,192,192,0.8)');
168
- scheduled.push({x: this.toString(), y: content[this][1]});
169
- });
170
-
171
- var unit = "day";
172
- if(published.length > 100)
173
- {
174
- unit = "month";
175
}
176
177
- var myChart = new Chart(ctx, {
178
- type: 'bar',
179
- data: {
180
- datasets: [{
181
- label: jQuery("#chart_div").data('text-published'),
182
- data: published,
183
- backgroundColor: published_colors
184
- }, {
185
- label: jQuery("#chart_div").data('text-scheduled'),
186
- data: scheduled,
187
- backgroundColor: scheduled_colors
188
- }]
189
- },
190
- options: {
191
- tooltips: {
192
- callbacks: {
193
- title: function(tooltipItem) {
194
- if(jQuery("#chart_div").data('language') == "de") {
195
- var date = new Date(tooltipItem[0].xLabel);
196
- return dateToDMY(date);
197
- }
198
- else{
199
- return tooltipItem[0].xLabel
200
- }
201
- }
202
- }
203
- },
204
- scales: {
205
- xAxes: [{
206
- type: "time",
207
- time: {
208
- unit: unit
209
- }
210
}
211
- ],
212
- yAxes: [{
213
- ticks: {
214
- beginAtZero: true
215
- }
216
- }]
217
}
218
}
219
- });
220
}
221
-
222
});
223
}
224
- drawBasic();
225
-
226
- jQuery('#b2s-activity-date-picker').b2sdatepicker({
227
- 'autoClose': true,
228
- 'toggleSelected': true,
229
- 'minutesStep': 15
230
- });
231
- jQuery('#b2s-activity-date-picker').on("selectDate", function(){
232
- setTimeout(drawBasic);
233
- });
234
- });
235
236
237
238
function isMail(mail) {
1
jQuery.noConflict();
2
3
+ /* Calendar-Widget */
4
+ jQuery(document).ready(function () {
5
+ jQuery('.b2s-widget-calendar').fullCalendar({
6
+ editable: false,
7
+ locale: b2s_calendar_locale,
8
+ eventLimit: 2,
9
+ contentHeight: 340,
10
+ timeFormat: 'H:mm',
11
+ eventSources: ajaxurl + '?action=b2s_get_calendar_events&filter_network_auth=all&filter_network=all',
12
+ eventRender: function (event, element) {
13
+ show = true;
14
+ $header = jQuery("<div>").addClass("b2s-calendar-header");
15
+ $network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
16
+ element.find(".fc-time").after($network_name);
17
+ element.html(element.html());
18
+ $parent = element.parent();
19
+ $header.append(element.find(".fc-content"));
20
+ element.append($header);
21
+ $body = jQuery("<div>").addClass("b2s-calendar-body");
22
+ $body.append(event.avatar);
23
+ $body.append(element.find(".fc-title"));
24
+ $body.append(jQuery("<br>"));
25
+ var $em = jQuery("<em>").css("padding-top", "5px").css("display", "block");
26
+ $em.append("<img src='" + b2s_plugin_url + "assets/images/portale/" + event.network_id + "_flat.png' style='height: 16px;width: 16px;display: inline-block;padding-right: 2px;padding-left: 2px;' />")
27
+ $em.append(event.network_name);
28
+ $em.append(jQuery("<span>").text(": " + event.profile));
29
+ $body.append($em);
30
+ element.append($body);
31
+ },
32
+ eventClick: function (calEvent, jsEvent, view) {
33
+ window.location.href = window.location.pathname + "?page=blog2social-calendar&rfd=true&b2s_id=" + calEvent.b2s_id;
34
+ }
35
+ });
36
+
37
+ getWidgetFaq();
38
+
39
+ drawBasic();
40
+
41
+ jQuery('#b2s-activity-date-picker').b2sdatepicker({
42
+ 'autoClose': true,
43
+ 'toggleSelected': true,
44
+ 'minutesStep': 15
45
+ });
46
+ jQuery('#b2s-activity-date-picker').on("selectDate", function () {
47
+ setTimeout(drawBasic);
48
+ });
49
+
50
+ getWidgetContent();
51
+
52
+
53
+
54
+
55
+ });
56
+
57
+ /* EMail-Widget */
58
jQuery(document).on('click', '.b2s-mail-btn', function () {
59
if (isMail(jQuery('#b2s-mail-update-input').val())) {
60
jQuery.ajax({
76
return false;
77
});
78
79
+ /*Post-Widget Position**/
80
+ jQuery(document).on('click', '.b2s-post-btn', function () {
81
+ var target = jQuery(".b2s-post");
82
+ if (target.length) {
83
+ jQuery('html,body').animate({
84
+ scrollTop: target.offset().top - 100
85
+ }, 1000);
86
+ }
87
+ });
88
89
+ /* FAQ-Widget */
90
+ //jQuery(window).on("load", function () {
91
+ function getWidgetFaq() {
92
jQuery('.b2s-faq-area').show();
93
if (typeof wp.heartbeat == "undefined") {
94
jQuery('#b2s-heartbeat-fail').show();
95
}
96
+
97
+ var legacyMode = jQuery('#isLegacyMode').val();
98
+ if (legacyMode == "1") {
99
+ legacyMode = false; // loading is sync (stack)
100
+ } else {
101
+ legacyMode = true; // loading is async (parallel)
102
+ }
103
+
104
jQuery.ajax({
105
url: ajaxurl,
106
type: "POST",
107
dataType: "json",
108
+ async: legacyMode,
109
cache: false,
110
+ data: {
111
+ 'action': 'b2s_get_faq_entries'
112
},
113
error: function () {
114
jQuery('.b2s-faq-area').hide();
123
}
124
}
125
});
126
+ }
127
+ //});
128
129
/* Content-Widget */
130
+ function getWidgetContent() {
131
+ if (jQuery('.b2s-dashboard-multi-widget').length > 0)
132
{
133
var data = [];
134
+ var widget = jQuery('.b2s-dashboard-multi-widget');
135
+ var legacyMode = jQuery('#isLegacyMode').val();
136
+ if (legacyMode == "1") {
137
+ legacyMode = false; // loading is sync (stack)
138
+ } else {
139
+ legacyMode = true; // loading is async (parallel)
140
+ }
141
142
jQuery.ajax({
143
url: ajaxurl,
144
type: "GET",
145
dataType: "json",
146
+ async: legacyMode,
147
+ cache: false,
148
data: {
149
'action': 'b2s_get_multi_widget_content',
150
},
151
success: function (content) {
152
data = content;
153
+ widget.data('position', new Date().getSeconds() % data.length);
154
show();
155
+ setInterval(function () {
156
jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').trigger("click");
157
+ }, 30000);
158
}
159
160
});
161
+ jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-right').on("click", function () {
162
+ widget.data('position', widget.data('position') * 1 + 1);
163
show(widget);
164
});
165
+ jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').on("click", function () {
166
+ widget.data('position', widget.data('position') * 1 - 1);
167
show(widget);
168
});
169
function show()
170
{
171
+ if (widget.data('position') < 0)
172
{
173
+ widget.data('position', data.length - 1);
174
+ } else if (widget.data('position') > data.length - 1)
175
{
176
+ widget.data('position', 0);
177
}
178
var id = widget.data('position');
179
widget.find('.b2s-dashboard-multi-widget-content').html(data[id]['content']);
180
widget.find('.b2s-dashboard-h5').text(data[id]['title']);
181
}
182
}
183
+ }
184
185
/* Aktivity-Chart*/
186
+ function drawBasic() {
187
+ jQuery('#chart_div').html("<div class=\"b2s-loading-area\">\n" +
188
+ " <br>\n" +
189
+ " <div class=\"b2s-loader-impulse b2s-loader-impulse-md\"></div>\n" +
190
+ " <div class=\"clearfix\"></div>\n" +
191
+ " </div>");
192
+ var legacyMode = jQuery('#isLegacyMode').val();
193
+ if (legacyMode == "1") {
194
+ legacyMode = false; // loading is sync (stack)
195
+ } else {
196
+ legacyMode = true; // loading is async (parallel)
197
+ }
198
199
+ jQuery.ajax({
200
+ url: ajaxurl,
201
+ type: "GET",
202
+ dataType: "json",
203
+ async: legacyMode,
204
+ cache: false,
205
+ data: {
206
+ 'action': 'b2s_get_stats',
207
+ 'from': jQuery('#b2s-activity-date-picker').val()
208
+ },
209
+ success: function (content) {
210
+ jQuery('#chart_div').html("<canvas id=\"b2s_activity_chart\" style=\"max-width:690px !important; max-height:320px !important;\"></canvas>");
211
+ var ctx = document.getElementById("b2s_activity_chart").getContext('2d');
212
+ var published = [];
213
+ var published_colors = [];
214
+ var scheduled = [];
215
+ var scheduled_colors = [];
216
+ function dateToYMD(date) {
217
+ var d = date.getDate();
218
+ var m = date.getMonth() + 1;
219
+ var y = date.getFullYear();
220
+ return '' + y + '-' + (m <= 9 ? '0' + m : m) + '-' + (d <= 9 ? '0' + d : d);
221
+ }
222
223
+ function dateToDMY(date) {
224
+ var d = date.getDate();
225
+ var m = date.getMonth() + 1;
226
+ var y = date.getFullYear();
227
+ return '' + (d <= 9 ? '0' + d : d) + '.' + (m <= 9 ? '0' + m : m) + '.' + y;
228
+ }
229
230
+ jQuery(Object.keys(content)).each(function () {
231
+ if (published.length > 0) {
232
+ var diff = parseInt((new Date(published[published.length - 1].x).getTime() - new Date(this).getTime()) / (24 * 3600 * 1000));
233
+ while (diff < -1) {
234
+ var date = new Date(published[published.length - 1].x.toString());
235
+ var newDate = new Date(date.setTime(date.getTime() + 86400000));
236
+ published.push({x: dateToYMD(newDate), y: 0});
237
published_colors.push('rgba(121,178,50,0.8)');
238
scheduled_colors.push('rgba(192,192,192,0.8)');
239
+ scheduled.push({x: dateToYMD(newDate), y: 0});
240
+ diff = parseInt((new Date(published[published.length - 1].x).getTime() - new Date(this).getTime()) / (24 * 3600 * 1000));
241
}
242
+ }
243
244
+ published.push({x: this.toString(), y: content[this][0]});
245
+ published_colors.push('rgba(121,178,50,0.8)');
246
+ scheduled_colors.push('rgba(192,192,192,0.8)');
247
+ scheduled.push({x: this.toString(), y: content[this][1]});
248
+ });
249
+ var unit = "day";
250
+ if (published.length > 100)
251
+ {
252
+ unit = "month";
253
+ }
254
+
255
+ var myChart = new Chart(ctx, {
256
+ type: 'bar',
257
+ data: {
258
+ datasets: [{
259
+ label: jQuery("#chart_div").data('text-published'),
260
+ data: published,
261
+ backgroundColor: published_colors
262
+ }, {
263
+ label: jQuery("#chart_div").data('text-scheduled'),
264
+ data: scheduled,
265
+ backgroundColor: scheduled_colors
266
+ }]
267
+ },
268
+ options: {
269
+ tooltips: {
270
+ callbacks: {
271
+ title: function (tooltipItem) {
272
+ if (jQuery("#chart_div").data('language') == "de") {
273
+ var date = new Date(tooltipItem[0].xLabel);
274
+ return dateToDMY(date);
275
+ } else {
276
+ return tooltipItem[0].xLabel
277
}
278
}
279
}
280
+ },
281
+ scales: {
282
+ xAxes: [{
283
+ type: "time",
284
+ time: {
285
+ unit: unit
286
+ }
287
+ }
288
+ ],
289
+ yAxes: [{
290
+ ticks: {
291
+ beginAtZero: true
292
+ }
293
+ }]
294
+ }
295
}
296
});
297
}
298
299
+ });
300
+ }
301
302
303
function isMail(mail) {
assets/js/b2s/wp/plugin-deactivate.js ADDED
@@ -0,0 +1,38 @@
1
+ jQuery(document).on('click', '.b2s-plugin-modal-btn-close', function () {
2
+ jQuery('#' + jQuery(this).attr('data-modal-target')).hide();
3
+ });
4
+ jQuery(document).on('click', '#b2s-deactivate', function (e) {
5
+ var redirect = jQuery(this).attr("href");
6
+ jQuery('html, body').animate({scrollTop: jQuery("body").offset().top}, 1);
7
+ jQuery('#b2s-plugin-deactivate-modal').show();
8
+ jQuery('#b2s-plugin-deactivate-redirect-url').val(redirect);
9
+ return false;
10
+ });
11
+ jQuery(document).on('click', '#b2s-plugin-deactivate-btn', function () {
12
+ var isChecked = 1;
13
+ if (!jQuery("#b2s-plugin-deactivate-checkbox-sched-post").is(':checked')) {
14
+ isChecked = 0;
15
+ }
16
+ jQuery.ajax({
17
+ url: ajaxurl,
18
+ type: "POST",
19
+ dataType: "json",
20
+ cache: false,
21
+ data: {
22
+ 'action': 'b2s_plugin_deactivate_delete_sched_post',
23
+ 'delete_sched_post': isChecked,
24
+ },
25
+ error: function () {
26
+ window.location.reload();
27
+ return false;
28
+ },
29
+ success: function (data) {
30
+ if (data.result == true) {
31
+ window.location.href = jQuery('#b2s-plugin-deactivate-redirect-url').val();
32
+ } else {
33
+ window.location.reload();
34
+ }
35
+ }
36
+ });
37
+ return false;
38
+ });
assets/js/b2s/wp/post-box.js CHANGED
@@ -4,6 +4,8 @@ jQuery(document).on('heartbeat-send', function (e, data) {
4
});
5
6
jQuery(window).on("load", function () {
7
if (typeof wp.heartbeat == "undefined") {
8
jQuery('#b2s-heartbeat-fail').show();
9
jQuery('.b2s-loading-area').hide();
@@ -14,10 +16,12 @@ jQuery(window).on("load", function () {
14
jQuery('#b2s-url-valid-warning').hide();
15
}
16
}
17
if (jQuery('#b2s-post-meta-box-time-dropdown-publish').is(':checked')) {
18
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
19
jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
20
- }else {
21
if (jQuery('#b2s-post-meta-box-profil-dropdown').length == 0) {
22
jQuery('.b2s-loading-area').show();
23
jQuery.ajax({
@@ -67,6 +71,20 @@ jQuery(window).on("load", function () {
67
}
68
});
69
70
jQuery(document).on('click', '#b2s-meta-box-btn-customize', function () {
71
var postStatus = jQuery('#b2s-post-status').val();
72
if (postStatus != 'publish' && postStatus != 'future') {
@@ -77,8 +95,60 @@ jQuery(document).on('click', '#b2s-meta-box-btn-customize', function () {
77
}
78
});
79
80
81
jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', function () {
82
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
83
jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
84
jQuery('#b2s-post-meta-box-note-trial').show();
4
});
5
6
jQuery(window).on("load", function () {
7
+ jQuery('#b2s-post-box-calendar-header').addClass('closed');
8
+ jQuery('#b2s-post-box-calendar-header').hide();
9
if (typeof wp.heartbeat == "undefined") {
10
jQuery('#b2s-heartbeat-fail').show();
11
jQuery('.b2s-loading-area').hide();
16
jQuery('#b2s-url-valid-warning').hide();
17
}
18
}
19
+
20
if (jQuery('#b2s-post-meta-box-time-dropdown-publish').is(':checked')) {
21
+ jQuery('#b2s-post-box-calendar-header').show();
22
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
23
jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
24
+ } else {
25
if (jQuery('#b2s-post-meta-box-profil-dropdown').length == 0) {
26
jQuery('.b2s-loading-area').show();
27
jQuery.ajax({
71
}
72
});
73
74
+
75
+ jQuery(document).on('click', '.handlediv', function () {
76
+ var id = jQuery(this).parent().attr('id');
77
+ if (id == 'b2s-post-box-calendar-header') {
78
+ if (!jQuery('#' + id).hasClass('closed')) {
79
+ if (jQuery('.b2s-post-box-calendar-content').is(':empty')) {
80
+ jQuery('#b2s-post-box-calendar-btn').trigger('click');
81
+ }
82
+ }
83
+ }
84
+ return true;
85
+ });
86
+
87
+
88
jQuery(document).on('click', '#b2s-meta-box-btn-customize', function () {
89
var postStatus = jQuery('#b2s-post-status').val();
90
if (postStatus != 'publish' && postStatus != 'future') {
95
}
96
});
97
98
+ jQuery(document).on('click', '#b2s-post-box-calendar-btn', function () {
99
+ jQuery('#b2s-post-box-calendar-header').show();
100
+ jQuery('#b2s-post-box-calendar-header').removeClass('closed');
101
+
102
+ if (jQuery('.b2s-post-box-calendar-content').is(':empty')) {
103
+ //Load First
104
+ jQuery('.b2s-post-box-calendar-content').fullCalendar({
105
+ editable: false,
106
+ locale: jQuery('#b2sUserLang').val(),
107
+ eventLimit: 2,
108
+ contentHeight: 530,
109
+ timeFormat: 'H:mm',
110
+ eventSources: ajaxurl + '?action=b2s_get_calendar_events&filter_network_auth=all&filter_network=all',
111
+ eventRender: function (event, element) {
112
+ show = true;
113
+ $header = jQuery("<div>").addClass("b2s-calendar-header");
114
+ $network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
115
+ element.find(".fc-time").after($network_name);
116
+ element.html(element.html());
117
+ $parent = element.parent();
118
+ $header.append(element.find(".fc-content"));
119
+ element.append($header);
120
+ $body = jQuery("<div>").addClass("b2s-calendar-body");
121
+ $body.append(event.avatar);
122
+ $body.append(element.find(".fc-title"));
123
+ $body.append(jQuery("<br>"));
124
+ var $em = jQuery("<em>").css("padding-top", "5px").css("display", "block");
125
+ $em.append("<img src='" + jQuery('#b2sPluginUrl').val() + "assets/images/portale/" + event.network_id + "_flat.png' style='height: 16px;width: 16px;display: inline-block;padding-right: 2px;padding-left: 2px;' />")
126
+ $em.append(event.network_name);
127
+ $em.append(jQuery("<span>").text(": " + event.profile));
128
+ $body.append($em);
129
+ element.append($body);
130
+ },
131
+ });
132
+ }
133
+
134
+ var target = jQuery(this.hash);
135
+ target = target.length ? target : jQuery('[name=' + this.hash.substr(1) + ']');
136
+ if (target.length) {
137
+ jQuery('html,body').animate({
138
+ scrollTop: target.offset().top - 100
139
+ }, 1000);
140
+ }
141
+
142
+ return false;
143
+
144
+
145
+ });
146
+
147
+
148
+
149
150
jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', function () {
151
+ jQuery('#b2s-post-box-calendar-header').show();
152
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
153
jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
154
jQuery('#b2s-post-meta-box-note-trial').show();
blog2social.php CHANGED
@@ -7,12 +7,12 @@
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
- * Version: 4.5.1
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
- define('B2S_PLUGIN_VERSION', '451');
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__));
@@ -27,12 +27,6 @@ define('B2S_PLUGIN_API_ENDPOINT_AUTH', 'https://developer.blog2social.com/wp/v3/
27
define('B2S_PLUGIN_PRG_API_ENDPOINT', 'http://developer.pr-gateway.de/wp/v3/');
28
define('B2S_PLUGIN_SERVER_URL', 'https://developer.blog2social.com');
29
30
-
31
- //B2SNoCaching
32
- /*if (function_exists("nocache_headers")) {
33
- nocache_headers(); //wp-functions
34
- }*/
35
-
36
//B2SLoader
37
require_once(B2S_PLUGIN_DIR . 'includes/Loader.php');
38
require_once (B2S_PLUGIN_DIR . 'includes/System.php');
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
+ * Version: 4.6.0
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
+ define('B2S_PLUGIN_VERSION', '460');
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__));
27
define('B2S_PLUGIN_PRG_API_ENDPOINT', 'http://developer.pr-gateway.de/wp/v3/');
28
define('B2S_PLUGIN_SERVER_URL', 'https://developer.blog2social.com');
29
30
//B2SLoader
31
require_once(B2S_PLUGIN_DIR . 'includes/Loader.php');
32
require_once (B2S_PLUGIN_DIR . 'includes/System.php');
includes/Ajax/Get.php CHANGED
@@ -46,13 +46,14 @@ class Ajax_Get {
46
$b2sSortPostStatus = isset($_POST['b2sSortPostStatus']) ? trim($_POST['b2sSortPostStatus']) : "";
47
$b2sShowByDate = isset($_POST['b2sShowByDate']) ? trim($_POST['b2sShowByDate']) : ""; //YYYY-mm-dd
48
$b2sUserAuthId = isset($_POST['b2sUserAuthId']) ? (int) $_POST['b2sUserAuthId'] : 0;
49
$b2sSortPostCat = isset($_POST['b2sSortPostCat']) ? trim($_POST['b2sSortPostCat']) : "";
50
$b2sSortPostType = isset($_POST['b2sSortPostType']) ? trim($_POST['b2sSortPostType']) : "";
51
$b2sSelectSchedDate = isset($_POST['b2sSchedDate']) ? trim($_POST['b2sSchedDate']) : "";
52
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
53
$b2sResultsPerPage = isset($_POST['b2sPostsPerPage']) && intval($_POST['b2sPostsPerPage']) > 0 ? intval($_POST['b2sPostsPerPage']) : B2S_PLUGIN_POSTPERPAGE;
54
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish'))) {
55
- $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sUserAuthId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
56
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
57
if ($b2sShowPagination) {
58
$result['pagination'] = $postItem->getPaginationHtml();
46
$b2sSortPostStatus = isset($_POST['b2sSortPostStatus']) ? trim($_POST['b2sSortPostStatus']) : "";
47
$b2sShowByDate = isset($_POST['b2sShowByDate']) ? trim($_POST['b2sShowByDate']) : ""; //YYYY-mm-dd
48
$b2sUserAuthId = isset($_POST['b2sUserAuthId']) ? (int) $_POST['b2sUserAuthId'] : 0;
49
+ $b2sPostBlogId = isset($_POST['b2sPostBlogId']) ? (int) $_POST['b2sPostBlogId'] : 0;
50
$b2sSortPostCat = isset($_POST['b2sSortPostCat']) ? trim($_POST['b2sSortPostCat']) : "";
51
$b2sSortPostType = isset($_POST['b2sSortPostType']) ? trim($_POST['b2sSortPostType']) : "";
52
$b2sSelectSchedDate = isset($_POST['b2sSchedDate']) ? trim($_POST['b2sSchedDate']) : "";
53
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
54
$b2sResultsPerPage = isset($_POST['b2sPostsPerPage']) && intval($_POST['b2sPostsPerPage']) > 0 ? intval($_POST['b2sPostsPerPage']) : B2S_PLUGIN_POSTPERPAGE;
55
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish'))) {
56
+ $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sUserAuthId,$b2sPostBlogId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
57
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
58
if ($b2sShowPagination) {
59
$result['pagination'] = $postItem->getPaginationHtml();
includes/Ajax/Post.php CHANGED
@@ -41,6 +41,17 @@ class Ajax_Post {
41
add_action("wp_ajax_b2s_hide_premium_message", array($this, 'hidePremiumMessage'));
42
add_action("wp_ajax_b2s_hide_trail_message", array($this, 'hideTrailMessage'));
43
add_action("wp_ajax_b2s_hide_trail_ended_message", array($this, 'hideTrailEndedMessage'));
44
}
45
46
public function prgShip() {
@@ -319,26 +330,37 @@ class Ajax_Post {
319
320
public function saveSocialMetaTags() {
321
322
- $options = new B2S_Options(0, 'B2S_PLUGIN_GENERAL_OPTIONS');
323
-
324
- $og_active = (!isset($_POST['b2s_og_active'])) ? 0 : 1;
325
- $options->_setOption('og_active', $og_active);
326
- $options->_setOption('og_default_title', $_POST['b2s_og_default_title']);
327
- $options->_setOption('og_default_desc', $_POST['b2s_og_default_desc']);
328
- $options->_setOption('og_default_image', $_POST['b2s_og_default_image']);
329
-
330
- $card_active = (!isset($_POST['b2s_card_active'])) ? 0 : 1;
331
- $options->_setOption('card_active', $card_active);
332
- $options->_setOption('card_default_title', $_POST['b2s_card_default_title']);
333
- $options->_setOption('card_default_desc', $_POST['b2s_card_default_desc']);
334
- $options->_setOption('card_default_image', $_POST['b2s_card_default_image']);
335
-
336
- $meta = B2S_Meta::getInstance();
337
$result = array('result' => true);
338
- $result['b2s'] = ($card_active == 1 || $og_active == 1) ? true : false;
339
- $result['yoast'] = $meta->is_yoast_seo_active();
340
- $result['aioseop'] = $meta->is_aioseop_active();
341
- $result['webdados'] = $meta->is_webdados_active();
342
echo json_encode($result);
343
wp_die();
344
}
@@ -418,10 +440,24 @@ class Ajax_Post {
418
wp_die();
419
}
420
421
if (isset($_POST['allow_hashtag'])) {
422
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
423
$options->_setOption('user_allow_hashtag', (int) $_POST['allow_hashtag']);
424
- echo json_encode(array('result' => true));
425
wp_die();
426
}
427
41
add_action("wp_ajax_b2s_hide_premium_message", array($this, 'hidePremiumMessage'));
42
add_action("wp_ajax_b2s_hide_trail_message", array($this, 'hideTrailMessage'));
43
add_action("wp_ajax_b2s_hide_trail_ended_message", array($this, 'hideTrailEndedMessage'));
44
+ add_action("wp_ajax_b2s_plugin_deactivate_delete_sched_post", array($this, 'b2sPluginDeactivate'));
45
+ }
46
+
47
+ public function b2sPluginDeactivate() {
48
+ if (isset($_POST['delete_sched_post']) && (int) $_POST['delete_sched_post'] == 1) {
49
+ update_option("B2S_PLUGIN_DEACTIVATE_SCHED_POST", 1);
50
+ } else {
51
+ delete_option("B2S_PLUGIN_DEACTIVATE_SCHED_POST");
52
+ }
53
+ echo json_encode(array('result' => true));
54
+ wp_die();
55
}
56
57
public function prgShip() {
330
331
public function saveSocialMetaTags() {
332
333
$result = array('result' => true);
334
+ if (isset($_POST['is_admin']) && (int) $_POST['is_admin'] == 1) {
335
+ $options = new B2S_Options(0, 'B2S_PLUGIN_GENERAL_OPTIONS');
336
+
337
+ $og_active = (!isset($_POST['b2s_og_active'])) ? 0 : 1;
338
+ $options->_setOption('og_active', $og_active);
339
+ $options->_setOption('og_default_title', $_POST['b2s_og_default_title']);
340
+ $options->_setOption('og_default_desc', $_POST['b2s_og_default_desc']);
341
+ $options->_setOption('og_default_image', $_POST['b2s_og_default_image']);
342
+
343
+ $card_active = (!isset($_POST['b2s_card_active'])) ? 0 : 1;
344
+ $options->_setOption('card_active', $card_active);
345
+ $options->_setOption('card_default_title', $_POST['b2s_card_default_title']);
346
+ $options->_setOption('card_default_desc', $_POST['b2s_card_default_desc']);
347
+ $options->_setOption('card_default_image', $_POST['b2s_card_default_image']);
348
+
349
+ $meta = B2S_Meta::getInstance();
350
+ $result['b2s'] = ($card_active == 1 || $og_active == 1) ? true : false;
351
+ $result['yoast'] = $meta->is_yoast_seo_active();
352
+ $result['aioseop'] = $meta->is_aioseop_active();
353
+ $result['webdados'] = $meta->is_webdados_active();
354
+ }
355
+
356
+ //Customize per user premium function
357
+ /*if (isset($_POST['version']) && (int) $_POST['version'] >= 1 && isset($_POST['b2s_og_article_author']) && isset($_POST['b2s_card_twitter_creator'])) {
358
+ $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
359
+ $og_article_author = (isset($_POST['b2s_og_article_author']) && !empty($_POST['b2s_og_article_author'])) ? trim($_POST['b2s_og_article_author']) : "";
360
+ $card_twitter_creator = (isset($_POST['b2s_card_twitter_creator']) && !empty($_POST['b2s_card_twitter_creator'])) ? trim($_POST['b2s_card_twitter_creator']) : "";
361
+ $meta_author_data = array('og_article_author' => $og_article_author, 'card_twitter_creator' => $card_twitter_creator);
362
+ $options->_setOption('meta_author_data', $meta_author_data);
363
+ }*/
364
echo json_encode($result);
365
wp_die();
366
}
440
wp_die();
441
}
442
443
+ if (isset($_POST['content_network_twitter'])) {
444
+ $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
445
+ $options->_setOption('content_network_twitter', (int) $_POST['content_network_twitter']);
446
+ echo json_encode(array('result' => true));
447
+ wp_die();
448
+ }
449
+
450
+
451
if (isset($_POST['allow_hashtag'])) {
452
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
453
$options->_setOption('user_allow_hashtag', (int) $_POST['allow_hashtag']);
454
+ echo json_encode(array('result' => true, 'content' => (((int) $_POST['allow_hashtag'] == 1) ? 0 : 1)));
455
+ wp_die();
456
+ }
457
+ if (isset($_POST['legacy_mode'])) {
458
+ $options = new B2S_Options(0, 'B2S_PLUGIN_GENERAL_OPTIONS');
459
+ $options->_setOption('legacy_mode', (int) $_POST['legacy_mode']);
460
+ echo json_encode(array('result' => true, 'content' => (((int) $_POST['legacy_mode'] == 1) ? 0 : 1)));
461
wp_die();
462
}
463
includes/B2S/AutoPost.php CHANGED
@@ -15,8 +15,9 @@ class B2S_AutoPost {
15
private $setPreFillText;
16
private $optionPostFormat;
17
private $allowHashTag;
18
19
- function __construct($postId = 0, $blogPostData = array(), $current_user_date = '0000-00-00 00:00:00', $myTimeSettings = false, $title = '', $content = '', $url = '', $imageUrl = '', $keywords = '', $b2sPostLang = 'en', $optionPostFormat = array(), $allowHashTag = true) {
20
$this->postId = $postId;
21
$this->blogPostData = $blogPostData;
22
$this->current_user_date = $current_user_date;
@@ -29,8 +30,9 @@ class B2S_AutoPost {
29
$this->keywords = $keywords;
30
$this->optionPostFormat = $optionPostFormat;
31
$this->allowHashTag = $allowHashTag;
32
- $this->setPreFillText = array(0 => array(1 => 239, 2 => 256, 3 => 239, 6 => 300, 8 => 239, 10 => 442, 12 => 240, 9 => 200, 16 => 250), 1 => array(1 => 239, 3 => 239, 8 => 1200, 10 => 442), 2 => array(1 => 239, 8 => 239, 10 => 442));
33
- $this->setPreFillTextLimit = array(0 => array(1 => 400, 2 => 256, 3 => 400, 6 => 400, 8 => 400, 10 => 500, 12 => 400, 9 => 200), 1 => array(1 => 400, 3 => 400, 8 => 1200, 10 => 500), 2 => array(1 => 400, 8 => 400, 10 => 500));
34
}
35
36
public function prepareShareData($networkAuthId = 0, $networkId = 0, $networkType = 0) {
@@ -50,9 +52,23 @@ class B2S_AutoPost {
50
}
51
}
52
if ($networkId == 2) {
53
- $postData['content'] = (isset($this->setPreFillText[$networkType][$networkId])) ? B2S_Util::getExcerpt(strip_tags($this->title), (int) $this->setPreFillText[$networkType][$networkId], (int) $this->setPreFillTextLimit[$networkType][$networkId]) : strip_tags($this->title);
54
- if ($this->allowHashTag) {
55
- $postData['content'] .= $this->getHashTagsString('');
56
}
57
}
58
if ($networkId == 4) {
@@ -103,8 +119,8 @@ class B2S_AutoPost {
103
}
104
}
105
106
- if ($networkId == 10) {
107
- $postData['content'] = (isset($this->setPreFillText[$networkType][$networkId])) ? B2S_Util::getExcerpt($this->content, (int) $this->setPreFillText[$networkType][$networkId], (int) $this->setPreFillTextLimit[$networkType][$networkId]) : $this->content;
108
if ($this->allowHashTag) {
109
$postData['content'] .= $this->getHashTagsString();
110
}
@@ -137,7 +153,7 @@ class B2S_AutoPost {
137
$hashTags = '';
138
if (is_array($this->keywords) && !empty($this->keywords)) {
139
foreach ($this->keywords as $tag) {
140
- $hashTags .= ' #' . str_replace(" ", "", $tag->name);
141
}
142
}
143
return (!empty($hashTags) ? (!empty($add) ? $add . $hashTags : $hashTags) : '');
15
private $setPreFillText;
16
private $optionPostFormat;
17
private $allowHashTag;
18
+ private $optionContentTwitter;
19
20
+ function __construct($postId = 0, $blogPostData = array(), $current_user_date = '0000-00-00 00:00:00', $myTimeSettings = false, $title = '', $content = '', $url = '', $imageUrl = '', $keywords = '', $b2sPostLang = 'en', $optionPostFormat = array(), $allowHashTag = true, $optionContentTwitter = 0) {
21
$this->postId = $postId;
22
$this->blogPostData = $blogPostData;
23
$this->current_user_date = $current_user_date;
30
$this->keywords = $keywords;
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), 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), 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) {
52
}
53
}
54
if ($networkId == 2) {
55
+ if (isset($this->setPreFillText[$networkType][$networkId])) {
56
+ $postData['content'] = strip_tags($this->title);
57
+ if ($this->optionContentTwitter !== false && $this->optionContentTwitter == 1) { //append
58
+ $postData['content'] .= ' ' . $this->content;
59
+ }
60
+ if ($this->optionContentTwitter !== false && $this->optionContentTwitter == 2) { //only
61
+ $postData['content'] = $this->content;
62
+ }
63
+ if ($this->allowHashTag) {
64
+ $postData['content'] .= $this->getHashTagsString('');
65
+ }
66
+ $postData['content'] = B2S_Util::getExcerpt($postData['content'], (int) $this->setPreFillText[$networkType][$networkId], (int) $this->setPreFillTextLimit[$networkType][$networkId]);
67
+ } else {
68
+ $postData['content'] = strip_tags($this->title);
69
+ if ($this->allowHashTag) {
70
+ $postData['content'] .= $this->getHashTagsString('');
71
+ }
72
}
73
}
74
if ($networkId == 4) {
119
}
120
}
121
122
+ if ($networkId == 10 || $networkId == 17) {
123
+ $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;
124
if ($this->allowHashTag) {
125
$postData['content'] .= $this->getHashTagsString();
126
}
153
$hashTags = '';
154
if (is_array($this->keywords) && !empty($this->keywords)) {
155
foreach ($this->keywords as $tag) {
156
+ $hashTags .= ' #' . str_replace(array(" ","-"), "", $tag->name);
157
}
158
}
159
return (!empty($hashTags) ? (!empty($add) ? $add . $hashTags : $hashTags) : '');
includes/B2S/Network/Item.php CHANGED
@@ -144,7 +144,7 @@ class B2S_Network_Item {
144
if ($v['notAllow'] !== false) {
145
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Profile', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
146
} else {
147
- $html .= __('Profile', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
148
}
149
150
if (!empty($mandantName)) {
@@ -170,7 +170,7 @@ class B2S_Network_Item {
170
if ($v['notAllow'] !== false) {
171
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Page', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
172
} else {
173
- $html .= __('Page', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
174
}
175
176
if (!empty($mandantName)) {
@@ -196,7 +196,7 @@ class B2S_Network_Item {
196
if ($v['notAllow'] !== false) {
197
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Group', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
198
} else {
199
- $html .= __('Group', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
200
}
201
202
if (!empty($mandantName)) {
144
if ($v['notAllow'] !== false) {
145
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Profile', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
146
} else {
147
+ $html .= '<span>'.__('Profile', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
148
}
149
150
if (!empty($mandantName)) {
170
if ($v['notAllow'] !== false) {
171
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Page', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
172
} else {
173
+ $html .='<span>'. __('Page', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
174
}
175
176
if (!empty($mandantName)) {
196
if ($v['notAllow'] !== false) {
197
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Group', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
198
} else {
199
+ $html .= '<span>'.__('Group', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
200
}
201
202
if (!empty($mandantName)) {
includes/B2S/Post/Item.php CHANGED
@@ -17,12 +17,13 @@ class B2S_Post_Item {
17
protected $searchPostType;
18
protected $postCalendarSchedDates;
19
protected $searchUserAuthId;
20
protected $userLang;
21
protected $results_per_page = null;
22
public $currentPage = 0;
23
public $type;
24
25
- function __construct($type = 'all', $title = "", $authorId = "", $postStatus = "", $publishDate = '', $schedDate = '', $showByDate = '', $userAuthId = 0, $currentPage = 0, $postCat = "", $postType = "", $userLang = "en", $results_per_page = B2S_PLUGIN_POSTPERPAGE) {
26
$this->type = $type;
27
$this->searchPostTitle = $title;
28
$this->searchAuthorId = $authorId;
@@ -31,6 +32,7 @@ class B2S_Post_Item {
31
$this->searchSchedDate = $schedDate;
32
$this->searchShowByDate = $showByDate;
33
$this->searchUserAuthId = $userAuthId;
34
$this->currentPage = $currentPage;
35
$this->searchPostCat = $postCat;
36
$this->searchPostType = $postType;
@@ -119,6 +121,7 @@ class B2S_Post_Item {
119
if ($wpdb->get_var("SHOW TABLES LIKE 'b2s_posts'") == 'b2s_posts') {
120
$where = ($this->type == 'publish') ? " a.`hide` = 0 AND (a.`sched_date`= '0000-00-00 00:00:00' OR a.`sched_type` = 3) $addNotAdminPosts GROUP BY a.`post_id` ORDER BY a.`publish_date` " . $sortType : " a.`hide` = 0 AND a.`sched_type` != 3 AND a.`publish_date`= '0000-00-00 00:00:00' $addNotAdminPosts GROUP BY a.`post_id` ORDER BY a.`sched_date` " . $sortType;
121
$orderBy = ($this->type == 'publish') ? " ORDER BY filter.`publish_date` " . $sortType : " ORDER BY filter.`sched_date` " . $sortType;
122
$addSearchShowByDate = (!empty($this->searchShowByDate)) ? (($this->type == 'publish') ? " DATE_FORMAT(a.`publish_date`,'%Y-%m-%d') = '" . $this->searchShowByDate . "' AND " : " DATE_FORMAT(a.`sched_date`,'%Y-%m-%d') = '" . $this->searchShowByDate . "' AND ") : '';
123
$addInnerJoinLeftJoin = ((int) $this->searchUserAuthId != 0) ? ' LEFT JOIN b2s_posts_network_details b ON b.`id` = a.`network_details_id` ' : '';
124
$addInnnerJoinLeftJoinWhere = ((int) $this->searchUserAuthId != 0) ? ' b.`network_auth_id` =' . $this->searchUserAuthId . ' AND ' : '';
@@ -130,7 +133,7 @@ class B2S_Post_Item {
130
INNER JOIN(
131
SELECT a.`id`,$selectInnerJoin, a.`blog_user_id`, a.`post_id`
132
FROM `b2s_posts` a $addInnerJoinLeftJoin
133
- WHERE $addInnnerJoinLeftJoinWhere $addSearchShowByDate $where
134
) filter
135
ON posts.`ID` = filter.`post_id`
136
WHERE $addSearchType $addSearchAuthorId $addSearchPostTitle AND $postTypes $leftJoinWhere $orderBy
17
protected $searchPostType;
18
protected $postCalendarSchedDates;
19
protected $searchUserAuthId;
20
+ protected $searchBlogPostId;
21
protected $userLang;
22
protected $results_per_page = null;
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;
32
$this->searchSchedDate = $schedDate;
33
$this->searchShowByDate = $showByDate;
34
$this->searchUserAuthId = $userAuthId;
35
+ $this->searchBlogPostId = $blogPostId;
36
$this->currentPage = $currentPage;
37
$this->searchPostCat = $postCat;
38
$this->searchPostType = $postType;
121
if ($wpdb->get_var("SHOW TABLES LIKE 'b2s_posts'") == 'b2s_posts') {
122
$where = ($this->type == 'publish') ? " a.`hide` = 0 AND (a.`sched_date`= '0000-00-00 00:00:00' OR a.`sched_type` = 3) $addNotAdminPosts GROUP BY a.`post_id` ORDER BY a.`publish_date` " . $sortType : " a.`hide` = 0 AND a.`sched_type` != 3 AND a.`publish_date`= '0000-00-00 00:00:00' $addNotAdminPosts GROUP BY a.`post_id` ORDER BY a.`sched_date` " . $sortType;
123
$orderBy = ($this->type == 'publish') ? " ORDER BY filter.`publish_date` " . $sortType : " ORDER BY filter.`sched_date` " . $sortType;
124
+ $addSearchBlogPostId = ((int)$this->searchBlogPostId != 0) ? " a.`post_id` = ".(int)$this->searchBlogPostId." AND " : '';
125
$addSearchShowByDate = (!empty($this->searchShowByDate)) ? (($this->type == 'publish') ? " DATE_FORMAT(a.`publish_date`,'%Y-%m-%d') = '" . $this->searchShowByDate . "' AND " : " DATE_FORMAT(a.`sched_date`,'%Y-%m-%d') = '" . $this->searchShowByDate . "' AND ") : '';
126
$addInnerJoinLeftJoin = ((int) $this->searchUserAuthId != 0) ? ' LEFT JOIN b2s_posts_network_details b ON b.`id` = a.`network_details_id` ' : '';
127
$addInnnerJoinLeftJoinWhere = ((int) $this->searchUserAuthId != 0) ? ' b.`network_auth_id` =' . $this->searchUserAuthId . ' AND ' : '';
133
INNER JOIN(
134
SELECT a.`id`,$selectInnerJoin, a.`blog_user_id`, a.`post_id`
135
FROM `b2s_posts` a $addInnerJoinLeftJoin
136
+ WHERE $addInnnerJoinLeftJoinWhere $addSearchBlogPostId $addSearchShowByDate $where
137
) filter
138
ON posts.`ID` = filter.`post_id`
139
WHERE $addSearchType $addSearchAuthorId $addSearchPostTitle AND $postTypes $leftJoinWhere $orderBy
includes/B2S/PostBox.php CHANGED
@@ -87,6 +87,7 @@ class B2S_PostBox {
87
<input type="hidden" id="b2sLang" name="b2s-user-lang" value="' . strtolower(substr(get_locale(), 0, 2)) . '">
88
<input type="hidden" id="b2sUserLang" name="b2s-user-lang" value="' . strtolower(substr(get_locale(), 0, 2)) . '">
89
<input type="hidden" id="b2sPostLang" name="b2s-post-lang" value="' . substr($this->postLang, 0, 2) . '">
90
<input type="hidden" id="b2sBlogUserId" name="b2s-blog-user-id" value="' . B2S_PLUGIN_BLOG_USER_ID . '">
91
<input type="hidden" id="b2s-user-timezone" name="b2s-user-timezone" value="' . $userTimeZoneOffset . '"/>
92
<input type="hidden" id="b2s-post-status" name="b2s-post-status" value="' . trim(strtolower($postStatus)) . '"/>
@@ -202,7 +203,9 @@ class B2S_PostBox {
202
//Opt: CustomDatePicker
203
$dateFormat = (substr(B2S_LANGUAGE, 0, 2) == 'de') ? 'dd.mm.yyyy' : 'yyyy-mm-dd';
204
$timeFormat = (substr(B2S_LANGUAGE, 0, 2) == 'de') ? 'hh:ii' : 'hh:ii aa';
205
- $content .='<label class="b2s-font-bold">' . __('Select date:', 'blog2social') . '</label><br><span class="dashicons dashicons-calendar b2s-calendar-icon"></span><input style="width:88%;" id="b2s-post-meta-box-sched-date-picker" name="b2s-post-meta-box-sched-date" value="" readonly data-timepicker="true" data-language="' . substr(B2S_LANGUAGE, 0, 2) . '" data-time-format="' . $timeFormat . '" data-date-format="' . $dateFormat . '" type="text"><br>';
206
207
//Opt: Best Time Settings
208
if (!empty($myBestTimeSettings) && is_array($myBestTimeSettings)) {
87
<input type="hidden" id="b2sLang" name="b2s-user-lang" value="' . strtolower(substr(get_locale(), 0, 2)) . '">
88
<input type="hidden" id="b2sUserLang" name="b2s-user-lang" value="' . strtolower(substr(get_locale(), 0, 2)) . '">
89
<input type="hidden" id="b2sPostLang" name="b2s-post-lang" value="' . substr($this->postLang, 0, 2) . '">
90
+ <input type="hidden" id="b2sPluginUrl" name="b2s-post-lang" value="' .B2S_PLUGIN_URL . '">
91
<input type="hidden" id="b2sBlogUserId" name="b2s-blog-user-id" value="' . B2S_PLUGIN_BLOG_USER_ID . '">
92
<input type="hidden" id="b2s-user-timezone" name="b2s-user-timezone" value="' . $userTimeZoneOffset . '"/>
93
<input type="hidden" id="b2s-post-status" name="b2s-post-status" value="' . trim(strtolower($postStatus)) . '"/>
203
//Opt: CustomDatePicker
204
$dateFormat = (substr(B2S_LANGUAGE, 0, 2) == 'de') ? 'dd.mm.yyyy' : 'yyyy-mm-dd';
205
$timeFormat = (substr(B2S_LANGUAGE, 0, 2) == 'de') ? 'hh:ii' : 'hh:ii aa';
206
+ $content .='<label class="b2s-font-bold">' . __('Select date:', 'blog2social') . '</label>';
207
+ $content .='<a href="#b2s-post-box-calendar-header" id="b2s-post-box-calendar-btn" class="pull-right">' . __('show calendar', 'blog2social') . '</a>';
208
+ $content .='<br><span class="dashicons dashicons-calendar b2s-calendar-icon"></span><input style="width:88%;" id="b2s-post-meta-box-sched-date-picker" name="b2s-post-meta-box-sched-date" value="" readonly data-timepicker="true" data-language="' . substr(B2S_LANGUAGE, 0, 2) . '" data-time-format="' . $timeFormat . '" data-date-format="' . $dateFormat . '" type="text"><br>';
209
210
//Opt: Best Time Settings
211
if (!empty($myBestTimeSettings) && is_array($myBestTimeSettings)) {
includes/B2S/Settings/Item.php CHANGED
@@ -67,6 +67,9 @@ class B2S_Settings_Item {
67
68
$optionUserTimeZone = $this->options->_getOption('user_time_zone');
69
$optionUserHashTag = $this->options->_getOption('user_allow_hashtag');
70
$userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
71
$userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
72
$userInfo = get_user_meta(B2S_PLUGIN_BLOG_USER_ID);
@@ -95,8 +98,24 @@ class B2S_Settings_Item {
95
$content .= '<br>';
96
$content .= '<input type="checkbox" value="' . (($isCheckedAllowHashTag == 1) ? 0 : 1) . '" id="b2s-user-network-settings-allow-hashtag" ' . (($isCheckedAllowHashTag == 1) ? 'checked="checked"' : '') . ' /><label for="b2s-user-network-settings-allow-hashtag"> ' . __('include Wordpress tags as hashtags in my post', 'blog2social') . ' <a href="#" data-toggle="modal" data-target="#b2sInfoAllowHashTagModal" class="b2s-info-btn del-padding-left">' . __('Info', 'Blog2Social') . '</a></label>';
97
$content .= '<br>';
98
-
99
- return $content;
100
}
101
102
public function getAutoPostingSettingsHtml() {
@@ -126,6 +145,8 @@ class B2S_Settings_Item {
126
$content .='</div>';
127
$content .='<br>';
128
$content .='<div class="row">';
129
$content .='<div class="col-xs-12 col-md-2">';
130
$content .='<label class="b2s-auto-post-update-label">' . __('updating existing posts', 'blog2social') . '</label>';
131
$content .='<br><small><button class="btn btn-link btn-xs hidden-xs b2s-post-type-select-btn" data-post-type="update" data-select-toogle-state="0" data-select-toogle-name="' . __('Unselect all', 'blog2social') . '">' . __('Select all', 'blog2social') . '</button></small>';
@@ -260,6 +281,7 @@ class B2S_Settings_Item {
260
261
$og = $this->generalOptions->_getOption('og_active');
262
$card = $this->generalOptions->_getOption('card_active');
263
$og_isChecked = ($og !== false && $og == 1) ? 0 : 1;
264
$card_isChecked = ($card !== false && $card == 1) ? 0 : 1;
265
@@ -269,19 +291,43 @@ class B2S_Settings_Item {
269
}
270
$content .='<strong>' . __('This is a global feature for your blog, which can only be edited by users with admin rights.', 'blog2social') . '</strong>';
271
$content .= '<br>';
272
$content .='<h4>' . __('Meta Tags Settings for Posts and Pages', 'blog2social') . '</h4>';
273
- $content .= '<input type="checkbox" value="' . $og_isChecked . '" name="b2s_og_active" id="b2s_og_active" ' . (($og_isChecked == 0) ? 'checked="checked"' : '') . ' /><label for="b2s_og_active"> ' . __('Add Open Graph meta tags to your shared posts or pages, required by Facebook and other social networks to display your post or page image, title and description correctly.', 'blog2social', 'blog2social') . ' <a href="#" class="b2s-load-info-meta-tag-modal b2s-info-btn del-padding-left" data-meta-type="og" data-meta-origin="settings">' . __('Info', 'Blog2Social') . '</a></label>';
274
$content .='<br>';
275
- $content .= '<input type="checkbox" value="' . $card_isChecked . '" name="b2s_card_active" id="b2s_card_active" ' . (($card_isChecked == 0) ? 'checked="checked"' : '') . ' /><label for="b2s_card_active"> ' . __('Add Twitter Card meta tags to your shared posts or pages, required by Twitter to display your post or page image, title and description correctly.', 'blog2social', 'blog2social') . ' <a href="#" class="b2s-load-info-meta-tag-modal b2s-info-btn del-padding-left" data-meta-type="card" data-meta-origin="settings">' . __('Info', 'Blog2Social') . '</a></label>';
276
$content .='<br><br><hr>';
277
$content .='<h4>' . __('Frontpage Settings', 'blog2social') . '</h4>';
278
$content .='<div><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/1_flat.png', B2S_PLUGIN_FILE) . '"> <b>Facebook</b></div>';
279
$content .= '<p>' . __('Add the default Open Graph parameters for title, description and image you want Facebook to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
280
$content .='<br>';
281
$content .='<div class="col-md-8">';
282
- $content .='<div class="form-group"><label for="b2s_og_default_title"><strong>' . __("Title", "blog2social") . ':</strong></label><input type="text" value="' . ( ($this->generalOptions->_getOption('og_default_title') !== false) ? $this->generalOptions->_getOption('og_default_title') : get_bloginfo('name') ) . '" name="b2s_og_default_title" class="form-control" id="b2s_og_default_title"></div>';
283
- $content .='<div class="form-group"><label for="b2s_og_default_desc"><strong>' . __("Description", "blog2social") . ':</strong></label><input type="text" value="' . ( ($this->generalOptions->_getOption('og_default_desc') !== false) ? $this->generalOptions->_getOption('og_default_desc') : get_bloginfo('description') ) . '" name="b2s_og_default_desc" class="form-control" id="b2s_og_default_desc"></div>';
284
- $content .='<div class="form-group"><label for="b2s_og_default_image"><strong>' . __("Image URL", "blog2social") . ':</strong></label> <button class="btn btn-link btn-xs b2s-upload-image pull-right" data-id="b2s_og_default_image">' . __("Image upload / Media Gallery", "blog2social") . '</button><input type="text" value="' . (($this->generalOptions->_getOption('og_default_image') !== false) ? $this->generalOptions->_getOption('og_default_image') : '') . '" name="b2s_og_default_image" class="form-control" id="b2s_og_default_image">';
285
$content .='<span>' . __('Please note: Facebook supports images with a minimum dimension of 200x200 pixels and an aspect ratio of 1:1.', 'blog2social') . '</span>';
286
$content .='</div>';
287
$content .='</div>';
@@ -291,13 +337,18 @@ class B2S_Settings_Item {
291
$content .='<p>' . __('Add the default Twitter Card parameters for title, description and image you want Twitter to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
292
$content .='<br>';
293
$content .='<div class="col-md-8">';
294
- $content .='<div class="form-group"><label for="b2s_card_default_title"><strong>' . __("Title", "blog2social") . ':</strong></label><input type="text" value="' . ( ($this->generalOptions->_getOption('card_default_title') !== false) ? $this->generalOptions->_getOption('card_default_title') : get_bloginfo('name') ) . '" name="b2s_card_default_title" class="form-control" id="b2s_card_default_title"></div>';
295
- $content .='<div class="form-group"><label for="b2s_card_default_desc"><strong>' . __("Description", "blog2social") . ':</strong></label><input type="text" value="' . ( ($this->generalOptions->_getOption('card_default_desc') !== false) ? $this->generalOptions->_getOption('card_default_desc') : get_bloginfo('description') ) . '" name="b2s_card_default_desc" class="form-control" id="b2s_card_default_desc"></div>';
296
- $content .='<div class="form-group"><label for="b2s_card_default_image"><strong>' . __("Image URL", "blog2social") . ':</strong></label> <button class="btn btn-link btn-xs pull-right b2s-upload-image" data-id="b2s_card_default_image">' . __("Image upload / Media Gallery", "blog2social") . '</button><input type="text" value="' . (($this->generalOptions->_getOption('card_default_image') !== false) ? $this->generalOptions->_getOption('card_default_image') : '') . '" name="b2s_card_default_image" class="form-control" id="b2s_card_default_image">';
297
$content .='<span>' . __('Please note: Twitter supports images with a minimum dimension of 144x144 pixels and a maximum dimension of 4096x4096 pixels and less than 5 BM. The image will be cropped to a square. Twitter supports JPG, PNG, WEBP and GIF formats.', 'blog2social') . '</span>';
298
$content .='</div>';
299
$content .='</div>';
300
$content .='</div>';
301
302
return $content;
303
}
@@ -359,8 +410,7 @@ class B2S_Settings_Item {
359
$optionPostFormat = $this->options->_getOption('post_format');
360
$optionNoCache = $this->options->_getOption('link_no_cache');
361
$optionNoCache = ($optionNoCache === false || $optionNoCache == 0) ? 0 : 1; //default inactive , 1=active 0=not
362
-
363
- //Take old settings
364
if (!isset($optionPostFormat[$networkId])) {
365
$oldPostFormatSettings = ($networkId == 1) ? (isset($this->settings->network_post_format_1) ? (int) $this->settings->network_post_format_1 : 0) : (isset($this->settings->network_post_format_2) ? (int) $this->settings->network_post_format_2 : 1); // Twitter Default Photopost
366
$post_format[$networkId] = array();
@@ -395,7 +445,7 @@ class B2S_Settings_Item {
395
$content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[1]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][1]) && (int) $optionPostFormat[$networkId][1] == 0) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0]) && B2S_PLUGIN_USER_VERSION >= 2) ? 'checked' : '') . ' name="type-format[1]" value="0"><label class="' . $disabledTextType . '" for="type[1]-' . $networkId . '-1">' . __('Page', 'blog2social') . '</label></div><div class="clearfix"></div>';
396
$content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[2]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][2]) && (int) $optionPostFormat[$networkId][2] == 0) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0]) && B2S_PLUGIN_USER_VERSION >= 2) ? 'checked' : '') . ' name="type-format[2]" value="0"><label class="' . $disabledTextType . '" for="type[2]-' . $networkId . '-1">' . __('Group', 'blog2social') . '</label></div><div class="clearfix"></div>';
397
398
- //Option: no_cache param for varnish caching
399
if ($networkId == 1) {
400
$content .= '<br><div class="col-lg-6 col-md-6 col-xs-12 del-padding-left del-padding-right"><input id="link-no-cache" type="checkbox" ' . (($optionNoCache == 1) ? 'checked' : '') . ' name="no_cache" value="' . (($optionNoCache == 1) ? 0 : 1) . '"><label for="link-no-cache">' . __('Activate Instant Caching', 'blog2social') . '</label> <a href="#" data-toggle="modal" data-target="#b2sInfoNoCache" class="b2s-info-btn vertical-middle del-padding-left">' . __('Info', 'Blog2Social') . '</a></div><div class="clearfix"></div>';
401
}
@@ -422,12 +472,12 @@ class B2S_Settings_Item {
422
return $content;
423
}
424
425
- //view=ship
426
public function setNetworkSettingsHtml() {
427
$optionPostFormat = $this->options->_getOption('post_format');
428
$content = "<input type='hidden' class='b2sNetworkSettingsPostFormatText' value='" . json_encode(array('post' => array(__('Link Post', 'blog2social'), __('Photo Post', 'blog2social')), 'image' => array(__('Image with frame'), __('Image cut out')))) . "'/>";
429
foreach (array(1, 2, 10, 12) as $n => $networkId) { //FB,TW,In
430
- //Take old settings
431
if (!isset($optionPostFormat[$networkId])) {
432
$oldPostFormatSettings = ($networkId == 1 || $networkId == 10) ? (isset($this->settings->network_post_format_1) ? (int) $this->settings->network_post_format_1 : 0) : (isset($this->settings->network_post_format_2) ? (int) $this->settings->network_post_format_2 : 1); // Twitter Default Photopost
433
$post_format[$networkId] = array();
67
68
$optionUserTimeZone = $this->options->_getOption('user_time_zone');
69
$optionUserHashTag = $this->options->_getOption('user_allow_hashtag');
70
+ $contentTwitter = $this->options->_getOption('content_network_twitter');
71
+ $legacyMode = $this->generalOptions->_getOption('legacy_mode');
72
+ $isCheckedLegacyMode = ($legacyMode !== false && $legacyMode == 1) ? 1 : 0; //default not active , 1=active 0=not active
73
$userTimeZone = ($optionUserTimeZone !== false) ? $optionUserTimeZone : get_option('timezone_string');
74
$userTimeZoneOffset = (empty($userTimeZone)) ? get_option('gmt_offset') : B2S_Util::getOffsetToUtcByTimeZone($userTimeZone);
75
$userInfo = get_user_meta(B2S_PLUGIN_BLOG_USER_ID);
98
$content .= '<br>';
99
$content .= '<input type="checkbox" value="' . (($isCheckedAllowHashTag == 1) ? 0 : 1) . '" id="b2s-user-network-settings-allow-hashtag" ' . (($isCheckedAllowHashTag == 1) ? 'checked="checked"' : '') . ' /><label for="b2s-user-network-settings-allow-hashtag"> ' . __('include Wordpress tags as hashtags in my post', 'blog2social') . ' <a href="#" data-toggle="modal" data-target="#b2sInfoAllowHashTagModal" class="b2s-info-btn del-padding-left">' . __('Info', 'Blog2Social') . '</a></label>';
100
$content .= '<br>';
101
+ $content .= '<br>';
102
+ $content .='<p>' . __('Define Twitter post content', 'blog2social');
103
+ if (B2S_PLUGIN_USER_VERSION < 1) {
104
+ $content .=' <span class="label label-success label-sm"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sPreFeatureModal">' . __("PREMIUM", "blog2social") . '</a></span>';
105
+ }
106
+ $content .='</p>';
107
+ $content .='<select id="b2s-user-network-twitter-content">';
108
+ $content .='<option ' . (($contentTwitter === false || $contentTwitter == 0 || B2S_PLUGIN_USER_VERSION < 1) ? 'checked' : '') . ' value="0">' . __('title', 'blog2social') . ''.(($isCheckedAllowHashTag == 1) ? ' & ' . __('hashtags', 'blog2social') : '') . '</option>';
109
+ $content .='<option ' . (($contentTwitter !== false && $contentTwitter == 1 && B2S_PLUGIN_USER_VERSION >= 1) ? 'checked' : '') . ' value="1">' . __('title & content', 'blog2social') . ''.(($isCheckedAllowHashTag == 1) ? ' & ' . __('hashtags', 'blog2social') : '') . ' ' . ((B2S_PLUGIN_USER_VERSION < 1) ? __('(PREMIUM)', 'blog2social') : '') . '</option>';
110
+ $content .='<option ' . (($contentTwitter !== false && $contentTwitter == 2 && B2S_PLUGIN_USER_VERSION >= 1) ? 'checked' : '') . ' value="2">' . __('only content', 'blog2social') . ''.(($isCheckedAllowHashTag == 1) ? ' & ' . __('hashtags', 'blog2social') : '') . ' ' . ((B2S_PLUGIN_USER_VERSION < 1) ? __('(PREMIUM)', 'blog2social') : '') . '</option>';
111
+ $content .='</select> <a href="#" data-toggle="modal" data-target="#b2sInfoContentTwitterModal" class="b2s-info-btn hidden-xs">' . __('Info', 'blog2social') . '</a>';
112
+ $content .='<div class="clearfix"></div>';
113
+ $content .='<br>';
114
+ $content .='<hr>';
115
+ $content .='<h4>' . __('System', 'blog2social') . '</h4>';
116
+ $content .='<strong>' . __('This is a global feature for your blog, which can only be edited by users with admin rights.', 'blog2social') . '</strong><br>';
117
+ $content .= '<input type="checkbox" value="' . (($isCheckedLegacyMode == 1) ? 0 : 1) . '" id="b2s-general-settings-legacy-mode" ' . (($isCheckedLegacyMode == 1) ? 'checked="checked"' : '') . ' /><label for="b2s-general-settings-legacy-mode"> ' . __('activate Legacy mode', 'blog2social') . ' <a href="#" data-toggle="modal" data-target="#b2sInfoLegacyMode" class="b2s-info-btn del-padding-left">' . __('Info', 'Blog2Social') . '</a></label>';
118
+ return $content;
119
}
120
121
public function getAutoPostingSettingsHtml() {
145
$content .='</div>';
146
$content .='<br>';
147
$content .='<div class="row">';
148
+ $content .='<div class="col-md-12"><div class="panel panel-group b2s-auto-post-own-update-warning" style="display: none;"><div class="panel-body"><span class="glyphicon glyphicon-exclamation-sign glyphicon-warning"></span> ' . __('By enabling this feature your previously published social media posts will be sent again to your selected social media channels as soon as the post is updated.', 'blog2social') . '</div></div></div>';
149
+ $content .='<div class"clearfix"></div>';
150
$content .='<div class="col-xs-12 col-md-2">';
151
$content .='<label class="b2s-auto-post-update-label">' . __('updating existing posts', 'blog2social') . '</label>';
152
$content .='<br><small><button class="btn btn-link btn-xs hidden-xs b2s-post-type-select-btn" data-post-type="update" data-select-toogle-state="0" data-select-toogle-name="' . __('Unselect all', 'blog2social') . '">' . __('Select all', 'blog2social') . '</button></small>';
281
282
$og = $this->generalOptions->_getOption('og_active');
283
$card = $this->generalOptions->_getOption('card_active');
284
+ //$user_meta_author_data = $this->options->_getOption('meta_author_data');
285
$og_isChecked = ($og !== false && $og == 1) ? 0 : 1;
286
$card_isChecked = ($card !== false && $card == 1) ? 0 : 1;
287
291
}
292
$content .='<strong>' . __('This is a global feature for your blog, which can only be edited by users with admin rights.', 'blog2social') . '</strong>';
293
$content .= '<br>';
294
+ $content .='<div class="' . ( (B2S_PLUGIN_ADMIN) ? "" : "b2s-disabled-div") . '">';
295
$content .='<h4>' . __('Meta Tags Settings for Posts and Pages', 'blog2social') . '</h4>';
296
+ $content .= '<input type="checkbox" value="' . $og_isChecked . '" name="b2s_og_active" ' . ((B2S_PLUGIN_ADMIN) ? "" : "onclick=\"return false\"") . ' id="b2s_og_active" ' . (($og_isChecked == 0) ? 'checked="checked"' : '') . ' /><label for="b2s_og_active"> ' . __('Add Open Graph meta tags to your shared posts or pages, required by Facebook and other social networks to display your post or page image, title and description correctly.', 'blog2social', 'blog2social') . ' <a href="#" class="b2s-load-info-meta-tag-modal b2s-info-btn del-padding-left" data-meta-type="og" data-meta-origin="settings">' . __('Info', 'Blog2Social') . '</a></label>';
297
$content .='<br>';
298
+ $content .= '<input type="checkbox" value="' . $card_isChecked . '" name="b2s_card_active" ' . ((B2S_PLUGIN_ADMIN) ? "" : "onclick=\"return false\"") . ' id="b2s_card_active" ' . (($card_isChecked == 0) ? 'checked="checked"' : '') . ' /><label for="b2s_card_active"> ' . __('Add Twitter Card meta tags to your shared posts or pages, required by Twitter to display your post or page image, title and description correctly.', 'blog2social', 'blog2social') . ' <a href="#" class="b2s-load-info-meta-tag-modal b2s-info-btn del-padding-left" data-meta-type="card" data-meta-origin="settings">' . __('Info', 'Blog2Social') . '</a></label>';
299
+ $content .='</div>';
300
$content .='<br><br><hr>';
301
+
302
+ /*$content .='<h4>' . __('Authorship Settings', 'blog2social');
303
+ if (B2S_PLUGIN_USER_VERSION < 1) {
304
+ $content .=' <span class="label label-success label-sm"><a href="#" class="btn-label-premium" data-toggle="modal" data-target="#b2sPreFeatureModal">' . __("PREMIUM", "blog2social") . '</a></span>';
305
+ }
306
+ $content .='</h4>';
307
+ $content .='<div class="' . ( (B2S_PLUGIN_USER_VERSION >= 1) ? "" : "b2s-disabled-div") . '">';
308
+ $content .='<p>' . __('Add authorship tags to your articles. When somesone shares your links on Facebook or Twitter, you will be automatically linked as the author.', 'blog2social') . '</p>';
309
+ $content .='<div class="col-md-8">';
310
+ $content .='<div class="form-group"><label for="b2s_og_article_author"><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/1_flat.png', B2S_PLUGIN_FILE) . '"> <strong>' . __("Facebook author link", "blog2social") . ':</strong></label><input type="text" placeholder="' . __("Enter your Facebook link profile here (e.g. https://www.facebook.com/Blog2Social/)", "blog2social") . '" ' . ((B2S_PLUGIN_USER_VERSION >= 1) ? "" : "readonly") . ' value="' . (($user_meta_author_data !== false && isset($user_meta_author_data['og_article_author'])) ? $user_meta_author_data['og_article_author'] : "") . '" name="b2s_og_article_author" class="form-control" id="b2s_og_article_author"></div>';
311
+ $content .='<div class="form-group"><label for="b2s_card_twitter_creator"><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/2_flat.png', B2S_PLUGIN_FILE) . '"> <strong>' . __("Twitter Username", "blog2social") . ':</strong></label><input type="text" placeholder="' . __("Enter your Twitter Username here (e.g. @blog2social)", "blog2social") . '" ' . ((B2S_PLUGIN_USER_VERSION >= 1) ? "" : "readonly") . ' value="' . (($user_meta_author_data !== false && isset($user_meta_author_data['card_twitter_creator'])) ? $user_meta_author_data['card_twitter_creator'] : "") . '" name="b2s_card_twitter_creator" class="form-control" id="b2s_card_twitter_creator"></div>';
312
+ $content .='</div>';
313
+ $content .='</div>';
314
+ $content .='<div class="clearfix"></div>';
315
+ $content .='<hr>';*/
316
+
317
+ $content .='<strong>' . __('This is a global feature for your blog, which can only be edited by users with admin rights.', 'blog2social') . '</strong>';
318
+ $content .='<div class="' . ( (B2S_PLUGIN_ADMIN) ? "" : "b2s-disabled-div") . '">';
319
$content .='<h4>' . __('Frontpage Settings', 'blog2social') . '</h4>';
320
$content .='<div><img alt="" class="b2s-post-item-network-image" src="' . plugins_url('/assets/images/portale/1_flat.png', B2S_PLUGIN_FILE) . '"> <b>Facebook</b></div>';
321
$content .= '<p>' . __('Add the default Open Graph parameters for title, description and image you want Facebook to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
322
$content .='<br>';
323
$content .='<div class="col-md-8">';
324
+ $content .='<div class="form-group"><label for="b2s_og_default_title"><strong>' . __("Title", "blog2social") . ':</strong></label><input type="text" ' . ((B2S_PLUGIN_ADMIN) ? "" : "readonly") . ' value="' . ( ($this->generalOptions->_getOption('og_default_title') !== false) ? $this->generalOptions->_getOption('og_default_title') : get_bloginfo('name') ) . '" name="b2s_og_default_title" class="form-control" id="b2s_og_default_title"></div>';
325
+ $content .='<div class="form-group"><label for="b2s_og_default_desc"><strong>' . __("Description", "blog2social") . ':</strong></label><input type="text" ' . ((B2S_PLUGIN_ADMIN) ? "" : "readonly") . ' value="' . ( ($this->generalOptions->_getOption('og_default_desc') !== false) ? $this->generalOptions->_getOption('og_default_desc') : get_bloginfo('description') ) . '" name="b2s_og_default_desc" class="form-control" id="b2s_og_default_desc"></div>';
326
+ $content .='<div class="form-group"><label for="b2s_og_default_image"><strong>' . __("Image URL", "blog2social") . ':</strong></label>';
327
+ if (B2S_PLUGIN_ADMIN) {
328
+ $content .='<button class="btn btn-link btn-xs b2s-upload-image pull-right" data-id="b2s_og_default_image">' . __("Image upload / Media Gallery", "blog2social") . '</button>';
329
+ }
330
+ $content .='<input type="text" ' . ((B2S_PLUGIN_ADMIN) ? "" : "readonly") . ' value="' . (($this->generalOptions->_getOption('og_default_image') !== false) ? $this->generalOptions->_getOption('og_default_image') : '') . '" name="b2s_og_default_image" class="form-control" id="b2s_og_default_image">';
331
$content .='<span>' . __('Please note: Facebook supports images with a minimum dimension of 200x200 pixels and an aspect ratio of 1:1.', 'blog2social') . '</span>';
332
$content .='</div>';
333
$content .='</div>';
337
$content .='<p>' . __('Add the default Twitter Card parameters for title, description and image you want Twitter to display, if you share the frontpage of your blog as link post (http://www.yourblog.com)', 'blog2social') . '</p>';
338
$content .='<br>';
339
$content .='<div class="col-md-8">';
340
+ $content .='<div class="form-group"><label for="b2s_card_default_title"><strong>' . __("Title", "blog2social") . ':</strong></label><input type="text" ' . ((B2S_PLUGIN_ADMIN) ? "" : "readonly") . ' value="' . ( ($this->generalOptions->_getOption('card_default_title') !== false) ? $this->generalOptions->_getOption('card_default_title') : get_bloginfo('name') ) . '" name="b2s_card_default_title" class="form-control" id="b2s_card_default_title"></div>';
341
+ $content .='<div class="form-group"><label for="b2s_card_default_desc"><strong>' . __("Description", "blog2social") . ':</strong></label><input type="text" ' . ((B2S_PLUGIN_ADMIN) ? "" : "readonly") . ' value="' . ( ($this->generalOptions->_getOption('card_default_desc') !== false) ? $this->generalOptions->_getOption('card_default_desc') : get_bloginfo('description') ) . '" name="b2s_card_default_desc" class="form-control" id="b2s_card_default_desc"></div>';
342
+ $content .='<div class="form-group"><label for="b2s_card_default_image"><strong>' . __("Image URL", "blog2social") . ':</strong></label> ';
343
+ if (B2S_PLUGIN_ADMIN) {
344
+ $content .='<button class="btn btn-link btn-xs pull-right b2s-upload-image" data-id="b2s_card_default_image">' . __("Image upload / Media Gallery", "blog2social") . '</button>';
345
+ }
346
+ $content .='<input type="text" ' . ((B2S_PLUGIN_ADMIN) ? "" : "readonly") . ' value="' . (($this->generalOptions->_getOption('card_default_image') !== false) ? $this->generalOptions->_getOption('card_default_image') : '') . '" name="b2s_card_default_image" class="form-control" id="b2s_card_default_image">';
347
$content .='<span>' . __('Please note: Twitter supports images with a minimum dimension of 144x144 pixels and a maximum dimension of 4096x4096 pixels and less than 5 BM. The image will be cropped to a square. Twitter supports JPG, PNG, WEBP and GIF formats.', 'blog2social') . '</span>';
348
$content .='</div>';
349
$content .='</div>';
350
$content .='</div>';
351
+ $content .='</div>';
352
353
return $content;
354
}
410
$optionPostFormat = $this->options->_getOption('post_format');
411
$optionNoCache = $this->options->_getOption('link_no_cache');
412
$optionNoCache = ($optionNoCache === false || $optionNoCache == 0) ? 0 : 1; //default inactive , 1=active 0=not
413
+ //Take old settings
414
if (!isset($optionPostFormat[$networkId])) {
415
$oldPostFormatSettings = ($networkId == 1) ? (isset($this->settings->network_post_format_1) ? (int) $this->settings->network_post_format_1 : 0) : (isset($this->settings->network_post_format_2) ? (int) $this->settings->network_post_format_2 : 1); // Twitter Default Photopost
416
$post_format[$networkId] = array();
445
$content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[1]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][1]) && (int) $optionPostFormat[$networkId][1] == 0) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0]) && B2S_PLUGIN_USER_VERSION >= 2) ? 'checked' : '') . ' name="type-format[1]" value="0"><label class="' . $disabledTextType . '" for="type[1]-' . $networkId . '-1">' . __('Page', 'blog2social') . '</label></div><div class="clearfix"></div>';
446
$content .= '<div class="col-lg-3 col-md-4 col-xs-5 del-padding-left del-padding-right"><input type="radio" ' . $disabledInputType . ' id="type[2]-' . $networkId . '-1" ' . ( (isset($optionPostFormat[$networkId][2]) && (int) $optionPostFormat[$networkId][2] == 0) ? 'checked' : ( (int) $optionPostFormat[$networkId]['all'] == 0 && !isset($optionPostFormat[$networkId][0]) && B2S_PLUGIN_USER_VERSION >= 2) ? 'checked' : '') . ' name="type-format[2]" value="0"><label class="' . $disabledTextType . '" for="type[2]-' . $networkId . '-1">' . __('Group', 'blog2social') . '</label></div><div class="clearfix"></div>';
447
448
+ //Option: no_cache param for varnish caching
449
if ($networkId == 1) {
450