Version Description
- Tweak - Only show welcome screen on major version upgrade.
- Tweak - Add filters to enable career totals calculation with extensions.
- Fix - Countdowns not reflecting timezone setting.
Download this release
Release Info
Developer | brianmiyaji |
Plugin | SportsPress – Sports Club & League Manager |
Version | 2.6.17 |
Comparing to | |
See all releases |
Code changes from version 2.6.16 to 2.6.17
- assets/js/admin/locationpicker.js +0 -16
- assets/js/admin/sportspress-admin.js +8 -1
- assets/js/locationpicker.jquery.js +0 -400
- assets/js/sportspress.js +10 -3
- changelog.txt +5 -0
- includes/admin/class-sp-admin-welcome.php +2 -2
- includes/class-sp-install.php +15 -3
- includes/class-sp-player.php +6 -2
- readme.txt +6 -1
- sportspress.php +3 -3
assets/js/admin/locationpicker.js
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function($){
|
2 |
-
$(".sp-location-picker").locationpicker({
|
3 |
-
location: {
|
4 |
-
latitude: Number($(".sp-latitude").val()),
|
5 |
-
longitude: Number($(".sp-longitude").val())
|
6 |
-
},
|
7 |
-
radius: 0,
|
8 |
-
inputBinding: {
|
9 |
-
latitudeInput: $(".sp-latitude"),
|
10 |
-
longitudeInput: $(".sp-longitude"),
|
11 |
-
locationNameInput: $(".sp-address")
|
12 |
-
},
|
13 |
-
addressFormat: null,
|
14 |
-
enableAutocomplete: true
|
15 |
-
});
|
16 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/sportspress-admin.js
CHANGED
@@ -466,8 +466,15 @@ jQuery(document).ready(function($){
|
|
466 |
// Iterate every second
|
467 |
var x = setInterval(function() {
|
468 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
// Find the distance between now and the count down date
|
470 |
-
var distance = countDownDate -
|
471 |
if ( distance < 0 ) {
|
472 |
distance = 0;
|
473 |
}
|
466 |
// Iterate every second
|
467 |
var x = setInterval(function() {
|
468 |
|
469 |
+
// Get todays date and time
|
470 |
+
var now = new Date();
|
471 |
+
|
472 |
+
// Convert curent date and time to UTC
|
473 |
+
var tzDifference = now.getTimezoneOffset();
|
474 |
+
var nowutc = new Date(now.getTime() + tzDifference * 60 * 1000);
|
475 |
+
|
476 |
// Find the distance between now and the count down date
|
477 |
+
var distance = countDownDate - nowutc;
|
478 |
if ( distance < 0 ) {
|
479 |
distance = 0;
|
480 |
}
|
assets/js/locationpicker.jquery.js
DELETED
@@ -1,400 +0,0 @@
|
|
1 |
-
/*! jquery-locationpicker - v0.1.16 - 2017-10-02 */
|
2 |
-
(function($) {
|
3 |
-
function GMapContext(domElement, options) {
|
4 |
-
var _map = new google.maps.Map(domElement, options);
|
5 |
-
var _marker = new google.maps.Marker({
|
6 |
-
position: new google.maps.LatLng(54.19335, -3.92695),
|
7 |
-
map: _map,
|
8 |
-
title: "Drag Me",
|
9 |
-
visible: options.markerVisible,
|
10 |
-
draggable: options.markerDraggable,
|
11 |
-
icon: options.markerIcon !== undefined ? options.markerIcon : undefined
|
12 |
-
});
|
13 |
-
return {
|
14 |
-
map: _map,
|
15 |
-
marker: _marker,
|
16 |
-
circle: null,
|
17 |
-
location: _marker.position,
|
18 |
-
radius: options.radius,
|
19 |
-
locationName: options.locationName,
|
20 |
-
addressComponents: {
|
21 |
-
formatted_address: null,
|
22 |
-
addressLine1: null,
|
23 |
-
addressLine2: null,
|
24 |
-
streetName: null,
|
25 |
-
streetNumber: null,
|
26 |
-
city: null,
|
27 |
-
district: null,
|
28 |
-
state: null,
|
29 |
-
stateOrProvince: null
|
30 |
-
},
|
31 |
-
settings: options.settings,
|
32 |
-
domContainer: domElement,
|
33 |
-
geodecoder: new google.maps.Geocoder()
|
34 |
-
};
|
35 |
-
}
|
36 |
-
var GmUtility = {
|
37 |
-
drawCircle: function(gmapContext, center, radius, options) {
|
38 |
-
if (gmapContext.circle != null) {
|
39 |
-
gmapContext.circle.setMap(null);
|
40 |
-
}
|
41 |
-
if (radius > 0) {
|
42 |
-
radius *= 1;
|
43 |
-
options = $.extend({
|
44 |
-
strokeColor: "#0000FF",
|
45 |
-
strokeOpacity: .35,
|
46 |
-
strokeWeight: 2,
|
47 |
-
fillColor: "#0000FF",
|
48 |
-
fillOpacity: .2
|
49 |
-
}, options);
|
50 |
-
options.map = gmapContext.map;
|
51 |
-
options.radius = radius;
|
52 |
-
options.center = center;
|
53 |
-
gmapContext.circle = new google.maps.Circle(options);
|
54 |
-
return gmapContext.circle;
|
55 |
-
}
|
56 |
-
return null;
|
57 |
-
},
|
58 |
-
setPosition: function(gMapContext, location, callback) {
|
59 |
-
gMapContext.location = location;
|
60 |
-
gMapContext.marker.setPosition(location);
|
61 |
-
gMapContext.map.panTo(location);
|
62 |
-
this.drawCircle(gMapContext, location, gMapContext.radius, {});
|
63 |
-
if (gMapContext.settings.enableReverseGeocode) {
|
64 |
-
this.updateLocationName(gMapContext, callback);
|
65 |
-
} else {
|
66 |
-
if (callback) {
|
67 |
-
callback.call(this, gMapContext);
|
68 |
-
}
|
69 |
-
}
|
70 |
-
},
|
71 |
-
locationFromLatLng: function(lnlg) {
|
72 |
-
return {
|
73 |
-
latitude: lnlg.lat(),
|
74 |
-
longitude: lnlg.lng()
|
75 |
-
};
|
76 |
-
},
|
77 |
-
addressByFormat: function(addresses, format) {
|
78 |
-
var result = null;
|
79 |
-
for (var i = addresses.length - 1; i >= 0; i--) {
|
80 |
-
if (addresses[i].types.indexOf(format) >= 0) {
|
81 |
-
result = addresses[i];
|
82 |
-
}
|
83 |
-
}
|
84 |
-
return result || addresses[0];
|
85 |
-
},
|
86 |
-
updateLocationName: function(gmapContext, callback) {
|
87 |
-
gmapContext.geodecoder.geocode({
|
88 |
-
latLng: gmapContext.marker.position
|
89 |
-
}, function(results, status) {
|
90 |
-
if (status == google.maps.GeocoderStatus.OK && results.length > 0) {
|
91 |
-
var address = GmUtility.addressByFormat(results, gmapContext.settings.addressFormat);
|
92 |
-
gmapContext.locationName = address.formatted_address;
|
93 |
-
gmapContext.addressComponents = GmUtility.address_component_from_google_geocode(address.address_components);
|
94 |
-
} else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
|
95 |
-
return setTimeout(function() {
|
96 |
-
GmUtility.updateLocationName(gmapContext, callback);
|
97 |
-
}, 1e3);
|
98 |
-
}
|
99 |
-
if (callback) {
|
100 |
-
callback.call(this, gmapContext);
|
101 |
-
}
|
102 |
-
});
|
103 |
-
},
|
104 |
-
address_component_from_google_geocode: function(address_components) {
|
105 |
-
var result = {};
|
106 |
-
for (var i = address_components.length - 1; i >= 0; i--) {
|
107 |
-
var component = address_components[i];
|
108 |
-
if (component.types.indexOf("postal_code") >= 0) {
|
109 |
-
result.postalCode = component.short_name;
|
110 |
-
} else if (component.types.indexOf("street_number") >= 0) {
|
111 |
-
result.streetNumber = component.short_name;
|
112 |
-
} else if (component.types.indexOf("route") >= 0) {
|
113 |
-
result.streetName = component.short_name;
|
114 |
-
} else if (component.types.indexOf("locality") >= 0) {
|
115 |
-
result.city = component.short_name;
|
116 |
-
} else if (component.types.indexOf("sublocality") >= 0) {
|
117 |
-
result.district = component.short_name;
|
118 |
-
} else if (component.types.indexOf("administrative_area_level_1") >= 0) {
|
119 |
-
result.stateOrProvince = component.short_name;
|
120 |
-
} else if (component.types.indexOf("country") >= 0) {
|
121 |
-
result.country = component.short_name;
|
122 |
-
}
|
123 |
-
}
|
124 |
-
result.addressLine1 = [ result.streetNumber, result.streetName ].join(" ").trim();
|
125 |
-
result.addressLine2 = "";
|
126 |
-
return result;
|
127 |
-
}
|
128 |
-
};
|
129 |
-
function isPluginApplied(domObj) {
|
130 |
-
return getContextForElement(domObj) != undefined;
|
131 |
-
}
|
132 |
-
function getContextForElement(domObj) {
|
133 |
-
return $(domObj).data("locationpicker");
|
134 |
-
}
|
135 |
-
function updateInputValues(inputBinding, gmapContext) {
|
136 |
-
if (!inputBinding) return;
|
137 |
-
var currentLocation = GmUtility.locationFromLatLng(gmapContext.marker.position);
|
138 |
-
if (inputBinding.latitudeInput) {
|
139 |
-
inputBinding.latitudeInput.val(currentLocation.latitude).change();
|
140 |
-
}
|
141 |
-
if (inputBinding.longitudeInput) {
|
142 |
-
inputBinding.longitudeInput.val(currentLocation.longitude).change();
|
143 |
-
}
|
144 |
-
if (inputBinding.radiusInput) {
|
145 |
-
inputBinding.radiusInput.val(gmapContext.radius).change();
|
146 |
-
}
|
147 |
-
if (inputBinding.locationNameInput) {
|
148 |
-
inputBinding.locationNameInput.val(gmapContext.locationName).change();
|
149 |
-
}
|
150 |
-
}
|
151 |
-
function setupInputListenersInput(inputBinding, gmapContext) {
|
152 |
-
if (inputBinding) {
|
153 |
-
if (inputBinding.radiusInput) {
|
154 |
-
inputBinding.radiusInput.on("change", function(e) {
|
155 |
-
var radiusInputValue = $(this).val();
|
156 |
-
if (!e.originalEvent || isNaN(radiusInputValue)) {
|
157 |
-
return;
|
158 |
-
}
|
159 |
-
gmapContext.radius = radiusInputValue;
|
160 |
-
GmUtility.setPosition(gmapContext, gmapContext.location, function(context) {
|
161 |
-
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
162 |
-
});
|
163 |
-
});
|
164 |
-
}
|
165 |
-
if (inputBinding.locationNameInput && gmapContext.settings.enableAutocomplete) {
|
166 |
-
var blur = false;
|
167 |
-
gmapContext.autocomplete = new google.maps.places.Autocomplete(inputBinding.locationNameInput.get(0), gmapContext.settings.autocompleteOptions);
|
168 |
-
google.maps.event.addListener(gmapContext.autocomplete, "place_changed", function() {
|
169 |
-
blur = false;
|
170 |
-
var place = gmapContext.autocomplete.getPlace();
|
171 |
-
if (!place.geometry) {
|
172 |
-
gmapContext.settings.onlocationnotfound(place.name);
|
173 |
-
return;
|
174 |
-
}
|
175 |
-
GmUtility.setPosition(gmapContext, place.geometry.location, function(context) {
|
176 |
-
updateInputValues(inputBinding, context);
|
177 |
-
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
178 |
-
});
|
179 |
-
});
|
180 |
-
if (gmapContext.settings.enableAutocompleteBlur) {
|
181 |
-
inputBinding.locationNameInput.on("change", function(e) {
|
182 |
-
if (!e.originalEvent) {
|
183 |
-
return;
|
184 |
-
}
|
185 |
-
blur = true;
|
186 |
-
});
|
187 |
-
inputBinding.locationNameInput.on("blur", function(e) {
|
188 |
-
if (!e.originalEvent) {
|
189 |
-
return;
|
190 |
-
}
|
191 |
-
setTimeout(function() {
|
192 |
-
var address = $(inputBinding.locationNameInput).val();
|
193 |
-
if (address.length > 5 && blur) {
|
194 |
-
blur = false;
|
195 |
-
gmapContext.geodecoder.geocode({
|
196 |
-
address: address
|
197 |
-
}, function(results, status) {
|
198 |
-
if (status == google.maps.GeocoderStatus.OK && results && results.length) {
|
199 |
-
GmUtility.setPosition(gmapContext, results[0].geometry.location, function(context) {
|
200 |
-
updateInputValues(inputBinding, context);
|
201 |
-
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
202 |
-
});
|
203 |
-
}
|
204 |
-
});
|
205 |
-
}
|
206 |
-
}, 1e3);
|
207 |
-
});
|
208 |
-
}
|
209 |
-
}
|
210 |
-
if (inputBinding.latitudeInput) {
|
211 |
-
inputBinding.latitudeInput.on("change", function(e) {
|
212 |
-
var latitudeInputValue = $(this).val();
|
213 |
-
if (!e.originalEvent || isNaN(latitudeInputValue)) {
|
214 |
-
return;
|
215 |
-
}
|
216 |
-
GmUtility.setPosition(gmapContext, new google.maps.LatLng(latitudeInputValue, gmapContext.location.lng()), function(context) {
|
217 |
-
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
218 |
-
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
|
219 |
-
});
|
220 |
-
});
|
221 |
-
}
|
222 |
-
if (inputBinding.longitudeInput) {
|
223 |
-
inputBinding.longitudeInput.on("change", function(e) {
|
224 |
-
var longitudeInputValue = $(this).val();
|
225 |
-
if (!e.originalEvent || isNaN(longitudeInputValue)) {
|
226 |
-
return;
|
227 |
-
}
|
228 |
-
GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), longitudeInputValue), function(context) {
|
229 |
-
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
230 |
-
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
|
231 |
-
});
|
232 |
-
});
|
233 |
-
}
|
234 |
-
}
|
235 |
-
}
|
236 |
-
function autosize(gmapContext) {
|
237 |
-
google.maps.event.trigger(gmapContext.map, "resize");
|
238 |
-
setTimeout(function() {
|
239 |
-
gmapContext.map.setCenter(gmapContext.marker.position);
|
240 |
-
}, 300);
|
241 |
-
}
|
242 |
-
function updateMap(gmapContext, $target, options) {
|
243 |
-
var settings = $.extend({}, $.fn.locationpicker.defaults, options), latNew = settings.location.latitude, lngNew = settings.location.longitude, radiusNew = settings.radius, latOld = gmapContext.settings.location.latitude, lngOld = gmapContext.settings.location.longitude, radiusOld = gmapContext.settings.radius;
|
244 |
-
if (latNew == latOld && lngNew == lngOld && radiusNew == radiusOld) return;
|
245 |
-
gmapContext.settings.location.latitude = latNew;
|
246 |
-
gmapContext.settings.location.longitude = lngNew;
|
247 |
-
gmapContext.radius = radiusNew;
|
248 |
-
GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.settings.location.latitude, gmapContext.settings.location.longitude), function(context) {
|
249 |
-
setupInputListenersInput(gmapContext.settings.inputBinding, gmapContext);
|
250 |
-
context.settings.oninitialized($target);
|
251 |
-
});
|
252 |
-
}
|
253 |
-
$.fn.locationpicker = function(options, params) {
|
254 |
-
if (typeof options == "string") {
|
255 |
-
var _targetDomElement = this.get(0);
|
256 |
-
if (!isPluginApplied(_targetDomElement)) return;
|
257 |
-
var gmapContext = getContextForElement(_targetDomElement);
|
258 |
-
switch (options) {
|
259 |
-
case "location":
|
260 |
-
if (params == undefined) {
|
261 |
-
var location = GmUtility.locationFromLatLng(gmapContext.location);
|
262 |
-
location.radius = gmapContext.radius;
|
263 |
-
location.name = gmapContext.locationName;
|
264 |
-
return location;
|
265 |
-
} else {
|
266 |
-
if (params.radius) {
|
267 |
-
gmapContext.radius = params.radius;
|
268 |
-
}
|
269 |
-
GmUtility.setPosition(gmapContext, new google.maps.LatLng(params.latitude, params.longitude), function(gmapContext) {
|
270 |
-
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
|
271 |
-
});
|
272 |
-
}
|
273 |
-
break;
|
274 |
-
|
275 |
-
case "subscribe":
|
276 |
-
if (params == undefined) {
|
277 |
-
return null;
|
278 |
-
} else {
|
279 |
-
var event = params.event;
|
280 |
-
var callback = params.callback;
|
281 |
-
if (!event || !callback) {
|
282 |
-
console.error('LocationPicker: Invalid arguments for method "subscribe"');
|
283 |
-
return null;
|
284 |
-
}
|
285 |
-
google.maps.event.addListener(gmapContext.map, event, callback);
|
286 |
-
}
|
287 |
-
break;
|
288 |
-
|
289 |
-
case "map":
|
290 |
-
if (params == undefined) {
|
291 |
-
var locationObj = GmUtility.locationFromLatLng(gmapContext.location);
|
292 |
-
locationObj.formattedAddress = gmapContext.locationName;
|
293 |
-
locationObj.addressComponents = gmapContext.addressComponents;
|
294 |
-
return {
|
295 |
-
map: gmapContext.map,
|
296 |
-
marker: gmapContext.marker,
|
297 |
-
location: locationObj
|
298 |
-
};
|
299 |
-
} else {
|
300 |
-
return null;
|
301 |
-
}
|
302 |
-
|
303 |
-
case "autosize":
|
304 |
-
autosize(gmapContext);
|
305 |
-
return this;
|
306 |
-
}
|
307 |
-
return null;
|
308 |
-
}
|
309 |
-
return this.each(function() {
|
310 |
-
var $target = $(this);
|
311 |
-
if (isPluginApplied(this)) {
|
312 |
-
updateMap(getContextForElement(this), $(this), options);
|
313 |
-
return;
|
314 |
-
}
|
315 |
-
var settings = $.extend({}, $.fn.locationpicker.defaults, options);
|
316 |
-
var gmapContext = new GMapContext(this, $.extend({}, {
|
317 |
-
zoom: settings.zoom,
|
318 |
-
center: new google.maps.LatLng(settings.location.latitude, settings.location.longitude),
|
319 |
-
mapTypeId: settings.mapTypeId,
|
320 |
-
mapTypeControl: false,
|
321 |
-
styles: settings.styles,
|
322 |
-
disableDoubleClickZoom: false,
|
323 |
-
scrollwheel: settings.scrollwheel,
|
324 |
-
streetViewControl: false,
|
325 |
-
radius: settings.radius,
|
326 |
-
locationName: settings.locationName,
|
327 |
-
settings: settings,
|
328 |
-
autocompleteOptions: settings.autocompleteOptions,
|
329 |
-
addressFormat: settings.addressFormat,
|
330 |
-
draggable: settings.draggable,
|
331 |
-
markerIcon: settings.markerIcon,
|
332 |
-
markerDraggable: settings.markerDraggable,
|
333 |
-
markerVisible: settings.markerVisible
|
334 |
-
}, settings.mapOptions));
|
335 |
-
$target.data("locationpicker", gmapContext);
|
336 |
-
function displayMarkerWithSelectedArea() {
|
337 |
-
GmUtility.setPosition(gmapContext, gmapContext.marker.position, function(context) {
|
338 |
-
var currentLocation = GmUtility.locationFromLatLng(gmapContext.location);
|
339 |
-
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
|
340 |
-
context.settings.onchanged.apply(gmapContext.domContainer, [ currentLocation, context.radius, true ]);
|
341 |
-
});
|
342 |
-
}
|
343 |
-
if (settings.markerInCenter) {
|
344 |
-
gmapContext.map.addListener("bounds_changed", function() {
|
345 |
-
if (!gmapContext.marker.dragging) {
|
346 |
-
gmapContext.marker.setPosition(gmapContext.map.center);
|
347 |
-
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
|
348 |
-
}
|
349 |
-
});
|
350 |
-
gmapContext.map.addListener("idle", function() {
|
351 |
-
if (!gmapContext.marker.dragging) {
|
352 |
-
displayMarkerWithSelectedArea();
|
353 |
-
}
|
354 |
-
});
|
355 |
-
}
|
356 |
-
google.maps.event.addListener(gmapContext.marker, "drag", function(event) {
|
357 |
-
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
|
358 |
-
});
|
359 |
-
google.maps.event.addListener(gmapContext.marker, "dragend", function(event) {
|
360 |
-
displayMarkerWithSelectedArea();
|
361 |
-
});
|
362 |
-
GmUtility.setPosition(gmapContext, new google.maps.LatLng(settings.location.latitude, settings.location.longitude), function(context) {
|
363 |
-
updateInputValues(settings.inputBinding, gmapContext);
|
364 |
-
setupInputListenersInput(settings.inputBinding, gmapContext);
|
365 |
-
context.settings.oninitialized($target);
|
366 |
-
});
|
367 |
-
});
|
368 |
-
};
|
369 |
-
$.fn.locationpicker.defaults = {
|
370 |
-
location: {
|
371 |
-
latitude: 40.7324319,
|
372 |
-
longitude: -73.82480777777776
|
373 |
-
},
|
374 |
-
locationName: "",
|
375 |
-
radius: 500,
|
376 |
-
zoom: 15,
|
377 |
-
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
378 |
-
styles: [],
|
379 |
-
mapOptions: {},
|
380 |
-
scrollwheel: true,
|
381 |
-
inputBinding: {
|
382 |
-
latitudeInput: null,
|
383 |
-
longitudeInput: null,
|
384 |
-
radiusInput: null,
|
385 |
-
locationNameInput: null
|
386 |
-
},
|
387 |
-
enableAutocomplete: false,
|
388 |
-
enableAutocompleteBlur: false,
|
389 |
-
autocompleteOptions: null,
|
390 |
-
addressFormat: "postal_code",
|
391 |
-
enableReverseGeocode: true,
|
392 |
-
draggable: true,
|
393 |
-
onchanged: function(currentLocation, radius, isMarkerDropped) {},
|
394 |
-
onlocationnotfound: function(locationName) {},
|
395 |
-
oninitialized: function(component) {},
|
396 |
-
markerIcon: undefined,
|
397 |
-
markerDraggable: true,
|
398 |
-
markerVisible: true
|
399 |
-
};
|
400 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/sportspress.js
CHANGED
@@ -21,9 +21,16 @@ function sp_viewport() {
|
|
21 |
var countDownDate = new Date($(this).data('countdown')).getTime();
|
22 |
// Iterate every second
|
23 |
var x = setInterval(function() {
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
// Find the distance between now and the count down date
|
26 |
-
var distance = countDownDate -
|
27 |
if ( distance < 0 ) {
|
28 |
distance = 0;
|
29 |
}
|
@@ -109,4 +116,4 @@ function sp_viewport() {
|
|
109 |
}
|
110 |
});
|
111 |
|
112 |
-
})(jQuery);
|
21 |
var countDownDate = new Date($(this).data('countdown')).getTime();
|
22 |
// Iterate every second
|
23 |
var x = setInterval(function() {
|
24 |
+
|
25 |
+
// Get todays date and time
|
26 |
+
var now = new Date();
|
27 |
+
|
28 |
+
// Convert curent date and time to UTC
|
29 |
+
var tzDifference = now.getTimezoneOffset();
|
30 |
+
var nowutc = new Date(now.getTime() + tzDifference * 60 * 1000);
|
31 |
+
|
32 |
// Find the distance between now and the count down date
|
33 |
+
var distance = countDownDate - nowutc;
|
34 |
if ( distance < 0 ) {
|
35 |
distance = 0;
|
36 |
}
|
116 |
}
|
117 |
});
|
118 |
|
119 |
+
})(jQuery);
|
changelog.txt
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
== SportsPress Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
3 |
= 2.6.16 =
|
4 |
* Tweak - Add support for updated baseball extension with partial innings.
|
5 |
* Fix - Error displaying staff in events when offense and defense are separate tables.
|
1 |
== SportsPress Changelog ==
|
2 |
|
3 |
+
= 2.6.17 =
|
4 |
+
* Tweak - Only show welcome screen on major version upgrade.
|
5 |
+
* Tweak - Add filters to enable career totals calculation with extensions.
|
6 |
+
* Fix - Countdowns not reflecting timezone setting.
|
7 |
+
|
8 |
= 2.6.16 =
|
9 |
* Tweak - Add support for updated baseball extension with partial innings.
|
10 |
* Fix - Error displaying staff in events when offense and defense are separate tables.
|
includes/admin/class-sp-admin-welcome.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* @author ThemeBoy
|
10 |
* @category Admin
|
11 |
* @package SportsPress/Admin
|
12 |
-
* @version 2.6
|
13 |
*/
|
14 |
|
15 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -383,7 +383,7 @@ class SP_Admin_Welcome {
|
|
383 |
public function welcome() {
|
384 |
|
385 |
// Bail if no activation redirect transient is set
|
386 |
-
|
387 |
return;
|
388 |
|
389 |
// Delete the redirect transient
|
9 |
* @author ThemeBoy
|
10 |
* @category Admin
|
11 |
* @package SportsPress/Admin
|
12 |
+
* @version 2.6.17
|
13 |
*/
|
14 |
|
15 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
383 |
public function welcome() {
|
384 |
|
385 |
// Bail if no activation redirect transient is set
|
386 |
+
if ( ! get_transient( '_sp_activation_redirect' ) )
|
387 |
return;
|
388 |
|
389 |
// Delete the redirect transient
|
includes/class-sp-install.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Classes
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -85,8 +85,20 @@ class SP_Install {
|
|
85 |
// Flush rules after install
|
86 |
flush_rewrite_rules();
|
87 |
|
88 |
-
//
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
/**
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Classes
|
8 |
+
* @version 2.6.17
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
85 |
// Flush rules after install
|
86 |
flush_rewrite_rules();
|
87 |
|
88 |
+
// Get current major version
|
89 |
+
$version = explode( '.', $current_version, 3 );
|
90 |
+
unset( $version[2] );
|
91 |
+
$major_current_version = implode( '.', $version );
|
92 |
+
|
93 |
+
// Get new major version
|
94 |
+
$version = explode( '.', SP()->version, 3 );
|
95 |
+
unset( $version[2] );
|
96 |
+
$major_version = implode( '.', $version );
|
97 |
+
|
98 |
+
// Redirect to welcome screen if major version has changed
|
99 |
+
if ( $major_current_version !== $major_version ) {
|
100 |
+
set_transient( '_sp_activation_redirect', 1, 60 * 60 );
|
101 |
+
}
|
102 |
}
|
103 |
|
104 |
/**
|
includes/class-sp-player.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The SportsPress player class handles individual player data.
|
6 |
*
|
7 |
* @class SP_Player
|
8 |
-
* @version 2.6.
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
@@ -728,7 +728,8 @@ class SP_Player extends SP_Custom_Post {
|
|
728 |
foreach ( $stats as $key => $value ):
|
729 |
if ( in_array( $key, array( 'name', 'team' ) ) ) continue;
|
730 |
$value = floatval( $value );
|
731 |
-
$
|
|
|
732 |
endforeach;
|
733 |
endforeach;
|
734 |
|
@@ -742,6 +743,9 @@ class SP_Player extends SP_Custom_Post {
|
|
742 |
$career[ $post->post_name ] = sp_solve( $value['equation'], $totals, $precision );
|
743 |
}
|
744 |
|
|
|
|
|
|
|
745 |
// Get manually entered career totals
|
746 |
$manual_career = sp_array_value( $data, 0, array() );
|
747 |
$manual_career = array_filter( $manual_career, 'sp_filter_non_empty' );
|
5 |
* The SportsPress player class handles individual player data.
|
6 |
*
|
7 |
* @class SP_Player
|
8 |
+
* @version 2.6.17
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
728 |
foreach ( $stats as $key => $value ):
|
729 |
if ( in_array( $key, array( 'name', 'team' ) ) ) continue;
|
730 |
$value = floatval( $value );
|
731 |
+
$add = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key );
|
732 |
+
$career[ $key ] = sp_array_value( $career, $key, 0 ) + $add;
|
733 |
endforeach;
|
734 |
endforeach;
|
735 |
|
743 |
$career[ $post->post_name ] = sp_solve( $value['equation'], $totals, $precision );
|
744 |
}
|
745 |
|
746 |
+
// Filter career total placeholders
|
747 |
+
$career = apply_filters( 'sportspress_player_performance_table_placeholders', $career );
|
748 |
+
|
749 |
// Get manually entered career totals
|
750 |
$manual_career = sp_array_value( $data, 0, array() );
|
751 |
$manual_career = array_filter( $manual_career, 'sp_filter_non_empty' );
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: calendars, club, club management, esports, events, fixtures, leagues, leag
|
|
4 |
Donate link: http://tboy.co/donate
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.2
|
7 |
-
Stable tag: 2.6.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -237,6 +237,11 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
|
|
237 |
|
238 |
== Changelog ==
|
239 |
|
|
|
|
|
|
|
|
|
|
|
240 |
= 2.6.16 =
|
241 |
* Tweak - Add support for updated baseball extension with partial innings.
|
242 |
* Fix - Error displaying staff in events when offense and defense are separate tables.
|
4 |
Donate link: http://tboy.co/donate
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.2
|
7 |
+
Stable tag: 2.6.17
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
237 |
|
238 |
== Changelog ==
|
239 |
|
240 |
+
= 2.6.17 =
|
241 |
+
* Tweak - Only show welcome screen on major version upgrade.
|
242 |
+
* Tweak - Add filters to enable career totals calculation with extensions.
|
243 |
+
* Fix - Countdowns not reflecting timezone setting.
|
244 |
+
|
245 |
= 2.6.16 =
|
246 |
* Tweak - Add support for updated baseball extension with partial innings.
|
247 |
* Fix - Error displaying staff in events when offense and defense are separate tables.
|
sportspress.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: SportsPress
|
4 |
* Plugin URI: http://themeboy.com/sportspress/
|
5 |
* Description: Manage your club and its players, staff, events, league tables, and player lists.
|
6 |
-
* Version: 2.6.
|
7 |
* Author: ThemeBoy
|
8 |
* Author URI: http://themeboy.com
|
9 |
* Requires at least: 3.8
|
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
|
|
26 |
* Main SportsPress Class
|
27 |
*
|
28 |
* @class SportsPress
|
29 |
-
* @version 2.6.
|
30 |
*/
|
31 |
final class SportsPress {
|
32 |
|
33 |
/**
|
34 |
* @var string
|
35 |
*/
|
36 |
-
public $version = '2.6.
|
37 |
|
38 |
/**
|
39 |
* @var SportsPress The single instance of the class
|
3 |
* Plugin Name: SportsPress
|
4 |
* Plugin URI: http://themeboy.com/sportspress/
|
5 |
* Description: Manage your club and its players, staff, events, league tables, and player lists.
|
6 |
+
* Version: 2.6.17
|
7 |
* Author: ThemeBoy
|
8 |
* Author URI: http://themeboy.com
|
9 |
* Requires at least: 3.8
|
26 |
* Main SportsPress Class
|
27 |
*
|
28 |
* @class SportsPress
|
29 |
+
* @version 2.6.17
|
30 |
*/
|
31 |
final class SportsPress {
|
32 |
|
33 |
/**
|
34 |
* @var string
|
35 |
*/
|
36 |
+
public $version = '2.6.17';
|
37 |
|
38 |
/**
|
39 |
* @var SportsPress The single instance of the class
|