Version Description
- Fix - Team in player statistics total row displaying as zero.
- Fix - Notice when no sendoffs are available during minutes played calculation.
Download this release
Release Info
Developer | brianmiyaji |
Plugin | SportsPress – Sports Club & League Manager |
Version | 2.3.2 |
Comparing to | |
See all releases |
Code changes from version 2.2.11 to 2.3.2
- assets/css/activation.css +0 -8
- assets/css/admin.css +13 -4
- assets/css/menu.css +11 -7
- assets/css/setup.css +421 -0
- assets/css/sportspress-style.css +19 -0
- assets/css/sportspress.css +7 -0
- assets/fonts/sportspress.eot +0 -0
- assets/fonts/sportspress.svg +1 -1
- assets/fonts/sportspress.ttf +0 -0
- assets/fonts/sportspress.woff +0 -0
- assets/fonts/sportspress.woff2 +0 -0
- assets/images/modules/sportspress-pro.png +0 -0
- assets/images/modules/sportspress.png +0 -0
- assets/images/welcome/screenshot-player-vs-player.png +0 -0
- assets/images/welcome/screenshot-send-offs.png +0 -0
- assets/images/welcome/screenshot-setup-wizard.png +0 -0
- assets/images/welcome/screenshot-team-vs-team.png +0 -0
- assets/images/welcome/screenshot-user-registration.png +0 -0
- assets/images/welcome/screenshot-user-scores-admin.png +0 -0
- assets/images/welcome/screenshot-user-scores-frontend.png +0 -0
- assets/js/admin/sportspress-admin.js +5 -5
- assets/js/admin/sportspress-setup.js +24 -0
- changelog.txt +25 -1
- includes/admin/class-sp-admin-notices.php +9 -7
- includes/admin/class-sp-admin-sample-data.php +10 -10
- includes/admin/class-sp-admin-settings.php +4 -1
- includes/admin/class-sp-admin-setup-wizard.php +790 -0
- includes/admin/class-sp-admin-welcome.php +68 -183
- includes/admin/class-sp-admin.php +10 -1
- includes/admin/post-types/class-sp-admin-meta-boxes.php +8 -1
- includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php +2 -2
- includes/admin/post-types/meta-boxes/class-sp-meta-box-event-mode.php +38 -0
- includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +5 -8
- includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php +4 -4
- includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php +30 -16
- includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php +3 -3
- includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php +1 -7
- includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php +26 -1
- includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php +1 -3
- includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php +1 -3
- includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php +13 -4
- includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php +5 -8
- includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php +38 -0
- includes/admin/settings/class-sp-settings-events.php +6 -24
- includes/admin/settings/class-sp-settings-general.php +2 -2
- includes/admin/settings/class-sp-settings-modules.php +2 -2
- includes/admin/views/html-admin-settings.php +1 -1
- includes/admin/views/html-notice-install.php +2 -2
- includes/class-sp-install.php +19 -22
- includes/class-sp-league-table.php +8 -2
- includes/class-sp-modules.php +8 -1
- includes/class-sp-player-list.php +139 -82
- includes/class-sp-player.php +72 -33
- includes/class-sp-template-loader.php +9 -24
- includes/sp-core-functions.php +65 -2
- includes/sp-template-hooks.php +1 -104
- modules/sportspress-event-status.php +1 -1
- modules/sportspress-individual-mode.php +0 -314
- modules/sportspress-lazy-loading.php +11 -2
- modules/sportspress-league-tables.php +10 -3
- modules/{sportspress-style.php → sportspress-styles.php} +33 -32
- modules/sportspress-template-selector.php +4 -7
- modules/sportspress-user-registration.php +141 -0
- presets/esports/csgo.json +4 -1
- presets/esports/dota2.json +4 -1
- presets/esports/lol.json +4 -1
- presets/racket-sports/squash.json +4 -1
- presets/racket-sports/table-tennis.json +4 -1
- presets/racket-sports/tennis.json +4 -1
- presets/target-sports/darts.json +4 -1
- presets/target-sports/golf.json +3 -3
- presets/target-sports/snooker.json +4 -1
- presets/team-sports/baseball.json +1 -0
- presets/team-sports/basketball.json +4 -1
- presets/team-sports/cricket.json +1 -1
- presets/team-sports/floorball.json +4 -1
- presets/team-sports/football.json +4 -1
- presets/team-sports/footy.json +4 -1
- presets/team-sports/handball.json +4 -1
- presets/team-sports/ice-hockey.json +3 -2
- presets/team-sports/lacrosse.json +4 -1
- presets/team-sports/netball.json +4 -1
- presets/team-sports/rugby-league.json +4 -1
- presets/team-sports/rugby-union.json +4 -1
- presets/team-sports/soccer.json +1 -0
- presets/team-sports/softball.json +1 -0
- presets/team-sports/volleyball.json +4 -1
- presets/water-sports/water-polo.json +4 -1
- readme.txt +23 -6
- sportspress.php +8 -8
- templates/event-performance-table-combined.php +0 -179
- templates/event-performance.php +4 -4
- templates/league-table.php +10 -2
- templates/player-selector.php +2 -2
- templates/staff-selector.php +2 -2
- uninstall.php +3 -2
- wpml-config.xml +1 -1
assets/css/activation.css
CHANGED
@@ -4,7 +4,6 @@ div.sportspress-message {
|
|
4 |
}
|
5 |
|
6 |
div.sportspress-message a.button-primary,
|
7 |
-
div.sportspress-message a.button-secondary,
|
8 |
p.sportspress-actions input.button-primary,
|
9 |
p.sportspress-actions input.button-primary:active,
|
10 |
p.sportspress-actions a.button-primary,
|
@@ -19,7 +18,6 @@ p.sportspress-actions a.button-primary:active {
|
|
19 |
}
|
20 |
|
21 |
div.sportspress-message a.button-primary:hover,
|
22 |
-
div.sportspress-message a.button-secondary:hover,
|
23 |
p.sportspress-actions input.button-primary:hover,
|
24 |
p.sportspress-actions input.button-primary:focus,
|
25 |
p.sportspress-actions a.button-primary:hover,
|
@@ -32,12 +30,6 @@ p.sportspress-actions a.button-primary:focus {
|
|
32 |
text-decoration: none;
|
33 |
}
|
34 |
|
35 |
-
div.sportspress-message a.button-secondary {
|
36 |
-
-moz-opacity: 0.7;
|
37 |
-
opacity: 0.7;
|
38 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
39 |
-
}
|
40 |
-
|
41 |
.sp-feature a {
|
42 |
text-decoration: none;
|
43 |
}
|
4 |
}
|
5 |
|
6 |
div.sportspress-message a.button-primary,
|
|
|
7 |
p.sportspress-actions input.button-primary,
|
8 |
p.sportspress-actions input.button-primary:active,
|
9 |
p.sportspress-actions a.button-primary,
|
18 |
}
|
19 |
|
20 |
div.sportspress-message a.button-primary:hover,
|
|
|
21 |
p.sportspress-actions input.button-primary:hover,
|
22 |
p.sportspress-actions input.button-primary:focus,
|
23 |
p.sportspress-actions a.button-primary:hover,
|
30 |
text-decoration: none;
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
.sp-feature a {
|
34 |
text-decoration: none;
|
35 |
}
|
assets/css/admin.css
CHANGED
@@ -15,10 +15,15 @@
|
|
15 |
content: "\f328";
|
16 |
}
|
17 |
|
|
|
18 |
.post-state-format.post-format-roster:before, .post-format-icon.post-format-roster:before, a.post-state-format.format-roster:before {
|
19 |
content: "\f307";
|
20 |
}
|
21 |
|
|
|
|
|
|
|
|
|
22 |
.post-state-format.post-format-list:before, .post-format-icon.post-format-list:before, a.post-state-format.format-list:before {
|
23 |
content: "\f163";
|
24 |
}
|
@@ -244,10 +249,6 @@
|
|
244 |
clear: both;
|
245 |
}
|
246 |
|
247 |
-
.sp-data-table-container {
|
248 |
-
overflow-x: scroll;
|
249 |
-
}
|
250 |
-
|
251 |
.sp-data-table-container::-webkit-scrollbar {
|
252 |
height:12px;
|
253 |
}
|
@@ -759,6 +760,14 @@ table.widefat.sp-sortable-table tbody tr .icon {
|
|
759 |
height: 42px;
|
760 |
}
|
761 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
762 |
/* Modules */
|
763 |
.sp-modules-wrapper {
|
764 |
margin-right: 300px;
|
15 |
content: "\f328";
|
16 |
}
|
17 |
|
18 |
+
.post-state-format.post-format-player:before, .post-format-icon.post-format-player:before, a.post-state-format.format-player:before,
|
19 |
.post-state-format.post-format-roster:before, .post-format-icon.post-format-roster:before, a.post-state-format.format-roster:before {
|
20 |
content: "\f307";
|
21 |
}
|
22 |
|
23 |
+
.post-state-format.post-format-team:before, .post-format-icon.post-format-team:before, a.post-state-format.format-team:before {
|
24 |
+
content: "\f334";
|
25 |
+
}
|
26 |
+
|
27 |
.post-state-format.post-format-list:before, .post-format-icon.post-format-list:before, a.post-state-format.format-list:before {
|
28 |
content: "\f163";
|
29 |
}
|
249 |
clear: both;
|
250 |
}
|
251 |
|
|
|
|
|
|
|
|
|
252 |
.sp-data-table-container::-webkit-scrollbar {
|
253 |
height:12px;
|
254 |
}
|
760 |
height: 42px;
|
761 |
}
|
762 |
|
763 |
+
/* Logo */
|
764 |
+
.sp-settings-logo {
|
765 |
+
width: auto;
|
766 |
+
height: auto;
|
767 |
+
max-width: 100%;
|
768 |
+
max-height: 35px;
|
769 |
+
}
|
770 |
+
|
771 |
/* Modules */
|
772 |
.sp-modules-wrapper {
|
773 |
margin-right: 300px;
|
assets/css/menu.css
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
/* SportsPress menu styles */
|
2 |
@font-face {
|
3 |
font-family: 'sportspress';
|
4 |
-
src:url('../fonts/sportspress.eot?
|
5 |
-
src:url('../fonts/sportspress.eot?#
|
6 |
-
url('../fonts/sportspress.woff2?
|
7 |
-
url('../fonts/sportspress.ttf?
|
8 |
-
url('../fonts/sportspress.woff?
|
9 |
-
url('../fonts/sportspress.svg?
|
10 |
font-weight: normal;
|
11 |
font-style: normal;
|
12 |
}
|
@@ -152,6 +152,9 @@
|
|
152 |
.sp-icon-key:before {
|
153 |
content: "\f112";
|
154 |
}
|
|
|
|
|
|
|
155 |
|
156 |
/* Performance Icons */
|
157 |
.sp-icon-card:before {
|
@@ -185,7 +188,8 @@
|
|
185 |
#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before,
|
186 |
#adminmenu #menu-posts-sp_player .menu-icon-sp_player div.wp-menu-image:before,
|
187 |
#adminmenu #menu-posts-sp_staff .menu-icon-sp_staff div.wp-menu-image:before,
|
188 |
-
#sp_formatdiv #post-formats-select .post-format-icon:before
|
|
|
189 |
font-family: sportspress, dashicons;
|
190 |
width: 20px;
|
191 |
text-align: center;
|
1 |
/* SportsPress menu styles */
|
2 |
@font-face {
|
3 |
font-family: 'sportspress';
|
4 |
+
src:url('../fonts/sportspress.eot?wwkd2y');
|
5 |
+
src:url('../fonts/sportspress.eot?#iefixwwkd2y') format('embedded-opentype'),
|
6 |
+
url('../fonts/sportspress.woff2?wwkd2y') format('woff2'),
|
7 |
+
url('../fonts/sportspress.ttf?wwkd2y') format('truetype'),
|
8 |
+
url('../fonts/sportspress.woff?wwkd2y') format('woff'),
|
9 |
+
url('../fonts/sportspress.svg?wwkd2y#sportspress') format('svg');
|
10 |
font-weight: normal;
|
11 |
font-style: normal;
|
12 |
}
|
152 |
.sp-icon-key:before {
|
153 |
content: "\f112";
|
154 |
}
|
155 |
+
.sp-icon-user-scores:before {
|
156 |
+
content: "\f101";
|
157 |
+
}
|
158 |
|
159 |
/* Performance Icons */
|
160 |
.sp-icon-card:before {
|
188 |
#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before,
|
189 |
#adminmenu #menu-posts-sp_player .menu-icon-sp_player div.wp-menu-image:before,
|
190 |
#adminmenu #menu-posts-sp_staff .menu-icon-sp_staff div.wp-menu-image:before,
|
191 |
+
#sp_formatdiv #post-formats-select .post-format-icon:before,
|
192 |
+
#sp_modediv #post-formats-select .post-format-icon:before {
|
193 |
font-family: sportspress, dashicons;
|
194 |
width: 20px;
|
195 |
text-align: center;
|
assets/css/setup.css
ADDED
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.sp-setup-content p,
|
2 |
+
.sp-setup-content table {
|
3 |
+
font-size: 1em;
|
4 |
+
line-height: 1.75em;
|
5 |
+
color: #666;
|
6 |
+
}
|
7 |
+
|
8 |
+
body {
|
9 |
+
margin: 100px auto 24px;
|
10 |
+
box-shadow: none;
|
11 |
+
background: #f1f1f1;
|
12 |
+
padding: 0;
|
13 |
+
}
|
14 |
+
|
15 |
+
#sp-logo {
|
16 |
+
border: 0;
|
17 |
+
margin: 0 0 24px;
|
18 |
+
padding: 0;
|
19 |
+
text-align: center;
|
20 |
+
}
|
21 |
+
|
22 |
+
#sp-logo img {
|
23 |
+
width: auto;
|
24 |
+
height: auto;
|
25 |
+
max-width: 100%;
|
26 |
+
max-height: 50px;
|
27 |
+
}
|
28 |
+
|
29 |
+
.sp-setup-content {
|
30 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, .13);
|
31 |
+
padding: 24px 24px 0;
|
32 |
+
background: #fff;
|
33 |
+
zoom: 1;
|
34 |
+
}
|
35 |
+
|
36 |
+
.sp-setup-content:after {
|
37 |
+
content: "";
|
38 |
+
display: table;
|
39 |
+
clear: both;
|
40 |
+
}
|
41 |
+
|
42 |
+
.sp-setup-content h1,
|
43 |
+
.sp-setup-content h2,
|
44 |
+
.sp-setup-content h3,
|
45 |
+
.sp-setup-content table {
|
46 |
+
margin: 0 0 24px;
|
47 |
+
border: 0;
|
48 |
+
padding: 0;
|
49 |
+
color: #666;
|
50 |
+
clear: none;
|
51 |
+
}
|
52 |
+
|
53 |
+
.sp-setup-content p {
|
54 |
+
margin: 0 0 24px;
|
55 |
+
}
|
56 |
+
|
57 |
+
.sp-setup-content a {
|
58 |
+
color: #00a69c;
|
59 |
+
}
|
60 |
+
|
61 |
+
.sp-setup-content a:focus,
|
62 |
+
.sp-setup-content a:hover {
|
63 |
+
color: #111;
|
64 |
+
}
|
65 |
+
|
66 |
+
.sp-setup-content .form-table {
|
67 |
+
width: 100%;
|
68 |
+
border-top: 1px solid #eee;
|
69 |
+
}
|
70 |
+
|
71 |
+
.sp-setup-content .form-table th {
|
72 |
+
width: 30%;
|
73 |
+
vertical-align: top;
|
74 |
+
font-weight: 700;
|
75 |
+
}
|
76 |
+
|
77 |
+
.sp-setup-content .form-table td {
|
78 |
+
vertical-align: top;
|
79 |
+
}
|
80 |
+
|
81 |
+
.sp-setup-content .form-table td input,
|
82 |
+
.sp-setup-content .form-table td select {
|
83 |
+
width: 100%;
|
84 |
+
box-sizing: border-box;
|
85 |
+
}
|
86 |
+
|
87 |
+
.sp-setup-content .form-table td input[size] {
|
88 |
+
width: auto;
|
89 |
+
}
|
90 |
+
|
91 |
+
.sp-setup-content .form-table td ol,
|
92 |
+
.sp-setup-content .form-table td ul {
|
93 |
+
margin: 0;
|
94 |
+
padding: 0;
|
95 |
+
}
|
96 |
+
|
97 |
+
.sp-setup-content .form-table td ul {
|
98 |
+
list-style: none;
|
99 |
+
}
|
100 |
+
|
101 |
+
.sp-setup-content .form-table td li {
|
102 |
+
margin-bottom: 10px;
|
103 |
+
}
|
104 |
+
|
105 |
+
.sp-setup-content .form-table td li:last-child {
|
106 |
+
margin-bottom: 0;
|
107 |
+
}
|
108 |
+
|
109 |
+
.sp-setup-content .form-table td .description {
|
110 |
+
line-height: 1.5em;
|
111 |
+
display: block;
|
112 |
+
margin: .25em 0 0;
|
113 |
+
color: #999;
|
114 |
+
font-style: italic;
|
115 |
+
}
|
116 |
+
|
117 |
+
.sp-setup-content .form-table td .input-checkbox,
|
118 |
+
.sp-setup-content .form-table td .input-radio {
|
119 |
+
width: auto;
|
120 |
+
box-sizing: inherit;
|
121 |
+
padding: inherit;
|
122 |
+
margin: 0 .5em 0 0;
|
123 |
+
box-shadow: none;
|
124 |
+
}
|
125 |
+
|
126 |
+
.sp-setup-content .form-table .section_title td {
|
127 |
+
padding: 0;
|
128 |
+
}
|
129 |
+
|
130 |
+
.sp-setup-content .form-table .section_title td h2,
|
131 |
+
.sp-setup-content .form-table .section_title td p {
|
132 |
+
margin: 12px 0 0;
|
133 |
+
}
|
134 |
+
|
135 |
+
.sp-setup-content .form-table td,
|
136 |
+
.sp-setup-content .form-table th {
|
137 |
+
padding: 14px 0;
|
138 |
+
margin: 0;
|
139 |
+
border: 0;
|
140 |
+
border-bottom: 1px solid #eee;
|
141 |
+
}
|
142 |
+
|
143 |
+
.sp-setup-content .form-table td:first-child,
|
144 |
+
.sp-setup-content .form-table th:first-child {
|
145 |
+
padding-right: 9px;
|
146 |
+
}
|
147 |
+
|
148 |
+
.sp-setup-content .form-table th .sp-desc-tip {
|
149 |
+
line-height: 1.4;
|
150 |
+
}
|
151 |
+
|
152 |
+
.sp-setup-content .form-table .sp-chosen-container {
|
153 |
+
display: block;
|
154 |
+
}
|
155 |
+
|
156 |
+
.sp-setup-content .form-table .sp-location-picker {
|
157 |
+
width: 100%;
|
158 |
+
height: 320px;
|
159 |
+
margin: 0.5em 0 0;
|
160 |
+
}
|
161 |
+
|
162 |
+
.sp-setup-content .twitter-share-button {
|
163 |
+
float: right;
|
164 |
+
}
|
165 |
+
|
166 |
+
.sp-setup-content .sp-banner {
|
167 |
+
margin: 0 -24px 24px;
|
168 |
+
}
|
169 |
+
|
170 |
+
.sp-setup-content .sp-banner img {
|
171 |
+
display: block;
|
172 |
+
width: auto;
|
173 |
+
height: auto;
|
174 |
+
max-width: 100%;
|
175 |
+
}
|
176 |
+
|
177 |
+
.sp-setup-content .sp-setup-next-steps {
|
178 |
+
overflow: hidden;
|
179 |
+
margin: 0 0 24px;
|
180 |
+
}
|
181 |
+
|
182 |
+
.sp-setup-content .sp-setup-next-steps h2 {
|
183 |
+
margin-bottom: 12px;
|
184 |
+
}
|
185 |
+
|
186 |
+
.sp-setup-content .sp-setup-next-steps .sp-setup-next-steps-first {
|
187 |
+
float: left;
|
188 |
+
width: 50%;
|
189 |
+
box-sizing: border-box;
|
190 |
+
}
|
191 |
+
|
192 |
+
.sp-setup-content .sp-setup-next-steps .sp-setup-next-steps-last {
|
193 |
+
float: right;
|
194 |
+
width: 50%;
|
195 |
+
box-sizing: border-box;
|
196 |
+
}
|
197 |
+
|
198 |
+
.sp-setup-content .sp-setup-next-steps ul {
|
199 |
+
padding: 0 2em 0 0;
|
200 |
+
list-style: none;
|
201 |
+
margin: 0;
|
202 |
+
}
|
203 |
+
|
204 |
+
.sp-setup-content .sp-setup-next-steps ul li .button {
|
205 |
+
display: block;
|
206 |
+
padding: 0 0 .75em;
|
207 |
+
}
|
208 |
+
|
209 |
+
.sp-setup-content .sp-setup-next-steps ul li .button-first-event {
|
210 |
+
background-color: #3bbab3;
|
211 |
+
border-color: #15a29a;
|
212 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
213 |
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
214 |
+
text-shadow: 0 -1px 1px #15a29a, 1px 0 1px #15a29a, 0 1px 1px #15a29a, -1px 0 1px #15a29a;
|
215 |
+
font-size: 1em;
|
216 |
+
height: auto;
|
217 |
+
line-height: 1.75em;
|
218 |
+
margin: 0 0 .75em;
|
219 |
+
opacity: 1;
|
220 |
+
padding: 1em;
|
221 |
+
text-align: center;
|
222 |
+
}
|
223 |
+
|
224 |
+
.sp-setup-content .sp-setup-next-steps ul li .button-first-event:active,
|
225 |
+
.sp-setup-content .sp-setup-next-steps ul li .button-first-event:focus,
|
226 |
+
.sp-setup-content .sp-setup-next-steps ul li .button-first-event:hover {
|
227 |
+
background: #15a29a;
|
228 |
+
border-color: #15a29a;
|
229 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
230 |
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
231 |
+
}
|
232 |
+
|
233 |
+
.sp-setup-content .sp-setup-next-steps ul li a:before {
|
234 |
+
color: #82878c;
|
235 |
+
font: 400 20px/1 dashicons;
|
236 |
+
speak: none;
|
237 |
+
display: inline-block;
|
238 |
+
padding: 0 10px 0 0;
|
239 |
+
top: 1px;
|
240 |
+
position: relative;
|
241 |
+
-webkit-font-smoothing: antialiased;
|
242 |
+
-moz-osx-font-smoothing: grayscale;
|
243 |
+
text-decoration: none!important;
|
244 |
+
vertical-align: top;
|
245 |
+
}
|
246 |
+
|
247 |
+
.sp-setup-content .sp-setup-next-steps ul .learn-more a:before {
|
248 |
+
content: "\f105";
|
249 |
+
}
|
250 |
+
|
251 |
+
.sp-setup-content .sp-setup-next-steps ul .video-walkthrough a:before {
|
252 |
+
content: "\f126";
|
253 |
+
}
|
254 |
+
|
255 |
+
.sp-setup-content .sp-setup-next-steps ul .newsletter a:before {
|
256 |
+
content: "\f465";
|
257 |
+
}
|
258 |
+
|
259 |
+
.sp-setup-content .updated {
|
260 |
+
padding: 24px 24px 0;
|
261 |
+
margin: 0 0 24px;
|
262 |
+
overflow: hidden;
|
263 |
+
background: #f5f5f5;
|
264 |
+
}
|
265 |
+
|
266 |
+
.sp-setup-content .updated p {
|
267 |
+
padding: 0;
|
268 |
+
margin: 0 0 12px;
|
269 |
+
}
|
270 |
+
|
271 |
+
.sp-setup-content .updated p:last-child {
|
272 |
+
margin: 0 0 24px;
|
273 |
+
}
|
274 |
+
|
275 |
+
.sp-setup-steps {
|
276 |
+
padding: 0 0 24px;
|
277 |
+
margin: 0;
|
278 |
+
list-style: none;
|
279 |
+
overflow: hidden;
|
280 |
+
color: #ccc;
|
281 |
+
width: 100%;
|
282 |
+
display: -webkit-inline-flex;
|
283 |
+
display: -ms-inline-flexbox;
|
284 |
+
display: inline-flex;
|
285 |
+
}
|
286 |
+
|
287 |
+
.sp-setup-steps li {
|
288 |
+
width: 20%;
|
289 |
+
float: left;
|
290 |
+
padding: 0 0 .8em;
|
291 |
+
margin: 0;
|
292 |
+
text-align: center;
|
293 |
+
position: relative;
|
294 |
+
border-bottom: 4px solid #ccc;
|
295 |
+
line-height: 1.4em;
|
296 |
+
}
|
297 |
+
|
298 |
+
.sp-setup-steps li:before {
|
299 |
+
content: "";
|
300 |
+
border: 4px solid #ccc;
|
301 |
+
border-radius: 100%;
|
302 |
+
width: 4px;
|
303 |
+
height: 4px;
|
304 |
+
position: absolute;
|
305 |
+
bottom: 0;
|
306 |
+
left: 50%;
|
307 |
+
margin-left: -6px;
|
308 |
+
margin-bottom: -8px;
|
309 |
+
background: #fff;
|
310 |
+
}
|
311 |
+
|
312 |
+
.sp-setup-steps li.active {
|
313 |
+
border-color: #00a69c;
|
314 |
+
color: #00a69c;
|
315 |
+
}
|
316 |
+
|
317 |
+
.sp-setup-steps li.active:before {
|
318 |
+
border-color: #00a69c;
|
319 |
+
}
|
320 |
+
|
321 |
+
.sp-setup-steps li.done {
|
322 |
+
border-color: #00a69c;
|
323 |
+
color: #00a69c;
|
324 |
+
}
|
325 |
+
|
326 |
+
.sp-setup-steps li.done:before {
|
327 |
+
border-color: #00a69c;
|
328 |
+
background: #00a69c;
|
329 |
+
}
|
330 |
+
|
331 |
+
.sp-setup .sp-setup-actions:after {
|
332 |
+
content: "";
|
333 |
+
display: table;
|
334 |
+
clear: both;
|
335 |
+
}
|
336 |
+
|
337 |
+
.sp-setup .sp-setup-actions .button {
|
338 |
+
float: right;
|
339 |
+
font-size: 1.25em;
|
340 |
+
padding: .5em 1em;
|
341 |
+
line-height: 1em;
|
342 |
+
margin-right: .5em;
|
343 |
+
margin-bottom: 2px;
|
344 |
+
height: auto;
|
345 |
+
border-radius: 4px;
|
346 |
+
}
|
347 |
+
|
348 |
+
.sp-setup .sp-setup-actions .button-primary {
|
349 |
+
background-color: #3bbab3;
|
350 |
+
border-color: #15a29a;
|
351 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
352 |
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
353 |
+
text-shadow: 0 -1px 1px #15a29a, 1px 0 1px #15a29a, 0 1px 1px #15a29a, -1px 0 1px #15a29a;
|
354 |
+
float: right;
|
355 |
+
margin: 0 0 0 1em;
|
356 |
+
opacity: 1;
|
357 |
+
}
|
358 |
+
|
359 |
+
.sp-setup .sp-setup-actions .button-primary:active,
|
360 |
+
.sp-setup .sp-setup-actions .button-primary:focus,
|
361 |
+
.sp-setup .sp-setup-actions .button-primary:hover {
|
362 |
+
background: #15a29a;
|
363 |
+
border-color: #15a29a;
|
364 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
365 |
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;
|
366 |
+
}
|
367 |
+
|
368 |
+
.sp-setup .sp-setup-actions .button-muted {
|
369 |
+
border: none;
|
370 |
+
background: transparent;
|
371 |
+
-webkit-box-shadow: none;
|
372 |
+
box-shadow: none;
|
373 |
+
padding: 0;
|
374 |
+
margin: .55em 0.05em 0.65em;
|
375 |
+
color: #ccc;
|
376 |
+
}
|
377 |
+
|
378 |
+
.sp-setup .sp-setup-actions .button-muted:hover {
|
379 |
+
color: #999;
|
380 |
+
}
|
381 |
+
|
382 |
+
.sp-return-to-dashboard {
|
383 |
+
font-size: .85em;
|
384 |
+
margin: 1.18em 0;
|
385 |
+
display: block;
|
386 |
+
text-align: center;
|
387 |
+
}
|
388 |
+
|
389 |
+
.sp-return-to-dashboard a {
|
390 |
+
color: #b5b5b5;
|
391 |
+
}
|
392 |
+
|
393 |
+
.sp-return-to-dashboard a:hover {
|
394 |
+
color: #888;
|
395 |
+
}
|
396 |
+
|
397 |
+
/* Media Queries */
|
398 |
+
|
399 |
+
@media screen and (max-width: 782px) {
|
400 |
+
.sp-setup-content .form-table tbody th {
|
401 |
+
width: auto
|
402 |
+
};
|
403 |
+
}
|
404 |
+
|
405 |
+
@media screen and (min-width: 783px) {
|
406 |
+
.sp-setup-content .form-table td li input {
|
407 |
+
width: 40%;
|
408 |
+
}
|
409 |
+
|
410 |
+
.sp-setup-content .form-table td .player input {
|
411 |
+
width: 40%;
|
412 |
+
}
|
413 |
+
|
414 |
+
.sp-setup-content .form-table td .player .player-number {
|
415 |
+
width: 11%;
|
416 |
+
}
|
417 |
+
|
418 |
+
.sp-setup-content .form-table td .staff .staff-name {
|
419 |
+
width: 52%;
|
420 |
+
}
|
421 |
+
}
|
assets/css/sportspress-style.css
CHANGED
@@ -64,6 +64,15 @@
|
|
64 |
width: 100% !important;
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
/* Links */
|
68 |
|
69 |
.sp-template a,
|
@@ -584,6 +593,10 @@
|
|
584 |
border: 1px solid #e5e5e5 !important;
|
585 |
}
|
586 |
|
|
|
|
|
|
|
|
|
587 |
.sp-tournament-bracket .sp-heading,
|
588 |
.sp-tournament-bracket .sp-heading:hover {
|
589 |
color: #fff !important;
|
@@ -640,6 +653,12 @@
|
|
640 |
border-bottom-color: #00a69c !important;
|
641 |
}
|
642 |
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
/* Post Content */
|
644 |
|
645 |
.single-sp_team .has-post-thumbnail .sp-post-content {
|
64 |
width: 100% !important;
|
65 |
}
|
66 |
|
67 |
+
/* Color Resets */
|
68 |
+
|
69 |
+
.sp-template input,
|
70 |
+
.sp-data-table input,
|
71 |
+
.sp-template .sp-event-logos,
|
72 |
+
.sp-template .sp-event-staff {
|
73 |
+
color: initial !important;
|
74 |
+
}
|
75 |
+
|
76 |
/* Links */
|
77 |
|
78 |
.sp-template a,
|
593 |
border: 1px solid #e5e5e5 !important;
|
594 |
}
|
595 |
|
596 |
+
.sp-tournament-bracket .sp-team-name:hover {
|
597 |
+
border: 1px solid #e5e5e5 !important;
|
598 |
+
}
|
599 |
+
|
600 |
.sp-tournament-bracket .sp-heading,
|
601 |
.sp-tournament-bracket .sp-heading:hover {
|
602 |
color: #fff !important;
|
653 |
border-bottom-color: #00a69c !important;
|
654 |
}
|
655 |
|
656 |
+
/* Messages */
|
657 |
+
.sp-template .sp-message {
|
658 |
+
color: #00a69c !important;
|
659 |
+
border-color: #00a69c !important;
|
660 |
+
}
|
661 |
+
|
662 |
/* Post Content */
|
663 |
|
664 |
.single-sp_team .has-post-thumbnail .sp-post-content {
|
assets/css/sportspress.css
CHANGED
@@ -218,6 +218,13 @@
|
|
218 |
cursor: pointer;
|
219 |
}
|
220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
/* Event Logos */
|
222 |
.sp-event-logos a {
|
223 |
text-decoration: none;
|
218 |
cursor: pointer;
|
219 |
}
|
220 |
|
221 |
+
/* Messages */
|
222 |
+
.sp-message {
|
223 |
+
padding: 1em;
|
224 |
+
border: 1px solid transparent;
|
225 |
+
text-align: center;
|
226 |
+
}
|
227 |
+
|
228 |
/* Event Logos */
|
229 |
.sp-event-logos a {
|
230 |
text-decoration: none;
|
assets/fonts/sportspress.eot
CHANGED
Binary file
|
assets/fonts/sportspress.svg
CHANGED
@@ -7,7 +7,6 @@
|
|
7 |
<font-face units-per-em="512" ascent="480" descent="-32" />
|
8 |
<missing-glyph horiz-adv-x="512" />
|
9 |
<glyph unicode=" " horiz-adv-x="256" d="" />
|
10 |
-
<glyph unicode="" glyph-name="stay_current_landscape" d="M405 320.333h-298v-214h298v214zM22 320.333q0 17 12.5 29.5t29.5 12.5h384q17 0 30-12.5t13-29.5v-214q0-17-13-29.5t-30-12.5h-384q-17 0-30 12.5t-13 29.5z" />
|
11 |
<glyph unicode="" glyph-name="soccer" d="M256 6.4c-127.28 0-230.4 103.12-230.4 230.4s103.12 230.4 230.4 230.4 230.4-103.12 230.4-230.4-103.12-230.4-230.4-230.4zM401.040 381.84c-18.32 18.24-40.080 32.88-65.44 43.6s-51.84 16.16-79.6 16.16-54.24-5.36-79.6-16.16-47.2-25.28-65.44-43.6-32.88-40.080-43.6-65.44-16.16-51.84-16.16-79.6 5.36-54.24 16.16-79.6 25.28-47.2 43.6-65.44c18.32-18.24 40.080-32.88 65.44-43.6s51.84-16.16 79.6-16.16 54.24 5.36 79.6 16.16 47.2 25.36 65.44 43.6c18.24 18.32 32.88 40.080 43.6 65.44s16.16 51.84 16.16 79.6-5.36 54.24-16.16 79.6-25.36 47.2-43.6 65.44zM332.8 134.4l-25.6-64v-5.2c-16.8-5.040-33.84-7.6-51.2-7.6s-34.4 2.56-51.2 7.6v5.2l-25.6 64h-70c-18.96 27.2-29.44 57.2-31.6 90l50.4 38v76.8l-14 6.8c18.64 24 42.16 42.24 70.4 54.8l71.6-36 71.6 36c28.24-12.56 51.6-30.8 70-54.8l-13.6-6.8v-76.8l50.4-38c-2.16-32.8-12.64-62.8-31.6-90h-70zM256 300.8l-64-44 24.4-70.8h79.2l24.4 70.8-64 44z" />
|
12 |
<glyph unicode="" glyph-name="baseball" d="M371.52 96.32c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0-0.080 0.080-0.080 0.080s0 0 0 0 0 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080-0.080 0.080-0.16 0.16v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080v0c-0.080 0.080-0.16 0.16-0.24 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32v0c-0.88 0.96-1.76 2-2.56 2.96l5.36 4.48c-4.96 6-9.6 12.32-13.76 18.88l-6.48-4.32c-1.36 2-2.64 4.080-3.92 6.16v0c0 0 0 0.080-0.080 0.080 0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.32 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s0 0.080 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.4 0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.080s0 0 0 0c-0.080 0.16-0.16 0.24-0.24 0.4 0 0 0 0 0 0-2.96 4.96-5.68 10.080-8.16 15.36l7.52 3.6c-2.8 6.24-5.36 12.64-7.52 19.2l-7.92-2.72c-1.68 4.96-3.2 10-4.56 15.040 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0-0.56 2.56-1.12 5.2-1.6 7.84l8.56 1.6c-1.12 6.48-1.92 13.040-2.4 19.68l-6.88-0.48v28.48l6.88-0.48c0.48 6.64 1.28 13.2 2.4 19.68l-8.56 1.6c0.48 2.64 1.040 5.28 1.6 7.84 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16v0c0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 1.28 5.12 2.8 10.16 4.56 15.040l7.92-2.72c2.16 6.56 4.64 12.96 7.52 19.2l-7.52 3.6c2.48 5.28 5.2 10.4 8.16 15.36 0 0 0 0 0 0 0.080 0.16 0.16 0.24 0.24 0.4 0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.080s0 0 0 0c0.080 0.080 0.16 0.24 0.24 0.4 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.16v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0.080 0.080 0.080c0 0 0 0.080 0.080 0.080 0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0 0 0c0 0.080 0.080 0.080 0.080 0.16 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.24 0.32 0 0 0 0 0 0s0 0.080 0.080 0.080v0c1.28 2.080 2.56 4.080 3.92 6.16l6.48-4.32c4.24 6.56 8.8 12.88 13.76 18.88l-5.36 4.48c0.88 1.040 1.68 2 2.56 2.96v0c0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.24 0.24v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080v0c0.080 0.080 0.080 0.080 0.16 0.16 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 3.44 3.68 7.040 7.2 10.72 10.64-33.76 30.56-77.92 48.4-126.24 48.4s-92.48-17.84-126.24-47.28c3.68-3.36 7.28-6.96 10.72-10.64 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080v0c0.080-0.080 0.080-0.080 0.16-0.16v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080v0c0.080-0.080 0.16-0.16 0.24-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32v0c0.88-0.96 1.76-2 2.56-2.96l-5.36-4.48c4.96-6 9.6-12.32 13.76-18.88l6.48 4.32c1.36-2 2.64-4.080 3.92-6.16v0c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.32 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.4 0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.080s0 0 0 0c0.080-0.16 0.16-0.24 0.24-0.4 0 0 0 0 0 0 2.96-4.96 5.68-10.080 8.16-15.36l-7.52-3.6c2.8-6.24 5.36-12.64 7.52-19.2l7.92 2.72c1.68-4.96 3.2-10 4.56-15.040 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32v0c0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0.56-2.56 1.12-5.2 1.6-7.84l-8.56-1.6c1.12-6.48 1.92-13.040 2.4-19.68l6.88 0.48v-28.48l-6.88 0.48c-0.48-6.64-1.28-13.2-2.4-19.68l8.56-1.6c-0.48-2.64-1.040-5.28-1.6-7.84 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0-1.28-5.12-2.8-10.16-4.56-15.040l-7.92 2.72c-2.16-6.56-4.64-12.96-7.52-19.2l7.52-3.6c-2.48-5.28-5.2-10.4-8.16-15.36 0 0 0 0 0 0-0.080-0.16-0.16-0.24-0.24-0.4 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.080s0 0 0 0c-0.080-0.080-0.16-0.24-0.24-0.4 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0-0.080-0.080-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.24-0.32 0 0 0 0 0 0s0-0.080-0.080-0.080v0c-1.28-2.080-2.56-4.080-3.92-6.16l-6.48 4.32c-4.24-6.56-8.8-12.88-13.76-18.88l5.36-4.48c-0.88-1.040-1.68-2-2.56-2.96v0c-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.24-0.24v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080v0c-0.080-0.080-0.080-0.080-0.16-0.16v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s0 0-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0-0.080-0.080 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-3.44-3.68-7.040-7.2-10.72-10.64 33.76-30.56 77.92-48.4 126.24-48.4s92.48 17.84 126.24 47.28c-3.76 3.44-7.28 6.96-10.72 10.64v0zM144.72 134l-6.8 4.56c4.56 6.72 8.64 13.92 12.080 21.28l6.96-3.28c0.64 1.36 1.2 2.72 1.76 4.080 1.92 4.56 3.68 9.2 5.2 13.84l-7.2 2.48c2.64 7.68 4.72 15.6 6.24 23.6l7.2-1.36c1.040 6.080 1.76 12.16 2.24 18.32l-7.2 0.56c0.32 4.080 0.4 8.16 0.4 12.24s-0.16 8.16-0.4 12.24l7.2 0.56c-0.4 6.16-1.2 12.32-2.24 18.32l-7.2-1.36c-1.44 8-3.6 15.92-6.24 23.6l7.2 2.48c-1.52 4.64-3.28 9.28-5.2 13.84-0.56 1.36-1.2 2.72-1.76 4.080l-6.96-3.28c-3.44 7.36-7.52 14.48-12.080 21.28l6.8 4.56c-3.92 6.16-8.24 12.080-12.96 17.76l-6.88-5.84c-4.72 5.6-9.84 10.96-15.28 15.84-28.48-33.28-45.6-76.64-45.6-124s17.12-90.72 45.52-124.16c5.44 4.96 10.56 10.24 15.28 15.84l6.88-5.84c4.8 5.68 9.12 11.6 13.040 17.76v0zM402.48 354.56c-5.44-4.96-10.56-10.24-15.28-15.84l-6.88 5.84c-4.72-5.68-9.040-11.6-12.96-17.76l6.8-4.56c-4.56-6.72-8.64-13.92-12.080-21.28l-6.96 3.28c-0.64-1.36-1.2-2.72-1.76-4.080-1.92-4.56-3.68-9.2-5.2-13.84l7.2-2.48c-2.64-7.68-4.72-15.6-6.24-23.6l-7.2 1.36c-1.040-6.080-1.76-12.16-2.24-18.32l7.2-0.56c-0.32-4.080-0.4-8.16-0.4-12.24s0.16-8.16 0.4-12.24l-7.2-0.56c0.4-6.16 1.2-12.32 2.24-18.32l7.2 1.36c1.44-8 3.6-15.92 6.24-23.6l-7.2-2.48c1.52-4.64 3.28-9.28 5.2-13.84 0.56-1.36 1.2-2.72 1.76-4.080l6.96 3.28c3.44-7.36 7.52-14.48 12.080-21.28l-6.8-4.56c3.92-6.16 8.24-12.080 12.96-17.76l6.88 5.84c4.72-5.6 9.84-10.96 15.28-15.84 28.4 33.44 45.52 76.8 45.52 124.16s-17.12 90.56-45.52 124z" />
|
13 |
<glyph unicode="" glyph-name="basketball" d="M460.4 256c-2.8 42.080-19.12 80.4-44.64 110.72-3.040-2.56-5.92-5.28-8.72-8.16-27.76-27.76-44.32-63.84-47.28-102.56h100.64zM395.6 387.36c-30.8 27.12-70.4 44.56-114 47.44v-178.8h49.2c3.44 52.24 27.84 98.8 64.8 131.36zM130.64 358.56c-2.8 2.8-5.76 5.52-8.72 8.16-25.6-30.32-41.92-68.64-44.72-110.72h100.64c-2.96 38.8-19.44 74.8-47.2 102.56zM206.8 256h49.2v178.8c-43.6-2.88-83.2-20.24-114-47.44 36.96-32.56 61.36-79.12 64.8-131.36zM407.040 127.76c2.8-2.8 5.76-5.52 8.72-8.16 25.52 30.32 41.84 68.72 44.64 110.72h-100.72c3.040-38.72 19.52-74.72 47.36-102.56zM330.8 230.4h-49.2v-178.8c43.6 2.88 83.2 20.24 114 47.44-36.96 32.56-61.36 79.12-64.8 131.36zM77.2 230.4c2.8-42.080 19.040-80.4 44.64-110.72 3.040 2.56 5.92 5.28 8.72 8.16 27.76 27.76 44.32 63.84 47.28 102.64 0.080-0.080-100.64-0.080-100.64-0.080zM142 99.040c30.8-27.12 70.4-44.56 114-47.44v178.8h-49.2c-3.44-52.24-27.84-98.8-64.8-131.36z" />
|
@@ -20,6 +19,7 @@
|
|
20 |
<glyph unicode="" glyph-name="baseball-icon" d="M256 25.6c-113.12 0-204.8 91.68-204.8 204.8s91.68 204.8 204.8 204.8 204.8-91.68 204.8-204.8-91.68-204.8-204.8-204.8zM76.8 230.4c0-48.8 19.52-93.040 51.12-125.28 31.68 32.32 51.28 76.48 51.28 125.28s-19.6 93.040-51.28 125.28c-31.6-32.24-51.12-76.48-51.12-125.28zM147.2 372.72c35.68-36.88 57.6-87.040 57.6-142.32s-22-105.52-57.6-142.32c30.16-23.12 67.92-36.88 108.8-36.88s78.64 13.76 108.8 36.88c-35.68 36.88-57.6 87.040-57.6 142.32s22 105.52 57.6 142.32c-30.16 23.12-67.84 36.88-108.8 36.88s-78.64-13.76-108.8-36.88zM384.080 355.68c-31.68-32.24-51.28-76.48-51.28-125.28s19.6-93.040 51.28-125.28c31.6 32.32 51.12 76.56 51.12 125.28s-19.52 93.040-51.12 125.28z" />
|
21 |
<glyph unicode="" glyph-name="shoe" d="M461.52 280.88l-21.2-20c-0.96-0.96-2.56-1.12-3.68-0.24l-27.040 19.84c4.080 4.24 8.4 8.48 13.36 13.2 3.36 3.2 6.4 6.080 9.6 8.88 2.8 2.56 5.36 4.88 7.76 7.28 1.28 1.2 2.56 2.4 3.84 3.6l17.84-28.96c0.72-1.2 0.48-2.72-0.48-3.6zM432.64 318.080c-5.040-4.8-10.96-10-17.36-16.080-4.56-4.24-9.28-8.88-14.16-14-22.8-24.080-189.76-191.36-224-223.6-34.24-32.4-94.64-54.96-120.32-27.68-25.68 27.2 24.080 72.24 39.84 119.44 15.76 47.28 59.36 108.4 59.36 108.4-6.64 13.92 5.2 26.88 9.84 31.28 1.040 1.040 1.76 1.52 1.76 1.52-8.16 16.16 13.44 36.56 13.44 36.56l17.36 94.88c0.32 1.76 1.12 3.28 2.32 4.32 1.76 1.68 4.32 2.48 6.88 2l38.16-6.72c25.12-4.56-9.92-70.56 0.96-70.72 6.96-0.16 20.24 5.28 32.96 17.28 7.12 6.72 14.080 15.6 19.6 26.64 11.44 22.88-12.72 46.96-4.56 54.72 2.72 2.64 9.44 3.36 22.48 1.6 51.6-7.76 92.8-59.040 121.44-90.24 19.44-21.2 12.24-32.4-6-49.6zM165.28 232.16l-16-26c-1.2-1.84 0.16-4.32 2.48-4.32l114.72 1.6c0.64 0.080 1.36 0.24 1.92 0.8l28.32 26.72c1.92 1.84 0.56 5.040-1.92 4.96l-127.2-2.48c-0.88 0.080-1.76-0.48-2.32-1.28zM351.84 290l-156-4.64c-0.96-0.080-1.84-0.56-2.32-1.36l-15.92-25.92c-1.2-2 0.24-4.4 2.56-4.4l141.68 2.64c0.64 0.080 1.36 0.24 1.92 0.8l30.24 27.76c1.76 1.92 0.4 5.12-2.16 5.12zM195.52 26.32c0.72-1.2 0.48-2.72-0.48-3.6l-21.2-20c-0.96-0.96-2.56-1.12-3.68-0.24l-29.28 21.52c-0.56 0.48-0.96 1.12-1.040 2.080 14.32 6.64 28.16 15.52 40 25.68l15.68-25.44zM228 98.24l16.16-26.080c0.72-1.2 0.48-2.72-0.48-3.6l-21.2-20c-0.96-0.96-2.56-1.12-3.68-0.24l-23.76 17.6c8.48 8.16 19.84 19.36 32.96 32.32zM405.68 230.72c0.72-1.2 0.48-2.72-0.48-3.6l-21.2-20.080c-0.96-0.96-2.56-1.12-3.68-0.24l-25.040 18.56c12.56 12.56 23.92 24 33.040 33.28l17.36-27.92z" />
|
22 |
<glyph unicode="" glyph-name="card" d="M153.6 435.2h204.8c14.16 0 25.6-11.44 25.6-25.6v-358.4c0-14.16-11.44-25.6-25.6-25.6h-204.8c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6z" />
|
|
|
23 |
<glyph unicode="" glyph-name="copy" d="M179.2 205.2h-76.8v204.8h153.6v-77.6h51.2v111.2c0 6.16-11.44 17.6-25.6 17.6h-204.8c-14.16 0-25.6-11.44-25.6-25.6v-256c0-14.16 11.44-25.6 25.6-25.6h102.4v51.2zM256 50.8h153.6v204.8h-153.6v-204.8zM435.2 306.8c14.16 0 25.6-11.44 25.6-25.6v-256c0-14.16-11.44-25.6-25.6-25.6h-204.8c-14.16 0-25.6 11.44-25.6 25.6v256c0 14.16 11.44 25.6 25.6 25.6h204.8z" />
|
24 |
<glyph unicode="" glyph-name="calculator" d="M409.6 435.2h-307.2c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h307.2c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM179.2 76.8h-51.2v51.2h51.2v-51.2zM179.2 153.6h-51.2v51.2h51.2v-51.2zM179.2 230.4h-51.2v51.2h51.2v-51.2zM281.6 76.8h-51.2v51.2h51.2v-51.2zM281.6 153.6h-51.2v51.2h51.2v-51.2zM281.6 230.4h-51.2v51.2h51.2v-51.2zM384 76.8h-51.2v51.2h51.2v-51.2zM384 153.6h-51.2v51.2h51.2v-51.2zM384 230.4h-51.2v51.2h51.2v-51.2zM384 332.8h-256v51.2h256v-51.2z" />
|
25 |
<glyph unicode="" glyph-name="sportspress" d="M484.88 328.96l-30.72-222.64c-7.68-54.32-36.72-80.64-92.72-80.64h-264.32c-55.92 0-77.84 26.32-70.16 80.64l30.72 222.64c8.24 54.32 37.28 80.64 93.2 80.64h264.32c56-0.080 77.92-26.4 69.68-80.64zM206.88 359.040c-42.88 0-67.44-30.080-73.28-74.48l-4.88-36c-6.32-44.4 10.4-69.68 53.36-69.68h100.16c13.52 0 11.2-11.84 11.2-11.84-1.44-8.8-6.32-13.2-15.12-13.2h-166.96l-10.080-76.96h201.6c42.88 0 65.84 20.48 72.16 64.88l7.28 49.6c6.32 44.4-10.72 64.88-53.6 64.88h-100.72c-8.8 0-12.64 4.4-11.68 13.2 0 0-0.56 11.84 14.8 11.84h166.4l10.88 77.76h-201.52z" />
|
7 |
<font-face units-per-em="512" ascent="480" descent="-32" />
|
8 |
<missing-glyph horiz-adv-x="512" />
|
9 |
<glyph unicode=" " horiz-adv-x="256" d="" />
|
|
|
10 |
<glyph unicode="" glyph-name="soccer" d="M256 6.4c-127.28 0-230.4 103.12-230.4 230.4s103.12 230.4 230.4 230.4 230.4-103.12 230.4-230.4-103.12-230.4-230.4-230.4zM401.040 381.84c-18.32 18.24-40.080 32.88-65.44 43.6s-51.84 16.16-79.6 16.16-54.24-5.36-79.6-16.16-47.2-25.28-65.44-43.6-32.88-40.080-43.6-65.44-16.16-51.84-16.16-79.6 5.36-54.24 16.16-79.6 25.28-47.2 43.6-65.44c18.32-18.24 40.080-32.88 65.44-43.6s51.84-16.16 79.6-16.16 54.24 5.36 79.6 16.16 47.2 25.36 65.44 43.6c18.24 18.32 32.88 40.080 43.6 65.44s16.16 51.84 16.16 79.6-5.36 54.24-16.16 79.6-25.36 47.2-43.6 65.44zM332.8 134.4l-25.6-64v-5.2c-16.8-5.040-33.84-7.6-51.2-7.6s-34.4 2.56-51.2 7.6v5.2l-25.6 64h-70c-18.96 27.2-29.44 57.2-31.6 90l50.4 38v76.8l-14 6.8c18.64 24 42.16 42.24 70.4 54.8l71.6-36 71.6 36c28.24-12.56 51.6-30.8 70-54.8l-13.6-6.8v-76.8l50.4-38c-2.16-32.8-12.64-62.8-31.6-90h-70zM256 300.8l-64-44 24.4-70.8h79.2l24.4 70.8-64 44z" />
|
11 |
<glyph unicode="" glyph-name="baseball" d="M371.52 96.32c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0-0.080 0.080-0.080 0.080s0 0 0 0 0 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080-0.080 0.080-0.16 0.16v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080v0c-0.080 0.080-0.16 0.16-0.24 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32v0c-0.88 0.96-1.76 2-2.56 2.96l5.36 4.48c-4.96 6-9.6 12.32-13.76 18.88l-6.48-4.32c-1.36 2-2.64 4.080-3.92 6.16v0c0 0 0 0.080-0.080 0.080 0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.32 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s0 0.080 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.4 0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.080s0 0 0 0c-0.080 0.16-0.16 0.24-0.24 0.4 0 0 0 0 0 0-2.96 4.96-5.68 10.080-8.16 15.36l7.52 3.6c-2.8 6.24-5.36 12.64-7.52 19.2l-7.92-2.72c-1.68 4.96-3.2 10-4.56 15.040 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0-0.56 2.56-1.12 5.2-1.6 7.84l8.56 1.6c-1.12 6.48-1.92 13.040-2.4 19.68l-6.88-0.48v28.48l6.88-0.48c0.48 6.64 1.28 13.2 2.4 19.68l-8.56 1.6c0.48 2.64 1.040 5.28 1.6 7.84 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16v0c0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 1.28 5.12 2.8 10.16 4.56 15.040l7.92-2.72c2.16 6.56 4.64 12.96 7.52 19.2l-7.52 3.6c2.48 5.28 5.2 10.4 8.16 15.36 0 0 0 0 0 0 0.080 0.16 0.16 0.24 0.24 0.4 0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.080s0 0 0 0c0.080 0.080 0.16 0.24 0.24 0.4 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.16v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0.080 0.080 0.080c0 0 0 0.080 0.080 0.080 0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0 0 0c0 0.080 0.080 0.080 0.080 0.16 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.24 0.32 0 0 0 0 0 0s0 0.080 0.080 0.080v0c1.28 2.080 2.56 4.080 3.92 6.16l6.48-4.32c4.24 6.56 8.8 12.88 13.76 18.88l-5.36 4.48c0.88 1.040 1.68 2 2.56 2.96v0c0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.24 0.24v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080v0c0.080 0.080 0.080 0.080 0.16 0.16 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 3.44 3.68 7.040 7.2 10.72 10.64-33.76 30.56-77.92 48.4-126.24 48.4s-92.48-17.84-126.24-47.28c3.68-3.36 7.28-6.96 10.72-10.64 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080v0c0.080-0.080 0.080-0.080 0.16-0.16v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080v0c0.080-0.080 0.16-0.16 0.24-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32v0c0.88-0.96 1.76-2 2.56-2.96l-5.36-4.48c4.96-6 9.6-12.32 13.76-18.88l6.48 4.32c1.36-2 2.64-4.080 3.92-6.16v0c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.32 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.4 0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.080s0 0 0 0c0.080-0.16 0.16-0.24 0.24-0.4 0 0 0 0 0 0 2.96-4.96 5.68-10.080 8.16-15.36l-7.52-3.6c2.8-6.24 5.36-12.64 7.52-19.2l7.92 2.72c1.68-4.96 3.2-10 4.56-15.040 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32v0c0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0.56-2.56 1.12-5.2 1.6-7.84l-8.56-1.6c1.12-6.48 1.92-13.040 2.4-19.68l6.88 0.48v-28.48l-6.88 0.48c-0.48-6.64-1.28-13.2-2.4-19.68l8.56-1.6c-0.48-2.64-1.040-5.28-1.6-7.84 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0-1.28-5.12-2.8-10.16-4.56-15.040l-7.92 2.72c-2.16-6.56-4.64-12.96-7.52-19.2l7.52-3.6c-2.48-5.28-5.2-10.4-8.16-15.36 0 0 0 0 0 0-0.080-0.16-0.16-0.24-0.24-0.4 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.080s0 0 0 0c-0.080-0.080-0.16-0.24-0.24-0.4 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0-0.080-0.080-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.24-0.32 0 0 0 0 0 0s0-0.080-0.080-0.080v0c-1.28-2.080-2.56-4.080-3.92-6.16l-6.48 4.32c-4.24-6.56-8.8-12.88-13.76-18.88l5.36-4.48c-0.88-1.040-1.68-2-2.56-2.96v0c-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.24-0.24v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080v0c-0.080-0.080-0.080-0.080-0.16-0.16v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s0 0-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0-0.080-0.080 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-3.44-3.68-7.040-7.2-10.72-10.64 33.76-30.56 77.92-48.4 126.24-48.4s92.48 17.84 126.24 47.28c-3.76 3.44-7.28 6.96-10.72 10.64v0zM144.72 134l-6.8 4.56c4.56 6.72 8.64 13.92 12.080 21.28l6.96-3.28c0.64 1.36 1.2 2.72 1.76 4.080 1.92 4.56 3.68 9.2 5.2 13.84l-7.2 2.48c2.64 7.68 4.72 15.6 6.24 23.6l7.2-1.36c1.040 6.080 1.76 12.16 2.24 18.32l-7.2 0.56c0.32 4.080 0.4 8.16 0.4 12.24s-0.16 8.16-0.4 12.24l7.2 0.56c-0.4 6.16-1.2 12.32-2.24 18.32l-7.2-1.36c-1.44 8-3.6 15.92-6.24 23.6l7.2 2.48c-1.52 4.64-3.28 9.28-5.2 13.84-0.56 1.36-1.2 2.72-1.76 4.080l-6.96-3.28c-3.44 7.36-7.52 14.48-12.080 21.28l6.8 4.56c-3.92 6.16-8.24 12.080-12.96 17.76l-6.88-5.84c-4.72 5.6-9.84 10.96-15.28 15.84-28.48-33.28-45.6-76.64-45.6-124s17.12-90.72 45.52-124.16c5.44 4.96 10.56 10.24 15.28 15.84l6.88-5.84c4.8 5.68 9.12 11.6 13.040 17.76v0zM402.48 354.56c-5.44-4.96-10.56-10.24-15.28-15.84l-6.88 5.84c-4.72-5.68-9.040-11.6-12.96-17.76l6.8-4.56c-4.56-6.72-8.64-13.92-12.080-21.28l-6.96 3.28c-0.64-1.36-1.2-2.72-1.76-4.080-1.92-4.56-3.68-9.2-5.2-13.84l7.2-2.48c-2.64-7.68-4.72-15.6-6.24-23.6l-7.2 1.36c-1.040-6.080-1.76-12.16-2.24-18.32l7.2-0.56c-0.32-4.080-0.4-8.16-0.4-12.24s0.16-8.16 0.4-12.24l-7.2-0.56c0.4-6.16 1.2-12.32 2.24-18.32l7.2 1.36c1.44-8 3.6-15.92 6.24-23.6l-7.2-2.48c1.52-4.64 3.28-9.28 5.2-13.84 0.56-1.36 1.2-2.72 1.76-4.080l6.96 3.28c3.44-7.36 7.52-14.48 12.080-21.28l-6.8-4.56c3.92-6.16 8.24-12.080 12.96-17.76l6.88 5.84c4.72-5.6 9.84-10.96 15.28-15.84 28.4 33.44 45.52 76.8 45.52 124.16s-17.12 90.56-45.52 124z" />
|
12 |
<glyph unicode="" glyph-name="basketball" d="M460.4 256c-2.8 42.080-19.12 80.4-44.64 110.72-3.040-2.56-5.92-5.28-8.72-8.16-27.76-27.76-44.32-63.84-47.28-102.56h100.64zM395.6 387.36c-30.8 27.12-70.4 44.56-114 47.44v-178.8h49.2c3.44 52.24 27.84 98.8 64.8 131.36zM130.64 358.56c-2.8 2.8-5.76 5.52-8.72 8.16-25.6-30.32-41.92-68.64-44.72-110.72h100.64c-2.96 38.8-19.44 74.8-47.2 102.56zM206.8 256h49.2v178.8c-43.6-2.88-83.2-20.24-114-47.44 36.96-32.56 61.36-79.12 64.8-131.36zM407.040 127.76c2.8-2.8 5.76-5.52 8.72-8.16 25.52 30.32 41.84 68.72 44.64 110.72h-100.72c3.040-38.72 19.52-74.72 47.36-102.56zM330.8 230.4h-49.2v-178.8c43.6 2.88 83.2 20.24 114 47.44-36.96 32.56-61.36 79.12-64.8 131.36zM77.2 230.4c2.8-42.080 19.040-80.4 44.64-110.72 3.040 2.56 5.92 5.28 8.72 8.16 27.76 27.76 44.32 63.84 47.28 102.64 0.080-0.080-100.64-0.080-100.64-0.080zM142 99.040c30.8-27.12 70.4-44.56 114-47.44v178.8h-49.2c-3.44-52.24-27.84-98.8-64.8-131.36z" />
|
19 |
<glyph unicode="" glyph-name="baseball-icon" d="M256 25.6c-113.12 0-204.8 91.68-204.8 204.8s91.68 204.8 204.8 204.8 204.8-91.68 204.8-204.8-91.68-204.8-204.8-204.8zM76.8 230.4c0-48.8 19.52-93.040 51.12-125.28 31.68 32.32 51.28 76.48 51.28 125.28s-19.6 93.040-51.28 125.28c-31.6-32.24-51.12-76.48-51.12-125.28zM147.2 372.72c35.68-36.88 57.6-87.040 57.6-142.32s-22-105.52-57.6-142.32c30.16-23.12 67.92-36.88 108.8-36.88s78.64 13.76 108.8 36.88c-35.68 36.88-57.6 87.040-57.6 142.32s22 105.52 57.6 142.32c-30.16 23.12-67.84 36.88-108.8 36.88s-78.64-13.76-108.8-36.88zM384.080 355.68c-31.68-32.24-51.28-76.48-51.28-125.28s19.6-93.040 51.28-125.28c31.6 32.32 51.12 76.56 51.12 125.28s-19.52 93.040-51.12 125.28z" />
|
20 |
<glyph unicode="" glyph-name="shoe" d="M461.52 280.88l-21.2-20c-0.96-0.96-2.56-1.12-3.68-0.24l-27.040 19.84c4.080 4.24 8.4 8.48 13.36 13.2 3.36 3.2 6.4 6.080 9.6 8.88 2.8 2.56 5.36 4.88 7.76 7.28 1.28 1.2 2.56 2.4 3.84 3.6l17.84-28.96c0.72-1.2 0.48-2.72-0.48-3.6zM432.64 318.080c-5.040-4.8-10.96-10-17.36-16.080-4.56-4.24-9.28-8.88-14.16-14-22.8-24.080-189.76-191.36-224-223.6-34.24-32.4-94.64-54.96-120.32-27.68-25.68 27.2 24.080 72.24 39.84 119.44 15.76 47.28 59.36 108.4 59.36 108.4-6.64 13.92 5.2 26.88 9.84 31.28 1.040 1.040 1.76 1.52 1.76 1.52-8.16 16.16 13.44 36.56 13.44 36.56l17.36 94.88c0.32 1.76 1.12 3.28 2.32 4.32 1.76 1.68 4.32 2.48 6.88 2l38.16-6.72c25.12-4.56-9.92-70.56 0.96-70.72 6.96-0.16 20.24 5.28 32.96 17.28 7.12 6.72 14.080 15.6 19.6 26.64 11.44 22.88-12.72 46.96-4.56 54.72 2.72 2.64 9.44 3.36 22.48 1.6 51.6-7.76 92.8-59.040 121.44-90.24 19.44-21.2 12.24-32.4-6-49.6zM165.28 232.16l-16-26c-1.2-1.84 0.16-4.32 2.48-4.32l114.72 1.6c0.64 0.080 1.36 0.24 1.92 0.8l28.32 26.72c1.92 1.84 0.56 5.040-1.92 4.96l-127.2-2.48c-0.88 0.080-1.76-0.48-2.32-1.28zM351.84 290l-156-4.64c-0.96-0.080-1.84-0.56-2.32-1.36l-15.92-25.92c-1.2-2 0.24-4.4 2.56-4.4l141.68 2.64c0.64 0.080 1.36 0.24 1.92 0.8l30.24 27.76c1.76 1.92 0.4 5.12-2.16 5.12zM195.52 26.32c0.72-1.2 0.48-2.72-0.48-3.6l-21.2-20c-0.96-0.96-2.56-1.12-3.68-0.24l-29.28 21.52c-0.56 0.48-0.96 1.12-1.040 2.080 14.32 6.64 28.16 15.52 40 25.68l15.68-25.44zM228 98.24l16.16-26.080c0.72-1.2 0.48-2.72-0.48-3.6l-21.2-20c-0.96-0.96-2.56-1.12-3.68-0.24l-23.76 17.6c8.48 8.16 19.84 19.36 32.96 32.32zM405.68 230.72c0.72-1.2 0.48-2.72-0.48-3.6l-21.2-20.080c-0.96-0.96-2.56-1.12-3.68-0.24l-25.040 18.56c12.56 12.56 23.92 24 33.040 33.28l17.36-27.92z" />
|
21 |
<glyph unicode="" glyph-name="card" d="M153.6 435.2h204.8c14.16 0 25.6-11.44 25.6-25.6v-358.4c0-14.16-11.44-25.6-25.6-25.6h-204.8c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6z" />
|
22 |
+
<glyph unicode="" glyph-name="user-scores" d="M153.6 256h204.8v-51.2h-204.8v51.2zM153.6 332.8h204.8v-51.2h-204.8v51.2zM435.2 435.2h-358.4c-14.16 0-25.6-11.44-25.6-25.6v-281.6c0-14.16 11.44-25.6 25.6-25.6h51.2v-76.8l115.2 76.8h192c14.16 0 25.6 11.44 25.6 25.6v281.6c0 14.16-11.44 25.6-25.6 25.6zM409.6 153.6h-166.4l-64-38.4v38.4h-76.8v230.4h307.2v-230.4z" />
|
23 |
<glyph unicode="" glyph-name="copy" d="M179.2 205.2h-76.8v204.8h153.6v-77.6h51.2v111.2c0 6.16-11.44 17.6-25.6 17.6h-204.8c-14.16 0-25.6-11.44-25.6-25.6v-256c0-14.16 11.44-25.6 25.6-25.6h102.4v51.2zM256 50.8h153.6v204.8h-153.6v-204.8zM435.2 306.8c14.16 0 25.6-11.44 25.6-25.6v-256c0-14.16-11.44-25.6-25.6-25.6h-204.8c-14.16 0-25.6 11.44-25.6 25.6v256c0 14.16 11.44 25.6 25.6 25.6h204.8z" />
|
24 |
<glyph unicode="" glyph-name="calculator" d="M409.6 435.2h-307.2c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h307.2c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM179.2 76.8h-51.2v51.2h51.2v-51.2zM179.2 153.6h-51.2v51.2h51.2v-51.2zM179.2 230.4h-51.2v51.2h51.2v-51.2zM281.6 76.8h-51.2v51.2h51.2v-51.2zM281.6 153.6h-51.2v51.2h51.2v-51.2zM281.6 230.4h-51.2v51.2h51.2v-51.2zM384 76.8h-51.2v51.2h51.2v-51.2zM384 153.6h-51.2v51.2h51.2v-51.2zM384 230.4h-51.2v51.2h51.2v-51.2zM384 332.8h-256v51.2h256v-51.2z" />
|
25 |
<glyph unicode="" glyph-name="sportspress" d="M484.88 328.96l-30.72-222.64c-7.68-54.32-36.72-80.64-92.72-80.64h-264.32c-55.92 0-77.84 26.32-70.16 80.64l30.72 222.64c8.24 54.32 37.28 80.64 93.2 80.64h264.32c56-0.080 77.92-26.4 69.68-80.64zM206.88 359.040c-42.88 0-67.44-30.080-73.28-74.48l-4.88-36c-6.32-44.4 10.4-69.68 53.36-69.68h100.16c13.52 0 11.2-11.84 11.2-11.84-1.44-8.8-6.32-13.2-15.12-13.2h-166.96l-10.080-76.96h201.6c42.88 0 65.84 20.48 72.16 64.88l7.28 49.6c6.32 44.4-10.72 64.88-53.6 64.88h-100.72c-8.8 0-12.64 4.4-11.68 13.2 0 0-0.56 11.84 14.8 11.84h166.4l10.88 77.76h-201.52z" />
|
assets/fonts/sportspress.ttf
CHANGED
Binary file
|
assets/fonts/sportspress.woff
CHANGED
Binary file
|
assets/fonts/sportspress.woff2
CHANGED
Binary file
|
assets/images/modules/sportspress-pro.png
CHANGED
Binary file
|
assets/images/modules/sportspress.png
CHANGED
Binary file
|
assets/images/welcome/screenshot-player-vs-player.png
ADDED
Binary file
|
assets/images/welcome/screenshot-send-offs.png
ADDED
Binary file
|
assets/images/welcome/screenshot-setup-wizard.png
ADDED
Binary file
|
assets/images/welcome/screenshot-team-vs-team.png
ADDED
Binary file
|
assets/images/welcome/screenshot-user-registration.png
ADDED
Binary file
|
assets/images/welcome/screenshot-user-scores-admin.png
ADDED
Binary file
|
assets/images/welcome/screenshot-user-scores-frontend.png
ADDED
Binary file
|
assets/js/admin/sportspress-admin.js
CHANGED
@@ -762,8 +762,8 @@ jQuery(document).ready(function($){
|
|
762 |
if ( -1 == response.data.sections ) {
|
763 |
if(response.data.players.length) {
|
764 |
$(response.data.players).each(function( key, value ) {
|
765 |
-
|
766 |
-
$target.eq(i).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_player[" + index + "][]\">" + value.post_title + "</li>");
|
767 |
});
|
768 |
} else {
|
769 |
$target.eq(i).html("<li>" + localized_strings.no_results_found + "</li>");
|
@@ -778,8 +778,8 @@ jQuery(document).ready(function($){
|
|
778 |
defense = i+1;
|
779 |
}
|
780 |
$(response.data.players).each(function( key, value ) {
|
781 |
-
$target.eq(offense).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_offense[" + index + "][]\">" + value.post_title + "</li>");
|
782 |
-
$target.eq(defense).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_defense[" + index + "][]\">" + value.post_title + "</li>");
|
783 |
});
|
784 |
} else {
|
785 |
$target.eq(offense).html("<li>" + localized_strings.no_results_found + "</li>");
|
@@ -790,7 +790,7 @@ jQuery(document).ready(function($){
|
|
790 |
i++;
|
791 |
if(response.data.staff.length) {
|
792 |
$(response.data.staff).each(function( key, value ) {
|
793 |
-
$target.eq(i).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_staff[" + index + "][]\">" + value.post_title + "</li>");
|
794 |
});
|
795 |
} else {
|
796 |
$target.eq(i).html("<li>" + localized_strings.no_results_found + "</li>");
|
762 |
if ( -1 == response.data.sections ) {
|
763 |
if(response.data.players.length) {
|
764 |
$(response.data.players).each(function( key, value ) {
|
765 |
+
if($target.eq(i).find("input[value=" + value.ID + "]").length) return true;
|
766 |
+
$target.eq(i).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_player[" + index + "][]\"> " + value.post_title + "</li>");
|
767 |
});
|
768 |
} else {
|
769 |
$target.eq(i).html("<li>" + localized_strings.no_results_found + "</li>");
|
778 |
defense = i+1;
|
779 |
}
|
780 |
$(response.data.players).each(function( key, value ) {
|
781 |
+
$target.eq(offense).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_offense[" + index + "][]\"> " + value.post_title + "</li>");
|
782 |
+
$target.eq(defense).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_defense[" + index + "][]\"> " + value.post_title + "</li>");
|
783 |
});
|
784 |
} else {
|
785 |
$target.eq(offense).html("<li>" + localized_strings.no_results_found + "</li>");
|
790 |
i++;
|
791 |
if(response.data.staff.length) {
|
792 |
$(response.data.staff).each(function( key, value ) {
|
793 |
+
$target.eq(i).append("<li><label class=\"selectit\"><input type=\"checkbox\" value=\"" + value.ID + "\" name=\"sp_staff[" + index + "][]\"> " + value.post_title + "</li>");
|
794 |
});
|
795 |
} else {
|
796 |
$target.eq(i).html("<li>" + localized_strings.no_results_found + "</li>");
|
assets/js/admin/sportspress-setup.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
|
3 |
+
// Tiptip
|
4 |
+
$(".sp-tip").tipTip({
|
5 |
+
delay: 200,
|
6 |
+
fadeIn: 100,
|
7 |
+
fadeOut: 100
|
8 |
+
});
|
9 |
+
$(".sp-desc-tip").tipTip({
|
10 |
+
delay: 200,
|
11 |
+
fadeIn: 100,
|
12 |
+
fadeOut: 100,
|
13 |
+
defaultPosition: 'right'
|
14 |
+
});
|
15 |
+
|
16 |
+
// Chosen select
|
17 |
+
$(".chosen-select, #poststuff #post_author_override").chosen({
|
18 |
+
allow_single_deselect: true,
|
19 |
+
search_contains: true,
|
20 |
+
single_backstroke_delete: false,
|
21 |
+
disable_search_threshold: 10,
|
22 |
+
placeholder_text_multiple: localized_strings.none
|
23 |
+
});
|
24 |
+
});
|
changelog.txt
CHANGED
@@ -1,5 +1,29 @@
|
|
1 |
== SportsPress Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 2.2.10 =
|
4 |
* Tweak - Update modules page.
|
5 |
* Fix - League table discrepancy due to change in number of teams setting.
|
@@ -163,7 +187,7 @@
|
|
163 |
* Feature - Add squad number and name option to player details.
|
164 |
* Feature - Add tab options to layout designer.
|
165 |
* Feature - Add option to display player and staff dropdowns in profiles.
|
166 |
-
* Feature - Add option to select TBA, postponed, and
|
167 |
* Feature - Licenses tab for third-party extensions.
|
168 |
* Tweak - Get player data only when needed.
|
169 |
* Tweak - Add capabilities to taxonomies.
|
1 |
== SportsPress Changelog ==
|
2 |
|
3 |
+
= 2.3.2 =
|
4 |
+
* Fix - Team in player statistics total row displaying as zero.
|
5 |
+
* Fix - Notice when no sendoffs are available during minutes played calculation.
|
6 |
+
|
7 |
+
= 2.3.1 =
|
8 |
+
* Tweak - Update version numbers of recommended sport-specific extensions.
|
9 |
+
* Fix - Manually entered statistics not reflected in player profile totals.
|
10 |
+
* Fix - Template hooks not callable for third-party integration.
|
11 |
+
* Fix - Error when editing league tables in PHP versions earlier than 5.5.
|
12 |
+
|
13 |
+
= 2.3 =
|
14 |
+
* Feature - New setup wizard for first-time installs.
|
15 |
+
* Feature - Option to automatically create player profiles during user registration.
|
16 |
+
* Feature - Choose team or individual mode for each event.
|
17 |
+
* Feature - Send Off setting for player statistics to suspend minute count for that player.
|
18 |
+
* Tweak - Remove horizontal scrolling in dashboard to fix hidden dropdowns.
|
19 |
+
* Tweak - Revert text color overrides for dark color schemes in frontend styles.
|
20 |
+
* Fix - Borrowed players not automatically loading on event edit.
|
21 |
+
* Fix - Played minutes calculation and player profile statistics.
|
22 |
+
|
23 |
+
= 2.2.11 =
|
24 |
+
* Fix - Timeout issue when tiebreaker checks for head-to-head standings.
|
25 |
+
* Fix - Check for REST API controllers to prevent errors when using Jetpack.
|
26 |
+
|
27 |
= 2.2.10 =
|
28 |
* Tweak - Update modules page.
|
29 |
* Fix - League table discrepancy due to change in number of teams setting.
|
187 |
* Feature - Add squad number and name option to player details.
|
188 |
* Feature - Add tab options to layout designer.
|
189 |
* Feature - Add option to display player and staff dropdowns in profiles.
|
190 |
+
* Feature - Add option to select TBA, postponed, and canceled event status.
|
191 |
* Feature - Licenses tab for third-party extensions.
|
192 |
* Tweak - Get player data only when needed.
|
193 |
* Tweak - Add capabilities to taxonomies.
|
includes/admin/class-sp-admin-notices.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -40,12 +40,14 @@ class SP_Admin_Notices {
|
|
40 |
$screen = get_current_screen();
|
41 |
$notices = get_option( 'sportspress_admin_notices', array() );
|
42 |
|
43 |
-
if (
|
44 |
-
|
45 |
-
|
|
|
|
|
46 |
}
|
47 |
|
48 |
-
if (
|
49 |
$post_id = get_the_ID();
|
50 |
if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) {
|
51 |
add_action( 'admin_notices', array( $this, 'no_access_notice' ) );
|
@@ -78,9 +80,9 @@ class SP_Admin_Notices {
|
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
-
* Show the
|
82 |
*/
|
83 |
-
public function
|
84 |
include( 'views/html-notice-install.php' );
|
85 |
}
|
86 |
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
40 |
$screen = get_current_screen();
|
41 |
$notices = get_option( 'sportspress_admin_notices', array() );
|
42 |
|
43 |
+
if ( ! is_object( $screen ) ) return;
|
44 |
+
|
45 |
+
if ( ! get_option( 'sportspress_completed_setup' ) && ! in_array( $screen->id, array( 'dashboard_page_sp-about', 'dashboard_page_sp-credits', 'dashboard_page_sp-translators' ) ) ) {
|
46 |
+
wp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) );
|
47 |
+
add_action( 'admin_notices', array( $this, 'setup_notice' ) );
|
48 |
}
|
49 |
|
50 |
+
if ( 'post' == $screen->base ) {
|
51 |
$post_id = get_the_ID();
|
52 |
if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) {
|
53 |
add_action( 'admin_notices', array( $this, 'no_access_notice' ) );
|
80 |
}
|
81 |
|
82 |
/**
|
83 |
+
* Show the setup notices
|
84 |
*/
|
85 |
+
public function setup_notice() {
|
86 |
include( 'views/html-notice-install.php' );
|
87 |
}
|
88 |
|
includes/admin/class-sp-admin-sample-data.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The SportsPress admin sample data class stores demo content.
|
6 |
*
|
7 |
* @class SP_Admin_Sample_Data
|
8 |
-
* @version
|
9 |
* @package SportsPress/Admin
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
@@ -77,7 +77,7 @@ class SP_Admin_Sample_Data {
|
|
77 |
);
|
78 |
|
79 |
// Jobs
|
80 |
-
$taxonomies['sp_role'] = array(
|
81 |
|
82 |
/*
|
83 |
* Insert terms
|
@@ -163,7 +163,7 @@ class SP_Admin_Sample_Data {
|
|
163 |
$post['post_title'] = $team['name'];
|
164 |
$post['post_type'] = 'sp_team';
|
165 |
$post['post_status'] = 'publish';
|
166 |
-
$post['post_content'] = sprintf( $sample_content, __( 'Team', 'sportspress' ), __( 'Teams', 'sportspress' ), admin_url() );
|
167 |
|
168 |
// Terms
|
169 |
$post['tax_input'] = array();
|
@@ -207,7 +207,7 @@ class SP_Admin_Sample_Data {
|
|
207 |
$post['post_title'] = $name;
|
208 |
$post['post_type'] = 'sp_player';
|
209 |
$post['post_status'] = 'publish';
|
210 |
-
$post['post_content'] = sprintf( $sample_content, __( 'Player', 'sportspress' ), __( 'Players', 'sportspress' ), admin_url() );
|
211 |
|
212 |
// Terms
|
213 |
$post['tax_input'] = array();
|
@@ -302,7 +302,7 @@ class SP_Admin_Sample_Data {
|
|
302 |
$post['post_title'] = $name;
|
303 |
$post['post_type'] = 'sp_staff';
|
304 |
$post['post_status'] = 'publish';
|
305 |
-
$post['post_content'] = sprintf( $sample_content, __( 'Staff', 'sportspress' ), __( 'Staff', 'sportspress' ), admin_url() );
|
306 |
|
307 |
// Terms
|
308 |
$post['tax_input'] = array();
|
@@ -362,7 +362,7 @@ class SP_Admin_Sample_Data {
|
|
362 |
'post_title' => $teams[ $i ]['name'] . ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ' . $teams[ $away_index ]['name'],
|
363 |
'post_type' => 'sp_event',
|
364 |
'post_status' => $post_status,
|
365 |
-
'post_content' => sprintf( $sample_content, __( 'Event', 'sportspress' ), __( 'Events', 'sportspress' ), admin_url() ),
|
366 |
'post_date' => $post_year . '-' . sprintf( '%02d', 3 + $i * 3 ) . '-' . sprintf( '%02d', 5 + $i * 10 ) . ' ' . ( 18 + $i ) . ':00:00',
|
367 |
'tax_input' => array(
|
368 |
'sp_league' => get_terms( 'sp_league', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1 ) ),
|
@@ -469,7 +469,7 @@ class SP_Admin_Sample_Data {
|
|
469 |
'post_title' => _x( 'Fixtures & Results', 'example', 'sportspress' ),
|
470 |
'post_type' => 'sp_calendar',
|
471 |
'post_status' => 'publish',
|
472 |
-
'post_content' => sprintf( $sample_content, __( 'Calendar', 'sportspress' ), __( 'Calendars', 'sportspress' ), admin_url() )
|
473 |
);
|
474 |
|
475 |
// Insert post
|
@@ -503,7 +503,7 @@ class SP_Admin_Sample_Data {
|
|
503 |
'post_title' => $league->name . ' ' . $season->name,
|
504 |
'post_type' => 'sp_table',
|
505 |
'post_status' => 'publish',
|
506 |
-
'post_content' => sprintf( $sample_content, __( 'League Table', 'sportspress' ), __( 'League Tables', 'sportspress' ), admin_url() ),
|
507 |
'tax_input' => array(
|
508 |
'sp_league' => $league->term_id,
|
509 |
'sp_season' => $season->term_id,
|
@@ -545,7 +545,7 @@ class SP_Admin_Sample_Data {
|
|
545 |
'post_title' => get_the_title( $team_id ) . ' ' . _x( 'Roster', 'example', 'sportspress' ),
|
546 |
'post_type' => 'sp_list',
|
547 |
'post_status' => 'publish',
|
548 |
-
'post_content' => sprintf( $sample_content, __( 'Player List', 'sportspress' ), __( 'Player Lists', 'sportspress' ), admin_url() ),
|
549 |
);
|
550 |
|
551 |
// Insert post
|
@@ -590,7 +590,7 @@ class SP_Admin_Sample_Data {
|
|
590 |
'post_title' => _x( 'Player Ranking', 'example', 'sportspress' ),
|
591 |
'post_type' => 'sp_list',
|
592 |
'post_status' => 'publish',
|
593 |
-
'post_content' => sprintf( $sample_content, __( 'Player List', 'sportspress' ), __( 'Player Lists', 'sportspress' ), admin_url() ),
|
594 |
);
|
595 |
|
596 |
// Insert post
|
5 |
* The SportsPress admin sample data class stores demo content.
|
6 |
*
|
7 |
* @class SP_Admin_Sample_Data
|
8 |
+
* @version 2.3
|
9 |
* @package SportsPress/Admin
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
77 |
);
|
78 |
|
79 |
// Jobs
|
80 |
+
$taxonomies['sp_role'] = array( 'Coach' );
|
81 |
|
82 |
/*
|
83 |
* Insert terms
|
163 |
$post['post_title'] = $team['name'];
|
164 |
$post['post_type'] = 'sp_team';
|
165 |
$post['post_status'] = 'publish';
|
166 |
+
$post['post_content'] = sprintf( $sample_content, __( 'Team', 'sportspress' ), __( 'Teams', 'sportspress' ), add_query_arg( 'post_type', 'sp_team', admin_url( 'edit.php' ) ) );
|
167 |
|
168 |
// Terms
|
169 |
$post['tax_input'] = array();
|
207 |
$post['post_title'] = $name;
|
208 |
$post['post_type'] = 'sp_player';
|
209 |
$post['post_status'] = 'publish';
|
210 |
+
$post['post_content'] = sprintf( $sample_content, __( 'Player', 'sportspress' ), __( 'Players', 'sportspress' ), add_query_arg( 'post_type', 'sp_player', admin_url( 'edit.php' ) ) );
|
211 |
|
212 |
// Terms
|
213 |
$post['tax_input'] = array();
|
302 |
$post['post_title'] = $name;
|
303 |
$post['post_type'] = 'sp_staff';
|
304 |
$post['post_status'] = 'publish';
|
305 |
+
$post['post_content'] = sprintf( $sample_content, __( 'Staff', 'sportspress' ), __( 'Staff', 'sportspress' ), add_query_arg( 'post_type', 'sp_staff', admin_url( 'edit.php' ) ) );
|
306 |
|
307 |
// Terms
|
308 |
$post['tax_input'] = array();
|
362 |
'post_title' => $teams[ $i ]['name'] . ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ' . $teams[ $away_index ]['name'],
|
363 |
'post_type' => 'sp_event',
|
364 |
'post_status' => $post_status,
|
365 |
+
'post_content' => sprintf( $sample_content, __( 'Event', 'sportspress' ), __( 'Events', 'sportspress' ), add_query_arg( 'post_type', 'sp_event', admin_url( 'edit.php' ) ) ),
|
366 |
'post_date' => $post_year . '-' . sprintf( '%02d', 3 + $i * 3 ) . '-' . sprintf( '%02d', 5 + $i * 10 ) . ' ' . ( 18 + $i ) . ':00:00',
|
367 |
'tax_input' => array(
|
368 |
'sp_league' => get_terms( 'sp_league', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1 ) ),
|
469 |
'post_title' => _x( 'Fixtures & Results', 'example', 'sportspress' ),
|
470 |
'post_type' => 'sp_calendar',
|
471 |
'post_status' => 'publish',
|
472 |
+
'post_content' => sprintf( $sample_content, __( 'Calendar', 'sportspress' ), __( 'Calendars', 'sportspress' ), add_query_arg( 'post_type', 'sp_calendar', admin_url( 'edit.php' ) ) )
|
473 |
);
|
474 |
|
475 |
// Insert post
|
503 |
'post_title' => $league->name . ' ' . $season->name,
|
504 |
'post_type' => 'sp_table',
|
505 |
'post_status' => 'publish',
|
506 |
+
'post_content' => sprintf( $sample_content, __( 'League Table', 'sportspress' ), __( 'League Tables', 'sportspress' ), add_query_arg( 'post_type', 'sp_table', admin_url( 'edit.php' ) ) ),
|
507 |
'tax_input' => array(
|
508 |
'sp_league' => $league->term_id,
|
509 |
'sp_season' => $season->term_id,
|
545 |
'post_title' => get_the_title( $team_id ) . ' ' . _x( 'Roster', 'example', 'sportspress' ),
|
546 |
'post_type' => 'sp_list',
|
547 |
'post_status' => 'publish',
|
548 |
+
'post_content' => sprintf( $sample_content, __( 'Player List', 'sportspress' ), __( 'Player Lists', 'sportspress' ), add_query_arg( 'post_type', 'sp_list', admin_url( 'edit.php' ) ) ),
|
549 |
);
|
550 |
|
551 |
// Insert post
|
590 |
'post_title' => _x( 'Player Ranking', 'example', 'sportspress' ),
|
591 |
'post_type' => 'sp_list',
|
592 |
'post_status' => 'publish',
|
593 |
+
'post_content' => sprintf( $sample_content, __( 'Player List', 'sportspress' ), __( 'Player Lists', 'sportspress' ), add_query_arg( 'post_type', 'sp_list', admin_url( 'edit.php' ) ) ),
|
594 |
);
|
595 |
|
596 |
// Insert post
|
includes/admin/class-sp-admin-settings.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -442,7 +442,10 @@ class SP_Admin_Settings {
|
|
442 |
// Select sport
|
443 |
case 'sport' :
|
444 |
|
|
|
445 |
$option_value = self::get_option( $value['id'], $value['default'] );
|
|
|
|
|
446 |
$categories = SP_Admin_Sports::sport_category_names();
|
447 |
|
448 |
?><tr valign="top">
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
442 |
// Select sport
|
443 |
case 'sport' :
|
444 |
|
445 |
+
$default = apply_filters( 'sportspress_default_sport', 'soccer' );
|
446 |
$option_value = self::get_option( $value['id'], $value['default'] );
|
447 |
+
if ( 'none' === $option_value ) $option_value = $default;
|
448 |
+
|
449 |
$categories = SP_Admin_Sports::sport_category_names();
|
450 |
|
451 |
?><tr valign="top">
|
includes/admin/class-sp-admin-setup-wizard.php
ADDED
@@ -0,0 +1,790 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Setup Wizard Class
|
4 |
+
*
|
5 |
+
* Takes new users through some basic steps to setup their club website.
|
6 |
+
*
|
7 |
+
* Adapted from code in WooCommerce (Copyright (c) 2017, Automattic).
|
8 |
+
*
|
9 |
+
* @author WooThemes
|
10 |
+
* @category Admin
|
11 |
+
* @package SportsPress/Admin
|
12 |
+
* @version 2.3
|
13 |
+
*/
|
14 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
15 |
+
exit;
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* WC_Admin_Setup_Wizard class.
|
20 |
+
*/
|
21 |
+
class WC_Admin_Setup_Wizard {
|
22 |
+
|
23 |
+
/** @var string Currenct Step */
|
24 |
+
private $step = '';
|
25 |
+
|
26 |
+
/** @var array Steps for the setup wizard */
|
27 |
+
private $steps = array();
|
28 |
+
|
29 |
+
/** @var array Tweets user can optionally send after install */
|
30 |
+
private $tweets = array(
|
31 |
+
"Someone give me a high five, I just set up a new sports data website with #SportsPress and #WordPress!"
|
32 |
+
);
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Hook in tabs.
|
36 |
+
*/
|
37 |
+
public function __construct() {
|
38 |
+
if ( apply_filters( 'sportspress_enable_setup_wizard', true ) && current_user_can( 'manage_sportspress' ) ) {
|
39 |
+
add_action( 'admin_menu', array( $this, 'admin_menus' ) );
|
40 |
+
add_action( 'admin_init', array( $this, 'setup_wizard' ) );
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Add admin menus/screens.
|
46 |
+
*/
|
47 |
+
public function admin_menus() {
|
48 |
+
add_dashboard_page( '', '', 'manage_options', 'sp-setup', '' );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Show the setup wizard.
|
53 |
+
*/
|
54 |
+
public function setup_wizard() {
|
55 |
+
if ( empty( $_GET['page'] ) || 'sp-setup' !== $_GET['page'] ) {
|
56 |
+
return;
|
57 |
+
}
|
58 |
+
$this->steps = array(
|
59 |
+
'introduction' => array(
|
60 |
+
'name' => __( 'Introduction', 'sportspress' ),
|
61 |
+
'view' => array( $this, 'sp_setup_introduction' ),
|
62 |
+
'handler' => ''
|
63 |
+
),
|
64 |
+
'basics' => array(
|
65 |
+
'name' => __( 'Basic Setup', 'sportspress' ),
|
66 |
+
'view' => array( $this, 'sp_setup_basics' ),
|
67 |
+
'handler' => array( $this, 'sp_setup_basics_save' )
|
68 |
+
),
|
69 |
+
'teams' => array(
|
70 |
+
'name' => __( 'Teams', 'sportspress' ),
|
71 |
+
'view' => array( $this, 'sp_setup_teams' ),
|
72 |
+
'handler' => array( $this, 'sp_setup_teams_save' )
|
73 |
+
),
|
74 |
+
'players_staff' => array(
|
75 |
+
'name' => __( 'Players', 'sportspress' ) . ' & ' . __( 'Staff', 'sportspress' ),
|
76 |
+
'view' => array( $this, 'sp_setup_players_staff' ),
|
77 |
+
'handler' => array( $this, 'sp_setup_players_staff_save' ),
|
78 |
+
),
|
79 |
+
'venue' => array(
|
80 |
+
'name' => __( 'Venue', 'sportspress' ),
|
81 |
+
'view' => array( $this, 'sp_setup_venue' ),
|
82 |
+
'handler' => array( $this, 'sp_setup_venue_save' ),
|
83 |
+
),
|
84 |
+
'pages' => array(
|
85 |
+
'name' => __( 'Pages', 'sportspress' ),
|
86 |
+
'view' => array( $this, 'sp_setup_pages' ),
|
87 |
+
'handler' => array( $this, 'sp_setup_pages_save' )
|
88 |
+
),
|
89 |
+
'next_steps' => array(
|
90 |
+
'name' => __( 'Ready!', 'sportspress' ),
|
91 |
+
'view' => array( $this, 'sp_setup_ready' ),
|
92 |
+
'handler' => ''
|
93 |
+
)
|
94 |
+
);
|
95 |
+
$this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );
|
96 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
97 |
+
|
98 |
+
wp_enqueue_style( 'jquery-chosen', SP()->plugin_url() . '/assets/css/chosen.css', array(), '1.1.0' );
|
99 |
+
wp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION );
|
100 |
+
wp_enqueue_style( 'sportspress-setup', SP()->plugin_url() . '/assets/css/setup.css', array( 'dashicons', 'install' ), SP_VERSION );
|
101 |
+
|
102 |
+
wp_register_script( 'chosen', SP()->plugin_url() . '/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
|
103 |
+
wp_register_script( 'jquery-tiptip', SP()->plugin_url() . '/assets/js/jquery.tipTip.min.js', array( 'jquery' ), '1.3', true );
|
104 |
+
wp_register_script( 'google-maps', '//maps.googleapis.com/maps/api/js?key=AIzaSyAWyt_AG0k_Pgz4LuegtHwesA_OMRnSSAE&libraries=places' );
|
105 |
+
wp_register_script( 'sportspress-setup', SP()->plugin_url() . '/assets/js/admin/sportspress-setup.js', array( 'jquery', 'chosen', 'jquery-tiptip' ), SP_VERSION, true );
|
106 |
+
|
107 |
+
wp_register_script( 'jquery-locationpicker', SP()->plugin_url() . '/assets/js/locationpicker.jquery.js', array( 'jquery', 'google-maps' ), '0.1.6', true );
|
108 |
+
wp_register_script( 'sportspress-admin-locationpicker', SP()->plugin_url() . '/assets/js/admin/locationpicker.js', array( 'jquery', 'jquery-locationpicker' ), SP_VERSION, true );
|
109 |
+
|
110 |
+
$strings = apply_filters( 'sportspress_localized_strings', array(
|
111 |
+
'none' => __( 'None', 'sportspress' ),
|
112 |
+
'remove_text' => __( '— Remove —', 'sportspress' ),
|
113 |
+
) );
|
114 |
+
|
115 |
+
// Localize scripts
|
116 |
+
wp_localize_script( 'sportspress-setup', 'localized_strings', $strings );
|
117 |
+
|
118 |
+
wp_enqueue_script( 'google-maps' );
|
119 |
+
|
120 |
+
if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {
|
121 |
+
call_user_func( $this->steps[ $this->step ]['handler'] );
|
122 |
+
}
|
123 |
+
|
124 |
+
ob_start();
|
125 |
+
$this->setup_wizard_header();
|
126 |
+
$this->setup_wizard_steps();
|
127 |
+
$this->setup_wizard_content();
|
128 |
+
$this->setup_wizard_footer();
|
129 |
+
exit;
|
130 |
+
}
|
131 |
+
|
132 |
+
public function get_next_step_link() {
|
133 |
+
$keys = array_keys( $this->steps );
|
134 |
+
return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ) ) + 1 ] );
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Setup Wizard Header.
|
139 |
+
*/
|
140 |
+
public function setup_wizard_header() {
|
141 |
+
?>
|
142 |
+
<!DOCTYPE html>
|
143 |
+
<html <?php language_attributes(); ?>>
|
144 |
+
<head>
|
145 |
+
<meta name="viewport" content="width=device-width" />
|
146 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
147 |
+
<title><?php _e( 'SportsPress', 'sportspress' ); ?> › <?php echo $this->steps[ $this->step ]['name']; ?></title>
|
148 |
+
<?php do_action( 'admin_print_styles' ); ?>
|
149 |
+
<?php do_action( 'admin_head' ); ?>
|
150 |
+
</head>
|
151 |
+
<body class="sp-setup wp-core-ui">
|
152 |
+
<h1 id="sp-logo"><?php echo apply_filters( 'sportspress_logo', '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/modules/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png" alt="' . __( 'SportsPress', 'sportspress' ) . '">' ); ?></h1>
|
153 |
+
<?php
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Setup Wizard Footer.
|
158 |
+
*/
|
159 |
+
public function setup_wizard_footer() {
|
160 |
+
?>
|
161 |
+
<?php if ( 'next_steps' === $this->step ) : ?>
|
162 |
+
<p class="sp-return-to-dashboard"><a href="<?php echo esc_url( admin_url( 'index.php?page=sp-about' ) ); ?>"><?php _e( 'Return to the WordPress Dashboard', 'sportspress' ); ?></a></p>
|
163 |
+
<?php endif; ?>
|
164 |
+
<?php wp_print_scripts( 'sportspress-setup' ); ?>
|
165 |
+
</body>
|
166 |
+
</html>
|
167 |
+
<?php
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Output the steps.
|
172 |
+
*/
|
173 |
+
public function setup_wizard_steps() {
|
174 |
+
$ouput_steps = $this->steps;
|
175 |
+
array_shift( $ouput_steps );
|
176 |
+
?>
|
177 |
+
<ol class="sp-setup-steps">
|
178 |
+
<?php foreach ( $ouput_steps as $step_key => $step ) : ?>
|
179 |
+
<li class="<?php
|
180 |
+
if ( $step_key === $this->step ) {
|
181 |
+
echo 'active';
|
182 |
+
} elseif ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) {
|
183 |
+
echo 'done';
|
184 |
+
}
|
185 |
+
?>"><?php echo esc_html( $step['name'] ); ?></li>
|
186 |
+
<?php endforeach; ?>
|
187 |
+
</ol>
|
188 |
+
<?php
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Output the content for the current step.
|
193 |
+
*/
|
194 |
+
public function setup_wizard_content() {
|
195 |
+
echo '<div class="sp-setup-content">';
|
196 |
+
call_user_func( $this->steps[ $this->step ]['view'] );
|
197 |
+
echo '</div>';
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Introduction Step.
|
202 |
+
*/
|
203 |
+
public function sp_setup_introduction() {
|
204 |
+
?>
|
205 |
+
<h1><?php _e( 'Welcome to SportsPress', 'sportspress' ); ?></h1>
|
206 |
+
<p><?php _e( 'Thank you for choosing SportsPress to power your sports website! This quick setup wizard will help you configure the basic settings. <strong>It’s completely optional and shouldn’t take longer than five minutes.</strong>', 'sportspress' ); ?></p>
|
207 |
+
<p><?php _e( 'No time right now? If you don’t want to go through the wizard, you can skip and return to the WordPress dashboard. Come back anytime if you change your mind!', 'sportspress' ); ?></p>
|
208 |
+
<p class="sp-setup-actions step">
|
209 |
+
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button-primary button button-large button-next"><?php _e( 'Let\'s Go!', 'sportspress' ); ?></a>
|
210 |
+
<a href="<?php echo esc_url( admin_url( 'index.php?page=sp-about' ) ); ?>" class="button button-large button-muted"><?php _e( 'Not right now', 'sportspress' ); ?></a>
|
211 |
+
</p>
|
212 |
+
<?php
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Basic Setup.
|
217 |
+
*/
|
218 |
+
public function sp_setup_basics() {
|
219 |
+
$class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' );
|
220 |
+
?>
|
221 |
+
<h1><?php _e( 'Basic Setup', 'sportspress' ); ?></h1>
|
222 |
+
<form method="post">
|
223 |
+
<p><?php _e( 'Select your timezone and sport to get started.', 'sportspress' ); ?></p>
|
224 |
+
<table class="form-table" cellspacing="0">
|
225 |
+
<tr>
|
226 |
+
<th scope="row"><?php _e( 'Timezone', 'sportspress' ); ?> <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Choose a city in the same timezone as you.', 'sportspress' ); ?>"></i></th>
|
227 |
+
<td>
|
228 |
+
<select id="timezone_string" name="timezone_string" class="<?php echo esc_attr( $class ); ?>">
|
229 |
+
<?php
|
230 |
+
$current_offset = get_option('gmt_offset');
|
231 |
+
$tzstring = get_option('timezone_string');
|
232 |
+
|
233 |
+
$check_zone_info = true;
|
234 |
+
|
235 |
+
// Remove old Etc mappings. Fallback to gmt_offset.
|
236 |
+
if ( false !== strpos($tzstring,'Etc/GMT') )
|
237 |
+
$tzstring = '';
|
238 |
+
|
239 |
+
if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
|
240 |
+
$check_zone_info = false;
|
241 |
+
if ( 0 == $current_offset )
|
242 |
+
$tzstring = 'UTC+0';
|
243 |
+
elseif ($current_offset < 0)
|
244 |
+
$tzstring = 'UTC' . $current_offset;
|
245 |
+
else
|
246 |
+
$tzstring = 'UTC+' . $current_offset;
|
247 |
+
}
|
248 |
+
echo wp_timezone_choice( $tzstring );
|
249 |
+
?>
|
250 |
+
</select>
|
251 |
+
</td>
|
252 |
+
</tr>
|
253 |
+
<tr>
|
254 |
+
<th scope="row"><?php echo _x( 'Sport', 'Page title', 'sportspress' ); ?></th>
|
255 |
+
<td>
|
256 |
+
<?php
|
257 |
+
$options = SP_Admin_Sports::get_preset_options();
|
258 |
+
$default = apply_filters( 'sportspress_default_sport', 'soccer' );
|
259 |
+
$sport = get_option( 'sportspress_sport', $default );
|
260 |
+
if ( 'none' === $sport ) $sport = $default;
|
261 |
+
$categories = SP_Admin_Sports::sport_category_names();
|
262 |
+
?>
|
263 |
+
<select name="sport" id="sport" class="sp-select-sport <?php echo esc_attr( $class ); ?>">
|
264 |
+
<?php
|
265 |
+
foreach ( $options as $group => $options ) {
|
266 |
+
?>
|
267 |
+
<optgroup label="<?php echo sp_array_value( $categories, $group, $group ); ?>">
|
268 |
+
<?php
|
269 |
+
foreach ( $options as $key => $val ) {
|
270 |
+
?>
|
271 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $sport, $key ); ?>><?php echo $val ?></option>
|
272 |
+
<?php
|
273 |
+
}
|
274 |
+
?>
|
275 |
+
</optgroup>
|
276 |
+
<?php
|
277 |
+
}
|
278 |
+
?>
|
279 |
+
</select>
|
280 |
+
</td>
|
281 |
+
</tr>
|
282 |
+
<tr>
|
283 |
+
<th scope="row"><?php _e( 'Main Competition', 'sportspress' ); ?> <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'The name of a league or division.', 'sportspress' ); ?>"></i></th>
|
284 |
+
<td>
|
285 |
+
<input name="league" type="text" class="widefat" value="<?php _ex( 'Primary League', 'example', 'sportspress' ); ?>">
|
286 |
+
</td>
|
287 |
+
</tr>
|
288 |
+
<tr>
|
289 |
+
<th scope="row"><?php _e( 'Current Season', 'sportspress' ); ?></th>
|
290 |
+
<td>
|
291 |
+
<input name="season" type="text" class="widefat" value="<?php echo date( 'Y' ); ?>">
|
292 |
+
</td>
|
293 |
+
</tr>
|
294 |
+
</table>
|
295 |
+
|
296 |
+
<p class="sp-setup-actions step">
|
297 |
+
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'sportspress' ); ?>" name="save_step" />
|
298 |
+
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next button-muted"><?php _e( 'Skip this step', 'sportspress' ); ?></a>
|
299 |
+
<?php wp_nonce_field( 'sp-setup' ); ?>
|
300 |
+
</p>
|
301 |
+
</form>
|
302 |
+
<?php
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Save Basic Settings.
|
307 |
+
*/
|
308 |
+
public function sp_setup_basics_save() {
|
309 |
+
check_admin_referer( 'sp-setup' );
|
310 |
+
|
311 |
+
// Update timezone
|
312 |
+
$timezone_string = $_POST['timezone_string'];
|
313 |
+
if ( ! empty( $timezone_string ) && preg_match( '/^UTC[+-]/', $timezone_string ) ) {
|
314 |
+
$gmt_offset = $timezone_string;
|
315 |
+
$gmt_offset = preg_replace( '/UTC\+?/', '', $gmt_offset );
|
316 |
+
$timezone_string = '';
|
317 |
+
}
|
318 |
+
|
319 |
+
if ( isset( $timezone_string ) )
|
320 |
+
update_option( 'timezone_string', $timezone_string );
|
321 |
+
|
322 |
+
if ( isset( $gmt_offset ) )
|
323 |
+
update_option( 'gmt_offset', $gmt_offset );
|
324 |
+
|
325 |
+
// Update sport
|
326 |
+
$sport = sanitize_text_field( $_POST['sport'] );
|
327 |
+
if ( ! empty( $sport ) && get_option( 'sportspress_sport', null ) !== $sport ) {
|
328 |
+
SP_Admin_Sports::apply_preset( $sport );
|
329 |
+
}
|
330 |
+
update_option( 'sportspress_sport', $sport );
|
331 |
+
|
332 |
+
// Insert competition
|
333 |
+
$league = sanitize_text_field( $_POST['league'] );
|
334 |
+
if ( ! is_string( $league ) || empty( $league ) ) {
|
335 |
+
$league = _x( 'Primary League', 'example', 'sportspress' );
|
336 |
+
}
|
337 |
+
wp_insert_term( $league, 'sp_league' );
|
338 |
+
|
339 |
+
// Insert season
|
340 |
+
$season = sanitize_text_field( $_POST['season'] );
|
341 |
+
if ( ! is_string( $season ) || empty( $season ) ) {
|
342 |
+
$season = date( 'Y' );
|
343 |
+
}
|
344 |
+
wp_insert_term( $season, 'sp_season' );
|
345 |
+
|
346 |
+
wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
|
347 |
+
exit;
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* Team Setup.
|
352 |
+
*/
|
353 |
+
public function sp_setup_teams() {
|
354 |
+
$class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' );
|
355 |
+
?>
|
356 |
+
<h1><?php _e( 'Team Setup', 'sportspress' ); ?></h1>
|
357 |
+
<form method="post">
|
358 |
+
<p><?php _e( "Great! Now let's add some teams.", 'sportspress' ); ?></p>
|
359 |
+
<table class="form-table" cellspacing="0">
|
360 |
+
<tr>
|
361 |
+
<th scope="row"><?php _e( 'Home Team', 'sportspress' ); ?></th>
|
362 |
+
<td>
|
363 |
+
<input name="home_team" type="text" class="widefat" placeholder="<?php _e( 'What is your team called?', 'sportspress' ); ?>">
|
364 |
+
</td>
|
365 |
+
</tr>
|
366 |
+
<tr>
|
367 |
+
<th scope="row"><?php _e( 'Rival Team', 'sportspress' ); ?></th>
|
368 |
+
<td>
|
369 |
+
<input name="away_team" type="text" class="widefat" placeholder="<?php _e( 'Who are you playing against next?', 'sportspress' ); ?>">
|
370 |
+
<p class="description"><?php _e( "You can add more teams later.", 'sportspress' ); ?></p>
|
371 |
+
</td>
|
372 |
+
</tr>
|
373 |
+
</table>
|
374 |
+
|
375 |
+
<p class="sp-setup-actions step">
|
376 |
+
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'sportspress' ); ?>" name="save_step" />
|
377 |
+
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next button-muted"><?php _e( 'Skip this step', 'sportspress' ); ?></a>
|
378 |
+
<?php wp_nonce_field( 'sp-setup' ); ?>
|
379 |
+
</p>
|
380 |
+
</form>
|
381 |
+
<?php
|
382 |
+
}
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Save Team Settings.
|
386 |
+
*/
|
387 |
+
public function sp_setup_teams_save() {
|
388 |
+
check_admin_referer( 'sp-setup' );
|
389 |
+
|
390 |
+
// Add away team
|
391 |
+
$post['post_title'] = $_POST['away_team'];
|
392 |
+
$post['post_type'] = 'sp_team';
|
393 |
+
$post['post_status'] = 'publish';
|
394 |
+
$post['tax_input'] = array();
|
395 |
+
$taxonomies = array( 'sp_league', 'sp_season' );
|
396 |
+
foreach ( $taxonomies as $taxonomy ) {
|
397 |
+
$post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids' ) );
|
398 |
+
};
|
399 |
+
wp_insert_post( $post );
|
400 |
+
|
401 |
+
// Add home team
|
402 |
+
$post['post_title'] = $_POST['home_team'];
|
403 |
+
wp_insert_post( $post );
|
404 |
+
|
405 |
+
wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
|
406 |
+
exit;
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Players & Staff Setup.
|
411 |
+
*/
|
412 |
+
public function sp_setup_players_staff() {
|
413 |
+
$positions = (array) get_terms( 'sp_position', array( 'hide_empty' => 0, 'orderby' => 'slug', 'fields' => 'names' ) )
|
414 |
+
?>
|
415 |
+
<h1><?php esc_html_e( 'Player & Staff Setup', 'sportspress' ); ?></h1>
|
416 |
+
<form method="post">
|
417 |
+
<p><?php _e( "Let's add players and a staff member.", 'sportspress' ); ?></p>
|
418 |
+
<table class="form-table" cellspacing="0">
|
419 |
+
<tr>
|
420 |
+
<th scope="row"><?php _e( 'Players', 'sportspress' ); ?> <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Enter a squad number, name, and position for each player.', 'sportspress' ); ?>"></i></th>
|
421 |
+
<td>
|
422 |
+
<ul>
|
423 |
+
<?php for ( $i = 0; $i < 3; $i++ ) { ?>
|
424 |
+
<li class="player"><input name="players[<?php echo $i; ?>][number]" type="text" class="player-number" placeholder="#" value="<?php echo $i + 1; ?>"> <input name="players[<?php echo $i; ?>][name]" type="text" placeholder="<?php _e( 'Name', 'sportspress' ); ?>"> <input name="players[<?php echo $i; ?>][position]" type="text" placeholder="<?php _e( 'Position', 'sportspress' ); ?>" <?php if ( sizeof( $positions ) ) { ?> value="<?php echo $positions[ $i % sizeof( $positions ) ]; ?>"<?php } ?>></li>
|
425 |
+
<?php } ?>
|
426 |
+
</ul>
|
427 |
+
<p class="description"><?php _e( "You can add more players later.", 'sportspress' ); ?></p>
|
428 |
+
</td>
|
429 |
+
</tr>
|
430 |
+
<tr>
|
431 |
+
<th scope="row"><?php _e( 'Staff', 'sportspress' ); ?></th>
|
432 |
+
<td>
|
433 |
+
<ul>
|
434 |
+
<li class="staff"><input name="staff" type="text" class="staff-name" placeholder="<?php _e( 'Name', 'sportspress' ); ?>"> <input name="role" type="text" placeholder="<?php _e( 'Job', 'sportspress' ); ?>" value="Coach"></li>
|
435 |
+
</ul>
|
436 |
+
</td>
|
437 |
+
</tr>
|
438 |
+
</table>
|
439 |
+
|
440 |
+
<p class="sp-setup-actions step">
|
441 |
+
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'sportspress' ); ?>" name="save_step" />
|
442 |
+
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next button-muted"><?php _e( 'Skip this step', 'sportspress' ); ?></a>
|
443 |
+
<?php wp_nonce_field( 'sp-setup' ); ?>
|
444 |
+
</p>
|
445 |
+
</form>
|
446 |
+
<?php
|
447 |
+
}
|
448 |
+
|
449 |
+
/**
|
450 |
+
* Save Player & Staff Settings.
|
451 |
+
*/
|
452 |
+
public function sp_setup_players_staff_save() {
|
453 |
+
check_admin_referer( 'sp-setup' );
|
454 |
+
|
455 |
+
// Get home team
|
456 |
+
$teams = (array) get_posts( array( 'posts_per_page' => 1, 'post_type' => 'sp_team', 'fields' => 'ids' ) );
|
457 |
+
$team = reset( $teams );
|
458 |
+
|
459 |
+
// Add players
|
460 |
+
$post['post_type'] = 'sp_player';
|
461 |
+
$post['post_status'] = 'publish';
|
462 |
+
$post['tax_input'] = array();
|
463 |
+
$taxonomies = array( 'sp_league', 'sp_season' );
|
464 |
+
foreach ( $taxonomies as $taxonomy ) {
|
465 |
+
$post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids' ) );
|
466 |
+
};
|
467 |
+
if ( is_array( $_POST['players'] ) ) {
|
468 |
+
foreach ( $_POST['players'] as $i => $player ) {
|
469 |
+
if ( empty( $player['name'] ) ) continue;
|
470 |
+
|
471 |
+
$post['post_title'] = $player['name'];
|
472 |
+
$id = wp_insert_post( $post );
|
473 |
+
|
474 |
+
// Add squad number
|
475 |
+
$number = sp_array_value( $player, 'number' );
|
476 |
+
update_post_meta( $id, 'sp_number', $number );
|
477 |
+
|
478 |
+
// Add position
|
479 |
+
wp_set_object_terms( $id, sp_array_value( $player, 'position', __( 'Position', 'sportspress' ) ), 'sp_position', false );
|
480 |
+
|
481 |
+
// Add team
|
482 |
+
if ( $team ) {
|
483 |
+
update_post_meta( $id, 'sp_team', $team );
|
484 |
+
update_post_meta( $id, 'sp_current_team', $team );
|
485 |
+
}
|
486 |
+
}
|
487 |
+
}
|
488 |
+
|
489 |
+
// Add staff
|
490 |
+
if ( ! empty( $_POST['staff'] ) ) {
|
491 |
+
|
492 |
+
$post['post_type'] = 'sp_staff';
|
493 |
+
$post['post_title'] = $_POST['staff'];
|
494 |
+
$id = wp_insert_post( $post );
|
495 |
+
|
496 |
+
// Add role
|
497 |
+
wp_set_object_terms( $id, sp_array_value( $_POST, 'role', 'Coach' ), 'sp_role', false );
|
498 |
+
|
499 |
+
// Add team
|
500 |
+
if ( $team ) {
|
501 |
+
update_post_meta( $id, 'sp_team', $team );
|
502 |
+
update_post_meta( $id, 'sp_current_team', $team );
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
|
507 |
+
exit;
|
508 |
+
}
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Venue Step.
|
512 |
+
*/
|
513 |
+
public function sp_setup_venue() {
|
514 |
+
?>
|
515 |
+
<h1><?php _e( 'Venue Setup', 'sportspress' ); ?></h1>
|
516 |
+
<form method="post">
|
517 |
+
<p><?php _e( "Enter the details of your home venue.", 'sportspress' ); ?></p>
|
518 |
+
<table class="form-table" cellspacing="0">
|
519 |
+
<tr>
|
520 |
+
<th scope="row"><?php _e( 'Name', 'sportspress' ); ?></th>
|
521 |
+
<td>
|
522 |
+
<input name="venue" type="text" placeholder="<?php _e( 'Venue', 'sportspress' ); ?>">
|
523 |
+
</td>
|
524 |
+
</tr>
|
525 |
+
<tr>
|
526 |
+
<th scope="row"><?php _e( 'Address', 'sportspress' ); ?></th>
|
527 |
+
<td>
|
528 |
+
<input name="address" class="sp-address" type="text">
|
529 |
+
<div class="sp-location-picker"></div>
|
530 |
+
<p class="description"><?php _e( "Drag the marker to the venue's location.", 'sportspress' ); ?></p>
|
531 |
+
<input name="latitude" class="sp-latitude" type="hidden" value="40.7324319">
|
532 |
+
<input name="longitude" class="sp-longitude" type="hidden" value="-73.82480799999996">
|
533 |
+
</td>
|
534 |
+
</tr>
|
535 |
+
</table>
|
536 |
+
|
537 |
+
<p class="sp-setup-actions step">
|
538 |
+
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'sportspress' ); ?>" name="save_step" />
|
539 |
+
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next button-muted"><?php _e( 'Skip this step', 'sportspress' ); ?></a>
|
540 |
+
<?php wp_nonce_field( 'sp-setup' ); ?>
|
541 |
+
</p>
|
542 |
+
</form>
|
543 |
+
<?php wp_print_scripts( 'sportspress-admin-locationpicker' ); ?>
|
544 |
+
<?php
|
545 |
+
}
|
546 |
+
|
547 |
+
/**
|
548 |
+
* Venue Settings.
|
549 |
+
*/
|
550 |
+
public function sp_setup_venue_save() {
|
551 |
+
check_admin_referer( 'sp-setup' );
|
552 |
+
|
553 |
+
// Get home team
|
554 |
+
$teams = (array) get_posts( array( 'posts_per_page' => 1, 'post_type' => 'sp_team', 'fields' => 'ids' ) );
|
555 |
+
$team = reset( $teams );
|
556 |
+
|
557 |
+
// Insert venue
|
558 |
+
$venue = sanitize_text_field( $_POST['venue'] );
|
559 |
+
if ( ! is_string( $venue ) || empty( $venue ) ) {
|
560 |
+
$venue = sp_array_value( $_POST, 'address', __( 'Venue', 'sportspress' ) );
|
561 |
+
}
|
562 |
+
$inserted = wp_insert_term( $venue, 'sp_venue' );
|
563 |
+
|
564 |
+
// Add address and coordinates to venue
|
565 |
+
if ( ! is_wp_error( $inserted ) ) {
|
566 |
+
$t_id = sp_array_value( $inserted, 'term_id', 1 );
|
567 |
+
|
568 |
+
if ( $team ) {
|
569 |
+
wp_set_object_terms( $team, $t_id, 'sp_venue', true );
|
570 |
+
}
|
571 |
+
|
572 |
+
$meta = array(
|
573 |
+
'sp_address' => sp_array_value( $_POST, 'address' ),
|
574 |
+
'sp_latitude' => sp_array_value( $_POST, 'latitude' ),
|
575 |
+
'sp_longitude' => sp_array_value( $_POST, 'longitude' ),
|
576 |
+
);
|
577 |
+
update_option( "taxonomy_$t_id", $meta );
|
578 |
+
}
|
579 |
+
|
580 |
+
wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
|
581 |
+
exit;
|
582 |
+
}
|
583 |
+
|
584 |
+
/**
|
585 |
+
* Pages Step.
|
586 |
+
*/
|
587 |
+
public function sp_setup_pages() {
|
588 |
+
$pages = apply_filters( 'sportspress_setup_pages', array(
|
589 |
+
'sp_calendar' => __( 'Organize and publish calendars using different layouts.', 'sportspress' ),
|
590 |
+
'sp_table' => __( 'Create automated league tables to keep track of team standings.', 'sportspress' ),
|
591 |
+
'sp_list' => __( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ),
|
592 |
+
) );
|
593 |
+
?>
|
594 |
+
<h1><?php _e( 'Pages', 'sportspress' ); ?></h1>
|
595 |
+
<form method="post">
|
596 |
+
<p><?php printf( __( 'The following will be created automatically (if they do not already exist):', 'sportspress' ), '<a href="' . esc_url( admin_url( 'edit.php?post_type=page' ) ) . '" target="_blank">', '</a>' ); ?></p>
|
597 |
+
<table class="form-table" cellspacing="0">
|
598 |
+
<?php foreach ( $pages as $post_type => $description ) { ?>
|
599 |
+
<?php
|
600 |
+
$obj = get_post_type_object( $post_type );
|
601 |
+
if ( ! is_object( $obj ) ) continue;
|
602 |
+
?>
|
603 |
+
<tr>
|
604 |
+
<th scope="row"><?php echo $obj->labels->singular_name; ?></th>
|
605 |
+
<td><?php echo $description; ?></td>
|
606 |
+
</tr>
|
607 |
+
<?php } ?>
|
608 |
+
</table>
|
609 |
+
|
610 |
+
<p><?php printf( __( 'Once created, these pages can be managed from your admin dashboard.', 'sportspress' ), '<a href="' . esc_url( admin_url( 'edit.php?post_type=page' ) ) . '" target="_blank">', '</a>', '<a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '" target="_blank">', '</a>' ); ?></p>
|
611 |
+
|
612 |
+
<p class="sp-setup-actions step">
|
613 |
+
<input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'sportspress' ); ?>" name="save_step" />
|
614 |
+
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next button-muted"><?php _e( 'Skip this step', 'sportspress' ); ?></a>
|
615 |
+
<?php wp_nonce_field( 'sp-setup' ); ?>
|
616 |
+
</p>
|
617 |
+
</form>
|
618 |
+
<?php
|
619 |
+
}
|
620 |
+
|
621 |
+
/**
|
622 |
+
* Pages Settings.
|
623 |
+
*/
|
624 |
+
public function sp_setup_pages_save() {
|
625 |
+
check_admin_referer( 'sp-setup' );
|
626 |
+
|
627 |
+
$pages = apply_filters( 'sportspress_setup_pages', array(
|
628 |
+
'sp_calendar' => __( 'Organize and publish calendars using different layouts.', 'sportspress' ),
|
629 |
+
'sp_table' => __( 'Create automated league tables to keep track of team standings.', 'sportspress' ),
|
630 |
+
'sp_list' => __( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ),
|
631 |
+
) );
|
632 |
+
|
633 |
+
// Initialize post
|
634 |
+
$post = array( 'post_status' => 'publish' );
|
635 |
+
$sample_content = _x( 'This is an example %1$s. As a new SportsPress user, you should go to <a href=\"%3$s\">your dashboard</a> to delete this %1$s and create new %2$s for your content. Have fun!', 'example', 'sportspress' );
|
636 |
+
|
637 |
+
// Insert posts
|
638 |
+
foreach ( $pages as $post_type => $description ) {
|
639 |
+
$obj = get_post_type_object( $post_type );
|
640 |
+
if ( ! is_object( $obj ) ) continue;
|
641 |
+
|
642 |
+
// Skip if post exists
|
643 |
+
$posts = get_posts( array( 'posts_per_page' => 1, 'post_type' => $post_type ) );
|
644 |
+
if ( $posts ) continue;
|
645 |
+
|
646 |
+
// Add post args
|
647 |
+
$post['post_title'] = $obj->labels->singular_name;
|
648 |
+
$post['post_type'] = $post_type;
|
649 |
+
$post['post_content'] = sprintf( $sample_content, $obj->labels->singular_name, $obj->labels->name, add_query_arg( 'post_type', $post_type, admin_url( 'edit.php' ) ) );
|
650 |
+
|
651 |
+
// Insert post
|
652 |
+
$id = wp_insert_post( $post );
|
653 |
+
|
654 |
+
// Flag as sample
|
655 |
+
update_post_meta( $id, '_sp_sample', 1 );
|
656 |
+
}
|
657 |
+
|
658 |
+
wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
|
659 |
+
exit;
|
660 |
+
}
|
661 |
+
|
662 |
+
/**
|
663 |
+
* Actions on the final step.
|
664 |
+
*/
|
665 |
+
private function sp_setup_ready_actions() {
|
666 |
+
delete_option( '_sp_needs_welcome' );
|
667 |
+
update_option( 'sportspress_installed', 1 );
|
668 |
+
update_option( 'sportspress_completed_setup', 1 );
|
669 |
+
delete_transient( '_sp_activation_redirect' );
|
670 |
+
|
671 |
+
// Check if first event already exists
|
672 |
+
$events = get_posts(
|
673 |
+
array(
|
674 |
+
'post_type' => 'sp_event',
|
675 |
+
'posts_per_page' => 11,
|
676 |
+
'post_status' => 'draft',
|
677 |
+
'meta_query' => array(
|
678 |
+
array(
|
679 |
+
'key' => '_sp_first',
|
680 |
+
'value' => 1
|
681 |
+
)
|
682 |
+
)
|
683 |
+
)
|
684 |
+
);
|
685 |
+
|
686 |
+
if ( $events ) {
|
687 |
+
$event = reset( $events );
|
688 |
+
return $event->ID;
|
689 |
+
}
|
690 |
+
|
691 |
+
// Get teams
|
692 |
+
$team_post_type = 'sp_team';
|
693 |
+
if ( 'player' === get_option( 'sportspress_mode', 'team' ) ) {
|
694 |
+
$team_post_type = 'sp_player';
|
695 |
+
}
|
696 |
+
$teams = get_posts( array( 'posts_per_page' => 2, 'post_type' => $team_post_type ) );
|
697 |
+
|
698 |
+
// Get players
|
699 |
+
$players = (array) get_posts( array( 'posts_per_page' => 3, 'post_type' => 'sp_player', 'fields' => 'ids' ) );
|
700 |
+
|
701 |
+
// Get staff
|
702 |
+
$staff = (array) get_posts( array( 'posts_per_page' => 1, 'post_type' => 'sp_staff', 'fields' => 'ids' ) );
|
703 |
+
|
704 |
+
// Initialize post
|
705 |
+
$post['post_type'] = 'sp_event';
|
706 |
+
$post['post_status'] = 'draft';
|
707 |
+
$post['tax_input'] = array();
|
708 |
+
|
709 |
+
// Add taxonomies
|
710 |
+
$taxonomies = array( 'sp_league', 'sp_season', 'sp_venue' );
|
711 |
+
foreach ( $taxonomies as $taxonomy ) {
|
712 |
+
$post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', 'number' => 1 ) );
|
713 |
+
};
|
714 |
+
|
715 |
+
// Add post title
|
716 |
+
if ( is_array( $teams ) && sizeof( $teams ) ) {
|
717 |
+
$team_names = array();
|
718 |
+
foreach ( $teams as $team ) {
|
719 |
+
if ( ! $team ) continue;
|
720 |
+
$team_names[] = $team->post_title;
|
721 |
+
}
|
722 |
+
$post['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names );
|
723 |
+
} else {
|
724 |
+
$post['post_title'] = __( 'Event', 'sportspress' );
|
725 |
+
}
|
726 |
+
|
727 |
+
// Insert event
|
728 |
+
$id = wp_insert_post( $post );
|
729 |
+
|
730 |
+
// Add teams
|
731 |
+
if ( is_array( $teams ) && sizeof( $teams ) ) {
|
732 |
+
foreach ( $teams as $team ) {
|
733 |
+
if ( ! $team ) continue;
|
734 |
+
add_post_meta( $id, 'sp_team', $team->ID );
|
735 |
+
}
|
736 |
+
}
|
737 |
+
|
738 |
+
// Add players
|
739 |
+
add_post_meta( $id, 'sp_player', 0 );
|
740 |
+
foreach ( $players as $player ) {
|
741 |
+
if ( ! $player ) continue;
|
742 |
+
add_post_meta( $id, 'sp_player', $player );
|
743 |
+
}
|
744 |
+
add_post_meta( $id, 'sp_player', 0 );
|
745 |
+
|
746 |
+
update_post_meta( $id, '_sp_first', 1 );
|
747 |
+
|
748 |
+
return $id;
|
749 |
+
}
|
750 |
+
|
751 |
+
/**
|
752 |
+
* Final step.
|
753 |
+
*/
|
754 |
+
public function sp_setup_ready() {
|
755 |
+
$id = $this->sp_setup_ready_actions();
|
756 |
+
shuffle( $this->tweets );
|
757 |
+
|
758 |
+
$steps = apply_filters( 'sportspress_setup_wizard_next_steps', array(
|
759 |
+
'first' => array(
|
760 |
+
'label' => __( 'Next Steps', 'sportspress' ),
|
761 |
+
'content' => '<a class="button button-primary button-large button-first-event" href="' . esc_url( admin_url( 'post.php?post=' . $id . '&action=edit' ) ) . '">' . __( 'Schedule your first event!', 'sportspress' ) . '</a>',
|
762 |
+
),
|
763 |
+
'last' => array(
|
764 |
+
'label' => __( 'Upgrade to Pro', 'sportspress' ),
|
765 |
+
'content' => __( 'Get SportsPress Pro to get access to all modules. You can upgrade any time without losing any of your data.', 'sportspress' ) . ' <a href="' . apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) . '" target="_blank">' . __( 'Learn more', 'sportspress' ) . '</a>',
|
766 |
+
),
|
767 |
+
) );
|
768 |
+
?>
|
769 |
+
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://tboy.co/sp" data-text="<?php echo esc_attr( $this->tweets[0] ); ?>" data-via="ThemeBoy" data-size="large">Tweet</a>
|
770 |
+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
771 |
+
|
772 |
+
<h1><?php _e( 'Thanks for installing!', 'sportspress' ); ?></h1>
|
773 |
+
|
774 |
+
<div class="sp-banner"><img src="//ps.w.org/sportspress/assets/banner-772x250.png"></div>
|
775 |
+
|
776 |
+
<div class="sp-setup-next-steps">
|
777 |
+
<?php foreach ( $steps as $class => $step ) { ?>
|
778 |
+
<div class="sp-setup-next-steps-<?php echo $class; ?>">
|
779 |
+
<h2><?php echo $step['label']; ?></h2>
|
780 |
+
<ul>
|
781 |
+
<li><?php echo $step['content']; ?></li>
|
782 |
+
</ul>
|
783 |
+
</div>
|
784 |
+
<?php } ?>
|
785 |
+
</div>
|
786 |
+
<?php
|
787 |
+
}
|
788 |
+
}
|
789 |
+
|
790 |
+
new WC_Admin_Setup_Wizard();
|
includes/admin/class-sp-admin-welcome.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* @author ThemeBoy
|
10 |
* @category Admin
|
11 |
* @package SportsPress/Admin
|
12 |
-
* @version
|
13 |
*/
|
14 |
|
15 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -173,203 +173,83 @@ class SP_Admin_Welcome {
|
|
173 |
SP_Admin_Sample_Data::delete_posts();
|
174 |
SP_Admin_Sample_Data::insert_posts();
|
175 |
endif;
|
|
|
|
|
176 |
?>
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
<div class="col">
|
191 |
-
<img src="https://www.themeboy.com/wp-content/uploads/event-blocks-style.png" alt="Widgets">
|
192 |
-
<h3>Widgets</h3>
|
193 |
-
<p>All related content including widgets can be styled instantly by enabling <strong>Frontend Styles</strong> in <a href="<?php echo add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), admin_url( 'admin.php' ) ); ?>">General Options</a>.</p>
|
194 |
-
</div>
|
195 |
-
</div>
|
196 |
|
197 |
-
|
198 |
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
</
|
208 |
-
<
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
</
|
213 |
-
<
|
214 |
-
<img src="https://www.themeboy.com/wp-content/uploads/time-format.png" alt="Time Format">
|
215 |
-
<h3>Time Format</h3>
|
216 |
-
<p>A new <strong>Time</strong> format has been added to player performance settings. Times are saved as minutes, and displayed using time format with <em>0:00</em> as the default.</p>
|
217 |
-
</div>
|
218 |
</div>
|
|
|
219 |
|
220 |
-
|
221 |
|
222 |
-
|
223 |
-
|
|
|
224 |
<div class="col">
|
225 |
-
<
|
226 |
-
<
|
227 |
-
<p>Bulk actions has been added to instantly generate team calendars. Simply select the checkboxes next to each team, then choose <strong>Generate Calendars</strong> from the <strong>Bulk Actions</strong> dropdown and voilà!</p>
|
228 |
</div>
|
229 |
<div class="col">
|
230 |
-
<
|
231 |
-
<
|
232 |
-
<p>Quickly add players to teams using the <strong>Bulk Edit</strong> feature. New sections have been added to select the current teams and past teams for multiple players at once.</p>
|
233 |
-
</div>
|
234 |
-
</div>
|
235 |
-
|
236 |
-
<hr />
|
237 |
-
|
238 |
-
<div class="changelog">
|
239 |
-
<h2>Admin Improvements</h2>
|
240 |
-
<div class="under-the-hood three-col">
|
241 |
-
<div class="col">
|
242 |
-
<h3>Player List Limits</h3>
|
243 |
-
<p>A limit option has been added to player lists when automatically adding players, enabling speedier queries.</p>
|
244 |
-
</div>
|
245 |
-
<div class="col">
|
246 |
-
<h3>Mixed Statistic Columns</h3>
|
247 |
-
<p>The order of player performance and statistics can now be mixed together by editing the order of each variable.</p>
|
248 |
-
</div>
|
249 |
-
<div class="col">
|
250 |
-
<h3>Explicit Team URL Redirect</h3>
|
251 |
-
<p>Decide whether to use native team pages or to redirect teams to their external URLs using the new <strong>Redirect</strong> option.</p>
|
252 |
-
</div>
|
253 |
</div>
|
254 |
-
|
255 |
-
|
256 |
-
<
|
257 |
-
<h3>Quick Edit Players</h3>
|
258 |
-
<p>In addition to editing the teams a player belongs to, squad numbers can also be updated via the <strong>Quick Edit</strong> menu</p>
|
259 |
-
</div>
|
260 |
-
<div class="col">
|
261 |
-
<h3>Independent Timed Option</h3>
|
262 |
-
<p>Choose which values in the box score need minutes recorded, with an independent setting for each column.</p>
|
263 |
-
</div>
|
264 |
-
<div class="col">
|
265 |
-
<h3>Taxonomies in REST API</h3>
|
266 |
-
<p>New endpoints have been added for taxonomies including seasons, competitions, venues, positions, and jobs.</p>
|
267 |
-
</div>
|
268 |
-
</div>
|
269 |
-
</div>
|
270 |
-
|
271 |
-
<hr />
|
272 |
-
|
273 |
-
<div class="changelog">
|
274 |
-
<h2>Under the Hood</h2>
|
275 |
-
<div class="under-the-hood three-col">
|
276 |
-
<div class="col">
|
277 |
-
<h3>Variables Filtered by Offense and Defense</h3>
|
278 |
-
<p>Offense and defense statistics are now calculated using only the player performance from the same category.</p>
|
279 |
-
</div>
|
280 |
-
<div class="col">
|
281 |
-
<h3>Account for Substitution Time</h3>
|
282 |
-
<p>The <strong>Minutes</strong> equation variable is now automatically adjusted by subtracting substitution time.</p>
|
283 |
-
</div>
|
284 |
-
<div class="col">
|
285 |
-
<h3>Division by Zero</h3>
|
286 |
-
<p>No more errors when dividing by zero. Equations with undefined solutions now simply return zero for that value.</p>
|
287 |
-
</div>
|
288 |
</div>
|
289 |
</div>
|
|
|
290 |
|
291 |
-
|
292 |
-
|
293 |
-
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
|
294 |
-
|
295 |
-
<?php } else { ?>
|
296 |
-
|
297 |
-
<div class="sp-feature feature-section col two-col">
|
298 |
-
<div>
|
299 |
-
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
300 |
-
<h4><?php _e( 'Basic Setup', 'sportspress' ); ?></h4>
|
301 |
-
<p><?php _e( 'Select your timezone and sport to get started.', 'sportspress' ); ?></p>
|
302 |
-
<table class="form-table">
|
303 |
-
<tbody>
|
304 |
-
<tr valign="top">
|
305 |
-
<th scope="row" class="titledesc">
|
306 |
-
<label for="timezone_string"><?php _e( 'Timezone', 'sportspress' ); ?> <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Choose a city in the same timezone as you.', 'sportspress' ); ?>"></i></label>
|
307 |
-
</th>
|
308 |
-
<td>
|
309 |
-
<select id="timezone_string" name="timezone_string" class="<?php echo $class; ?>">
|
310 |
-
<?php
|
311 |
-
$current_offset = get_option('gmt_offset');
|
312 |
-
$tzstring = get_option('timezone_string');
|
313 |
-
|
314 |
-
$check_zone_info = true;
|
315 |
-
|
316 |
-
// Remove old Etc mappings. Fallback to gmt_offset.
|
317 |
-
if ( false !== strpos($tzstring,'Etc/GMT') )
|
318 |
-
$tzstring = '';
|
319 |
-
|
320 |
-
if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
|
321 |
-
$check_zone_info = false;
|
322 |
-
if ( 0 == $current_offset )
|
323 |
-
$tzstring = 'UTC+0';
|
324 |
-
elseif ($current_offset < 0)
|
325 |
-
$tzstring = 'UTC' . $current_offset;
|
326 |
-
else
|
327 |
-
$tzstring = 'UTC+' . $current_offset;
|
328 |
-
}
|
329 |
-
echo wp_timezone_choice($tzstring);
|
330 |
-
?>
|
331 |
-
</select>
|
332 |
-
</td>
|
333 |
-
</tr>
|
334 |
-
<?php
|
335 |
-
$sport_options = SP_Admin_Sports::get_preset_options();
|
336 |
-
$settings = array(
|
337 |
-
array(
|
338 |
-
'id' => 'sportspress_sport',
|
339 |
-
'default' => get_option( 'sportspress_sport', 'custom' ),
|
340 |
-
'type' => 'sport',
|
341 |
-
'title' => __( 'Sport', 'sportspress' ),
|
342 |
-
'welcome' => true,
|
343 |
-
'class' => $class,
|
344 |
-
'options' => $sport_options,
|
345 |
-
),
|
346 |
-
);
|
347 |
-
SP_Admin_Settings::output_fields( $settings );
|
348 |
-
?>
|
349 |
-
</tbody>
|
350 |
-
</table>
|
351 |
-
<p class="submit sportspress-actions">
|
352 |
-
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save Changes', 'sportspress' ); ?>" />
|
353 |
-
<input type="hidden" name="subtab" id="last_tab" />
|
354 |
-
<?php wp_nonce_field( 'sportspress-settings' ); ?>
|
355 |
-
</p>
|
356 |
-
</form>
|
357 |
-
</div>
|
358 |
-
<?php if ( current_user_can( 'install_themes' ) && ! current_theme_supports( 'sportspress' ) ) { ?>
|
359 |
-
<div class="last-feature">
|
360 |
-
<h4><?php _e( 'Free SportsPress Theme', 'sportspress' ); ?></h4>
|
361 |
-
<a href="<?php echo add_query_arg( array( 'theme' => 'rookie' ), network_admin_url( 'theme-install.php' ) ); ?>" class="sp-theme-screenshot"><img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>/assets/images/welcome/rookie.png"></a>
|
362 |
-
<p><?php _e( 'Have you tried the free Rookie theme yet?', 'sportspress' ); ?></p>
|
363 |
-
<p><?php _e( 'Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress' ); ?></p>
|
364 |
-
<p class="sp-module-actions">
|
365 |
-
<a class="button button-large" href="<?php echo add_query_arg( array( 'theme' => 'rookie' ), network_admin_url( 'theme-install.php' ) ); ?>"><?php _e( 'Install Now', 'sportspress' ); ?></a>
|
366 |
-
</p>
|
367 |
-
</div>
|
368 |
-
<?php } ?>
|
369 |
-
</div>
|
370 |
-
|
371 |
-
<?php } ?>
|
372 |
|
|
|
373 |
</div>
|
374 |
<?php
|
375 |
}
|
@@ -723,6 +603,11 @@ class SP_Admin_Welcome {
|
|
723 |
if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'sportspress.php' ) ) )
|
724 |
return;
|
725 |
|
|
|
|
|
|
|
|
|
|
|
726 |
wp_redirect( admin_url( 'index.php?page=sp-about' ) );
|
727 |
exit;
|
728 |
}
|
9 |
* @author ThemeBoy
|
10 |
* @category Admin
|
11 |
* @package SportsPress/Admin
|
12 |
+
* @version 2.3
|
13 |
*/
|
14 |
|
15 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
173 |
SP_Admin_Sample_Data::delete_posts();
|
174 |
SP_Admin_Sample_Data::insert_posts();
|
175 |
endif;
|
176 |
+
|
177 |
+
do_action( 'sportspress_before_welcome_features' );
|
178 |
?>
|
179 |
+
<div class="feature-section two-col">
|
180 |
+
<h2>Mode Switching</h2>
|
181 |
+
<div class="col">
|
182 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-team-vs-team.png" alt="Team vs Team">
|
183 |
+
<h3>Team vs Team</h3>
|
184 |
+
<p>Switch between team and individual mode per event. By default, events are held between teams with multiple players on each side.</p>
|
185 |
+
</div>
|
186 |
+
<div class="col">
|
187 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-player-vs-player.png" alt="Player vs Player">
|
188 |
+
<h3>Player vs Player</h3>
|
189 |
+
<p>Select this mode to remove team selectors in events. Instead, players compete with each other. Select a default mode in <a href="<?php echo add_query_arg( array( 'page' => 'sportspress', 'tab' => 'events' ), admin_url( 'admin.php' ) ); ?>">Event Options</a>.</p>
|
190 |
+
</div>
|
191 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
+
<hr>
|
194 |
|
195 |
+
<div class="feature-section three-col">
|
196 |
+
<h2>Time-Saving Features</h2>
|
197 |
+
<div class="col">
|
198 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-user-registration.png" alt="User Registration">
|
199 |
+
<h3>User Registration</h3>
|
200 |
+
<p>Automatically create player profiles for new users by enabling <strong>User Registration</strong> in <a href="<?php echo add_query_arg( array( 'page' => 'sportspress', 'tab' => 'players' ), admin_url( 'admin.php' ) ); ?>">Player Options</a> and <strong>Membership</strong> in <a href="<?php echo admin_url( 'options-general.php' ); ?>">General Settings</a>.</p>
|
201 |
+
</div>
|
202 |
+
<div class="col">
|
203 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-setup-wizard.png" alt="Setup Wizard">
|
204 |
+
<h3>Setup Wizard</h3>
|
205 |
+
<p>A guided <a href="<?php echo add_query_arg( array( 'page' => 'sp-setup' ), admin_url( 'admin.php' ) ); ?>">Setup Wizard</a> can help you get started by adding basic details, teams, players, staff, venues, and your first event.</p>
|
206 |
+
</div>
|
207 |
+
<div class="col">
|
208 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-send-offs.png" alt="Send Offs">
|
209 |
+
<h3>Send Offs</h3>
|
210 |
+
<p>A new <strong>Send Off</strong> option has been added to player performance settings, limiting the played minutes for sent off players.</p>
|
211 |
+
</div>
|
212 |
+
</div>
|
213 |
|
214 |
+
<hr>
|
215 |
+
|
216 |
+
<div class="feature-section two-col">
|
217 |
+
<h2>New in SportsPress Pro</h2>
|
218 |
+
<div class="col">
|
219 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-user-scores-frontend.png" alt="Frontend Submissions">
|
220 |
+
<h3>Frontend Submissions</h3>
|
221 |
+
<p>Display a frontend section for logged in players to submit their own scores. Optionally, registered staff and team managers can also submit scores for their entire team.</p>
|
222 |
+
</div>
|
223 |
+
<div class="col">
|
224 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-user-scores-admin.png" alt="Admin Approval">
|
225 |
+
<h3>Admin Approval</h3>
|
226 |
+
<p>Once the scores are received, the owner of the event or an admin user can approve or reject each submission. Logged in users can amend their submissions at any time. Only approved scores are published.</p>
|
|
|
|
|
|
|
|
|
227 |
</div>
|
228 |
+
</div>
|
229 |
|
230 |
+
<hr />
|
231 |
|
232 |
+
<div class="changelog">
|
233 |
+
<h2>Under the Hood</h2>
|
234 |
+
<div class="under-the-hood three-col">
|
235 |
<div class="col">
|
236 |
+
<h3>Loading Borrowed Players</h3>
|
237 |
+
<p>Players borrowed from other teams are now automatically loaded when editing events in the dashboard.</p>
|
|
|
238 |
</div>
|
239 |
<div class="col">
|
240 |
+
<h3>Frontend Style Overrides</h3>
|
241 |
+
<p>Text colors have been adjusted to improve readability when using color schemes with dark backgrounds and light text.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
</div>
|
243 |
+
<div class="col">
|
244 |
+
<h3>Shared Box Score Template</h3>
|
245 |
+
<p>The templates used for rendering team and individual box scores have been combined into a single template.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
</div>
|
247 |
</div>
|
248 |
+
</div>
|
249 |
|
250 |
+
<?php do_action( 'sportspress_after_welcome_features' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
252 |
+
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
|
253 |
</div>
|
254 |
<?php
|
255 |
}
|
603 |
if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'sportspress.php' ) ) )
|
604 |
return;
|
605 |
|
606 |
+
if ( ! get_option( 'sportspress_completed_setup' ) ) {
|
607 |
+
wp_redirect( admin_url( 'admin.php?page=sp-setup' ) );
|
608 |
+
exit;
|
609 |
+
}
|
610 |
+
|
611 |
wp_redirect( admin_url( 'index.php?page=sp-about' ) );
|
612 |
exit;
|
613 |
}
|
includes/admin/class-sp-admin.php
CHANGED
@@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
10 |
* @author ThemeBoy
|
11 |
* @category Admin
|
12 |
* @package SportsPress/Admin
|
13 |
-
* @version 2.
|
14 |
*/
|
15 |
class SP_Admin {
|
16 |
|
@@ -55,6 +55,15 @@ class SP_Admin {
|
|
55 |
include( 'class-sp-admin-editor.php' );
|
56 |
endif;
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
/**
|
10 |
* @author ThemeBoy
|
11 |
* @category Admin
|
12 |
* @package SportsPress/Admin
|
13 |
+
* @version 2.3
|
14 |
*/
|
15 |
class SP_Admin {
|
16 |
|
55 |
include( 'class-sp-admin-editor.php' );
|
56 |
endif;
|
57 |
}
|
58 |
+
|
59 |
+
// Setup/welcome
|
60 |
+
if ( ! empty( $_GET['page'] ) ) {
|
61 |
+
switch ( $_GET['page'] ) {
|
62 |
+
case 'sp-setup' :
|
63 |
+
include_once( 'class-sp-admin-setup-wizard.php' );
|
64 |
+
break;
|
65 |
+
}
|
66 |
+
}
|
67 |
}
|
68 |
|
69 |
/**
|
includes/admin/post-types/class-sp-admin-meta-boxes.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author ThemeBoy
|
8 |
* @category Admin
|
9 |
* @package SportsPress/Admin/Meta_Boxes
|
10 |
-
* @version 2.
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -123,6 +123,13 @@ class SP_Admin_Meta_Boxes {
|
|
123 |
'context' => 'side',
|
124 |
'priority' => 'default',
|
125 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
'details' => array(
|
127 |
'title' => __( 'Details', 'sportspress' ),
|
128 |
'save' => 'SP_Meta_Box_Event_Details::save',
|
7 |
* @author ThemeBoy
|
8 |
* @category Admin
|
9 |
* @package SportsPress/Admin/Meta_Boxes
|
10 |
+
* @version 2.3
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
123 |
'context' => 'side',
|
124 |
'priority' => 'default',
|
125 |
),
|
126 |
+
'mode' => array(
|
127 |
+
'title' => __( 'Mode', 'sportspress' ),
|
128 |
+
'save' => 'SP_Meta_Box_Event_Mode::save',
|
129 |
+
'output' => 'SP_Meta_Box_Event_Mode::output',
|
130 |
+
'context' => 'side',
|
131 |
+
'priority' => 'default',
|
132 |
+
),
|
133 |
'details' => array(
|
134 |
'title' => __( 'Details', 'sportspress' ),
|
135 |
'save' => 'SP_Meta_Box_Event_Details::save',
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -25,7 +25,7 @@ class SP_Meta_Box_Event_Details {
|
|
25 |
?>
|
26 |
<?php do_action( 'sportspress_event_details_meta_box', $post ); ?>
|
27 |
<div class="sp-event-day-field">
|
28 |
-
<p><strong><?php _e( 'Match Day', 'sportspress' ); ?></strong></p>
|
29 |
<p>
|
30 |
<input name="sp_day" type="text" class="medium-text" placeholder="<?php _e( 'Default', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>">
|
31 |
</p>
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
25 |
?>
|
26 |
<?php do_action( 'sportspress_event_details_meta_box', $post ); ?>
|
27 |
<div class="sp-event-day-field">
|
28 |
+
<p><strong><?php _e( 'Match Day', 'sportspress' ); ?></strong> <span class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Optional', 'sportspress' ); ?>"></span></p>
|
29 |
<p>
|
30 |
<input name="sp_day" type="text" class="medium-text" placeholder="<?php _e( 'Default', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>">
|
31 |
</p>
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-mode.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Event Mode
|
4 |
+
*
|
5 |
+
* @author ThemeBoy
|
6 |
+
* @category Admin
|
7 |
+
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
12 |
+
|
13 |
+
/**
|
14 |
+
* SP_Meta_Box_Event_Mode
|
15 |
+
*/
|
16 |
+
class SP_Meta_Box_Event_Mode {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Output the metabox
|
20 |
+
*/
|
21 |
+
public static function output( $post ) {
|
22 |
+
$the_mode = sp_get_post_mode( $post->ID );
|
23 |
+
?>
|
24 |
+
<div id="post-formats-select">
|
25 |
+
<?php foreach ( array( 'team' => __( 'Team vs team', 'sportspress' ), 'player' => __( 'Player vs player', 'sportspress' ) ) as $key => $mode ): ?>
|
26 |
+
<input type="radio" name="sp_mode" class="post-format" id="post-format-<?php echo $key; ?>" value="<?php echo $key; ?>" <?php checked( $the_mode, $key ); ?>> <label for="post-format-<?php echo $key; ?>" class="post-format-icon post-format-<?php echo $key; ?>"><?php echo $mode; ?></label><br>
|
27 |
+
<?php endforeach; ?>
|
28 |
+
</div>
|
29 |
+
<?php
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Save meta box data
|
34 |
+
*/
|
35 |
+
public static function save( $post_id, $post ) {
|
36 |
+
update_post_meta( $post_id, 'sp_mode', sp_array_value( $_POST, 'sp_mode', 'team' ) );
|
37 |
+
}
|
38 |
+
}
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -53,17 +53,14 @@ class SP_Meta_Box_Event_Performance {
|
|
53 |
$positions = get_terms( 'sp_position', $args );
|
54 |
endif;
|
55 |
|
56 |
-
// Get status option
|
57 |
-
if ( 'yes' == get_option( 'sportspress_event_show_status', 'yes' ) )
|
58 |
-
$status = true;
|
59 |
-
else
|
60 |
-
$status = false;
|
61 |
-
|
62 |
// Apply filters to labels
|
63 |
$labels = apply_filters( 'sportspress_event_performance_labels_admin', $labels );
|
64 |
|
65 |
// Check if individual mode
|
66 |
-
$is_individual =
|
|
|
|
|
|
|
67 |
|
68 |
self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline, $timed );
|
69 |
}
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
53 |
$positions = get_terms( 'sp_position', $args );
|
54 |
endif;
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
// Apply filters to labels
|
57 |
$labels = apply_filters( 'sportspress_event_performance_labels_admin', $labels );
|
58 |
|
59 |
// Check if individual mode
|
60 |
+
$is_individual = 'player' === sp_get_post_mode( $post->ID );
|
61 |
+
|
62 |
+
// Get status option
|
63 |
+
$status = ! $is_individual;
|
64 |
|
65 |
self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline, $timed );
|
66 |
}
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -236,7 +236,7 @@ class SP_Meta_Box_Event_Results {
|
|
236 |
$auto_columns = wp_list_pluck( $dynamic_results, 'post_name' );
|
237 |
?>
|
238 |
<div class="sp-data-table-container">
|
239 |
-
<table class="widefat sp-data-table">
|
240 |
<thead>
|
241 |
<tr>
|
242 |
<th class="column-team">
|
@@ -265,14 +265,14 @@ class SP_Meta_Box_Event_Results {
|
|
265 |
foreach ( $data as $team_id => $team_results ):
|
266 |
if ( ! $team_id || -1 == $team_id ) continue;
|
267 |
?>
|
268 |
-
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
|
269 |
<td>
|
270 |
<?php echo get_the_title( $team_id ); ?>
|
271 |
</td>
|
272 |
<?php foreach( $columns as $column => $label ):
|
273 |
$value = sp_array_value( $team_results, $column, '' );
|
274 |
?>
|
275 |
-
<td><input type="text" name="sp_results[<?php echo $team_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $value ); ?>"<?php if ( in_array( $column, $auto_columns ) ) { ?> placeholder="<?php _e( '(Auto)', 'sportspress' ); ?>"<?php } ?> /></td>
|
276 |
<?php endforeach; ?>
|
277 |
<td>
|
278 |
<?php
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
236 |
$auto_columns = wp_list_pluck( $dynamic_results, 'post_name' );
|
237 |
?>
|
238 |
<div class="sp-data-table-container">
|
239 |
+
<table class="widefat sp-data-table sp-results-table">
|
240 |
<thead>
|
241 |
<tr>
|
242 |
<th class="column-team">
|
265 |
foreach ( $data as $team_id => $team_results ):
|
266 |
if ( ! $team_id || -1 == $team_id ) continue;
|
267 |
?>
|
268 |
+
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>" data-team="<?php echo $team_id; ?>">
|
269 |
<td>
|
270 |
<?php echo get_the_title( $team_id ); ?>
|
271 |
</td>
|
272 |
<?php foreach( $columns as $column => $label ):
|
273 |
$value = sp_array_value( $team_results, $column, '' );
|
274 |
?>
|
275 |
+
<td><input class="sp-team-<?php echo $column; ?>-input" type="text" name="sp_results[<?php echo $team_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $value ); ?>"<?php if ( in_array( $column, $auto_columns ) ) { ?> placeholder="<?php _e( '(Auto)', 'sportspress' ); ?>"<?php } ?> /></td>
|
276 |
<?php endforeach; ?>
|
277 |
<td>
|
278 |
<?php
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -21,7 +21,8 @@ class SP_Meta_Box_Event_Teams {
|
|
21 |
public static function output( $post ) {
|
22 |
$limit = get_option( 'sportspress_event_teams', 2 );
|
23 |
$teams = (array) get_post_meta( $post->ID, 'sp_team', false );
|
24 |
-
|
|
|
25 |
for ( $i = 0; $i < $limit; $i ++ ):
|
26 |
$team = array_shift( $teams );
|
27 |
?>
|
@@ -29,7 +30,7 @@ class SP_Meta_Box_Event_Teams {
|
|
29 |
<p class="sp-tab-select sp-title-generator">
|
30 |
<?php
|
31 |
$args = array(
|
32 |
-
'post_type' =>
|
33 |
'name' => 'sp_team[]',
|
34 |
'class' => 'sportspress-pages',
|
35 |
'show_option_none' => __( '— None —', 'sportspress' ),
|
@@ -119,10 +120,10 @@ class SP_Meta_Box_Event_Teams {
|
|
119 |
endfor;
|
120 |
} else {
|
121 |
?>
|
122 |
-
<p><strong><?php printf( __( 'Select %s:', 'sportspress' ),
|
123 |
<?php
|
124 |
$args = array(
|
125 |
-
'post_type' =>
|
126 |
'name' => 'sp_team[]',
|
127 |
'selected' => $teams,
|
128 |
'values' => 'ID',
|
@@ -132,7 +133,7 @@ class SP_Meta_Box_Event_Teams {
|
|
132 |
'placeholder' => __( 'None', 'sportspress' ),
|
133 |
);
|
134 |
if ( ! sp_dropdown_pages( $args ) ):
|
135 |
-
sp_post_adder(
|
136 |
endif;
|
137 |
}
|
138 |
wp_nonce_field( 'sp-get-players', 'sp-get-players-nonce', false );
|
@@ -142,17 +143,30 @@ class SP_Meta_Box_Event_Teams {
|
|
142 |
* Save meta box data
|
143 |
*/
|
144 |
public static function save( $post_id, $post ) {
|
145 |
-
|
146 |
-
|
147 |
-
$
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
154 |
sp_update_post_meta_recursive( $post_id, 'sp_player', $players );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
-
sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array() ) );
|
157 |
}
|
158 |
}
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
21 |
public static function output( $post ) {
|
22 |
$limit = get_option( 'sportspress_event_teams', 2 );
|
23 |
$teams = (array) get_post_meta( $post->ID, 'sp_team', false );
|
24 |
+
$post_type = sp_get_post_mode_type( $post->ID );
|
25 |
+
if ( $limit && 'sp_player' !== $post_type ) {
|
26 |
for ( $i = 0; $i < $limit; $i ++ ):
|
27 |
$team = array_shift( $teams );
|
28 |
?>
|
30 |
<p class="sp-tab-select sp-title-generator">
|
31 |
<?php
|
32 |
$args = array(
|
33 |
+
'post_type' => $post_type,
|
34 |
'name' => 'sp_team[]',
|
35 |
'class' => 'sportspress-pages',
|
36 |
'show_option_none' => __( '— None —', 'sportspress' ),
|
120 |
endfor;
|
121 |
} else {
|
122 |
?>
|
123 |
+
<p><strong><?php printf( __( 'Select %s:', 'sportspress' ), sp_get_post_mode_label( $post->ID ) ); ?></strong></p>
|
124 |
<?php
|
125 |
$args = array(
|
126 |
+
'post_type' => $post_type,
|
127 |
'name' => 'sp_team[]',
|
128 |
'selected' => $teams,
|
129 |
'values' => 'ID',
|
133 |
'placeholder' => __( 'None', 'sportspress' ),
|
134 |
);
|
135 |
if ( ! sp_dropdown_pages( $args ) ):
|
136 |
+
sp_post_adder( $post_type, __( 'Add New', 'sportspress' ) );
|
137 |
endif;
|
138 |
}
|
139 |
wp_nonce_field( 'sp-get-players', 'sp-get-players-nonce', false );
|
143 |
* Save meta box data
|
144 |
*/
|
145 |
public static function save( $post_id, $post ) {
|
146 |
+
$teams = sp_array_value( $_POST, 'sp_team', array() );
|
147 |
+
|
148 |
+
sp_update_post_meta_recursive( $post_id, 'sp_team', $teams );
|
149 |
+
|
150 |
+
$post_type = sp_get_post_mode_type( $post->ID );
|
151 |
+
|
152 |
+
if ( 'sp_player' === $post_type ) {
|
153 |
+
$players = array();
|
154 |
+
foreach ( $teams as $player ) {
|
155 |
+
$players[] = array( 0, $player );
|
156 |
+
}
|
157 |
sp_update_post_meta_recursive( $post_id, 'sp_player', $players );
|
158 |
+
} else {
|
159 |
+
$tabs = array();
|
160 |
+
$sections = get_option( 'sportspress_event_performance_sections', -1 );
|
161 |
+
if ( -1 == $sections ) {
|
162 |
+
sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) );
|
163 |
+
} else {
|
164 |
+
$players = array_merge( sp_array_value( $_POST, 'sp_offense', array() ), sp_array_value( $_POST, 'sp_defense', array() ) );
|
165 |
+
sp_update_post_meta_recursive( $post_id, 'sp_offense', sp_array_value( $_POST, 'sp_offense', array() ) );
|
166 |
+
sp_update_post_meta_recursive( $post_id, 'sp_defense', sp_array_value( $_POST, 'sp_defense', array() ) );
|
167 |
+
sp_update_post_meta_recursive( $post_id, 'sp_player', $players );
|
168 |
+
}
|
169 |
+
sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array() ) );
|
170 |
}
|
|
|
171 |
}
|
172 |
}
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -51,7 +51,7 @@ class SP_Meta_Box_List_Data {
|
|
51 |
<th><?php echo in_array( $orderby, array( 'number', 'name' ) ) ? '#' : __( 'Rank', 'sportspress' ); ?></th>
|
52 |
<?php } ?>
|
53 |
<th><?php _e( 'Player', 'sportspress' ); ?></th>
|
54 |
-
<?php if ( array_key_exists( 'team', $columns )
|
55 |
<th><?php _e( 'Team', 'sportspress' ); ?></th>
|
56 |
<?php } ?>
|
57 |
<?php if ( array_key_exists( 'position', $columns ) ) { ?>
|
@@ -103,7 +103,7 @@ class SP_Meta_Box_List_Data {
|
|
103 |
<a class="button button-primary sp-save"><?php _e( 'Save', 'sportspress' ); ?></a>
|
104 |
</span>
|
105 |
</td>
|
106 |
-
<?php if ( array_key_exists( 'team', $columns )
|
107 |
<td>
|
108 |
<?php
|
109 |
$selected = sp_array_value( $player_stats, 'team', get_post_meta( get_the_ID(), 'sp_team', true ) );
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
51 |
<th><?php echo in_array( $orderby, array( 'number', 'name' ) ) ? '#' : __( 'Rank', 'sportspress' ); ?></th>
|
52 |
<?php } ?>
|
53 |
<th><?php _e( 'Player', 'sportspress' ); ?></th>
|
54 |
+
<?php if ( array_key_exists( 'team', $columns ) ) { ?>
|
55 |
<th><?php _e( 'Team', 'sportspress' ); ?></th>
|
56 |
<?php } ?>
|
57 |
<?php if ( array_key_exists( 'position', $columns ) ) { ?>
|
103 |
<a class="button button-primary sp-save"><?php _e( 'Save', 'sportspress' ); ?></a>
|
104 |
</span>
|
105 |
</td>
|
106 |
+
<?php if ( array_key_exists( 'team', $columns ) ) { ?>
|
107 |
<td>
|
108 |
<?php
|
109 |
$selected = sp_array_value( $player_stats, 'team', get_post_meta( get_the_ID(), 'sp_team', true ) );
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -28,10 +28,6 @@ class SP_Meta_Box_List_Details {
|
|
28 |
$order = get_post_meta( $post->ID, 'sp_order', true );
|
29 |
$select = get_post_meta( $post->ID, 'sp_select', true );
|
30 |
$number = get_post_meta( $post->ID, 'sp_number', true );
|
31 |
-
if ( ! $select ) {
|
32 |
-
global $pagenow;
|
33 |
-
$select = ( 'post-new.php' == $pagenow ? 'auto' : 'manual' );
|
34 |
-
}
|
35 |
?>
|
36 |
<div>
|
37 |
<p><strong><?php _e( 'Heading', 'sportspress' ); ?></strong></p>
|
@@ -42,7 +38,6 @@ class SP_Meta_Box_List_Details {
|
|
42 |
sp_taxonomy_field( $taxonomy, $post, true );
|
43 |
}
|
44 |
?>
|
45 |
-
<?php if ( apply_filters( 'sportspress_list_team_selector', true ) ) { ?>
|
46 |
<p><strong><?php _e( 'Team', 'sportspress' ); ?></strong></p>
|
47 |
<p class="sp-tab-select sp-team-era-selector">
|
48 |
<?php
|
@@ -63,7 +58,6 @@ class SP_Meta_Box_List_Details {
|
|
63 |
<option value="past" <?php selected( 'past', $era ); ?>><?php _e( 'Past', 'sportspress' ); ?></option>
|
64 |
</select>
|
65 |
</p>
|
66 |
-
<?php } ?>
|
67 |
<p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p>
|
68 |
<p>
|
69 |
<select name="sp_grouping">
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
28 |
$order = get_post_meta( $post->ID, 'sp_order', true );
|
29 |
$select = get_post_meta( $post->ID, 'sp_select', true );
|
30 |
$number = get_post_meta( $post->ID, 'sp_number', true );
|
|
|
|
|
|
|
|
|
31 |
?>
|
32 |
<div>
|
33 |
<p><strong><?php _e( 'Heading', 'sportspress' ); ?></strong></p>
|
38 |
sp_taxonomy_field( $taxonomy, $post, true );
|
39 |
}
|
40 |
?>
|
|
|
41 |
<p><strong><?php _e( 'Team', 'sportspress' ); ?></strong></p>
|
42 |
<p class="sp-tab-select sp-team-era-selector">
|
43 |
<?php
|
58 |
<option value="past" <?php selected( 'past', $era ); ?>><?php _e( 'Past', 'sportspress' ); ?></option>
|
59 |
</select>
|
60 |
</p>
|
|
|
61 |
<p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p>
|
62 |
<p>
|
63 |
<select name="sp_grouping">
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -48,6 +48,10 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
|
|
48 |
if ( '' === $timed ) {
|
49 |
$timed = true;
|
50 |
}
|
|
|
|
|
|
|
|
|
51 |
?>
|
52 |
<p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
|
53 |
<p>
|
@@ -106,6 +110,26 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
|
|
106 |
</li>
|
107 |
</ul>
|
108 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
<?php
|
110 |
if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
|
111 |
$visible = get_post_meta( $post->ID, 'sp_visible', true );
|
@@ -145,6 +169,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
|
|
145 |
update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
|
146 |
update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0 ) );
|
147 |
update_post_meta( $post_id, 'sp_timed', sp_array_value( $_POST, 'sp_timed', 0 ) );
|
|
|
148 |
if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
|
149 |
update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
|
150 |
}
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
48 |
if ( '' === $timed ) {
|
49 |
$timed = true;
|
50 |
}
|
51 |
+
$sendoff = get_post_meta( $post->ID, 'sp_sendoff', true );
|
52 |
+
if ( '' === $sendoff ) {
|
53 |
+
$sendoff = false;
|
54 |
+
}
|
55 |
?>
|
56 |
<p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
|
57 |
<p>
|
110 |
</li>
|
111 |
</ul>
|
112 |
</div>
|
113 |
+
<div id="sp_sendoffdiv">
|
114 |
+
<p>
|
115 |
+
<strong><?php _e( 'Send Off', 'sportspress' ); ?></strong>
|
116 |
+
<i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( "Don't count minutes after?", 'sportspress' ); ?>"></i>
|
117 |
+
</p>
|
118 |
+
<ul class="sp-sendoff-selector">
|
119 |
+
<li>
|
120 |
+
<label class="selectit">
|
121 |
+
<input name="sp_sendoff" id="sp_sendoff_yes" type="radio" value="1" <?php checked( $sendoff ); ?>>
|
122 |
+
<?php _e( 'Yes', 'sportspress' ); ?>
|
123 |
+
</label>
|
124 |
+
</li>
|
125 |
+
<li>
|
126 |
+
<label class="selectit">
|
127 |
+
<input name="sp_sendoff" id="sp_sendoff_no" type="radio" value="0" <?php checked( ! $sendoff ); ?>>
|
128 |
+
<?php _e( 'No', 'sportspress' ); ?>
|
129 |
+
</label>
|
130 |
+
</li>
|
131 |
+
</ul>
|
132 |
+
</div>
|
133 |
<?php
|
134 |
if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
|
135 |
$visible = get_post_meta( $post->ID, 'sp_visible', true );
|
169 |
update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
|
170 |
update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0 ) );
|
171 |
update_post_meta( $post_id, 'sp_timed', sp_array_value( $_POST, 'sp_timed', 0 ) );
|
172 |
+
update_post_meta( $post_id, 'sp_sendoff', sp_array_value( $_POST, 'sp_sendoff', 0 ) );
|
173 |
if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
|
174 |
update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
|
175 |
}
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -99,7 +99,6 @@ class SP_Meta_Box_Player_Details {
|
|
99 |
?></p>
|
100 |
<?php } ?>
|
101 |
|
102 |
-
<?php if ( apply_filters( 'sportspress_player_teams', true ) ) { ?>
|
103 |
<p><strong><?php _e( 'Current Teams', 'sportspress' ); ?></strong></p>
|
104 |
<p><?php
|
105 |
$args = array(
|
@@ -129,7 +128,6 @@ class SP_Meta_Box_Player_Details {
|
|
129 |
);
|
130 |
sp_dropdown_pages( $args );
|
131 |
?></p>
|
132 |
-
<?php } ?>
|
133 |
|
134 |
<?php if ( taxonomy_exists( 'sp_league' ) ) { ?>
|
135 |
<p><strong><?php _e( 'Competitions', 'sportspress' ); ?></strong></p>
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
99 |
?></p>
|
100 |
<?php } ?>
|
101 |
|
|
|
102 |
<p><strong><?php _e( 'Current Teams', 'sportspress' ); ?></strong></p>
|
103 |
<p><?php
|
104 |
$args = array(
|
128 |
);
|
129 |
sp_dropdown_pages( $args );
|
130 |
?></p>
|
|
|
131 |
|
132 |
<?php if ( taxonomy_exists( 'sp_league' ) ) { ?>
|
133 |
<p><strong><?php _e( 'Competitions', 'sportspress' ); ?></strong></p>
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -89,7 +89,6 @@ class SP_Meta_Box_Staff_Details {
|
|
89 |
<?php endforeach; ?>
|
90 |
</select></p>
|
91 |
|
92 |
-
<?php if ( apply_filters( 'sportspress_staff_teams', true ) ) { ?>
|
93 |
<p><strong><?php _e( 'Current Teams', 'sportspress' ); ?></strong></p>
|
94 |
<p><?php
|
95 |
$args = array(
|
@@ -119,7 +118,6 @@ class SP_Meta_Box_Staff_Details {
|
|
119 |
);
|
120 |
sp_dropdown_pages( $args );
|
121 |
?></p>
|
122 |
-
<?php } ?>
|
123 |
|
124 |
<p><strong><?php _e( 'Competitions', 'sportspress' ); ?></strong></p>
|
125 |
<p><?php
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
89 |
<?php endforeach; ?>
|
90 |
</select></p>
|
91 |
|
|
|
92 |
<p><strong><?php _e( 'Current Teams', 'sportspress' ); ?></strong></p>
|
93 |
<p><?php
|
94 |
$args = array(
|
118 |
);
|
119 |
sp_dropdown_pages( $args );
|
120 |
?></p>
|
|
|
121 |
|
122 |
<p><strong><?php _e( 'Competitions', 'sportspress' ); ?></strong></p>
|
123 |
<p><?php
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -23,7 +23,7 @@ class SP_Meta_Box_Table_Data {
|
|
23 |
list( $columns, $usecolumns, $data, $placeholders, $merged ) = $table->data( true );
|
24 |
$adjustments = $table->adjustments;
|
25 |
$highlight = get_post_meta( $table->ID, 'sp_highlight', true );
|
26 |
-
self::table( $columns, $usecolumns, $data, $placeholders, $adjustments, $highlight );
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -39,10 +39,19 @@ class SP_Meta_Box_Table_Data {
|
|
39 |
/**
|
40 |
* Admin edit table
|
41 |
*/
|
42 |
-
public static function table( $columns = array(), $usecolumns = null, $data = array(), $placeholders = array(), $adjustments = array(), $highlight = null ) {
|
43 |
if ( is_array( $usecolumns ) )
|
44 |
$usecolumns = array_filter( $usecolumns );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
$show_team_logo = get_option( 'sportspress_table_show_logos', 'no' ) == 'yes' ? true : false;
|
|
|
|
|
46 |
?>
|
47 |
<input type="hidden" name="sp_highlight" value="0">
|
48 |
<ul class="subsubsub sp-table-bar">
|
@@ -53,7 +62,7 @@ class SP_Meta_Box_Table_Data {
|
|
53 |
<table class="widefat sp-data-table sp-league-table">
|
54 |
<thead>
|
55 |
<tr>
|
56 |
-
<th class="radio"><span class="dashicons
|
57 |
<th><?php _e( 'Team', 'sportspress' ); ?></th>
|
58 |
<?php foreach ( $columns as $key => $label ): ?>
|
59 |
<th><label for="sp_columns_<?php echo $key; ?>">
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
23 |
list( $columns, $usecolumns, $data, $placeholders, $merged ) = $table->data( true );
|
24 |
$adjustments = $table->adjustments;
|
25 |
$highlight = get_post_meta( $table->ID, 'sp_highlight', true );
|
26 |
+
self::table( $table->ID, $columns, $usecolumns, $data, $placeholders, $adjustments, $highlight );
|
27 |
}
|
28 |
|
29 |
/**
|
39 |
/**
|
40 |
* Admin edit table
|
41 |
*/
|
42 |
+
public static function table( $id, $columns = array(), $usecolumns = null, $data = array(), $placeholders = array(), $adjustments = array(), $highlight = null ) {
|
43 |
if ( is_array( $usecolumns ) )
|
44 |
$usecolumns = array_filter( $usecolumns );
|
45 |
+
|
46 |
+
$mode = sp_get_post_mode( $id );
|
47 |
+
|
48 |
+
if ( 'player' === $mode ) {
|
49 |
+
$show_team_logo = get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false;
|
50 |
+
$icon_class = 'sp-icon-tshirt';
|
51 |
+
} else {
|
52 |
$show_team_logo = get_option( 'sportspress_table_show_logos', 'no' ) == 'yes' ? true : false;
|
53 |
+
$icon_class = 'sp-icon-shield';
|
54 |
+
}
|
55 |
?>
|
56 |
<input type="hidden" name="sp_highlight" value="0">
|
57 |
<ul class="subsubsub sp-table-bar">
|
62 |
<table class="widefat sp-data-table sp-league-table">
|
63 |
<thead>
|
64 |
<tr>
|
65 |
+
<th class="radio"><span class="dashicons <?php echo $icon_class; ?> sp-tip" title="<?php _e( 'Highlight', 'sportspress' ); ?>"></span></th>
|
66 |
<th><?php _e( 'Team', 'sportspress' ); ?></th>
|
67 |
<?php foreach ( $columns as $key => $label ): ?>
|
68 |
<th><label for="sp_columns_<?php echo $key; ?>">
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
-
* @version
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -23,10 +23,7 @@ class SP_Meta_Box_Table_Details {
|
|
23 |
$taxonomies = get_object_taxonomies( 'sp_table' );
|
24 |
$caption = get_post_meta( $post->ID, 'sp_caption', true );
|
25 |
$select = get_post_meta( $post->ID, 'sp_select', true );
|
26 |
-
|
27 |
-
global $pagenow;
|
28 |
-
$select = ( 'post-new.php' ? 'auto' : 'manual' );
|
29 |
-
}
|
30 |
?>
|
31 |
<div>
|
32 |
<p><strong><?php _e( 'Heading', 'sportspress' ); ?></strong></p>
|
@@ -38,7 +35,7 @@ class SP_Meta_Box_Table_Details {
|
|
38 |
}
|
39 |
?>
|
40 |
<p><strong>
|
41 |
-
<?php
|
42 |
</strong></p>
|
43 |
<p class="sp-select-setting">
|
44 |
<select name="sp_select">
|
@@ -48,8 +45,8 @@ class SP_Meta_Box_Table_Details {
|
|
48 |
</p>
|
49 |
<?php
|
50 |
if ( 'manual' == $select ) {
|
51 |
-
sp_post_checklist( $post->ID,
|
52 |
-
sp_post_adder(
|
53 |
}
|
54 |
?>
|
55 |
</div>
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
23 |
$taxonomies = get_object_taxonomies( 'sp_table' );
|
24 |
$caption = get_post_meta( $post->ID, 'sp_caption', true );
|
25 |
$select = get_post_meta( $post->ID, 'sp_select', true );
|
26 |
+
$post_type = sp_get_post_mode_type( $post->ID );
|
|
|
|
|
|
|
27 |
?>
|
28 |
<div>
|
29 |
<p><strong><?php _e( 'Heading', 'sportspress' ); ?></strong></p>
|
35 |
}
|
36 |
?>
|
37 |
<p><strong>
|
38 |
+
<?php echo sp_get_post_mode_label( $post->ID ); ?>
|
39 |
</strong></p>
|
40 |
<p class="sp-select-setting">
|
41 |
<select name="sp_select">
|
45 |
</p>
|
46 |
<?php
|
47 |
if ( 'manual' == $select ) {
|
48 |
+
sp_post_checklist( $post->ID, $post_type, ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season' ), null, 'sp_team' );
|
49 |
+
sp_post_adder( $post_type, __( 'Add New', 'sportspress' ) );
|
50 |
}
|
51 |
?>
|
52 |
</div>
|
includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* League Table Mode
|
4 |
+
*
|
5 |
+
* @author ThemeBoy
|
6 |
+
* @category Admin
|
7 |
+
* @package SportsPress/Admin/Meta_Boxes
|
8 |
+
* @version 2.3
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
12 |
+
|
13 |
+
/**
|
14 |
+
* SP_Meta_Box_Table_Mode
|
15 |
+
*/
|
16 |
+
class SP_Meta_Box_Table_Mode {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Output the metabox
|
20 |
+
*/
|
21 |
+
public static function output( $post ) {
|
22 |
+
$the_mode = sp_get_post_mode( $post->ID );
|
23 |
+
?>
|
24 |
+
<div id="post-formats-select">
|
25 |
+
<?php foreach ( array( 'team' => __( 'Team vs team', 'sportspress' ), 'player' => __( 'Player vs player', 'sportspress' ) ) as $key => $mode ): ?>
|
26 |
+
<input type="radio" name="sp_mode" class="post-format" id="post-format-<?php echo $key; ?>" value="<?php echo $key; ?>" <?php checked( $the_mode, $key ); ?>> <label for="post-format-<?php echo $key; ?>" class="post-format-icon post-format-<?php echo $key; ?>"><?php echo $mode; ?></label><br>
|
27 |
+
<?php endforeach; ?>
|
28 |
+
</div>
|
29 |
+
<?php
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Save meta box data
|
34 |
+
*/
|
35 |
+
public static function save( $post_id, $post ) {
|
36 |
+
update_post_meta( $post_id, 'sp_mode', sp_array_value( $_POST, 'sp_mode', 'team' ) );
|
37 |
+
}
|
38 |
+
}
|
includes/admin/settings/class-sp-settings-events.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -27,7 +27,6 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|
27 |
|
28 |
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
|
29 |
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
|
30 |
-
add_action( 'sportspress_admin_field_current_mode', array( $this, 'current_mode_setting' ) );
|
31 |
add_action( 'sportspress_admin_field_delimiter', array( $this, 'delimiter_setting' ) );
|
32 |
add_action( 'sportspress_admin_field_event_layout', array( $this, 'layout_setting' ) );
|
33 |
add_action( 'sportspress_admin_field_event_tabs', array( $this, 'tabs_setting' ) );
|
@@ -98,18 +97,16 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|
98 |
|
99 |
array(
|
100 |
array(
|
101 |
-
'title' => __( '
|
102 |
-
'id' => '
|
103 |
-
'default' => '
|
104 |
'type' => 'radio',
|
105 |
'options' => array(
|
106 |
-
'
|
107 |
-
'
|
108 |
),
|
109 |
'desc_tip' => _x( 'Who competes in events?', 'mode setting description', 'sportspress' ),
|
110 |
),
|
111 |
-
|
112 |
-
array( 'type' => 'current_mode' ),
|
113 |
|
114 |
array(
|
115 |
'title' => __( 'Limit', 'sportspress' ),
|
@@ -476,21 +473,6 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|
476 |
</tr>
|
477 |
<?php
|
478 |
}
|
479 |
-
|
480 |
-
/**
|
481 |
-
* Output script to refresh page when mode is changed.
|
482 |
-
*/
|
483 |
-
function current_mode_setting() {
|
484 |
-
?>
|
485 |
-
<input type="hidden" name="sportspress_individual_mode_module_loaded" value="<?php echo get_option( 'sportspress_load_individual_mode_module', 'no' ); ?>">
|
486 |
-
<?php if ( sp_array_value( $_POST, 'sportspress_load_individual_mode_module', 'no' ) !== sp_array_value( $_POST, 'sportspress_individual_mode_module_loaded', 'no' ) ) { ?>
|
487 |
-
<script type="text/javascript">
|
488 |
-
window.onload = function() {
|
489 |
-
window.location = window.location.href;
|
490 |
-
}
|
491 |
-
</script>
|
492 |
-
<?php }
|
493 |
-
}
|
494 |
}
|
495 |
|
496 |
endif;
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
27 |
|
28 |
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
|
29 |
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
|
|
|
30 |
add_action( 'sportspress_admin_field_delimiter', array( $this, 'delimiter_setting' ) );
|
31 |
add_action( 'sportspress_admin_field_event_layout', array( $this, 'layout_setting' ) );
|
32 |
add_action( 'sportspress_admin_field_event_tabs', array( $this, 'tabs_setting' ) );
|
97 |
|
98 |
array(
|
99 |
array(
|
100 |
+
'title' => __( 'Default mode', 'sportspress' ),
|
101 |
+
'id' => 'sportspress_mode',
|
102 |
+
'default' => 'team',
|
103 |
'type' => 'radio',
|
104 |
'options' => array(
|
105 |
+
'team' => __( 'Team vs team', 'sportspress' ),
|
106 |
+
'player' => __( 'Player vs player', 'sportspress' ),
|
107 |
),
|
108 |
'desc_tip' => _x( 'Who competes in events?', 'mode setting description', 'sportspress' ),
|
109 |
),
|
|
|
|
|
110 |
|
111 |
array(
|
112 |
'title' => __( 'Limit', 'sportspress' ),
|
473 |
</tr>
|
474 |
<?php
|
475 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
}
|
477 |
|
478 |
endif;
|
includes/admin/settings/class-sp-settings-general.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -52,7 +52,7 @@ class SP_Settings_General extends SP_Settings_Page {
|
|
52 |
array(
|
53 |
'title' => __( 'Sport', 'sportspress' ),
|
54 |
'id' => 'sportspress_sport',
|
55 |
-
'default' => '
|
56 |
'type' => 'sport',
|
57 |
'options' => $presets,
|
58 |
),
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
52 |
array(
|
53 |
'title' => __( 'Sport', 'sportspress' ),
|
54 |
'id' => 'sportspress_sport',
|
55 |
+
'default' => 'none',
|
56 |
'type' => 'sport',
|
57 |
'options' => $presets,
|
58 |
),
|
includes/admin/settings/class-sp-settings-modules.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
-
* @version 2.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -122,7 +122,7 @@ class SP_Settings_Modules extends SP_Settings_Page {
|
|
122 |
</thead>
|
123 |
<tbody>
|
124 |
<tr><td>
|
125 |
-
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>/assets/images/
|
126 |
<p><?php _e( 'Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress' ); ?></p>
|
127 |
<p class="sp-module-actions">
|
128 |
<span><?php _e( 'Free', 'sportspress' ); ?></span>
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Admin
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
122 |
</thead>
|
123 |
<tbody>
|
124 |
<tr><td>
|
125 |
+
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>/assets/images/welcome/rookie.png" class="sp-theme-screenshot">
|
126 |
<p><?php _e( 'Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress' ); ?></p>
|
127 |
<p class="sp-module-actions">
|
128 |
<span><?php _e( 'Free', 'sportspress' ); ?></span>
|
includes/admin/views/html-admin-settings.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<div class="wrap sportspress">
|
2 |
-
<h2><?php echo apply_filters( 'sportspress_logo', '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/modules/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png" alt="' . __( 'SportsPress', 'sportspress' ) . '">' ); ?></h2>
|
3 |
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
4 |
<h2 class="nav-tab-wrapper sp-nav-tab-wrapper">
|
5 |
<?php foreach ( $tabs as $name => $label ): ?><a href="<?php echo admin_url( 'admin.php?page=sportspress&tab=' . $name ); ?>" class="nav-tab <?php echo ( $current_tab == $name ? 'nav-tab-active' : '' ); ?>"><?php echo $label; ?></a><?php endforeach; ?>
|
1 |
<div class="wrap sportspress">
|
2 |
+
<h2><?php echo apply_filters( 'sportspress_logo', '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/modules/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png" alt="' . __( 'SportsPress', 'sportspress' ) . '" class="sp-settings-logo">' ); ?></h2>
|
3 |
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
4 |
<h2 class="nav-tab-wrapper sp-nav-tab-wrapper">
|
5 |
<?php foreach ( $tabs as $name => $label ): ?><a href="<?php echo admin_url( 'admin.php?page=sportspress&tab=' . $name ); ?>" class="nav-tab <?php echo ( $current_tab == $name ? 'nav-tab-active' : '' ); ?>"><?php echo $label; ?></a><?php endforeach; ?>
|
includes/admin/views/html-notice-install.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
?>
|
4 |
<div id="message" class="updated sportspress-message">
|
5 |
-
<p><strong><?php
|
6 |
<p class="submit">
|
7 |
-
<a class="button-primary" href="<?php echo admin_url( add_query_arg( array( 'page' => 'sp-
|
8 |
<a class="button-secondary" href="<?php echo add_query_arg('skip_install_sportspress', 'true' ); ?>"><?php _e( 'Hide this notice', 'sportspress' ); ?></a>
|
9 |
</p>
|
10 |
</div>
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
?>
|
4 |
<div id="message" class="updated sportspress-message">
|
5 |
+
<p><strong><?php _e( 'Welcome to SportsPress', 'sportspress' ); ?></strong> – <?php _e( "Let's get started with some basic settings.", 'sportspress' ); ?></p>
|
6 |
<p class="submit">
|
7 |
+
<a class="button-primary" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-setup', 'install_sportspress' => 'true' ), 'admin.php' ) ) ); ?>"><?php _e( 'Run the Setup Wizard', 'sportspress' ); ?></a>
|
8 |
<a class="button-secondary" href="<?php echo add_query_arg('skip_install_sportspress', 'true' ); ?>"><?php _e( 'Hide this notice', 'sportspress' ); ?></a>
|
9 |
</p>
|
10 |
</div>
|
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
|
@@ -46,33 +46,16 @@ class SP_Install {
|
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
-
*
|
50 |
*/
|
51 |
public function install_actions() {
|
52 |
-
|
53 |
-
if ( ! empty( $_GET['install_sportspress'] ) ) {
|
54 |
-
|
55 |
-
// We no longer need to install pages
|
56 |
-
delete_option( '_sp_needs_welcome' );
|
57 |
-
update_option( 'sportspress_installed', 1 );
|
58 |
-
delete_transient( '_sp_activation_redirect' );
|
59 |
-
|
60 |
-
// What's new redirect
|
61 |
-
//wp_redirect( admin_url( 'index.php?page=sp-about&sp-installed=true' ) );
|
62 |
-
//exit;
|
63 |
-
|
64 |
-
// Skip button
|
65 |
-
} elseif ( ! empty( $_GET['skip_install_sportspress'] ) ) {
|
66 |
|
67 |
// We no longer need to install configs
|
68 |
delete_option( '_sp_needs_welcome' );
|
69 |
update_option( 'sportspress_installed', 1 );
|
|
|
70 |
delete_transient( '_sp_activation_redirect' );
|
71 |
-
|
72 |
-
// What's new redirect
|
73 |
-
wp_redirect( admin_url( 'index.php?page=sp-about' ) );
|
74 |
-
exit;
|
75 |
-
|
76 |
}
|
77 |
}
|
78 |
|
@@ -401,7 +384,7 @@ class SP_Install {
|
|
401 |
* @return void
|
402 |
*/
|
403 |
public function upgrades( $version = null ) {
|
404 |
-
if (
|
405 |
|
406 |
if ( version_compare( $version, '2.0', '<' ) ) {
|
407 |
update_option( 'sportspress_player_columns', 'manual' );
|
@@ -436,6 +419,19 @@ class SP_Install {
|
|
436 |
$option = get_option( 'sportspress_player_show_total', 'no' );
|
437 |
update_option( 'sportspress_player_show_career_total', $option );
|
438 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
}
|
440 |
|
441 |
/**
|
@@ -510,6 +506,7 @@ class SP_Install {
|
|
510 |
foreach ( $cap_group as $cap ) {
|
511 |
$wp_roles->remove_cap( 'sp_player', $cap );
|
512 |
$wp_roles->remove_cap( 'sp_staff', $cap );
|
|
|
513 |
$wp_roles->remove_cap( 'sp_team_manager', $cap );
|
514 |
$wp_roles->remove_cap( 'sp_league_manager', $cap );
|
515 |
$wp_roles->remove_cap( 'administrator', $cap );
|
5 |
* @author ThemeBoy
|
6 |
* @category Admin
|
7 |
* @package SportsPress/Classes
|
8 |
+
* @version 2.3
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
+
* Basic setup when a button is clicked.
|
50 |
*/
|
51 |
public function install_actions() {
|
52 |
+
if ( ! empty( $_GET['skip_install_sportspress'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
// We no longer need to install configs
|
55 |
delete_option( '_sp_needs_welcome' );
|
56 |
update_option( 'sportspress_installed', 1 );
|
57 |
+
update_option( 'sportspress_completed_setup', 1 );
|
58 |
delete_transient( '_sp_activation_redirect' );
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
}
|
61 |
|
384 |
* @return void
|
385 |
*/
|
386 |
public function upgrades( $version = null ) {
|
387 |
+
if ( empty( $version ) ) return;
|
388 |
|
389 |
if ( version_compare( $version, '2.0', '<' ) ) {
|
390 |
update_option( 'sportspress_player_columns', 'manual' );
|
419 |
$option = get_option( 'sportspress_player_show_total', 'no' );
|
420 |
update_option( 'sportspress_player_show_career_total', $option );
|
421 |
}
|
422 |
+
|
423 |
+
if ( version_compare( $version, '2.2.11', '<' ) ) {
|
424 |
+
update_option( 'sportspress_completed_setup', 1 );
|
425 |
+
update_option( 'sportspress_registration_name_inputs', 'no' );
|
426 |
+
update_option( 'sportspress_registration_add_player', 'no' );
|
427 |
+
|
428 |
+
$individual_mode = get_option( 'sportspress_load_individual_mode_module', 'no' );
|
429 |
+
if ( 'yes' === $individual_mode ) {
|
430 |
+
update_option( 'sportspress_mode', 'player' );
|
431 |
+
} else {
|
432 |
+
update_option( 'sportspress_mode', 'team' );
|
433 |
+
}
|
434 |
+
}
|
435 |
}
|
436 |
|
437 |
/**
|
506 |
foreach ( $cap_group as $cap ) {
|
507 |
$wp_roles->remove_cap( 'sp_player', $cap );
|
508 |
$wp_roles->remove_cap( 'sp_staff', $cap );
|
509 |
+
$wp_roles->remove_cap( 'sp_event_manager', $cap );
|
510 |
$wp_roles->remove_cap( 'sp_team_manager', $cap );
|
511 |
$wp_roles->remove_cap( 'sp_league_manager', $cap );
|
512 |
$wp_roles->remove_cap( 'administrator', $cap );
|
includes/class-sp-league-table.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The SportsPress league table class handles individual league table data.
|
6 |
*
|
7 |
* @class SP_League_Table
|
8 |
-
* @version 2.
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
@@ -42,11 +42,17 @@ class SP_League_Table extends SP_Custom_Post{
|
|
42 |
$link_events = get_option( 'sportspress_link_events', 'yes' ) === 'yes' ? true : false;
|
43 |
$form_limit = (int) get_option( 'sportspress_form_limit', 5 );
|
44 |
|
|
|
|
|
|
|
45 |
// Get labels from result variables
|
46 |
$result_labels = (array)sp_get_var_labels( 'sp_result' );
|
47 |
|
48 |
// Get labels from outcome variables
|
49 |
$outcome_labels = (array)sp_get_var_labels( 'sp_outcome' );
|
|
|
|
|
|
|
50 |
|
51 |
// Determine if main loop
|
52 |
if ( $team_ids ) {
|
@@ -60,7 +66,7 @@ class SP_League_Table extends SP_Custom_Post{
|
|
60 |
$team_ids = array();
|
61 |
|
62 |
$args = array(
|
63 |
-
'post_type' =>
|
64 |
'numberposts' => -1,
|
65 |
'posts_per_page' => -1,
|
66 |
'order' => 'ASC',
|
5 |
* The SportsPress league table class handles individual league table data.
|
6 |
*
|
7 |
* @class SP_League_Table
|
8 |
+
* @version 2.3
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
42 |
$link_events = get_option( 'sportspress_link_events', 'yes' ) === 'yes' ? true : false;
|
43 |
$form_limit = (int) get_option( 'sportspress_form_limit', 5 );
|
44 |
|
45 |
+
// Apply defaults
|
46 |
+
if ( empty( $select ) ) $select = 'auto';
|
47 |
+
|
48 |
// Get labels from result variables
|
49 |
$result_labels = (array)sp_get_var_labels( 'sp_result' );
|
50 |
|
51 |
// Get labels from outcome variables
|
52 |
$outcome_labels = (array)sp_get_var_labels( 'sp_outcome' );
|
53 |
+
|
54 |
+
// Get post type
|
55 |
+
$post_type = sp_get_post_mode_type( $this->ID );
|
56 |
|
57 |
// Determine if main loop
|
58 |
if ( $team_ids ) {
|
66 |
$team_ids = array();
|
67 |
|
68 |
$args = array(
|
69 |
+
'post_type' => $post_type,
|
70 |
'numberposts' => -1,
|
71 |
'posts_per_page' => -1,
|
72 |
'order' => 'ASC',
|
includes/class-sp-modules.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The SportsPress modules class stores available modules.
|
6 |
*
|
7 |
* @class SP_Modules
|
8 |
-
* @version 2.
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
@@ -36,6 +36,13 @@ class SP_Modules {
|
|
36 |
'link' => 'https://www.themeboy.com/sportspress-extensions/scoreboard/',
|
37 |
'desc' => __( 'Display multiple event results in a horizontal scoreboard.', 'sportspress' ),
|
38 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
'match_stats' => array(
|
40 |
'label' => __( 'Match Stats', 'sportspress' ),
|
41 |
'class' => 'SportsPress_Match_Stats',
|
5 |
* The SportsPress modules class stores available modules.
|
6 |
*
|
7 |
* @class SP_Modules
|
8 |
+
* @version 2.3
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
36 |
'link' => 'https://www.themeboy.com/sportspress-extensions/scoreboard/',
|
37 |
'desc' => __( 'Display multiple event results in a horizontal scoreboard.', 'sportspress' ),
|
38 |
),
|
39 |
+
'user_scores' => array(
|
40 |
+
'label' => __( 'User Scores', 'sportspress' ),
|
41 |
+
'class' => 'SportsPress_User_Scores',
|
42 |
+
'icon' => 'sp-icon-user-scores',
|
43 |
+
'link' => 'https://www.themeboy.com/sportspress-extensions/user-scores/',
|
44 |
+
'desc' => __( 'Let players, staff, and visitors submit event scores for review.', 'sportspress' ),
|
45 |
+
),
|
46 |
'match_stats' => array(
|
47 |
'label' => __( 'Match Stats', 'sportspress' ),
|
48 |
'class' => 'SportsPress_Match_Stats',
|
includes/class-sp-player-list.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The SportsPress player list class handles individual player list data.
|
6 |
*
|
7 |
* @class SP_Player_List
|
8 |
-
* @version 2.2
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
@@ -25,7 +25,7 @@ class SP_Player_List extends SP_Custom_Post {
|
|
25 |
parent::__construct( $post );
|
26 |
$this->columns = get_post_meta( $this->ID, 'sp_columns', true );
|
27 |
if ( is_array( $this->columns ) ) $this->columns = array_filter( $this->columns );
|
28 |
-
else $this->columns = array();
|
29 |
}
|
30 |
|
31 |
/**
|
@@ -47,6 +47,11 @@ class SP_Player_List extends SP_Custom_Post {
|
|
47 |
$order = get_post_meta( $this->ID, 'sp_order', true );
|
48 |
$select = get_post_meta( $this->ID, 'sp_select', true );
|
49 |
|
|
|
|
|
|
|
|
|
|
|
50 |
// Get labels from performance variables
|
51 |
$performance_labels = (array)sp_get_var_labels( 'sp_performance' );
|
52 |
|
@@ -96,7 +101,7 @@ class SP_Player_List extends SP_Custom_Post {
|
|
96 |
);
|
97 |
endif;
|
98 |
|
99 |
-
if ( $team
|
100 |
$team_key = 'sp_team';
|
101 |
switch ( $era ):
|
102 |
case 'current':
|
@@ -142,6 +147,85 @@ class SP_Player_List extends SP_Custom_Post {
|
|
142 |
$last5s = array();
|
143 |
$last10s = array();
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
foreach ( $player_ids as $player_id ):
|
146 |
if ( ! $player_id )
|
147 |
continue;
|
@@ -320,27 +404,72 @@ class SP_Player_List extends SP_Custom_Post {
|
|
320 |
$totals[ $player_id ]['eventsattended'] ++;
|
321 |
|
322 |
// Continue with incrementing values if active in event
|
323 |
-
if ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ):
|
324 |
$totals[ $player_id ]['eventsplayed'] ++;
|
325 |
-
$totals[ $player_id ]['eventminutes'] += $minutes;
|
326 |
|
327 |
-
//
|
|
|
|
|
|
|
328 |
if ( sp_array_value( $player_performance, 'status' ) === 'sub' ):
|
329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
else:
|
|
|
|
|
|
|
331 |
foreach ( $timeline as $timeline_team => $timeline_players ):
|
332 |
if ( ! is_array( $timeline_players ) ) continue;
|
333 |
foreach ( $timeline_players as $timeline_player => $timeline_performance ):
|
334 |
if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $player_id === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
|
335 |
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
|
336 |
if ( $substitution_time ):
|
337 |
-
|
|
|
|
|
|
|
338 |
endif;
|
339 |
endif;
|
340 |
endforeach;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
endforeach;
|
342 |
endif;
|
343 |
|
|
|
|
|
344 |
if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
|
345 |
$totals[ $player_id ]['eventsstarted'] ++;
|
346 |
elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
|
@@ -452,78 +581,6 @@ class SP_Player_List extends SP_Custom_Post {
|
|
452 |
$totals[ $player_id ]['last10'] = $last10;
|
453 |
endforeach;
|
454 |
|
455 |
-
$args = array(
|
456 |
-
'post_type' => array( 'sp_performance', 'sp_metric', 'sp_statistic' ),
|
457 |
-
'numberposts' => -1,
|
458 |
-
'posts_per_page' => -1,
|
459 |
-
'orderby' => 'menu_order',
|
460 |
-
'order' => 'ASC',
|
461 |
-
'meta_query' => array(
|
462 |
-
'relation' => 'OR',
|
463 |
-
array(
|
464 |
-
'key' => 'sp_format',
|
465 |
-
'value' => 'number',
|
466 |
-
'compare' => 'NOT EXISTS',
|
467 |
-
),
|
468 |
-
array(
|
469 |
-
'key' => 'sp_format',
|
470 |
-
'value' => array( 'equation', 'text' ),
|
471 |
-
'compare' => 'NOT IN',
|
472 |
-
),
|
473 |
-
),
|
474 |
-
);
|
475 |
-
$stats = get_posts( $args );
|
476 |
-
|
477 |
-
$formats = array();
|
478 |
-
$data = array();
|
479 |
-
$merged = array();
|
480 |
-
$column_order = array();
|
481 |
-
$ordered_columns = array();
|
482 |
-
|
483 |
-
if ( $stats ):
|
484 |
-
|
485 |
-
foreach ( $stats as $stat ):
|
486 |
-
|
487 |
-
// Get post meta
|
488 |
-
$meta = get_post_meta( $stat->ID );
|
489 |
-
|
490 |
-
// Add equation to object
|
491 |
-
if ( $stat->post_type == 'sp_metric' ):
|
492 |
-
$stat->equation = null;
|
493 |
-
else:
|
494 |
-
$stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, 0 );
|
495 |
-
endif;
|
496 |
-
|
497 |
-
// Add precision to object
|
498 |
-
$stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ) + 0;
|
499 |
-
|
500 |
-
// Add column name to columns
|
501 |
-
$columns[ $stat->post_name ] = $stat->post_title;
|
502 |
-
|
503 |
-
// Add format
|
504 |
-
$format = get_post_meta( $stat->ID, 'sp_format', true );
|
505 |
-
if ( '' === $format ) {
|
506 |
-
$format = 'number';
|
507 |
-
}
|
508 |
-
$formats[ $stat->post_name ] = $format;
|
509 |
-
|
510 |
-
$column_order[] = $stat->post_name;
|
511 |
-
|
512 |
-
endforeach;
|
513 |
-
|
514 |
-
endif;
|
515 |
-
|
516 |
-
foreach ( $column_order as $slug ):
|
517 |
-
|
518 |
-
if ( ! in_array( $slug, $this->columns ) ) continue;
|
519 |
-
|
520 |
-
$ordered_columns[] = $slug;
|
521 |
-
|
522 |
-
endforeach;
|
523 |
-
|
524 |
-
$diff = array_diff( $this->columns, $ordered_columns );
|
525 |
-
$this->columns = array_merge( $diff, $ordered_columns );
|
526 |
-
|
527 |
// Fill in empty placeholder values for each player
|
528 |
foreach ( $player_ids as $player_id ):
|
529 |
if ( ! $player_id )
|
@@ -648,7 +705,7 @@ class SP_Player_List extends SP_Custom_Post {
|
|
648 |
foreach( $this->columns as $key ):
|
649 |
if ( $key == 'number' ):
|
650 |
$labels[ $key ] = '#';
|
651 |
-
elseif ( $key == 'team'
|
652 |
$labels[ $key ] = __( 'Team', 'sportspress' );
|
653 |
elseif ( $key == 'position' ):
|
654 |
$labels[ $key ] = __( 'Position', 'sportspress' );
|
@@ -695,7 +752,7 @@ class SP_Player_List extends SP_Custom_Post {
|
|
695 |
$labels = array();
|
696 |
if ( in_array( 'number', $this->columns ) ) $labels['number'] = '#';
|
697 |
$labels['name'] = __( 'Player', 'sportspress' );
|
698 |
-
if ( in_array( 'team', $this->columns )
|
699 |
if ( in_array( 'position', $this->columns ) ) $labels['position'] = __( 'Position', 'sportspress' );
|
700 |
|
701 |
$merged[0] = array_merge( $labels, $columns );
|
5 |
* The SportsPress player list class handles individual player list data.
|
6 |
*
|
7 |
* @class SP_Player_List
|
8 |
+
* @version 2.3.2
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
25 |
parent::__construct( $post );
|
26 |
$this->columns = get_post_meta( $this->ID, 'sp_columns', true );
|
27 |
if ( is_array( $this->columns ) ) $this->columns = array_filter( $this->columns );
|
28 |
+
else $this->columns = array( 'number', 'team', 'position' );
|
29 |
}
|
30 |
|
31 |
/**
|
47 |
$order = get_post_meta( $this->ID, 'sp_order', true );
|
48 |
$select = get_post_meta( $this->ID, 'sp_select', true );
|
49 |
|
50 |
+
// Apply defaults
|
51 |
+
if ( empty( $orderby ) ) $orderby = 'number';
|
52 |
+
if ( empty( $order ) ) $order = 'ASC';
|
53 |
+
if ( empty( $select ) ) $select = 'auto';
|
54 |
+
|
55 |
// Get labels from performance variables
|
56 |
$performance_labels = (array)sp_get_var_labels( 'sp_performance' );
|
57 |
|
101 |
);
|
102 |
endif;
|
103 |
|
104 |
+
if ( $team ):
|
105 |
$team_key = 'sp_team';
|
106 |
switch ( $era ):
|
107 |
case 'current':
|
147 |
$last5s = array();
|
148 |
$last10s = array();
|
149 |
|
150 |
+
$args = array(
|
151 |
+
'post_type' => array( 'sp_performance', 'sp_metric', 'sp_statistic' ),
|
152 |
+
'numberposts' => -1,
|
153 |
+
'posts_per_page' => -1,
|
154 |
+
'orderby' => 'menu_order',
|
155 |
+
'order' => 'ASC',
|
156 |
+
'meta_query' => array(
|
157 |
+
'relation' => 'OR',
|
158 |
+
array(
|
159 |
+
'key' => 'sp_format',
|
160 |
+
'value' => 'number',
|
161 |
+
'compare' => 'NOT EXISTS',
|
162 |
+
),
|
163 |
+
array(
|
164 |
+
'key' => 'sp_format',
|
165 |
+
'value' => array( 'equation', 'text' ),
|
166 |
+
'compare' => 'NOT IN',
|
167 |
+
),
|
168 |
+
),
|
169 |
+
);
|
170 |
+
$stats = get_posts( $args );
|
171 |
+
|
172 |
+
$formats = array();
|
173 |
+
$sendoffs = array();
|
174 |
+
$data = array();
|
175 |
+
$merged = array();
|
176 |
+
$column_order = array();
|
177 |
+
$ordered_columns = array();
|
178 |
+
|
179 |
+
if ( $stats ):
|
180 |
+
|
181 |
+
foreach ( $stats as $stat ):
|
182 |
+
|
183 |
+
// Get post meta
|
184 |
+
$meta = get_post_meta( $stat->ID );
|
185 |
+
|
186 |
+
// Add equation to object
|
187 |
+
if ( $stat->post_type == 'sp_metric' ):
|
188 |
+
$stat->equation = null;
|
189 |
+
else:
|
190 |
+
$stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, 0 );
|
191 |
+
endif;
|
192 |
+
|
193 |
+
// Add precision to object
|
194 |
+
$stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ) + 0;
|
195 |
+
|
196 |
+
// Add column name to columns
|
197 |
+
$columns[ $stat->post_name ] = $stat->post_title;
|
198 |
+
|
199 |
+
// Add format
|
200 |
+
$format = get_post_meta( $stat->ID, 'sp_format', true );
|
201 |
+
if ( '' === $format ) {
|
202 |
+
$format = 'number';
|
203 |
+
}
|
204 |
+
$formats[ $stat->post_name ] = $format;
|
205 |
+
|
206 |
+
// Add sendoffs
|
207 |
+
$sendoff = get_post_meta( $stat->ID, 'sp_sendoff', true );
|
208 |
+
if ( $sendoff ) {
|
209 |
+
$sendoffs[] = $stat->post_name;
|
210 |
+
}
|
211 |
+
|
212 |
+
$column_order[] = $stat->post_name;
|
213 |
+
|
214 |
+
endforeach;
|
215 |
+
|
216 |
+
endif;
|
217 |
+
|
218 |
+
foreach ( $column_order as $slug ):
|
219 |
+
|
220 |
+
if ( ! in_array( $slug, $this->columns ) ) continue;
|
221 |
+
|
222 |
+
$ordered_columns[] = $slug;
|
223 |
+
|
224 |
+
endforeach;
|
225 |
+
|
226 |
+
$diff = array_diff( $this->columns, $ordered_columns );
|
227 |
+
$this->columns = array_merge( $diff, $ordered_columns );
|
228 |
+
|
229 |
foreach ( $player_ids as $player_id ):
|
230 |
if ( ! $player_id )
|
231 |
continue;
|
404 |
$totals[ $player_id ]['eventsattended'] ++;
|
405 |
|
406 |
// Continue with incrementing values if active in event
|
407 |
+
if ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ):
|
408 |
$totals[ $player_id ]['eventsplayed'] ++;
|
|
|
409 |
|
410 |
+
// Initialize played minutes
|
411 |
+
$played_minutes = $minutes;
|
412 |
+
|
413 |
+
// Adjust for sendoffs and substitution time
|
414 |
if ( sp_array_value( $player_performance, 'status' ) === 'sub' ):
|
415 |
+
|
416 |
+
// Substituted for another player
|
417 |
+
$timeline_performance = sp_array_value( sp_array_value( $timeline, $team_id, array() ), $player_id, array() );
|
418 |
+
if ( empty( $timeline_performance ) ) continue;
|
419 |
+
foreach ( $sendoffs as $sendoff_key ):
|
420 |
+
if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) continue;
|
421 |
+
$sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key, array() );
|
422 |
+
$sendoff_times = array_filter( $sendoff_times );
|
423 |
+
$sendoff_time = end( $sendoff_times );
|
424 |
+
if ( ! $sendoff_time ) $sendoff_time = 0;
|
425 |
+
|
426 |
+
// Count minutes until being sent off
|
427 |
+
$played_minutes = $sendoff_time;
|
428 |
+
endforeach;
|
429 |
+
|
430 |
+
// Subtract minutes prior to substitution
|
431 |
+
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), 'sub' ), 0, 0 );
|
432 |
+
$played_minutes -= $substitution_time;
|
433 |
else:
|
434 |
+
|
435 |
+
// Starting lineup with possible substitution
|
436 |
+
$subbed_out = false;
|
437 |
foreach ( $timeline as $timeline_team => $timeline_players ):
|
438 |
if ( ! is_array( $timeline_players ) ) continue;
|
439 |
foreach ( $timeline_players as $timeline_player => $timeline_performance ):
|
440 |
if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $player_id === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
|
441 |
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
|
442 |
if ( $substitution_time ):
|
443 |
+
|
444 |
+
// Count minutes until substitution
|
445 |
+
$played_minutes = $substitution_time;
|
446 |
+
$subbed_out = true;
|
447 |
endif;
|
448 |
endif;
|
449 |
endforeach;
|
450 |
+
|
451 |
+
// No need to check for sendoffs if subbed out
|
452 |
+
if ( $subbed_out ) continue;
|
453 |
+
|
454 |
+
// Check for sendoffs
|
455 |
+
$timeline_performance = sp_array_value( $timeline_players, $player_id, array() );
|
456 |
+
if ( empty( $timeline_performance ) ) continue;
|
457 |
+
foreach ( $sendoffs as $sendoff_key ):
|
458 |
+
if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) continue;
|
459 |
+
if ( ! sp_array_value( $player_performance, $sendoff_key, 0 ) ) continue;
|
460 |
+
$sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key );
|
461 |
+
$sendoff_times = array_filter( $sendoff_times );
|
462 |
+
$sendoff_time = end( $sendoff_times );
|
463 |
+
if ( false === $sendoff_time ) continue;
|
464 |
+
|
465 |
+
// Count minutes until being sent off
|
466 |
+
$played_minutes = $sendoff_time;
|
467 |
+
endforeach;
|
468 |
endforeach;
|
469 |
endif;
|
470 |
|
471 |
+
$totals[ $player_id ]['eventminutes'] += max( 0, $played_minutes );
|
472 |
+
|
473 |
if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
|
474 |
$totals[ $player_id ]['eventsstarted'] ++;
|
475 |
elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
|
581 |
$totals[ $player_id ]['last10'] = $last10;
|
582 |
endforeach;
|
583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
// Fill in empty placeholder values for each player
|
585 |
foreach ( $player_ids as $player_id ):
|
586 |
if ( ! $player_id )
|
705 |
foreach( $this->columns as $key ):
|
706 |
if ( $key == 'number' ):
|
707 |
$labels[ $key ] = '#';
|
708 |
+
elseif ( $key == 'team' ):
|
709 |
$labels[ $key ] = __( 'Team', 'sportspress' );
|
710 |
elseif ( $key == 'position' ):
|
711 |
$labels[ $key ] = __( 'Position', 'sportspress' );
|
752 |
$labels = array();
|
753 |
if ( in_array( 'number', $this->columns ) ) $labels['number'] = '#';
|
754 |
$labels['name'] = __( 'Player', 'sportspress' );
|
755 |
+
if ( in_array( 'team', $this->columns ) ) $labels['team'] = __( 'Team', 'sportspress' );
|
756 |
if ( in_array( 'position', $this->columns ) ) $labels['position'] = __( 'Position', 'sportspress' );
|
757 |
|
758 |
$merged[0] = array_merge( $labels, $columns );
|
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.2
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
@@ -161,6 +161,7 @@ class SP_Player extends SP_Custom_Post {
|
|
161 |
|
162 |
$performance_labels = array();
|
163 |
$formats = array();
|
|
|
164 |
|
165 |
foreach ( $posts as $post ):
|
166 |
if ( -1 === $section ) {
|
@@ -182,6 +183,11 @@ class SP_Player extends SP_Custom_Post {
|
|
182 |
$format = 'number';
|
183 |
}
|
184 |
$formats[ $post->post_name ] = $format;
|
|
|
|
|
|
|
|
|
|
|
185 |
endforeach;
|
186 |
|
187 |
// Get statistic labels
|
@@ -353,25 +359,67 @@ class SP_Player extends SP_Custom_Post {
|
|
353 |
// Continue with incrementing values if active in event
|
354 |
if ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ):
|
355 |
$totals['eventsplayed'] ++;
|
356 |
-
$
|
357 |
|
358 |
// Adjust for substitution time
|
359 |
if ( sp_array_value( $player_performance, 'status' ) === 'sub' ):
|
360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
else:
|
|
|
|
|
|
|
362 |
foreach ( $timeline as $timeline_team => $timeline_players ):
|
363 |
if ( ! is_array( $timeline_players ) ) continue;
|
364 |
foreach ( $timeline_players as $timeline_player => $timeline_performance ):
|
365 |
if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $this->ID === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
|
366 |
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
|
367 |
if ( $substitution_time ):
|
368 |
-
|
|
|
|
|
|
|
369 |
endif;
|
370 |
endif;
|
371 |
endforeach;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
endforeach;
|
373 |
endif;
|
374 |
|
|
|
|
|
375 |
if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
|
376 |
$totals['eventsstarted'] ++;
|
377 |
elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
|
@@ -621,6 +669,21 @@ class SP_Player extends SP_Custom_Post {
|
|
621 |
endforeach;
|
622 |
endif;
|
623 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
if ( $admin ):
|
625 |
$labels = array();
|
626 |
if ( is_array( $usecolumns ) ): foreach ( $usecolumns as $key ):
|
@@ -630,6 +693,7 @@ class SP_Player extends SP_Custom_Post {
|
|
630 |
$labels[ $key ] = $columns[ $key ];
|
631 |
endif;
|
632 |
endforeach; endif;
|
|
|
633 |
return array( $labels, $data, $placeholders, $merged, $leagues, $has_checkboxes, $formats );
|
634 |
else:
|
635 |
if ( is_array( $usecolumns ) ):
|
@@ -648,34 +712,9 @@ class SP_Player extends SP_Custom_Post {
|
|
648 |
$labels['name'] = __( 'Season', 'sportspress' );
|
649 |
$labels['team'] = __( 'Team', 'sportspress' );
|
650 |
}
|
651 |
-
|
652 |
-
if ( '
|
653 |
-
|
654 |
-
$total_placeholders = sp_array_value( $placeholders, 0, array() );
|
655 |
-
|
656 |
-
// Get totals as entered directly and filter out the empty values
|
657 |
-
$total_data = sp_array_value( $data, 0, array() );
|
658 |
-
|
659 |
-
// Get totals of all seasons as entered manually
|
660 |
-
$totals = array();
|
661 |
-
foreach ( $merged as $season => $stats ) {
|
662 |
-
foreach ( $stats as $key => $value ) {
|
663 |
-
$value = floatval( $value );
|
664 |
-
$totals[ $key ] = sp_array_value( $totals, $key, 0 ) + $value;
|
665 |
-
}
|
666 |
-
}
|
667 |
-
|
668 |
-
// Merge with direct values
|
669 |
-
foreach ( $total_data as $key => $value ) {
|
670 |
-
if ( '' === $value ) {
|
671 |
-
$total_data[ $key ] = sp_array_value( $totals, $key, 0 );
|
672 |
-
}
|
673 |
-
}
|
674 |
-
|
675 |
-
// Then merge with placeholder values
|
676 |
-
$total = array_merge( $total_placeholders, $total_data );
|
677 |
-
$merged[-1] = $total;
|
678 |
-
$merged[-1]['name'] = __( 'Total', 'sportspress' );
|
679 |
}
|
680 |
|
681 |
// Convert to time notation
|
@@ -703,7 +742,7 @@ class SP_Player extends SP_Custom_Post {
|
|
703 |
endif;
|
704 |
|
705 |
$merged[0] = array_merge( $labels, $columns );
|
706 |
-
|
707 |
return $merged;
|
708 |
endif;
|
709 |
}
|
5 |
* The SportsPress player class handles individual player data.
|
6 |
*
|
7 |
* @class SP_Player
|
8 |
+
* @version 2.3.2
|
9 |
* @package SportsPress/Classes
|
10 |
* @category Class
|
11 |
* @author ThemeBoy
|
161 |
|
162 |
$performance_labels = array();
|
163 |
$formats = array();
|
164 |
+
$sendoffs = array();
|
165 |
|
166 |
foreach ( $posts as $post ):
|
167 |
if ( -1 === $section ) {
|
183 |
$format = 'number';
|
184 |
}
|
185 |
$formats[ $post->post_name ] = $format;
|
186 |
+
|
187 |
+
$sendoff = get_post_meta( $post->ID, 'sp_sendoff', true );
|
188 |
+
if ( $sendoff ) {
|
189 |
+
$sendoffs[] = $post->post_name;
|
190 |
+
}
|
191 |
endforeach;
|
192 |
|
193 |
// Get statistic labels
|
359 |
// Continue with incrementing values if active in event
|
360 |
if ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ):
|
361 |
$totals['eventsplayed'] ++;
|
362 |
+
$played_minutes = $minutes;
|
363 |
|
364 |
// Adjust for substitution time
|
365 |
if ( sp_array_value( $player_performance, 'status' ) === 'sub' ):
|
366 |
+
|
367 |
+
// Substituted for another player
|
368 |
+
$timeline_performance = sp_array_value( sp_array_value( $timeline, $team_id, array() ), $this->ID, array() );
|
369 |
+
if ( empty( $timeline_performance ) ) continue;
|
370 |
+
foreach ( $sendoffs as $sendoff_key ):
|
371 |
+
if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) continue;
|
372 |
+
$sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key );
|
373 |
+
$sendoff_times = array_filter( $sendoff_times );
|
374 |
+
$sendoff_time = end( $sendoff_times );
|
375 |
+
if ( ! $sendoff_time ) $sendoff_time = 0;
|
376 |
+
|
377 |
+
// Count minutes until being sent off
|
378 |
+
$played_minutes = $sendoff_time;
|
379 |
+
endforeach;
|
380 |
+
|
381 |
+
// Subtract minutes prior to substitution
|
382 |
+
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), 'sub' ), 0, 0 );
|
383 |
+
$played_minutes -= $substitution_time;
|
384 |
else:
|
385 |
+
|
386 |
+
// Starting lineup with possible substitution
|
387 |
+
$subbed_out = false;
|
388 |
foreach ( $timeline as $timeline_team => $timeline_players ):
|
389 |
if ( ! is_array( $timeline_players ) ) continue;
|
390 |
foreach ( $timeline_players as $timeline_player => $timeline_performance ):
|
391 |
if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $this->ID === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
|
392 |
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
|
393 |
if ( $substitution_time ):
|
394 |
+
|
395 |
+
// Count minutes until substitution
|
396 |
+
$played_minutes = $substitution_time;
|
397 |
+
$subbed_out = true;
|
398 |
endif;
|
399 |
endif;
|
400 |
endforeach;
|
401 |
+
|
402 |
+
// No need to check for sendoffs if subbed out
|
403 |
+
if ( $subbed_out ) continue;
|
404 |
+
|
405 |
+
// Check for sendoffs
|
406 |
+
$timeline_performance = sp_array_value( $timeline_players, $this->ID, array() );
|
407 |
+
if ( empty( $timeline_performance ) ) continue;
|
408 |
+
foreach ( $sendoffs as $sendoff_key ):
|
409 |
+
if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) continue;
|
410 |
+
$sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key, array() );
|
411 |
+
$sendoff_times = array_filter( $sendoff_times );
|
412 |
+
$sendoff_time = end( $sendoff_times );
|
413 |
+
if ( false === $sendoff_time ) continue;
|
414 |
+
|
415 |
+
// Count minutes until being sent off
|
416 |
+
$played_minutes = $sendoff_time;
|
417 |
+
endforeach;
|
418 |
endforeach;
|
419 |
endif;
|
420 |
|
421 |
+
$totals['eventminutes'] += max( 0, $played_minutes );
|
422 |
+
|
423 |
if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
|
424 |
$totals['eventsstarted'] ++;
|
425 |
elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
|
669 |
endforeach;
|
670 |
endif;
|
671 |
|
672 |
+
// Calculate total statistics
|
673 |
+
$totals = array(
|
674 |
+
'name' => __( 'Total', 'sportspress' ),
|
675 |
+
'team' => '-',
|
676 |
+
);
|
677 |
+
foreach ( $merged as $season => $stats ):
|
678 |
+
if ( ! is_array( $stats ) ) continue;
|
679 |
+
foreach ( $stats as $key => $value ):
|
680 |
+
if ( in_array( $key, array( 'name', 'team' ) ) ) continue;
|
681 |
+
$value = floatval( $value );
|
682 |
+
$totals[ $key ] = sp_array_value( $totals, $key, 0 ) + $value;
|
683 |
+
endforeach;
|
684 |
+
endforeach;
|
685 |
+
$merged[-1] = $totals;
|
686 |
+
|
687 |
if ( $admin ):
|
688 |
$labels = array();
|
689 |
if ( is_array( $usecolumns ) ): foreach ( $usecolumns as $key ):
|
693 |
$labels[ $key ] = $columns[ $key ];
|
694 |
endif;
|
695 |
endforeach; endif;
|
696 |
+
$placeholders[0] = $merged[-1];
|
697 |
return array( $labels, $data, $placeholders, $merged, $leagues, $has_checkboxes, $formats );
|
698 |
else:
|
699 |
if ( is_array( $usecolumns ) ):
|
712 |
$labels['name'] = __( 'Season', 'sportspress' );
|
713 |
$labels['team'] = __( 'Team', 'sportspress' );
|
714 |
}
|
715 |
+
|
716 |
+
if ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) {
|
717 |
+
unset( $merged[-1] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
718 |
}
|
719 |
|
720 |
// Convert to time notation
|
742 |
endif;
|
743 |
|
744 |
$merged[0] = array_merge( $labels, $columns );
|
745 |
+
|
746 |
return $merged;
|
747 |
endif;
|
748 |
}
|
includes/class-sp-template-loader.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Template Loader
|
4 |
*
|
5 |
* @class SP_Template_Loader
|
6 |
-
* @version 2.1
|
7 |
* @package SportsPress/Classes
|
8 |
* @category Class
|
9 |
* @author ThemeBoy
|
@@ -42,29 +42,6 @@ class SP_Template_Loader {
|
|
42 |
|
43 |
$content = '<div class="sp-post-content">' . $content . '</div>';
|
44 |
}
|
45 |
-
|
46 |
-
global $wp_filter;
|
47 |
-
|
48 |
-
// Array of hooks associated with this post type
|
49 |
-
$hooks = array(
|
50 |
-
'sportspress_before_single_' . $type,
|
51 |
-
'sportspress_single_' . $type . '_content',
|
52 |
-
'sportspress_after_single_' . $type,
|
53 |
-
);
|
54 |
-
|
55 |
-
$actions = array();
|
56 |
-
|
57 |
-
// Find all actions associated with those hooks
|
58 |
-
foreach ( $hooks as $hook ) {
|
59 |
-
$priorities = sp_array_value( $wp_filter, $hook, array() );
|
60 |
-
|
61 |
-
foreach ( $priorities as $priority => $action ) {
|
62 |
-
$a = reset( $action );
|
63 |
-
$function = sp_array_value( $a, 'function', false );
|
64 |
-
remove_action( $hook, $function, $priority );
|
65 |
-
$actions[] = $function;
|
66 |
-
}
|
67 |
-
}
|
68 |
|
69 |
// Get layout setting
|
70 |
$layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );
|
@@ -88,6 +65,9 @@ class SP_Template_Loader {
|
|
88 |
}
|
89 |
|
90 |
ob_start();
|
|
|
|
|
|
|
91 |
|
92 |
// Loop through sections
|
93 |
if ( ! empty( $section_templates ) ) {
|
@@ -101,12 +81,17 @@ class SP_Template_Loader {
|
|
101 |
echo '<div class="sp-section-content sp-section-content-' . $key . '">';
|
102 |
if ( 'content' === $key ) {
|
103 |
echo $content;
|
|
|
|
|
104 |
} else {
|
105 |
call_user_func( $template['action'] );
|
106 |
}
|
107 |
echo '</div>';
|
108 |
}
|
109 |
}
|
|
|
|
|
|
|
110 |
|
111 |
$ob = ob_get_clean();
|
112 |
|
3 |
* Template Loader
|
4 |
*
|
5 |
* @class SP_Template_Loader
|
6 |
+
* @version 2.3.1
|
7 |
* @package SportsPress/Classes
|
8 |
* @category Class
|
9 |
* @author ThemeBoy
|
42 |
|
43 |
$content = '<div class="sp-post-content">' . $content . '</div>';
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
// Get layout setting
|
47 |
$layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );
|
65 |
}
|
66 |
|
67 |
ob_start();
|
68 |
+
|
69 |
+
// Before template hook
|
70 |
+
do_action( 'sportspress_before_single_' . $type );
|
71 |
|
72 |
// Loop through sections
|
73 |
if ( ! empty( $section_templates ) ) {
|
81 |
echo '<div class="sp-section-content sp-section-content-' . $key . '">';
|
82 |
if ( 'content' === $key ) {
|
83 |
echo $content;
|
84 |
+
// Template content hook
|
85 |
+
do_action( 'sportspress_single_' . $type . '_content' );
|
86 |
} else {
|
87 |
call_user_func( $template['action'] );
|
88 |
}
|
89 |
echo '</div>';
|
90 |
}
|
91 |
}
|
92 |
+
|
93 |
+
// After template hook
|
94 |
+
do_action( 'sportspress_after_single_' . $type );
|
95 |
|
96 |
$ob = ob_get_clean();
|
97 |
|
includes/sp-core-functions.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author ThemeBoy
|
8 |
* @category Core
|
9 |
* @package SportsPress/Functions
|
10 |
-
* @version 2.
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -502,6 +502,69 @@ if ( !function_exists( 'sp_get_term_sections' ) ) {
|
|
502 |
}
|
503 |
}
|
504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
if ( !function_exists( 'sp_dropdown_statuses' ) ) {
|
506 |
function sp_dropdown_statuses( $args = array() ) {
|
507 |
$defaults = array(
|
@@ -1360,7 +1423,7 @@ function sp_get_text_options() {
|
|
1360 |
__( 'Article', 'sportspress' ),
|
1361 |
__( 'Away', 'sportspress' ),
|
1362 |
__( 'Box Score', 'sportspress' ),
|
1363 |
-
__( '
|
1364 |
__( 'Career Total', 'sportspress' ),
|
1365 |
__( 'Competition', 'sportspress' ),
|
1366 |
__( 'Current Team', 'sportspress' ),
|
7 |
* @author ThemeBoy
|
8 |
* @category Core
|
9 |
* @package SportsPress/Functions
|
10 |
+
* @version 2.3.1
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
502 |
}
|
503 |
}
|
504 |
|
505 |
+
if ( !function_exists( 'sp_get_default_mode' ) ) {
|
506 |
+
function sp_get_default_mode() {
|
507 |
+
$mode = get_option( 'sportspress_mode', 'team' );
|
508 |
+
|
509 |
+
if ( empty( $mode ) ) {
|
510 |
+
$mode = 'team';
|
511 |
+
}
|
512 |
+
|
513 |
+
return $mode;
|
514 |
+
}
|
515 |
+
}
|
516 |
+
|
517 |
+
if ( !function_exists( 'sp_get_post_mode' ) ) {
|
518 |
+
function sp_get_post_mode( $post_id ) {
|
519 |
+
$mode = get_post_meta( $post_id, 'sp_mode', true );
|
520 |
+
|
521 |
+
if ( empty( $mode ) ) {
|
522 |
+
$mode = sp_get_default_mode();
|
523 |
+
}
|
524 |
+
|
525 |
+
return $mode;
|
526 |
+
}
|
527 |
+
}
|
528 |
+
|
529 |
+
if ( !function_exists( 'sp_get_post_mode_type' ) ) {
|
530 |
+
function sp_get_post_mode_type( $post_id ) {
|
531 |
+
$mode = sp_get_post_mode( $post_id );
|
532 |
+
|
533 |
+
$post_type = "sp_$mode";
|
534 |
+
|
535 |
+
if ( ! in_array( $post_type, sp_primary_post_types() ) ) {
|
536 |
+
$post_type = sp_get_default_mode();
|
537 |
+
}
|
538 |
+
|
539 |
+
return $post_type;
|
540 |
+
}
|
541 |
+
}
|
542 |
+
|
543 |
+
if ( !function_exists( 'sp_get_post_mode_label' ) ) {
|
544 |
+
function sp_get_post_mode_label( $post_id, $singular = false ) {
|
545 |
+
$labels = array(
|
546 |
+
'team' => array(
|
547 |
+
__( 'Teams', 'sportspress' ),
|
548 |
+
__( 'Team', 'sportspress' ),
|
549 |
+
),
|
550 |
+
'player' => array(
|
551 |
+
__( 'Players', 'sportspress' ),
|
552 |
+
__( 'Player', 'sportspress' ),
|
553 |
+
),
|
554 |
+
);
|
555 |
+
|
556 |
+
$mode = sp_get_post_mode( $post_id );
|
557 |
+
|
558 |
+
if ( ! array_key_exists( $mode, $labels ) ) {
|
559 |
+
$mode = 'team';
|
560 |
+
}
|
561 |
+
|
562 |
+
$index = intval( $singular );
|
563 |
+
|
564 |
+
return $labels[ $mode ][ $index ];
|
565 |
+
}
|
566 |
+
}
|
567 |
+
|
568 |
if ( !function_exists( 'sp_dropdown_statuses' ) ) {
|
569 |
function sp_dropdown_statuses( $args = array() ) {
|
570 |
$defaults = array(
|
1423 |
__( 'Article', 'sportspress' ),
|
1424 |
__( 'Away', 'sportspress' ),
|
1425 |
__( 'Box Score', 'sportspress' ),
|
1426 |
+
__( 'Canceled', 'sportspress' ),
|
1427 |
__( 'Career Total', 'sportspress' ),
|
1428 |
__( 'Competition', 'sportspress' ),
|
1429 |
__( 'Current Team', 'sportspress' ),
|
includes/sp-template-hooks.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author ThemeBoy
|
8 |
* @category Core
|
9 |
* @package SportsPress/Functions
|
10 |
-
* @version 2.
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -22,109 +22,6 @@ add_filter( 'body_class', 'sp_body_class' );
|
|
22 |
add_action( 'get_the_generator_html', 'sp_generator_tag', 10, 2 );
|
23 |
add_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 );
|
24 |
|
25 |
-
/**
|
26 |
-
* Before Single Event
|
27 |
-
* @see sportspress_output_event_logos()
|
28 |
-
* @see sportspress_output_post_excerpt()
|
29 |
-
*/
|
30 |
-
add_action( 'sportspress_before_single_event', 'sportspress_output_event_logos', 10 );
|
31 |
-
add_action( 'sportspress_before_single_event', 'sportspress_output_post_excerpt', 20 );
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Single Event Content
|
35 |
-
*
|
36 |
-
* @see sportspress_output_event_video()
|
37 |
-
* @see sportspress_output_event_overview()
|
38 |
-
* @see sportspress_output_event_performance()
|
39 |
-
*/
|
40 |
-
add_action( 'sportspress_single_event_content', 'sportspress_output_event_video', 10 );
|
41 |
-
add_action( 'sportspress_single_event_content', 'sportspress_output_event_overview', 30 );
|
42 |
-
add_action( 'sportspress_single_event_content', 'sportspress_output_event_performance', 50 );
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Event Overview Content
|
46 |
-
*
|
47 |
-
* @see sportspress_output_event_details()
|
48 |
-
* @see sportspress_output_event_venue()
|
49 |
-
* @see sportspress_output_event_results()
|
50 |
-
*/
|
51 |
-
add_action( 'sportspress_event_overview_content', 'sportspress_output_event_details', 10 );
|
52 |
-
add_action( 'sportspress_event_overview_content', 'sportspress_output_event_venue', 20 );
|
53 |
-
add_action( 'sportspress_event_overview_content', 'sportspress_output_event_results', 30 );
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Single Calendar Content
|
57 |
-
*
|
58 |
-
* @see sportspress_output_calendar()
|
59 |
-
*/
|
60 |
-
add_action( 'sportspress_single_calendar_content', 'sportspress_output_calendar', 10 );
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Before Single Team
|
64 |
-
* @see sportspress_output_team_logo()
|
65 |
-
* @see sportspress_output_post_excerpt()
|
66 |
-
*/
|
67 |
-
add_action( 'sportspress_before_single_team', 'sportspress_output_team_logo', 10 );
|
68 |
-
add_action( 'sportspress_before_single_team', 'sportspress_output_post_excerpt', 20 );
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Single Team Content
|
72 |
-
*
|
73 |
-
* @see sportspress_output_team_link()
|
74 |
-
* @see sportspress_output_team_details()
|
75 |
-
* @see sportspress_output_team_staff()
|
76 |
-
* @see sportspress_output_team_lists()
|
77 |
-
* @see sportspress_output_team_tables()
|
78 |
-
* @see sportspress_output_team_events()
|
79 |
-
*/
|
80 |
-
add_action( 'sportspress_single_team_content', 'sportspress_output_team_link', 0 );
|
81 |
-
add_action( 'sportspress_single_team_content', 'sportspress_output_team_details', 10 );
|
82 |
-
add_action( 'sportspress_single_team_content', 'sportspress_output_team_staff', 15 );
|
83 |
-
add_action( 'sportspress_single_team_content', 'sportspress_output_team_lists', 20 );
|
84 |
-
add_action( 'sportspress_single_team_content', 'sportspress_output_team_tables', 30 );
|
85 |
-
add_action( 'sportspress_single_team_content', 'sportspress_output_team_events', 40 );
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Single Table Content
|
89 |
-
*
|
90 |
-
* @see sportspress_output_league_table()
|
91 |
-
*/
|
92 |
-
add_action( 'sportspress_single_table_content', 'sportspress_output_league_table', 10 );
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Before Single Player
|
96 |
-
* @see sportspress_output_player_photo()
|
97 |
-
* @see sportspress_output_player_details()
|
98 |
-
* @see sportspress_output_post_excerpt()
|
99 |
-
*/
|
100 |
-
add_action( 'sportspress_before_single_player', 'sportspress_output_player_photo', 10 );
|
101 |
-
add_action( 'sportspress_before_single_player', 'sportspress_output_player_details', 15 );
|
102 |
-
add_action( 'sportspress_before_single_player', 'sportspress_output_post_excerpt', 20 );
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Single Player Content
|
106 |
-
*
|
107 |
-
* @see sportspress_output_player_statistics()
|
108 |
-
*/
|
109 |
-
add_action( 'sportspress_single_player_content', 'sportspress_output_player_statistics', 20 );
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Single List Content
|
113 |
-
*
|
114 |
-
* @see sportspress_output_player_list()
|
115 |
-
*/
|
116 |
-
add_action( 'sportspress_single_list_content', 'sportspress_output_player_list', 10 );
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Before Single Staff
|
120 |
-
* @see sportspress_output_staff_photo()
|
121 |
-
* @see sportspress_output_staff_details()
|
122 |
-
* @see sportspress_output_post_excerpt()
|
123 |
-
*/
|
124 |
-
add_action( 'sportspress_before_single_staff', 'sportspress_output_staff_photo', 10 );
|
125 |
-
add_action( 'sportspress_before_single_staff', 'sportspress_output_staff_details', 15 );
|
126 |
-
add_action( 'sportspress_before_single_staff', 'sportspress_output_post_excerpt', 20 );
|
127 |
-
|
128 |
/**
|
129 |
* Venue Archive Content
|
130 |
*/
|
7 |
* @author ThemeBoy
|
8 |
* @category Core
|
9 |
* @package SportsPress/Functions
|
10 |
+
* @version 2.3.1
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
22 |
add_action( 'get_the_generator_html', 'sp_generator_tag', 10, 2 );
|
23 |
add_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 );
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
/**
|
26 |
* Venue Archive Content
|
27 |
*/
|
modules/sportspress-event-status.php
CHANGED
@@ -64,7 +64,7 @@ class SportsPress_Event_Status {
|
|
64 |
'ok' => __( 'On time', 'sportspress' ),
|
65 |
'tbd' => __( 'TBD', 'sportspress' ),
|
66 |
'postponed' => __( 'Postponed', 'sportspress' ),
|
67 |
-
'cancelled' => __( '
|
68 |
) );
|
69 |
}
|
70 |
|
64 |
'ok' => __( 'On time', 'sportspress' ),
|
65 |
'tbd' => __( 'TBD', 'sportspress' ),
|
66 |
'postponed' => __( 'Postponed', 'sportspress' ),
|
67 |
+
'cancelled' => __( 'Canceled', 'sportspress' ),
|
68 |
) );
|
69 |
}
|
70 |
|
modules/sportspress-individual-mode.php
DELETED
@@ -1,314 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: SportsPress Individual Mode
|
4 |
-
Plugin URI: http://themeboy.com/
|
5 |
-
Description: Modify SportsPress to work with individual (player vs player) sports.
|
6 |
-
Author: ThemeBoy
|
7 |
-
Author URI: http://themeboy.com/
|
8 |
-
Version: 1.9
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
if ( ! class_exists( 'SportsPress_Individual_Mode' ) ) :
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Main SportsPress Individual Mode Class
|
18 |
-
*
|
19 |
-
* @class SportsPress_Individual_Mode
|
20 |
-
* @version 1.9
|
21 |
-
*/
|
22 |
-
class SportsPress_Individual_Mode {
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Constructor
|
26 |
-
*/
|
27 |
-
public function __construct() {
|
28 |
-
// Define constants
|
29 |
-
$this->define_constants();
|
30 |
-
|
31 |
-
// Actions
|
32 |
-
add_action( 'admin_head', array( $this, 'menu_highlight' ) );
|
33 |
-
add_action( 'sportspress_process_sp_event_meta', array( $this, 'save_player_meta' ), 99, 2 );
|
34 |
-
|
35 |
-
// Filters
|
36 |
-
add_filter( 'gettext', array( $this, 'gettext' ), 99, 3 );
|
37 |
-
add_filter( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
|
38 |
-
add_filter( 'sportspress_register_post_type_team', array( $this, 'hide_post_type' ), 99 );
|
39 |
-
add_filter( 'sportspress_register_post_type_table', array( $this, 'move_table_post_type' ), 99 );
|
40 |
-
add_filter( 'sportspress_settings_tabs_array', array( $this, 'remove_team_settings_tab' ), 99 );
|
41 |
-
add_filter( 'sportspress_get_settings_pages', array( $this, 'remove_team_settings' ), 99 );
|
42 |
-
add_filter( 'sportspress_performance_options', array( $this, 'remove_performance_options' ), 99 );
|
43 |
-
add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ), 99 );
|
44 |
-
add_filter( 'sportspress_player_settings', array( $this, 'add_player_settings' ), 99 );
|
45 |
-
add_filter( 'sportspress_next_steps', array( $this, 'remove_team_step' ), 99 );
|
46 |
-
add_filter( 'sportspress_modules', array( $this, 'rearrange_modules' ), 99 );
|
47 |
-
add_filter( 'sportspress_glance_items', array( $this, 'remove_glance_item' ), 99 );
|
48 |
-
add_filter( 'sportspress_player_admin_columns', array( $this, 'remove_team_column' ), 99 );
|
49 |
-
add_filter( 'sportspress_list_admin_columns', array( $this, 'remove_team_column' ), 99 );
|
50 |
-
add_filter( 'sportspress_staff_admin_columns', array( $this, 'remove_team_column' ), 99 );
|
51 |
-
add_filter( 'sportspress_directory_admin_columns', array( $this, 'remove_team_column' ), 99 );
|
52 |
-
add_filter( 'sportspress_importers', array( $this, 'remove_teams_importer' ), 99 );
|
53 |
-
add_filter( 'sportspress_permalink_slugs', array( $this, 'remove_team_permalink_slug' ), 99 );
|
54 |
-
add_filter( 'sportspress_primary_post_types', array( $this, 'primary_post_types' ) );
|
55 |
-
add_filter( 'sportspress_post_type_hierarchy', array( $this, 'post_type_hierarchy' ) );
|
56 |
-
add_filter( 'sportspress_event_team_tabs', '__return_false' );
|
57 |
-
add_filter( 'sportspress_player_team_statistics', '__return_false' );
|
58 |
-
add_filter( 'sportspress_player_teams', '__return_false' );
|
59 |
-
add_filter( 'sportspress_staff_teams', '__return_false' );
|
60 |
-
add_filter( 'sportspress_list_team_selector', '__return_false' );
|
61 |
-
add_filter( 'pre_option_sportspress_event_split_players_by_team', array( $this, 'no' ) );
|
62 |
-
add_filter( 'pre_option_sportspress_event_show_status', array( $this, 'no' ) );
|
63 |
-
add_filter( 'pre_option_sportspress_link_teams', array( $this, 'link_players' ) );
|
64 |
-
add_filter( 'sportspress_has_teams', '__return_false' );
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Define constants.
|
69 |
-
*/
|
70 |
-
private function define_constants() {
|
71 |
-
if ( !defined( 'SP_INDIVIDUAL_MODE_VERSION' ) )
|
72 |
-
define( 'SP_INDIVIDUAL_MODE_VERSION', '1.9' );
|
73 |
-
|
74 |
-
if ( !defined( 'SP_INDIVIDUAL_MODE_URL' ) )
|
75 |
-
define( 'SP_INDIVIDUAL_MODE_URL', plugin_dir_url( __FILE__ ) );
|
76 |
-
|
77 |
-
if ( !defined( 'SP_INDIVIDUAL_MODE_DIR' ) )
|
78 |
-
define( 'SP_INDIVIDUAL_MODE_DIR', plugin_dir_path( __FILE__ ) );
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Return no.
|
83 |
-
*/
|
84 |
-
public function no() {
|
85 |
-
return 'no';
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Return link players instead of teams.
|
90 |
-
*/
|
91 |
-
public function link_players() {
|
92 |
-
return get_option( 'sportspress_link_players', 'yes' );
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Save teams as players in events.
|
97 |
-
*/
|
98 |
-
public function save_player_meta( $post_id, $post ) {
|
99 |
-
if ( isset( $_POST['sp_team'] ) && is_array( $_POST['sp_team'] ) ) {
|
100 |
-
$players = array();
|
101 |
-
foreach ( $_POST['sp_team'] as $player ) {
|
102 |
-
$players[] = array( 0, $player );
|
103 |
-
}
|
104 |
-
sp_update_post_meta_recursive( $post_id, 'sp_player', $players );
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Modify all team-related strings for players.
|
110 |
-
*/
|
111 |
-
public function gettext( $translated_text, $untranslated_text, $domain ) {
|
112 |
-
if ( 'sportspress' !== $domain ) return $translated_text;
|
113 |
-
|
114 |
-
switch ( $untranslated_text ) {
|
115 |
-
case 'Teams':
|
116 |
-
return __( 'Players', 'sportspress' );
|
117 |
-
break;
|
118 |
-
case 'Team':
|
119 |
-
return __( 'Player', 'sportspress' );
|
120 |
-
break;
|
121 |
-
case 'teams':
|
122 |
-
return __( 'players', 'sportspress' );
|
123 |
-
break;
|
124 |
-
}
|
125 |
-
|
126 |
-
return $translated_text;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Modify all team post type queries for players.
|
131 |
-
*/
|
132 |
-
public function pre_get_posts( $query ) {
|
133 |
-
if ( 'sp_team' !== $query->get( 'post_type' ) ) return $query;
|
134 |
-
|
135 |
-
$query->set( 'post_type', 'sp_player' );
|
136 |
-
|
137 |
-
return $query;
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Remove meta boxes.
|
142 |
-
*/
|
143 |
-
public function remove_meta_boxes( $meta_boxes ) {
|
144 |
-
unset( $meta_boxes['sp_event']['performance'] );
|
145 |
-
return $meta_boxes;
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Hide post types.
|
150 |
-
*/
|
151 |
-
public function hide_post_type( $args ) {
|
152 |
-
return array_merge( $args, array(
|
153 |
-
'public' => false,
|
154 |
-
'exclude_from_search' => true,
|
155 |
-
'publicly_queryable' => false,
|
156 |
-
'show_ui' => false,
|
157 |
-
'show_in_nav_menus' => false,
|
158 |
-
'show_in_menu' => false,
|
159 |
-
'show_in_admin_bar' => false,
|
160 |
-
'can_export' => false,
|
161 |
-
) );
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Move league table post type under players.
|
166 |
-
*/
|
167 |
-
public function move_table_post_type( $args ) {
|
168 |
-
return array_merge( $args, array(
|
169 |
-
'show_in_menu' => 'edit.php?post_type=sp_player',
|
170 |
-
) );
|
171 |
-
}
|
172 |
-
|
173 |
-
/**
|
174 |
-
* Remove team settings tab.
|
175 |
-
*/
|
176 |
-
public function remove_team_settings_tab( $tabs ) {
|
177 |
-
unset( $tabs['teams'] );
|
178 |
-
return $tabs;
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Remove team settings section.
|
183 |
-
*/
|
184 |
-
public function remove_team_settings( $settings ) {
|
185 |
-
foreach ( $settings as $index => $section ) {
|
186 |
-
if ( is_a( $section, 'SP_Settings_Teams' ) ) {
|
187 |
-
unset( $settings[ $index ] );
|
188 |
-
}
|
189 |
-
}
|
190 |
-
return $settings;
|
191 |
-
}
|
192 |
-
|
193 |
-
/**
|
194 |
-
* Remove option to split players by team.
|
195 |
-
*/
|
196 |
-
public function remove_performance_options( $options ) {
|
197 |
-
foreach ( $options as $index => $option ) {
|
198 |
-
if ( 'sportspress_event_split_players_by_team' == sp_array_value( $option, 'id' ) ) {
|
199 |
-
unset( $options[ $index ] );
|
200 |
-
}
|
201 |
-
}
|
202 |
-
return $options;
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Add options from teams to players tab.
|
207 |
-
*/
|
208 |
-
public function add_player_options( $options ) {
|
209 |
-
return apply_filters( 'sportspress_team_options', $options );
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Add settings from teams to players tab.
|
214 |
-
*/
|
215 |
-
public function add_player_settings( $settings ) {
|
216 |
-
return apply_filters( 'sportspress_team_settings', $settings );
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Remove team step from welcome screen.
|
221 |
-
*/
|
222 |
-
public function remove_team_step( $steps ) {
|
223 |
-
unset( $steps['teams'] );
|
224 |
-
return $steps;
|
225 |
-
}
|
226 |
-
|
227 |
-
/**
|
228 |
-
* Rearrange modules.
|
229 |
-
*/
|
230 |
-
public function rearrange_modules( $modules ) {
|
231 |
-
$modules['player_staff'] = array_merge(
|
232 |
-
sp_array_value( $modules, 'team', array() ),
|
233 |
-
sp_array_value( $modules, 'player_staff', array() )
|
234 |
-
);
|
235 |
-
unset( $modules['team'] );
|
236 |
-
unset( $modules['player_staff']['team_colors'] );
|
237 |
-
return $modules;
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Remove teams glance item.
|
242 |
-
*/
|
243 |
-
public function remove_glance_item( $items ) {
|
244 |
-
if ( ( $index = array_search ( 'sp_team', $items ) ) !== false ) {
|
245 |
-
unset( $items[ $index ] );
|
246 |
-
}
|
247 |
-
return $items;
|
248 |
-
}
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Remove team column from player list admin.
|
252 |
-
*/
|
253 |
-
public function remove_team_column( $columns ) {
|
254 |
-
unset( $columns['sp_team'] );
|
255 |
-
return $columns;
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Remove the teams csv importer.
|
260 |
-
*/
|
261 |
-
public function remove_teams_importer( $importers ) {
|
262 |
-
unset( $importers['sp_team_csv'] );
|
263 |
-
return $importers;
|
264 |
-
}
|
265 |
-
|
266 |
-
/**
|
267 |
-
* Remove the team permalink slug setting.
|
268 |
-
*/
|
269 |
-
public function remove_team_permalink_slug( $slugs ) {
|
270 |
-
if ( ( $index = array_search ( array( 'team', __( 'Teams', 'sportspress' ) ), $slugs ) ) !== false ) {
|
271 |
-
unset( $slugs[ $index ] );
|
272 |
-
}
|
273 |
-
return $slugs;
|
274 |
-
}
|
275 |
-
|
276 |
-
/**
|
277 |
-
* Remove the team primary post type.
|
278 |
-
*/
|
279 |
-
public function primary_post_types( $post_types ) {
|
280 |
-
if ( ( $key = array_search( 'sp_team', $post_types ) ) !== false ) {
|
281 |
-
unset( $post_types[ $key ] );
|
282 |
-
}
|
283 |
-
return $post_types;
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Adjust post type hierarchy.
|
288 |
-
*/
|
289 |
-
public function post_type_hierarchy( $hierarchy ) {
|
290 |
-
$hierarchy['sp_player'] = array_merge( sp_array_value( $hierarchy, 'sp_player', array() ), sp_array_value( $hierarchy, 'sp_team', array() ) );
|
291 |
-
unset( $hierarchy['sp_team'] );
|
292 |
-
return $hierarchy;
|
293 |
-
}
|
294 |
-
|
295 |
-
/**
|
296 |
-
* Highlights the correct top level admin menu item for post type add screens.
|
297 |
-
*
|
298 |
-
* @access public
|
299 |
-
* @return void
|
300 |
-
*/
|
301 |
-
public function menu_highlight() {
|
302 |
-
global $typenow, $parent_file, $submenu_file;
|
303 |
-
if ( 'sp_table' == $typenow ) {
|
304 |
-
$parent_file = 'edit.php?post_type=sp_player';
|
305 |
-
$submenu_file = 'edit.php?post_type=sp_table';
|
306 |
-
}
|
307 |
-
}
|
308 |
-
}
|
309 |
-
|
310 |
-
endif;
|
311 |
-
|
312 |
-
if ( get_option( 'sportspress_load_individual_mode_module', 'no' ) == 'yes' ) {
|
313 |
-
new SportsPress_Individual_Mode();
|
314 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modules/sportspress-lazy-loading.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://tboy.co/pro
|
|
5 |
Description: Load players using Ajax to speed up the event edit screen.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com
|
8 |
-
Version: 2.
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Lazy_Loading' ) ) :
|
|
17 |
* Main SportsPress Lazy Loading Class
|
18 |
*
|
19 |
* @class SportsPress_Lazy_Loading
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
class SportsPress_Lazy_Loading {
|
23 |
|
@@ -173,7 +173,16 @@ class SportsPress_Lazy_Loading {
|
|
173 |
$posts = sp_get_posts( $post_type, $args );
|
174 |
$post_ids = wp_list_pluck( $posts, 'ID' );
|
175 |
$diff = array_diff( $post_ids, $selected );
|
|
|
176 |
$selected = array_flip( $selected );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
?>
|
178 |
<div id="<?php echo $slug; ?>-all" class="posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-ajax-checklist sp-select-all-range" style="display: <?php echo $display; ?>;">
|
179 |
<input type="hidden" value="0" name="<?php echo $slug; ?><?php if ( isset( $index ) ) echo '[' . $index . ']'; ?>[]" />
|
5 |
Description: Load players using Ajax to speed up the event edit screen.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com
|
8 |
+
Version: 2.3
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
17 |
* Main SportsPress Lazy Loading Class
|
18 |
*
|
19 |
* @class SportsPress_Lazy_Loading
|
20 |
+
* @version 2.3
|
21 |
*/
|
22 |
class SportsPress_Lazy_Loading {
|
23 |
|
173 |
$posts = sp_get_posts( $post_type, $args );
|
174 |
$post_ids = wp_list_pluck( $posts, 'ID' );
|
175 |
$diff = array_diff( $post_ids, $selected );
|
176 |
+
$borrowed = array_diff( $selected, $post_ids );
|
177 |
$selected = array_flip( $selected );
|
178 |
+
|
179 |
+
if ( sizeof( $borrowed ) ) {
|
180 |
+
$args = array( 'post__in' => $borrowed );
|
181 |
+
$borrowed_posts = sp_get_posts( $post_type, $args );
|
182 |
+
if ( is_array( $borrowed_posts ) ) {
|
183 |
+
$posts += $borrowed_posts;
|
184 |
+
}
|
185 |
+
}
|
186 |
?>
|
187 |
<div id="<?php echo $slug; ?>-all" class="posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-ajax-checklist sp-select-all-range" style="display: <?php echo $display; ?>;">
|
188 |
<input type="hidden" value="0" name="<?php echo $slug; ?><?php if ( isset( $index ) ) echo '[' . $index . ']'; ?>[]" />
|
modules/sportspress-league-tables.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
|
|
5 |
Description: Add league tables to SportsPress.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com/
|
8 |
-
Version: 2.
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_League_Tables' ) ) :
|
|
17 |
* Main SportsPress League Tables Class
|
18 |
*
|
19 |
* @class SportsPress_League_Tables
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
class SportsPress_League_Tables {
|
23 |
|
@@ -48,7 +48,7 @@ class SportsPress_League_Tables {
|
|
48 |
*/
|
49 |
private function define_constants() {
|
50 |
if ( !defined( 'SP_LEAGUE_TABLES_VERSION' ) )
|
51 |
-
define( 'SP_LEAGUE_TABLES_VERSION', '2.
|
52 |
|
53 |
if ( !defined( 'SP_LEAGUE_TABLES_URL' ) )
|
54 |
define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );
|
@@ -172,6 +172,13 @@ class SportsPress_League_Tables {
|
|
172 |
'priority' => 'high',
|
173 |
);
|
174 |
$meta_boxes['sp_table'] = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
'shortcode' => array(
|
176 |
'title' => __( 'Shortcode', 'sportspress' ),
|
177 |
'output' => 'SP_Meta_Box_Table_Shortcode::output',
|
5 |
Description: Add league tables to SportsPress.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com/
|
8 |
+
Version: 2.3
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
17 |
* Main SportsPress League Tables Class
|
18 |
*
|
19 |
* @class SportsPress_League_Tables
|
20 |
+
* @version 2.3
|
21 |
*/
|
22 |
class SportsPress_League_Tables {
|
23 |
|
48 |
*/
|
49 |
private function define_constants() {
|
50 |
if ( !defined( 'SP_LEAGUE_TABLES_VERSION' ) )
|
51 |
+
define( 'SP_LEAGUE_TABLES_VERSION', '2.3' );
|
52 |
|
53 |
if ( !defined( 'SP_LEAGUE_TABLES_URL' ) )
|
54 |
define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );
|
172 |
'priority' => 'high',
|
173 |
);
|
174 |
$meta_boxes['sp_table'] = array(
|
175 |
+
'mode' => array(
|
176 |
+
'title' => __( 'Mode', 'sportspress' ),
|
177 |
+
'save' => 'SP_Meta_Box_Table_Mode::save',
|
178 |
+
'output' => 'SP_Meta_Box_Table_Mode::output',
|
179 |
+
'context' => 'side',
|
180 |
+
'priority' => 'default',
|
181 |
+
),
|
182 |
'shortcode' => array(
|
183 |
'title' => __( 'Shortcode', 'sportspress' ),
|
184 |
'output' => 'SP_Meta_Box_Table_Shortcode::output',
|
modules/{sportspress-style.php → sportspress-styles.php}
RENAMED
@@ -1,25 +1,25 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name: SportsPress
|
4 |
Plugin URI: http://themeboy.com/
|
5 |
Description: Add frontend styles to SportsPress.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com/
|
8 |
-
Version: 2.
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
12 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
|
14 |
-
if ( ! class_exists( '
|
15 |
|
16 |
/**
|
17 |
-
* Main SportsPress
|
18 |
*
|
19 |
-
* @class
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
-
class
|
23 |
|
24 |
/**
|
25 |
* Constructor
|
@@ -42,29 +42,30 @@ class SportsPress_Style {
|
|
42 |
* Define constants.
|
43 |
*/
|
44 |
private function define_constants() {
|
45 |
-
if ( !defined( '
|
46 |
-
define( '
|
47 |
|
48 |
-
if ( !defined( '
|
49 |
-
define( '
|
50 |
|
51 |
-
if ( !defined( '
|
52 |
-
define( '
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
* Add option.
|
57 |
*/
|
58 |
public static function add_option( $options = array() ) {
|
59 |
-
if ( ! current_theme_supports( 'sportspress' ) )
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
68 |
return $options;
|
69 |
}
|
70 |
|
@@ -72,20 +73,20 @@ class SportsPress_Style {
|
|
72 |
* Add stylesheet.
|
73 |
*/
|
74 |
public static function add_styles( $styles = array() ) {
|
75 |
-
if ( current_theme_supports( 'sportspress' ) ) return $styles;
|
76 |
if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) return $styles;
|
77 |
|
78 |
$styles['sportspress-roboto'] = array(
|
79 |
'src' => '//fonts.googleapis.com/css?family=Roboto:400,500&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese',
|
80 |
'deps' => '',
|
81 |
-
'version' =>
|
82 |
'media' => 'all'
|
83 |
);
|
84 |
|
85 |
$styles['sportspress-style'] = array(
|
86 |
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style.css',
|
87 |
'deps' => '',
|
88 |
-
'version' =>
|
89 |
'media' => 'all'
|
90 |
);
|
91 |
|
@@ -93,14 +94,14 @@ class SportsPress_Style {
|
|
93 |
$styles['sportspress-style-rtl'] = array(
|
94 |
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-rtl.css',
|
95 |
'deps' => 'sportspress-style',
|
96 |
-
'version' =>
|
97 |
'media' => 'all'
|
98 |
);
|
99 |
} else {
|
100 |
$styles['sportspress-style-ltr'] = array(
|
101 |
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-ltr.css',
|
102 |
'deps' => 'sportspress-style',
|
103 |
-
'version' =>
|
104 |
'media' => 'all'
|
105 |
);
|
106 |
}
|
@@ -112,7 +113,7 @@ class SportsPress_Style {
|
|
112 |
* Output custom CSS.
|
113 |
*/
|
114 |
public function custom_css( $colors = array() ) {
|
115 |
-
if ( current_theme_supports( 'sportspress' ) ) return $styles;
|
116 |
if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) return $styles;
|
117 |
|
118 |
// Defaults
|
@@ -144,19 +145,19 @@ class SportsPress_Style {
|
|
144 |
echo '.sp-data-table .sp-highlight,.sp-data-table .highlighted td,.sp-template-scoreboard td:hover{background:' . $colors['background_highlight'] . ' !important}';
|
145 |
|
146 |
// Text
|
147 |
-
echo '.sp-template *,.sp-data-table *,.sp-table-caption,.sp-data-table tfoot a:hover,.sp-template .sp-view-all-link a:hover,.sp-template-gallery .sp-gallery-group-name,.sp-template-details dd,.sp-template-event-logos .sp-team-
|
148 |
echo '.sp-template .sp-view-all-link a,.sp-countdown span small,.sp-template-event-calendar tfoot a,.sp-template-event-blocks .sp-event-date,.sp-template-details dt,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket th,.sp-tournament-bracket .sp-event .sp-event-title,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket .sp-event .sp-event-title *{color:' . $colors['text_muted'] . ' !important}';
|
149 |
|
150 |
// Heading
|
151 |
echo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-item a,.sp-template-gallery .gallery-caption,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-heading{color:' . $colors['heading'] . ' !important}';
|
152 |
|
153 |
// Link
|
154 |
-
echo '.sp-template a,.sp-data-table a,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover{color:' . $colors['link'] . ' !important}';
|
155 |
echo '.sp-template-gallery .gallery-caption strong,.sp-tournament-bracket .sp-team-name:hover,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-heading{background:' . $colors['link'] . ' !important}';
|
156 |
-
echo '.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket .sp-heading,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover{border-color:' . $colors['link'] . ' !important}';
|
157 |
}
|
158 |
}
|
159 |
|
160 |
endif;
|
161 |
|
162 |
-
new
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: SportsPress Styles
|
4 |
Plugin URI: http://themeboy.com/
|
5 |
Description: Add frontend styles to SportsPress.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com/
|
8 |
+
Version: 2.3
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
12 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
|
14 |
+
if ( ! class_exists( 'SportsPress_Styles' ) ) :
|
15 |
|
16 |
/**
|
17 |
+
* Main SportsPress Styles Class
|
18 |
*
|
19 |
+
* @class SportsPress_Styles
|
20 |
+
* @version 2.3
|
21 |
*/
|
22 |
+
class SportsPress_Styles {
|
23 |
|
24 |
/**
|
25 |
* Constructor
|
42 |
* Define constants.
|
43 |
*/
|
44 |
private function define_constants() {
|
45 |
+
if ( !defined( 'SP_STYLES_VERSION' ) )
|
46 |
+
define( 'SP_STYLES_VERSION', '2.3' );
|
47 |
|
48 |
+
if ( !defined( 'SP_STYLES_URL' ) )
|
49 |
+
define( 'SP_STYLES_URL', plugin_dir_url( __FILE__ ) );
|
50 |
|
51 |
+
if ( !defined( 'SP_STYLES_DIR' ) )
|
52 |
+
define( 'SP_STYLES_DIR', plugin_dir_path( __FILE__ ) );
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
* Add option.
|
57 |
*/
|
58 |
public static function add_option( $options = array() ) {
|
59 |
+
if ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) return $options;
|
60 |
+
|
61 |
+
array_unshift( $options, array(
|
62 |
+
'title' => __( 'Frontend Styles', 'sportspress' ),
|
63 |
+
'desc' => __( 'Enable', 'sportspress' ),
|
64 |
+
'id' => 'sportspress_styles',
|
65 |
+
'default' => 'yes',
|
66 |
+
'type' => 'checkbox',
|
67 |
+
) );
|
68 |
+
|
69 |
return $options;
|
70 |
}
|
71 |
|
73 |
* Add stylesheet.
|
74 |
*/
|
75 |
public static function add_styles( $styles = array() ) {
|
76 |
+
if ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) return $styles;
|
77 |
if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) return $styles;
|
78 |
|
79 |
$styles['sportspress-roboto'] = array(
|
80 |
'src' => '//fonts.googleapis.com/css?family=Roboto:400,500&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese',
|
81 |
'deps' => '',
|
82 |
+
'version' => SP_STYLES_VERSION,
|
83 |
'media' => 'all'
|
84 |
);
|
85 |
|
86 |
$styles['sportspress-style'] = array(
|
87 |
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style.css',
|
88 |
'deps' => '',
|
89 |
+
'version' => SP_STYLES_VERSION,
|
90 |
'media' => 'all'
|
91 |
);
|
92 |
|
94 |
$styles['sportspress-style-rtl'] = array(
|
95 |
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-rtl.css',
|
96 |
'deps' => 'sportspress-style',
|
97 |
+
'version' => SP_STYLES_VERSION,
|
98 |
'media' => 'all'
|
99 |
);
|
100 |
} else {
|
101 |
$styles['sportspress-style-ltr'] = array(
|
102 |
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-ltr.css',
|
103 |
'deps' => 'sportspress-style',
|
104 |
+
'version' => SP_STYLES_VERSION,
|
105 |
'media' => 'all'
|
106 |
);
|
107 |
}
|
113 |
* Output custom CSS.
|
114 |
*/
|
115 |
public function custom_css( $colors = array() ) {
|
116 |
+
if ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) return $styles;
|
117 |
if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) return $styles;
|
118 |
|
119 |
// Defaults
|
145 |
echo '.sp-data-table .sp-highlight,.sp-data-table .highlighted td,.sp-template-scoreboard td:hover{background:' . $colors['background_highlight'] . ' !important}';
|
146 |
|
147 |
// Text
|
148 |
+
echo '.sp-template *,.sp-data-table *,.sp-table-caption,.sp-data-table tfoot a:hover,.sp-template .sp-view-all-link a:hover,.sp-template-gallery .sp-gallery-group-name,.sp-template-details dd,.sp-template-event-logos .sp-team-result,.sp-template-event-blocks .sp-event-results,.sp-template-scoreboard a,.sp-template-scoreboard a:hover,.sp-tournament-bracket,.sp-tournament-bracket .sp-event .sp-event-title:hover,.sp-tournament-bracket .sp-event .sp-event-title:hover *{color:' . $colors['text'] . ' !important}';
|
149 |
echo '.sp-template .sp-view-all-link a,.sp-countdown span small,.sp-template-event-calendar tfoot a,.sp-template-event-blocks .sp-event-date,.sp-template-details dt,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket th,.sp-tournament-bracket .sp-event .sp-event-title,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket .sp-event .sp-event-title *{color:' . $colors['text_muted'] . ' !important}';
|
150 |
|
151 |
// Heading
|
152 |
echo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-item a,.sp-template-gallery .gallery-caption,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-heading{color:' . $colors['heading'] . ' !important}';
|
153 |
|
154 |
// Link
|
155 |
+
echo '.sp-template a,.sp-data-table a,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover,.sp-template .sp-message{color:' . $colors['link'] . ' !important}';
|
156 |
echo '.sp-template-gallery .gallery-caption strong,.sp-tournament-bracket .sp-team-name:hover,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-heading{background:' . $colors['link'] . ' !important}';
|
157 |
+
echo '.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket .sp-heading,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover,.sp-template .sp-message{border-color:' . $colors['link'] . ' !important}';
|
158 |
}
|
159 |
}
|
160 |
|
161 |
endif;
|
162 |
|
163 |
+
new SportsPress_Styles();
|
modules/sportspress-template-selector.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
|
|
5 |
Description: Add a template selector to SportsPress post types.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com/
|
8 |
-
Version:
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Template_Selector' ) ) :
|
|
17 |
* Main SportsPress Template Selector Class
|
18 |
*
|
19 |
* @class SportsPress_Template_Selector
|
20 |
-
* @version
|
21 |
*/
|
22 |
class SportsPress_Template_Selector {
|
23 |
|
@@ -46,7 +46,7 @@ class SportsPress_Template_Selector {
|
|
46 |
*/
|
47 |
private function define_constants() {
|
48 |
if ( !defined( 'SP_TEMPLATE_SELECTOR_VERSION' ) )
|
49 |
-
define( 'SP_TEMPLATE_SELECTOR_VERSION', '
|
50 |
|
51 |
if ( !defined( 'SP_TEMPLATE_SELECTOR_URL' ) )
|
52 |
define( 'SP_TEMPLATE_SELECTOR_URL', plugin_dir_url( __FILE__ ) );
|
@@ -73,10 +73,7 @@ class SportsPress_Template_Selector {
|
|
73 |
* Add option to team post type.
|
74 |
*/
|
75 |
public function team_options( $options ) {
|
76 |
-
|
77 |
-
return $this->options( $options, 'team' );
|
78 |
-
}
|
79 |
-
return $options;
|
80 |
}
|
81 |
|
82 |
/**
|
5 |
Description: Add a template selector to SportsPress post types.
|
6 |
Author: ThemeBoy
|
7 |
Author URI: http://themeboy.com/
|
8 |
+
Version: 2.3
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly
|
17 |
* Main SportsPress Template Selector Class
|
18 |
*
|
19 |
* @class SportsPress_Template_Selector
|
20 |
+
* @version 2.3
|
21 |
*/
|
22 |
class SportsPress_Template_Selector {
|
23 |
|
46 |
*/
|
47 |
private function define_constants() {
|
48 |
if ( !defined( 'SP_TEMPLATE_SELECTOR_VERSION' ) )
|
49 |
+
define( 'SP_TEMPLATE_SELECTOR_VERSION', '2.3' );
|
50 |
|
51 |
if ( !defined( 'SP_TEMPLATE_SELECTOR_URL' ) )
|
52 |
define( 'SP_TEMPLATE_SELECTOR_URL', plugin_dir_url( __FILE__ ) );
|
73 |
* Add option to team post type.
|
74 |
*/
|
75 |
public function team_options( $options ) {
|
76 |
+
return $this->options( $options, 'team' );
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
/**
|
modules/sportspress-user-registration.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: SportsPress User Registration
|
4 |
+
Plugin URI: http://themeboy.com/
|
5 |
+
Description: Create a new player during user registration.
|
6 |
+
Author: ThemeBoy
|
7 |
+
Author URI: http://themeboy.com/
|
8 |
+
Version: 2.3
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
if ( ! class_exists( 'SportsPress_User_Registration' ) ) :
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Main SportsPress User Registration Class
|
18 |
+
*
|
19 |
+
* @class SportsPress_User_Registration
|
20 |
+
* @version 2.3
|
21 |
+
*/
|
22 |
+
class SportsPress_User_Registration {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Constructor
|
26 |
+
*/
|
27 |
+
public function __construct() {
|
28 |
+
// Define constants
|
29 |
+
$this->define_constants();
|
30 |
+
|
31 |
+
// Hooks
|
32 |
+
add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) );
|
33 |
+
add_action( 'register_form', array( $this, 'register_form' ) );
|
34 |
+
add_action( 'user_register', array( $this, 'user_register' ) );
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Define constants.
|
39 |
+
*/
|
40 |
+
private function define_constants() {
|
41 |
+
if ( !defined( 'SP_USER_REGISTRATION_VERSION' ) )
|
42 |
+
define( 'SP_USER_REGISTRATION_VERSION', '2.3' );
|
43 |
+
|
44 |
+
if ( !defined( 'SP_USER_REGISTRATION_URL' ) )
|
45 |
+
define( 'SP_USER_REGISTRATION_URL', plugin_dir_url( __FILE__ ) );
|
46 |
+
|
47 |
+
if ( !defined( 'SP_USER_REGISTRATION_DIR' ) )
|
48 |
+
define( 'SP_USER_REGISTRATION_DIR', plugin_dir_path( __FILE__ ) );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Add options to player settings page.
|
53 |
+
*
|
54 |
+
* @return array
|
55 |
+
*/
|
56 |
+
public function add_player_options( $options ) {
|
57 |
+
$options = array_merge( $options, array(
|
58 |
+
array(
|
59 |
+
'title' => __( 'User Registration', 'sportspress' ),
|
60 |
+
'desc' => __( 'Add name fields to signup form', 'sportspress' ),
|
61 |
+
'id' => 'sportspress_registration_name_inputs',
|
62 |
+
'default' => 'no',
|
63 |
+
'type' => 'checkbox',
|
64 |
+
'checkboxgroup' => 'start',
|
65 |
+
),
|
66 |
+
|
67 |
+
array(
|
68 |
+
'desc' => __( 'Create player profiles for new users', 'sportspress' ),
|
69 |
+
'id' => 'sportspress_registration_add_player',
|
70 |
+
'default' => 'no',
|
71 |
+
'type' => 'checkbox',
|
72 |
+
'checkboxgroup' => 'end',
|
73 |
+
),
|
74 |
+
) );
|
75 |
+
|
76 |
+
return $options;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Add name fields to user registration form.
|
81 |
+
*/
|
82 |
+
public static function register_form() {
|
83 |
+
if ( 'yes' === get_option( 'sportspress_registration_name_inputs', 'no' ) ) {
|
84 |
+
$first_name = ( ! empty( $_POST['first_name'] ) ) ? trim( $_POST['first_name'] ) : '';
|
85 |
+
$last_name = ( ! empty( $_POST['last_name'] ) ) ? trim( $_POST['last_name'] ) : '';
|
86 |
+
?>
|
87 |
+
<p>
|
88 |
+
<label for="first_name"><?php _e( 'First Name', 'themeboy' ) ?><br />
|
89 |
+
<input type="text" name="first_name" id="first_name" class="input" value="<?php echo esc_attr( wp_unslash( $first_name ) ); ?>" size="25" /></label>
|
90 |
+
</p>
|
91 |
+
|
92 |
+
<p>
|
93 |
+
<label for="last_name"><?php _e( 'Last Name', 'themeboy' ) ?><br />
|
94 |
+
<input type="text" name="last_name" id="last_name" class="input" value="<?php echo esc_attr( wp_unslash( $last_name ) ); ?>" size="25" /></label>
|
95 |
+
</p>
|
96 |
+
<?php
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Save fields and add player during user registration.
|
102 |
+
*/
|
103 |
+
public static function user_register( $user_id ) {
|
104 |
+
$parts = array();
|
105 |
+
|
106 |
+
// Save first and last name
|
107 |
+
if ( 'yes' === get_option( 'sportspress_registration_name_inputs', 'no' ) ) {
|
108 |
+
if ( ! empty( $_POST['first_name'] ) ) {
|
109 |
+
$meta = trim( $_POST['first_name'] );
|
110 |
+
$parts[] = $meta;
|
111 |
+
update_user_meta( $user_id, 'first_name', $meta );
|
112 |
+
}
|
113 |
+
|
114 |
+
if ( ! empty( $_POST['last_name'] ) ) {
|
115 |
+
$meta = trim( $_POST['last_name'] );
|
116 |
+
$parts[] = $meta;
|
117 |
+
update_user_meta( $user_id, 'last_name', $meta );
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
// Add player
|
122 |
+
if ( 'yes' === get_option( 'sportspress_registration_add_player', 'no' ) ) {
|
123 |
+
if ( ! sizeof( $parts ) && ! empty( $_POST['user_login'] ) ) {
|
124 |
+
$parts[] = trim( $_POST['user_login'] );
|
125 |
+
}
|
126 |
+
|
127 |
+
if ( sizeof( $parts ) ) {
|
128 |
+
$name = implode( ' ', $parts );
|
129 |
+
$post['post_type'] = 'sp_player';
|
130 |
+
$post['post_title'] = trim( $name );
|
131 |
+
$post['post_author'] = $user_id;
|
132 |
+
$post['post_status'] = 'publish';
|
133 |
+
$id = wp_insert_post( $post );
|
134 |
+
}
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
endif;
|
140 |
+
|
141 |
+
new SportsPress_User_Registration();
|
presets/esports/csgo.json
CHANGED
@@ -17,5 +17,8 @@
|
|
17 |
],
|
18 |
"statistics": [
|
19 |
{ "name" : "KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 2, "description" : "Kills/deaths/assists ratio" }
|
20 |
-
]
|
|
|
|
|
|
|
21 |
}
|
17 |
],
|
18 |
"statistics": [
|
19 |
{ "name" : "KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 2, "description" : "Kills/deaths/assists ratio" }
|
20 |
+
],
|
21 |
+
"options": {
|
22 |
+
"mode" : "team"
|
23 |
+
}
|
24 |
}
|
presets/esports/dota2.json
CHANGED
@@ -21,5 +21,8 @@
|
|
21 |
{ "name" : "Wins", "equation" : "$win" },
|
22 |
{ "name" : "Losses", "equation" : "$loss" },
|
23 |
{ "name" : "Winrate", "equation" : "$win / $eventsplayed * 100" }
|
24 |
-
]
|
|
|
|
|
|
|
25 |
}
|
21 |
{ "name" : "Wins", "equation" : "$win" },
|
22 |
{ "name" : "Losses", "equation" : "$loss" },
|
23 |
{ "name" : "Winrate", "equation" : "$win / $eventsplayed * 100" }
|
24 |
+
],
|
25 |
+
"options": {
|
26 |
+
"mode" : "team"
|
27 |
+
}
|
28 |
}
|
presets/esports/lol.json
CHANGED
@@ -26,5 +26,8 @@
|
|
26 |
{ "name" : "Avg. KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 1, "description" : "Average kills/deaths/assists ratio" },
|
27 |
{ "name" : "Avg. Gold per Min", "equation" : "$gold / $eventminutes", "description" : "Average gold per minute" },
|
28 |
{ "name" : "Avg. Total Gold", "equation" : "$gold / $eventsplayed", "description" : "Average total gold" }
|
29 |
-
]
|
|
|
|
|
|
|
30 |
}
|
26 |
{ "name" : "Avg. KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 1, "description" : "Average kills/deaths/assists ratio" },
|
27 |
{ "name" : "Avg. Gold per Min", "equation" : "$gold / $eventminutes", "description" : "Average gold per minute" },
|
28 |
{ "name" : "Avg. Total Gold", "equation" : "$gold / $eventsplayed", "description" : "Average total gold" }
|
29 |
+
],
|
30 |
+
"options": {
|
31 |
+
"mode" : "team"
|
32 |
+
}
|
33 |
}
|
presets/racket-sports/squash.json
CHANGED
@@ -29,5 +29,8 @@
|
|
29 |
{ "name" : "Weight", "description" : "Player weight" }
|
30 |
],
|
31 |
"statistics": [
|
32 |
-
]
|
|
|
|
|
|
|
33 |
}
|
29 |
{ "name" : "Weight", "description" : "Player weight" }
|
30 |
],
|
31 |
"statistics": [
|
32 |
+
],
|
33 |
+
"options": {
|
34 |
+
"mode" : "player"
|
35 |
+
}
|
36 |
}
|
presets/racket-sports/table-tennis.json
CHANGED
@@ -29,5 +29,8 @@
|
|
29 |
"Weight"
|
30 |
],
|
31 |
"statistics": [
|
32 |
-
]
|
|
|
|
|
|
|
33 |
}
|
29 |
"Weight"
|
30 |
],
|
31 |
"statistics": [
|
32 |
+
],
|
33 |
+
"options": {
|
34 |
+
"mode" : "player"
|
35 |
+
}
|
36 |
}
|
presets/racket-sports/tennis.json
CHANGED
@@ -26,5 +26,8 @@
|
|
26 |
"Weight"
|
27 |
],
|
28 |
"statistics": [
|
29 |
-
]
|
|
|
|
|
|
|
30 |
}
|
26 |
"Weight"
|
27 |
],
|
28 |
"statistics": [
|
29 |
+
],
|
30 |
+
"options": {
|
31 |
+
"mode" : "player"
|
32 |
+
}
|
33 |
}
|
presets/target-sports/darts.json
CHANGED
@@ -21,5 +21,8 @@
|
|
21 |
"metrics": [
|
22 |
],
|
23 |
"statistics": [
|
24 |
-
]
|
|
|
|
|
|
|
25 |
}
|
21 |
"metrics": [
|
22 |
],
|
23 |
"statistics": [
|
24 |
+
],
|
25 |
+
"options": {
|
26 |
+
"mode" : "player"
|
27 |
+
}
|
28 |
}
|
presets/target-sports/golf.json
CHANGED
@@ -52,14 +52,14 @@
|
|
52 |
{ "name" : "GIR", "equation" : "$girfor", "description" : "Greens in regulation" }
|
53 |
],
|
54 |
"options": {
|
|
|
55 |
"event_teams" : "0",
|
56 |
"event_show_players" : "yes",
|
57 |
"event_show_total" : "no",
|
58 |
-
"
|
59 |
"event_show_player_numbers" : "no",
|
60 |
"event_split_players_by_team" : "no",
|
61 |
"event_split_players_by_position" : "no",
|
62 |
-
"event_performance_sections" : -1
|
63 |
-
"load_individual_mode_module" : "yes"
|
64 |
}
|
65 |
}
|
52 |
{ "name" : "GIR", "equation" : "$girfor", "description" : "Greens in regulation" }
|
53 |
],
|
54 |
"options": {
|
55 |
+
"mode" : "player",
|
56 |
"event_teams" : "0",
|
57 |
"event_show_players" : "yes",
|
58 |
"event_show_total" : "no",
|
59 |
+
"event_performance_mode" : "values",
|
60 |
"event_show_player_numbers" : "no",
|
61 |
"event_split_players_by_team" : "no",
|
62 |
"event_split_players_by_position" : "no",
|
63 |
+
"event_performance_sections" : -1
|
|
|
64 |
}
|
65 |
}
|
presets/target-sports/snooker.json
CHANGED
@@ -26,5 +26,8 @@
|
|
26 |
{ "name" : "Games Played", "equation" : "$eventsplayed" },
|
27 |
{ "name" : "Games Won", "equation" : "$win" },
|
28 |
{ "name" : "Win Percentage", "equation" : "$win / $eventsplayed * 100", "precision" : 2 }
|
29 |
-
]
|
|
|
|
|
|
|
30 |
}
|
26 |
{ "name" : "Games Played", "equation" : "$eventsplayed" },
|
27 |
{ "name" : "Games Won", "equation" : "$win" },
|
28 |
{ "name" : "Win Percentage", "equation" : "$win / $eventsplayed * 100", "precision" : 2 }
|
29 |
+
],
|
30 |
+
"options": {
|
31 |
+
"mode" : "player"
|
32 |
+
}
|
33 |
}
|
presets/team-sports/baseball.json
CHANGED
@@ -74,6 +74,7 @@
|
|
74 |
{ "name" : "AVG", "equation" : "$h / $ab", "precision" : 3, "description" : "Batting average" }
|
75 |
],
|
76 |
"options": {
|
|
|
77 |
"event_teams" : "2",
|
78 |
"event_hide_child_positions" : "yes",
|
79 |
"event_show_players" : "yes",
|
74 |
{ "name" : "AVG", "equation" : "$h / $ab", "precision" : 3, "description" : "Batting average" }
|
75 |
],
|
76 |
"options": {
|
77 |
+
"mode" : "team",
|
78 |
"event_teams" : "2",
|
79 |
"event_hide_child_positions" : "yes",
|
80 |
"event_show_players" : "yes",
|
presets/team-sports/basketball.json
CHANGED
@@ -68,5 +68,8 @@
|
|
68 |
{ "name" : "BPG", "equation" : "$blk / $eventsplayed", "precision" : 1, "description" : "Blocks per game" },
|
69 |
{ "name" : "PPG", "equation" : "$pts / $eventsplayed", "precision" : 1, "description" : "Points per game" },
|
70 |
{ "name" : "EFF", "equation" : "$pts + $off + $def + $ast + $stl + $blk - $fga + $fgm - $fta + $ftm + $to", "description" : "Efficiency rating" }
|
71 |
-
]
|
|
|
|
|
|
|
72 |
}
|
68 |
{ "name" : "BPG", "equation" : "$blk / $eventsplayed", "precision" : 1, "description" : "Blocks per game" },
|
69 |
{ "name" : "PPG", "equation" : "$pts / $eventsplayed", "precision" : 1, "description" : "Points per game" },
|
70 |
{ "name" : "EFF", "equation" : "$pts + $off + $def + $ast + $stl + $blk - $fga + $fgm - $fta + $ftm + $to", "description" : "Efficiency rating" }
|
71 |
+
],
|
72 |
+
"options": {
|
73 |
+
"mode" : "team"
|
74 |
+
}
|
75 |
}
|
presets/team-sports/cricket.json
CHANGED
@@ -49,7 +49,7 @@
|
|
49 |
{ "name" : "SR", "equation" : "( $runs / $b ) * 100", "precision" : 2, "description" : "Strike Rate" }
|
50 |
],
|
51 |
"options": {
|
52 |
-
"
|
53 |
"event_teams" : "2",
|
54 |
"event_logos_show_team_names" : "no",
|
55 |
"event_logos_show_results" : "yes",
|
49 |
{ "name" : "SR", "equation" : "( $runs / $b ) * 100", "precision" : 2, "description" : "Strike Rate" }
|
50 |
],
|
51 |
"options": {
|
52 |
+
"mode" : "team",
|
53 |
"event_teams" : "2",
|
54 |
"event_logos_show_team_names" : "no",
|
55 |
"event_logos_show_results" : "yes",
|
presets/team-sports/floorball.json
CHANGED
@@ -53,5 +53,8 @@
|
|
53 |
{ "name" : "GAA", "equation" : "$ga / $eventsplayed", "precision" : 2, "description" : "Goals against average" },
|
54 |
{ "name" : "S%", "equation" : "$g / $s * 100", "precision" : 2, "description" : "Shot percentage" },
|
55 |
{ "name" : "SV%", "equation" : "$sv / $sa * 100", "precision" : 2, "description" : "Save percentage" }
|
56 |
-
]
|
|
|
|
|
|
|
57 |
}
|
53 |
{ "name" : "GAA", "equation" : "$ga / $eventsplayed", "precision" : 2, "description" : "Goals against average" },
|
54 |
{ "name" : "S%", "equation" : "$g / $s * 100", "precision" : 2, "description" : "Shot percentage" },
|
55 |
{ "name" : "SV%", "equation" : "$sv / $sa * 100", "precision" : 2, "description" : "Save percentage" }
|
56 |
+
],
|
57 |
+
"options": {
|
58 |
+
"mode" : "team"
|
59 |
+
}
|
60 |
}
|
presets/team-sports/football.json
CHANGED
@@ -61,5 +61,8 @@
|
|
61 |
{ "name" : "GS", "equation" : "$eventsstarted", "description" : "Games started" },
|
62 |
{ "name" : "Avg", "equation" : "$yds / $att", "precision" : 1, "description" : "Average yards per carry" },
|
63 |
{ "name" : "Rec Avg", "equation" : "$recyds / $rec", "precision" : 1, "description" : "Average yards per reception" }
|
64 |
-
]
|
|
|
|
|
|
|
65 |
}
|
61 |
{ "name" : "GS", "equation" : "$eventsstarted", "description" : "Games started" },
|
62 |
{ "name" : "Avg", "equation" : "$yds / $att", "precision" : 1, "description" : "Average yards per carry" },
|
63 |
{ "name" : "Rec Avg", "equation" : "$recyds / $rec", "precision" : 1, "description" : "Average yards per reception" }
|
64 |
+
],
|
65 |
+
"options": {
|
66 |
+
"mode" : "team"
|
67 |
+
}
|
68 |
}
|
presets/team-sports/footy.json
CHANGED
@@ -51,5 +51,8 @@
|
|
51 |
{ "name" : "HO", "equation" : "$hitouts / $eventsplayed", "precision" : 1, "description" : "Average hitouts per game" },
|
52 |
{ "name" : "T", "equation" : "$tackles / $eventsplayed", "precision" : 1, "description" : "Average tackles per game" },
|
53 |
{ "name" : "G", "equation" : "$goals / $eventsplayed", "precision" : 1, "description" : "Average goals per game" }
|
54 |
-
]
|
|
|
|
|
|
|
55 |
}
|
51 |
{ "name" : "HO", "equation" : "$hitouts / $eventsplayed", "precision" : 1, "description" : "Average hitouts per game" },
|
52 |
{ "name" : "T", "equation" : "$tackles / $eventsplayed", "precision" : 1, "description" : "Average tackles per game" },
|
53 |
{ "name" : "G", "equation" : "$goals / $eventsplayed", "precision" : 1, "description" : "Average goals per game" }
|
54 |
+
],
|
55 |
+
"options": {
|
56 |
+
"mode" : "team"
|
57 |
+
}
|
58 |
}
|
presets/team-sports/handball.json
CHANGED
@@ -39,5 +39,8 @@
|
|
39 |
],
|
40 |
"statistics": [
|
41 |
{ "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" }
|
42 |
-
]
|
|
|
|
|
|
|
43 |
}
|
39 |
],
|
40 |
"statistics": [
|
41 |
{ "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" }
|
42 |
+
],
|
43 |
+
"options": {
|
44 |
+
"mode" : "team"
|
45 |
+
}
|
46 |
}
|
presets/team-sports/ice-hockey.json
CHANGED
@@ -57,13 +57,14 @@
|
|
57 |
{ "name" : "SV%", "equation" : "$sv / $sa * 100", "precision" : 2, "description" : "Save percentage" }
|
58 |
],
|
59 |
"options": {
|
|
|
60 |
"event_teams" : "2",
|
61 |
"event_show_players" : "yes",
|
62 |
"event_show_total" : "yes",
|
63 |
-
"
|
64 |
"event_show_player_numbers" : "yes",
|
65 |
"event_split_players_by_team" : "yes",
|
66 |
"event_split_players_by_position" : "yes",
|
67 |
-
"
|
68 |
}
|
69 |
}
|
57 |
{ "name" : "SV%", "equation" : "$sv / $sa * 100", "precision" : 2, "description" : "Save percentage" }
|
58 |
],
|
59 |
"options": {
|
60 |
+
"mode" : "team",
|
61 |
"event_teams" : "2",
|
62 |
"event_show_players" : "yes",
|
63 |
"event_show_total" : "yes",
|
64 |
+
"event_performance_mode" : "values",
|
65 |
"event_show_player_numbers" : "yes",
|
66 |
"event_split_players_by_team" : "yes",
|
67 |
"event_split_players_by_position" : "yes",
|
68 |
+
"event_total_performance" : "all"
|
69 |
}
|
70 |
}
|
presets/team-sports/lacrosse.json
CHANGED
@@ -45,5 +45,8 @@
|
|
45 |
{ "name" : "Games", "equation" : "$eventsplayed", "description" : "Games played" },
|
46 |
{ "name" : "Shooting %", "equation" : "$goals / $shots", "precision" : 1, "description" : "Shooting percentage" },
|
47 |
{ "name" : "SoG %", "equation" : "$sog / $shots", "precision" : 1, "description" : "Shots on goal percentage" }
|
48 |
-
]
|
|
|
|
|
|
|
49 |
}
|
45 |
{ "name" : "Games", "equation" : "$eventsplayed", "description" : "Games played" },
|
46 |
{ "name" : "Shooting %", "equation" : "$goals / $shots", "precision" : 1, "description" : "Shooting percentage" },
|
47 |
{ "name" : "SoG %", "equation" : "$sog / $shots", "precision" : 1, "description" : "Shots on goal percentage" }
|
48 |
+
],
|
49 |
+
"options": {
|
50 |
+
"mode" : "team"
|
51 |
+
}
|
52 |
}
|
presets/team-sports/netball.json
CHANGED
@@ -46,5 +46,8 @@
|
|
46 |
],
|
47 |
"statistics": [
|
48 |
{ "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" }
|
49 |
-
]
|
|
|
|
|
|
|
50 |
}
|
46 |
],
|
47 |
"statistics": [
|
48 |
{ "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" }
|
49 |
+
],
|
50 |
+
"options": {
|
51 |
+
"mode" : "team"
|
52 |
+
}
|
53 |
}
|
presets/team-sports/rugby-league.json
CHANGED
@@ -46,5 +46,8 @@
|
|
46 |
"statistics": [
|
47 |
{ "name" : "A", "equation" : "$eventsplayed", "description" : "Appearances" },
|
48 |
{ "name" : "Pts", "equation" : "$t * 5 + $c * 2 + $p * 3 + $dg * 3", "description" : "Points" }
|
49 |
-
]
|
|
|
|
|
|
|
50 |
}
|
46 |
"statistics": [
|
47 |
{ "name" : "A", "equation" : "$eventsplayed", "description" : "Appearances" },
|
48 |
{ "name" : "Pts", "equation" : "$t * 5 + $c * 2 + $p * 3 + $dg * 3", "description" : "Points" }
|
49 |
+
],
|
50 |
+
"options": {
|
51 |
+
"mode" : "team"
|
52 |
+
}
|
53 |
}
|
presets/team-sports/rugby-union.json
CHANGED
@@ -47,5 +47,8 @@
|
|
47 |
"statistics": [
|
48 |
{ "name" : "A", "equation" : "$eventsplayed", "description" : "Appearances" },
|
49 |
{ "name" : "Pts", "equation" : "$t * 5 + $c * 2 + $p * 3 + $dg * 3", "description" : "Points" }
|
50 |
-
]
|
|
|
|
|
|
|
51 |
}
|
47 |
"statistics": [
|
48 |
{ "name" : "A", "equation" : "$eventsplayed", "description" : "Appearances" },
|
49 |
{ "name" : "Pts", "equation" : "$t * 5 + $c * 2 + $p * 3 + $dg * 3", "description" : "Points" }
|
50 |
+
],
|
51 |
+
"options": {
|
52 |
+
"mode" : "team"
|
53 |
+
}
|
54 |
}
|
presets/team-sports/soccer.json
CHANGED
@@ -43,6 +43,7 @@
|
|
43 |
{ "name" : "Loss Ratio", "equation" : "$loss / $eventsplayed * 100", "precision" : 2, "description" : "Loss ratio" }
|
44 |
],
|
45 |
"options": {
|
|
|
46 |
"event_teams" : "2",
|
47 |
"event_show_players" : "yes",
|
48 |
"event_show_total" : "no",
|
43 |
{ "name" : "Loss Ratio", "equation" : "$loss / $eventsplayed * 100", "precision" : 2, "description" : "Loss ratio" }
|
44 |
],
|
45 |
"options": {
|
46 |
+
"mode" : "team",
|
47 |
"event_teams" : "2",
|
48 |
"event_show_players" : "yes",
|
49 |
"event_show_total" : "no",
|
presets/team-sports/softball.json
CHANGED
@@ -71,6 +71,7 @@
|
|
71 |
{ "name" : "AVG", "equation" : "$h / $ab", "precision" : 3, "description" : "Batting average" }
|
72 |
],
|
73 |
"options": {
|
|
|
74 |
"event_teams" : "2",
|
75 |
"event_hide_child_positions" : "yes",
|
76 |
"event_show_players" : "yes",
|
71 |
{ "name" : "AVG", "equation" : "$h / $ab", "precision" : 3, "description" : "Batting average" }
|
72 |
],
|
73 |
"options": {
|
74 |
+
"mode" : "team",
|
75 |
"event_teams" : "2",
|
76 |
"event_hide_child_positions" : "yes",
|
77 |
"event_show_players" : "yes",
|
presets/team-sports/volleyball.json
CHANGED
@@ -48,5 +48,8 @@
|
|
48 |
{ "name" : "Pct", "equation" : "( $k - $e ) / $ta", "description" : "Hitting percentage" },
|
49 |
{ "name" : "B/S", "equation" : "$b / $sets", "description" : "Blocks per set" },
|
50 |
{ "name" : "A/S", "equation" : "$a / $sets", "description" : "Assists per set" }
|
51 |
-
]
|
|
|
|
|
|
|
52 |
}
|
48 |
{ "name" : "Pct", "equation" : "( $k - $e ) / $ta", "description" : "Hitting percentage" },
|
49 |
{ "name" : "B/S", "equation" : "$b / $sets", "description" : "Blocks per set" },
|
50 |
{ "name" : "A/S", "equation" : "$a / $sets", "description" : "Assists per set" }
|
51 |
+
],
|
52 |
+
"options": {
|
53 |
+
"mode" : "team"
|
54 |
+
}
|
55 |
}
|
presets/water-sports/water-polo.json
CHANGED
@@ -50,5 +50,8 @@
|
|
50 |
{ "name" : "Win Ratio", "equation" : "$win / $eventsplayed * 100", "precision" : 2 },
|
51 |
{ "name" : "Draw Ratio", "equation" : "$draw / $eventsplayed * 100", "precision" : 2 },
|
52 |
{ "name" : "Loss Ratio", "equation" : "$loss / $eventsplayed * 100", "precision" : 2 }
|
53 |
-
]
|
|
|
|
|
|
|
54 |
}
|
50 |
{ "name" : "Win Ratio", "equation" : "$win / $eventsplayed * 100", "precision" : 2 },
|
51 |
{ "name" : "Draw Ratio", "equation" : "$draw / $eventsplayed * 100", "precision" : 2 },
|
52 |
{ "name" : "Loss Ratio", "equation" : "$loss / $eventsplayed * 100", "precision" : 2 }
|
53 |
+
],
|
54 |
+
"options": {
|
55 |
+
"mode" : "team"
|
56 |
+
}
|
57 |
}
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: ThemeBoy, brianmiyaji, aylaview, rochesterj
|
|
3 |
Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
|
4 |
Donate link: http://tboy.co/donate
|
5 |
Requires at least: 3.8
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.2
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -238,9 +238,26 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
|
|
238 |
|
239 |
== Changelog ==
|
240 |
|
241 |
-
= 2.2
|
242 |
-
* Fix -
|
243 |
-
* Fix -
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
= 2.2.10 =
|
246 |
* Tweak - Update modules page.
|
@@ -405,7 +422,7 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
|
|
405 |
* Feature - Add squad number and name option to player details.
|
406 |
* Feature - Add tab options to layout designer.
|
407 |
* Feature - Add option to display player and staff dropdowns in profiles.
|
408 |
-
* Feature - Add option to select TBA, postponed, and
|
409 |
* Feature - Licenses tab for third-party extensions.
|
410 |
* Tweak - Get player data only when needed.
|
411 |
* Tweak - Add capabilities to taxonomies.
|
3 |
Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
|
4 |
Donate link: http://tboy.co/donate
|
5 |
Requires at least: 3.8
|
6 |
+
Tested up to: 4.8
|
7 |
+
Stable tag: 2.3.2
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
238 |
|
239 |
== Changelog ==
|
240 |
|
241 |
+
= 2.3.2 =
|
242 |
+
* Fix - Team in player statistics total row displaying as zero.
|
243 |
+
* Fix - Notice when no sendoffs are available during minutes played calculation.
|
244 |
+
|
245 |
+
= 2.3.1 =
|
246 |
+
* Tweak - Update version numbers of recommended sport-specific extensions.
|
247 |
+
* Fix - Manually entered statistics not reflected in player profile totals.
|
248 |
+
* Fix - Template hooks not callable for third-party integration.
|
249 |
+
* Fix - Error when editing league tables in PHP versions earlier than 5.5.
|
250 |
+
|
251 |
+
= 2.3 =
|
252 |
+
* Feature - New setup wizard for first-time installs.
|
253 |
+
* Feature - Option to automatically create player profiles during user registration.
|
254 |
+
* Feature - Choose team or individual mode for each event.
|
255 |
+
* Feature - Send Off setting for player statistics to suspend minute count for that player.
|
256 |
+
* Tweak - Remove horizontal scrolling in dashboard to fix hidden dropdowns.
|
257 |
+
* Tweak - Revert text color overrides for dark color schemes in frontend styles.
|
258 |
+
* Fix - Borrowed players not automatically loading on event edit.
|
259 |
+
* Fix - Played minutes calculation and player profile statistics.
|
260 |
+
* Preset - Update all presets to support new mode switching feature.
|
261 |
|
262 |
= 2.2.10 =
|
263 |
* Tweak - Update modules page.
|
422 |
* Feature - Add squad number and name option to player details.
|
423 |
* Feature - Add tab options to layout designer.
|
424 |
* Feature - Add option to display player and staff dropdowns in profiles.
|
425 |
+
* Feature - Add option to select TBA, postponed, and canceled event status.
|
426 |
* Feature - Licenses tab for third-party extensions.
|
427 |
* Tweak - Get player data only when needed.
|
428 |
* Tweak - Add capabilities to taxonomies.
|
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.2
|
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.2
|
30 |
*/
|
31 |
final class SportsPress {
|
32 |
|
33 |
/**
|
34 |
* @var string
|
35 |
*/
|
36 |
-
public $version = '2.2
|
37 |
|
38 |
/**
|
39 |
* @var SportsPress The single instance of the class
|
@@ -347,7 +347,7 @@ final class SportsPress {
|
|
347 |
'name' => 'SportsPress for Baseball',
|
348 |
'slug' => 'sportspress-for-baseball',
|
349 |
'required' => false,
|
350 |
-
'version' => '0.9.
|
351 |
);
|
352 |
break;
|
353 |
case 'basketball':
|
@@ -355,7 +355,7 @@ final class SportsPress {
|
|
355 |
'name' => 'SportsPress for Basketball',
|
356 |
'slug' => 'sportspress-for-basketball',
|
357 |
'required' => false,
|
358 |
-
'version' => '0.9',
|
359 |
);
|
360 |
break;
|
361 |
case 'cricket':
|
@@ -363,7 +363,7 @@ final class SportsPress {
|
|
363 |
'name' => 'SportsPress for Cricket',
|
364 |
'slug' => 'sportspress-for-cricket',
|
365 |
'required' => false,
|
366 |
-
'version' => '1.1',
|
367 |
);
|
368 |
break;
|
369 |
case 'golf':
|
@@ -371,7 +371,7 @@ final class SportsPress {
|
|
371 |
'name' => 'SportsPress for Golf',
|
372 |
'slug' => 'sportspress-for-golf',
|
373 |
'required' => false,
|
374 |
-
'version' => '0.9',
|
375 |
);
|
376 |
break;
|
377 |
case 'soccer':
|
@@ -379,7 +379,7 @@ final class SportsPress {
|
|
379 |
'name' => 'SportsPress for Football (Soccer)',
|
380 |
'slug' => 'sportspress-for-soccer',
|
381 |
'required' => false,
|
382 |
-
'version' => '0.9.
|
383 |
);
|
384 |
break;
|
385 |
endswitch;
|
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.3.2
|
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.3.2
|
30 |
*/
|
31 |
final class SportsPress {
|
32 |
|
33 |
/**
|
34 |
* @var string
|
35 |
*/
|
36 |
+
public $version = '2.3.2';
|
37 |
|
38 |
/**
|
39 |
* @var SportsPress The single instance of the class
|
347 |
'name' => 'SportsPress for Baseball',
|
348 |
'slug' => 'sportspress-for-baseball',
|
349 |
'required' => false,
|
350 |
+
'version' => '0.9.2',
|
351 |
);
|
352 |
break;
|
353 |
case 'basketball':
|
355 |
'name' => 'SportsPress for Basketball',
|
356 |
'slug' => 'sportspress-for-basketball',
|
357 |
'required' => false,
|
358 |
+
'version' => '0.9.1',
|
359 |
);
|
360 |
break;
|
361 |
case 'cricket':
|
363 |
'name' => 'SportsPress for Cricket',
|
364 |
'slug' => 'sportspress-for-cricket',
|
365 |
'required' => false,
|
366 |
+
'version' => '1.1.1',
|
367 |
);
|
368 |
break;
|
369 |
case 'golf':
|
371 |
'name' => 'SportsPress for Golf',
|
372 |
'slug' => 'sportspress-for-golf',
|
373 |
'required' => false,
|
374 |
+
'version' => '0.9.1',
|
375 |
);
|
376 |
break;
|
377 |
case 'soccer':
|
379 |
'name' => 'SportsPress for Football (Soccer)',
|
380 |
'slug' => 'sportspress-for-soccer',
|
381 |
'required' => false,
|
382 |
+
'version' => '0.9.6',
|
383 |
);
|
384 |
break;
|
385 |
endswitch;
|
templates/event-performance-table-combined.php
DELETED
@@ -1,179 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Event Performance Table Combined
|
4 |
-
*
|
5 |
-
* @author ThemeBoy
|
6 |
-
* @package SportsPress/Templates
|
7 |
-
* @version 2.2.5
|
8 |
-
*/
|
9 |
-
|
10 |
-
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
11 |
-
|
12 |
-
// Initialize totals
|
13 |
-
$totals = array();
|
14 |
-
|
15 |
-
// Set null
|
16 |
-
if ( ! isset( $position ) ) $position = null;
|
17 |
-
if ( ! isset( $class ) ) $class = null;
|
18 |
-
?>
|
19 |
-
<div class="sp-template sp-template-event-performance sp-template-event-performance-combined sp-template-event-performance-<?php echo $mode; ?><?php if ( isset( $class ) ) { echo ' ' . $class; } ?>">
|
20 |
-
<?php if ( $caption ): ?>
|
21 |
-
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
22 |
-
<?php endif; ?>
|
23 |
-
<div class="sp-table-wrapper">
|
24 |
-
<table class="sp-event-performance sp-data-table<?php if ( $scrollable ) { ?> sp-scrollable-table<?php } ?><?php if ( $sortable ) { ?> sp-sortable-table<?php } ?>">
|
25 |
-
<thead>
|
26 |
-
<tr>
|
27 |
-
<?php if ( isset( $labels['number'] ) ): ?>
|
28 |
-
<th class="data-number">#</th>
|
29 |
-
<?php endif; ?>
|
30 |
-
<th class="data-name"><?php _e( 'Player', 'sportspress' ); ?></th>
|
31 |
-
<?php if ( $mode == 'values' ): foreach( $labels as $key => $label ): ?>
|
32 |
-
<?php if ( 'number' == $key ) continue; ?>
|
33 |
-
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
34 |
-
<?php endforeach; else: ?>
|
35 |
-
<th class="sp-performance-icons"> </th>
|
36 |
-
<?php endif; ?>
|
37 |
-
</tr>
|
38 |
-
</thead>
|
39 |
-
<tbody>
|
40 |
-
<?php
|
41 |
-
if ( $show_players ) {
|
42 |
-
|
43 |
-
$data = apply_filters( 'sportspress_event_performance_players', $data, $data, array(), $mode );
|
44 |
-
|
45 |
-
$i = 0;
|
46 |
-
foreach ( $data as $player_id => $row ):
|
47 |
-
|
48 |
-
if ( ! $player_id )
|
49 |
-
continue;
|
50 |
-
|
51 |
-
$name = get_the_title( $player_id );
|
52 |
-
|
53 |
-
if ( ! $name )
|
54 |
-
continue;
|
55 |
-
|
56 |
-
echo '<tr class="' . sp_array_value( $row, 'status', 'lineup' ) . ' ' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
57 |
-
|
58 |
-
if ( isset( $labels['number'] ) ):
|
59 |
-
$number = sp_array_value( $row, 'number', ' ' );
|
60 |
-
|
61 |
-
// Player number
|
62 |
-
echo '<td class="data-number">' . $number . '</td>';
|
63 |
-
endif;
|
64 |
-
|
65 |
-
if ( $link_posts ):
|
66 |
-
$permalink = get_post_permalink( $player_id );
|
67 |
-
$name = '<a href="' . $permalink . '">' . $name . '</a>';
|
68 |
-
endif;
|
69 |
-
|
70 |
-
echo '<td class="data-name">' . $name . '</td>';
|
71 |
-
|
72 |
-
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
73 |
-
|
74 |
-
foreach ( $labels as $key => $label ):
|
75 |
-
if ( in_array( $key, array( 'number', 'name' ) ) )
|
76 |
-
continue;
|
77 |
-
|
78 |
-
$format = sp_array_value( $formats, $key, 'number' );
|
79 |
-
$placeholder = sp_get_format_placeholder( $format );
|
80 |
-
|
81 |
-
$value = '-';
|
82 |
-
if ( $key == 'position' ):
|
83 |
-
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
84 |
-
$positions = array();
|
85 |
-
$position_ids = (array) $row[ $key ];
|
86 |
-
foreach ( $position_ids as $position_id ) {
|
87 |
-
$player_position = get_term_by( 'id', $position_id, 'sp_position' );
|
88 |
-
if ( $player_position ) $positions[] = $player_position->name;
|
89 |
-
}
|
90 |
-
$value = implode( ', ', $positions );
|
91 |
-
endif;
|
92 |
-
else:
|
93 |
-
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
94 |
-
$value = $row[ $key ];
|
95 |
-
else:
|
96 |
-
$value = $placeholder;
|
97 |
-
endif;
|
98 |
-
endif;
|
99 |
-
if ( ! array_key_exists( $key, $totals ) ):
|
100 |
-
$totals[ $key ] = $placeholder;
|
101 |
-
endif;
|
102 |
-
|
103 |
-
if ( 'number' === $format ) {
|
104 |
-
$add = floatval( $value );
|
105 |
-
$totals[ $key ] += $add;
|
106 |
-
}
|
107 |
-
|
108 |
-
if ( $mode == 'values' ):
|
109 |
-
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
110 |
-
elseif ( intval( $value ) && $mode == 'icons' ):
|
111 |
-
$performance_id = sp_array_value( $performance_ids, $key, null );
|
112 |
-
$icons = '';
|
113 |
-
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
114 |
-
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', $value );
|
115 |
-
endif;
|
116 |
-
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
|
117 |
-
endif;
|
118 |
-
endforeach;
|
119 |
-
|
120 |
-
if ( $mode == 'icons' ) echo '</td>';
|
121 |
-
|
122 |
-
echo '</tr>';
|
123 |
-
|
124 |
-
$i++;
|
125 |
-
|
126 |
-
endforeach;
|
127 |
-
|
128 |
-
}
|
129 |
-
?>
|
130 |
-
</tbody>
|
131 |
-
<?php if ( apply_filters( 'sportspress_event_performance_show_footer', $show_total ) ): ?>
|
132 |
-
<tfoot>
|
133 |
-
<?php do_action( 'sportspress_event_performance_table_footer', $data, $labels, $position, $performance_ids ); ?>
|
134 |
-
<?php if ( $show_total && ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ) ): ?>
|
135 |
-
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
136 |
-
<?php
|
137 |
-
if ( isset( $labels['number'] ) ):
|
138 |
-
echo '<td class="data-number"> </td>';
|
139 |
-
endif;
|
140 |
-
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
141 |
-
|
142 |
-
$row = sp_array_value( $data, 1, array() );
|
143 |
-
|
144 |
-
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
145 |
-
|
146 |
-
foreach ( $labels as $key => $label ):
|
147 |
-
if ( in_array( $key, array( 'number', 'name' ) ) )
|
148 |
-
continue;
|
149 |
-
if ( $key == 'position' ):
|
150 |
-
$value = '—';
|
151 |
-
elseif ( $primary && $key !== $primary ):
|
152 |
-
$value = ' ';
|
153 |
-
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
154 |
-
$value = $row[ $key ];
|
155 |
-
else:
|
156 |
-
$value = sp_array_value( $totals, $key, 0 );
|
157 |
-
endif;
|
158 |
-
|
159 |
-
if ( $mode == 'values' ):
|
160 |
-
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
161 |
-
elseif ( intval( $value ) && $mode == 'icons' ):
|
162 |
-
$performance_id = sp_array_value( $performance_ids, $key, null );
|
163 |
-
$icons = '';
|
164 |
-
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
165 |
-
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
166 |
-
endif;
|
167 |
-
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
|
168 |
-
endif;
|
169 |
-
endforeach;
|
170 |
-
|
171 |
-
if ( $mode == 'icons' ) echo '</td>';
|
172 |
-
?>
|
173 |
-
</tr>
|
174 |
-
<?php endif; ?>
|
175 |
-
</tfoot>
|
176 |
-
<?php endif; ?>
|
177 |
-
</table>
|
178 |
-
</div>
|
179 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/event-performance.php
CHANGED
@@ -4,12 +4,11 @@
|
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
-
* @version 2.
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
11 |
|
12 |
-
$is_individual = get_option( 'sportspress_load_individual_mode_module', 'no' ) === 'yes' ? true : false;
|
13 |
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) === 'yes' ? true : false;
|
14 |
$show_staff = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;
|
15 |
$show_total = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;
|
@@ -29,6 +28,8 @@ if ( ! isset( $id ) )
|
|
29 |
|
30 |
$teams = get_post_meta( $id, 'sp_team', false );
|
31 |
|
|
|
|
|
32 |
if ( is_array( $teams ) ):
|
33 |
ob_start();
|
34 |
|
@@ -107,7 +108,7 @@ if ( is_array( $teams ) ):
|
|
107 |
}
|
108 |
}
|
109 |
|
110 |
-
sp_get_template( 'event-performance-table
|
111 |
'scrollable' => $scrollable,
|
112 |
'sortable' => $sortable,
|
113 |
'show_players' => $show_players,
|
@@ -125,7 +126,6 @@ if ( is_array( $teams ) ):
|
|
125 |
'primary' => 'primary' == $total ? $primary : null,
|
126 |
) );
|
127 |
} else {
|
128 |
-
|
129 |
// Prepare for offense and defense sections
|
130 |
if ( -1 != $sections ) {
|
131 |
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
+
* @version 2.3
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
11 |
|
|
|
12 |
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) === 'yes' ? true : false;
|
13 |
$show_staff = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;
|
14 |
$show_total = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;
|
28 |
|
29 |
$teams = get_post_meta( $id, 'sp_team', false );
|
30 |
|
31 |
+
$is_individual = sp_get_post_mode( $id ) === 'player' ? true : false;
|
32 |
+
|
33 |
if ( is_array( $teams ) ):
|
34 |
ob_start();
|
35 |
|
108 |
}
|
109 |
}
|
110 |
|
111 |
+
sp_get_template( 'event-performance-table.php', array(
|
112 |
'scrollable' => $scrollable,
|
113 |
'sortable' => $sortable,
|
114 |
'show_players' => $show_players,
|
126 |
'primary' => 'primary' == $total ? $primary : null,
|
127 |
) );
|
128 |
} else {
|
|
|
129 |
// Prepare for offense and defense sections
|
130 |
if ( -1 != $sections ) {
|
131 |
|
templates/league-table.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
-
* @version
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -18,7 +18,7 @@ $defaults = array(
|
|
18 |
'title' => false,
|
19 |
'show_title' => get_option( 'sportspress_table_show_title', 'yes' ) == 'yes' ? true : false,
|
20 |
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
|
21 |
-
'link_posts' =>
|
22 |
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
23 |
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
24 |
'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false,
|
@@ -27,6 +27,14 @@ $defaults = array(
|
|
27 |
|
28 |
extract( $defaults, EXTR_SKIP );
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
if ( ! isset( $highlight ) ) $highlight = get_post_meta( $id, 'sp_highlight', true );
|
31 |
|
32 |
$table = new SP_League_Table( $id );
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
+
* @version 2.3
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
18 |
'title' => false,
|
19 |
'show_title' => get_option( 'sportspress_table_show_title', 'yes' ) == 'yes' ? true : false,
|
20 |
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
|
21 |
+
'link_posts' => null,
|
22 |
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
23 |
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
24 |
'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false,
|
27 |
|
28 |
extract( $defaults, EXTR_SKIP );
|
29 |
|
30 |
+
if ( ! isset( $link_posts ) ) {
|
31 |
+
if ( 'player' === sp_get_post_mode( $id ) ) {
|
32 |
+
$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;
|
33 |
+
} else {
|
34 |
+
$link_posts = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
if ( ! isset( $highlight ) ) $highlight = get_post_meta( $id, 'sp_highlight', true );
|
39 |
|
40 |
$table = new SP_League_Table( $id );
|
templates/player-selector.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
-
* @version 2.
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -45,7 +45,7 @@ if ( $season_ids ):
|
|
45 |
);
|
46 |
endif;
|
47 |
|
48 |
-
if ( $team
|
49 |
$args['meta_query'] = array(
|
50 |
array(
|
51 |
'key' => 'sp_team',
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
+
* @version 2.3
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
45 |
);
|
46 |
endif;
|
47 |
|
48 |
+
if ( $team ):
|
49 |
$args['meta_query'] = array(
|
50 |
array(
|
51 |
'key' => 'sp_team',
|
templates/staff-selector.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
-
* @version 2.
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
@@ -44,7 +44,7 @@ if ( $season_ids ):
|
|
44 |
);
|
45 |
endif;
|
46 |
|
47 |
-
if ( $team
|
48 |
$args['meta_query'] = array(
|
49 |
array(
|
50 |
'key' => 'sp_team',
|
4 |
*
|
5 |
* @author ThemeBoy
|
6 |
* @package SportsPress/Templates
|
7 |
+
* @version 2.3
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
44 |
);
|
45 |
endif;
|
46 |
|
47 |
+
if ( $team ):
|
48 |
$args['meta_query'] = array(
|
49 |
array(
|
50 |
'key' => 'sp_team',
|
uninstall.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @author ThemeBoy
|
8 |
* @category Core
|
9 |
* @package SportsPress/Uninstaller
|
10 |
-
* @version
|
11 |
*/
|
12 |
if( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
|
13 |
exit();
|
@@ -23,4 +23,5 @@ $installer->remove_roles();
|
|
23 |
// Delete options
|
24 |
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'sportspress_%';");
|
25 |
|
26 |
-
delete_option( 'sportspress_installed' );
|
|
7 |
* @author ThemeBoy
|
8 |
* @category Core
|
9 |
* @package SportsPress/Uninstaller
|
10 |
+
* @version 2.3
|
11 |
*/
|
12 |
if( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
|
13 |
exit();
|
23 |
// Delete options
|
24 |
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'sportspress_%';");
|
25 |
|
26 |
+
delete_option( 'sportspress_installed' );
|
27 |
+
delete_option( 'sportspress_completed_setup' );
|
wpml-config.xml
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<key name="Article"/>
|
6 |
<key name="Birthday"/>
|
7 |
<key name="Box Score"/>
|
8 |
-
<key name="
|
9 |
<key name="Competition"/>
|
10 |
<key name="Current Team"/>
|
11 |
<key name="Current Teams"/>
|
5 |
<key name="Article"/>
|
6 |
<key name="Birthday"/>
|
7 |
<key name="Box Score"/>
|
8 |
+
<key name="Canceled"/>
|
9 |
<key name="Competition"/>
|
10 |
<key name="Current Team"/>
|
11 |
<key name="Current Teams"/>
|