Add icons module
This commit is contained in:
50
assets/css/icons.css
Normal file
50
assets/css/icons.css
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/* SportsPress icons */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'sportspress';
|
||||||
|
src:url('../fonts/sportspress.eot?-76nsup');
|
||||||
|
src:url('../fonts/sportspress.eot?#iefix-76nsup') format('embedded-opentype'),
|
||||||
|
url('../fonts/sportspress.woff2?-76nsup') format('woff2'),
|
||||||
|
url('../fonts/sportspress.ttf?-76nsup') format('truetype'),
|
||||||
|
url('../fonts/sportspress.woff?-76nsup') format('woff'),
|
||||||
|
url('../fonts/sportspress.svg?-76nsup#sportspress') format('svg');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
[class^="sp-icon-"], [class*=" sp-icon-"] {
|
||||||
|
font-family: sportspress, dashicons;
|
||||||
|
speak: none;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
font-variant: normal;
|
||||||
|
text-transform: none;
|
||||||
|
line-height: 1;
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
font-size: 20px;
|
||||||
|
vertical-align: top;
|
||||||
|
|
||||||
|
/* Better Font Rendering =========== */
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-icon-baseball:before {
|
||||||
|
content: "\e701";
|
||||||
|
}
|
||||||
|
.sp-icon-basketball:before {
|
||||||
|
content: "\e602";
|
||||||
|
}
|
||||||
|
.sp-icon-cricketball:before {
|
||||||
|
content: "\e604";
|
||||||
|
}
|
||||||
|
.sp-icon-soccerball:before {
|
||||||
|
content: "\e700";
|
||||||
|
}
|
||||||
|
.sp-icon-shoe:before {
|
||||||
|
content: "\e800";
|
||||||
|
}
|
||||||
|
.sp-icon-card:before {
|
||||||
|
content: "\e801";
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
/* SportsPress menu styles */
|
/* SportsPress menu styles */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'sportspress';
|
font-family: 'sportspress';
|
||||||
src:url('../fonts/sportspress.eot?gvy36n');
|
src:url('../fonts/sportspress.eot?-76nsup');
|
||||||
src:url('../fonts/sportspress.eot?#iefixgvy36n') format('embedded-opentype'),
|
src:url('../fonts/sportspress.eot?#iefix-76nsup') format('embedded-opentype'),
|
||||||
url('../fonts/sportspress.woff2?gvy36n') format('woff2'),
|
url('../fonts/sportspress.woff2?-76nsup') format('woff2'),
|
||||||
url('../fonts/sportspress.ttf?gvy36n') format('truetype'),
|
url('../fonts/sportspress.ttf?-76nsup') format('truetype'),
|
||||||
url('../fonts/sportspress.woff?gvy36n') format('woff'),
|
url('../fonts/sportspress.woff?-76nsup') format('woff'),
|
||||||
url('../fonts/sportspress.svg?gvy36n#sportspress') format('svg');
|
url('../fonts/sportspress.svg?-76nsup#sportspress') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
@@ -138,6 +138,27 @@
|
|||||||
.sp-icon-whistle:before {
|
.sp-icon-whistle:before {
|
||||||
content: "\f227";
|
content: "\f227";
|
||||||
}
|
}
|
||||||
|
.sp-icon-baseball:before {
|
||||||
|
content: "\e701";
|
||||||
|
}
|
||||||
|
.sp-icon-basketball:before {
|
||||||
|
content: "\e602";
|
||||||
|
}
|
||||||
|
.sp-icon-golfball:before {
|
||||||
|
content: "\e603";
|
||||||
|
}
|
||||||
|
.sp-icon-cricketball:before {
|
||||||
|
content: "\e604";
|
||||||
|
}
|
||||||
|
.sp-icon-soccerball:before {
|
||||||
|
content: "\e700";
|
||||||
|
}
|
||||||
|
.sp-icon-shoe:before {
|
||||||
|
content: "\e800";
|
||||||
|
}
|
||||||
|
.sp-icon-card:before {
|
||||||
|
content: "\e801";
|
||||||
|
}
|
||||||
|
|
||||||
#adminmenu #toplevel_page_sportspress .toplevel_page_sportspress div.wp-menu-image:before,
|
#adminmenu #toplevel_page_sportspress .toplevel_page_sportspress div.wp-menu-image:before,
|
||||||
#adminmenu #toplevel_page_themeboy .toplevel_page_themeboy div.wp-menu-image:before,
|
#adminmenu #toplevel_page_themeboy .toplevel_page_themeboy div.wp-menu-image:before,
|
||||||
@@ -202,6 +223,30 @@
|
|||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Icons */
|
||||||
|
.sp-icons .button {
|
||||||
|
margin: 0 3px 4px 0;
|
||||||
|
padding: 0 7px 1px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-icons .button i {
|
||||||
|
margin: 3px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-icon-color-box input[type=text] {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-admin .sp-icons label input[type=radio] {
|
||||||
|
margin-top: -3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 782px) {
|
||||||
|
.wp-admin .sp-icons label input[type=radio] {
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* TinyMCE */
|
/* TinyMCE */
|
||||||
.mce-toolbar i.mce-i-sp_shortcodes_button, .mce-toolbar span.mce_sp_shortcodes_button {
|
.mce-toolbar i.mce-i-sp_shortcodes_button, .mce-toolbar span.mce_sp_shortcodes_button {
|
||||||
margin-right: -5px;
|
margin-right: -5px;
|
||||||
|
|||||||
Binary file not shown.
@@ -7,6 +7,15 @@
|
|||||||
<font-face units-per-em="512" ascent="480" descent="-32" />
|
<font-face units-per-em="512" ascent="480" descent="-32" />
|
||||||
<missing-glyph horiz-adv-x="512" />
|
<missing-glyph horiz-adv-x="512" />
|
||||||
<glyph unicode=" " horiz-adv-x="256" d="" />
|
<glyph unicode=" " horiz-adv-x="256" d="" />
|
||||||
|
<glyph unicode="" glyph-name="football" d="M256 0c-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 375.44c-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 128l-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 294.4l-64-44 24.4-70.8h79.2l24.4 70.8-64 44z" />
|
||||||
|
<glyph unicode="" glyph-name="baseball" d="M403.2 88c-42.8 32.72-70.4 84.32-70.4 142.4s27.6 109.6 70.4 142.4c35.68-36.88 57.6-87.040 57.6-142.4s-21.92-105.52-57.6-142.4zM384 70.56c-35.040-28.080-79.6-44.96-128-44.96s-92.96 16.8-128 44.96c46.8 37.52 76.8 95.2 76.8 159.84s-30 122.32-76.8 159.84c35.040 28.080 79.6 44.96 128 44.96s92.96-16.8 128-44.96c-46.8-37.52-76.8-95.2-76.8-159.84s30-122.32 76.8-159.84zM108.8 88c-35.68 36.88-57.6 87.040-57.6 142.4s21.92 105.52 57.6 142.4c42.8-32.72 70.4-84.32 70.4-142.4s-27.6-109.6-70.4-142.4z" />
|
||||||
|
<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" />
|
||||||
|
<glyph unicode="" glyph-name="golf" d="M383.6 282c0-14.080 11.52-25.6 25.6-25.6 0 0 0 0 0 0-8-19.12-19.44-36.48-33.6-51.2h-43.28c0-10.4 6.32-19.44 15.28-23.44-26.4-17.52-58-27.76-92.080-27.76s-65.68 10.24-92.080 27.76c8.96 4 15.28 12.96 15.28 23.44h-43.28c-14.16 14.72-25.6 32.080-33.6 51.2 0 0 0 0 0 0 14.080 0 25.6 11.52 25.6 25.6h-33.92c-2.88 12.32-4.48 25.2-4.48 38.4 0 91.92 74.48 166.4 166.4 166.4s166.4-74.48 166.4-166.4c0-13.2-1.52-26.080-4.48-38.4h-33.76zM306.8 256.4c14.080 0 25.6 11.52 25.6 25.6h-51.2c0-14.080 11.52-25.6 25.6-25.6zM255.6 179.6c14.080 0 25.6 11.52 25.6 25.6h-51.2c0-14.080 11.52-25.6 25.6-25.6zM204.4 256.4c14.080 0 25.6 11.52 25.6 25.6h-51.2c0-14.080 11.52-25.6 25.6-25.6zM153.2 333.2c14.080 0 25.6 11.52 25.6 25.6h-51.2c0-14.080 11.52-25.6 25.6-25.6zM178.8 435.6c0-14.080 11.52-25.6 25.6-25.6s25.6 11.52 25.6 25.6h-51.2zM230 358.8c0-14.080 11.52-25.6 25.6-25.6s25.6 11.52 25.6 25.6h-51.2zM281.2 435.6c0-14.080 11.52-25.6 25.6-25.6s25.6 11.52 25.6 25.6h-51.2zM332.4 358.8c0-14.080 11.52-25.6 25.6-25.6s25.6 11.52 25.6 25.6h-51.2zM310.88 136.48l-29.68-59.28v-102.4h-51.2v102.4l-29.68 59.28c17.52-5.28 36.080-8.080 55.28-8.080s37.76 2.88 55.28 8.080z" />
|
||||||
|
<glyph unicode="" glyph-name="cricket" d="M233.44 26.88l226.080 226.080c6.56-59.68-13.040-121.6-58.72-167.36s-107.68-65.28-167.36-58.72zM151.92 53.92c-14.56 8.56-28.24 19.12-40.8 31.68-12.48 12.48-23.040 26.24-31.68 40.8l280.64 280.48c14.56-8.56 28.24-19.12 40.8-31.68 12.48-12.48 23.040-26.24 31.68-40.8l-280.64-280.48zM52.48 207.84c-6.56 59.68 12.96 121.68 58.72 167.36s107.68 65.28 167.36 58.72l-226.080-226.080zM309.040 428.24c9.12-2.48 18.16-5.52 26.96-9.28l-268.56-268.56c-3.76 8.8-6.8 17.84-9.28 26.96l250.88 250.88zM444.56 310.4c3.76-8.8 6.8-17.84 9.28-26.96l-250.88-250.88c-9.12 2.48-18.16 5.52-26.96 9.28l268.56 268.56z" />
|
||||||
|
<glyph unicode="" glyph-name="goal" d="M335.6 419.040c25.36-10.72 47.12-25.36 65.44-43.6 18.24-18.24 32.8-40.080 43.6-65.44s16.16-51.84 16.16-79.6-5.44-54.24-16.16-79.6c-10.72-25.36-25.36-47.12-43.6-65.44-18.24-18.24-40.080-32.8-65.44-43.6s-51.84-16.16-79.6-16.16-54.24 5.44-79.6 16.16-47.12 25.36-65.44 43.6c-18.32 18.24-32.8 40.080-43.6 65.44s-16.16 51.84-16.16 79.6 5.44 54.24 16.16 79.6 25.36 47.12 43.6 65.44 40.080 32.8 65.44 43.6 51.84 16.16 79.6 16.16 54.24-5.44 79.6-16.16zM114 339.6l14-6.8v-76.8l-50.4-38c2.16-32.8 12.64-62.8 31.6-90h70l25.6-64v-5.2c16.8-5.040 33.84-7.6 51.2-7.6s34.4 2.56 51.2 7.6v5.2l25.6 64h70c18.96 27.2 29.44 57.2 31.6 90l-50.4 38v76.8l13.6 6.8c-18.4 24-41.76 42.24-70 54.8l-71.6-36-71.6 36c-28.24-12.56-51.76-30.8-70.4-54.8zM320 250.4l-24.4-70.8h-79.2l-24.4 70.8 64 44 64-44z" />
|
||||||
|
<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" />
|
||||||
|
<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" />
|
||||||
|
<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" />
|
||||||
<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" />
|
<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" />
|
||||||
<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" />
|
<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" />
|
||||||
<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" />
|
<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" />
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 28 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
37
assets/js/admin/iconpicker.js
Normal file
37
assets/js/admin/iconpicker.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
jQuery(document).ready(function($){
|
||||||
|
|
||||||
|
// Icon picker
|
||||||
|
$('.sp-icons input').on('change', function() {
|
||||||
|
if ('' == $(this).val()) {
|
||||||
|
$('.sp-custom-colors').hide();
|
||||||
|
$('.sp-custom-thumbnail').show();
|
||||||
|
} else {
|
||||||
|
$('.sp-custom-thumbnail').hide();
|
||||||
|
$('.sp-custom-colors').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Color picker
|
||||||
|
$('.colorpick').iris( {
|
||||||
|
change: function(event, ui){
|
||||||
|
$(this).css( { backgroundColor: ui.color.toString() } );
|
||||||
|
},
|
||||||
|
hide: true,
|
||||||
|
border: true
|
||||||
|
} ).each( function() {
|
||||||
|
$(this).css( { backgroundColor: $(this).val() } );
|
||||||
|
})
|
||||||
|
.click(function(){
|
||||||
|
$('.iris-picker').hide();
|
||||||
|
$(this).closest('.sp-icon-color-box, td').find('.iris-picker').show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').click(function() {
|
||||||
|
$('.iris-picker').hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.sp-icon-color-box, .colorpick').click(function(event){
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -47,6 +47,16 @@ class SP_Admin_Sports {
|
|||||||
$id = preg_replace('/\\.[^.\\s]{3,4}$/', '', $file );
|
$id = preg_replace('/\\.[^.\\s]{3,4}$/', '', $file );
|
||||||
$presets[ $id ] = $data;
|
$presets[ $id ] = $data;
|
||||||
$name = array_key_exists( 'name', $data ) ? __( $data['name'], 'sportspress' ) : $id;
|
$name = array_key_exists( 'name', $data ) ? __( $data['name'], 'sportspress' ) : $id;
|
||||||
|
|
||||||
|
// Conditionally append filename in parentheses for clarity
|
||||||
|
if ( false === strpos( str_replace( ' ', '', strtolower( $data['name'] ) ), str_replace( '-', '', $id ) ) ) {
|
||||||
|
if ( 4 < strlen( $id ) ) {
|
||||||
|
$name .= ' (' . ucfirst( $id ) . ')';
|
||||||
|
} else {
|
||||||
|
$name .= ' (' . strtoupper( $id ) . ')';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self::$options[ $slug ][ $id ] = $name;
|
self::$options[ $slug ][ $id ] = $name;
|
||||||
}
|
}
|
||||||
asort( self::$options[ $slug ] );
|
asort( self::$options[ $slug ] );
|
||||||
@@ -153,6 +163,8 @@ class SP_Admin_Sports {
|
|||||||
if ( isset( $performance['position'] ) ) {
|
if ( isset( $performance['position'] ) ) {
|
||||||
wp_set_object_terms( $id, $performance['position'], 'sp_position', false );
|
wp_set_object_terms( $id, $performance['position'], 'sp_position', false );
|
||||||
}
|
}
|
||||||
|
update_post_meta( $id, 'sp_icon', sp_array_value( $performance, 'icon', null ) );
|
||||||
|
update_post_meta( $id, 'sp_color', sp_array_value( $performance, 'color', null ) );
|
||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,9 +185,11 @@
|
|||||||
<td class="icon">
|
<td class="icon">
|
||||||
<?php
|
<?php
|
||||||
if ( has_post_thumbnail( $row->ID ) )
|
if ( has_post_thumbnail( $row->ID ) )
|
||||||
echo get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );
|
$icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );
|
||||||
else
|
else
|
||||||
echo ' ';
|
$icon = ' ';
|
||||||
|
|
||||||
|
echo apply_filters( 'sportspress_performance_icon', $icon, $row->ID );
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
<td class="row-title"><?php echo $row->post_title; ?></td>
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ permission notices:
|
|||||||
SportsPress includes icons from WebHostingHub Glyphs, released under the
|
SportsPress includes icons from WebHostingHub Glyphs, released under the
|
||||||
SIL Open Font License; 80 Shades of White Icons by Victor Erixon; Entypo
|
SIL Open Font License; 80 Shades of White Icons by Victor Erixon; Entypo
|
||||||
and Entypo+ by Daniel Bruce, released under CC BY-SA 3.0; Font Awesome by
|
and Entypo+ by Daniel Bruce, released under CC BY-SA 3.0; Font Awesome by
|
||||||
Dave Gancy, released under the GPL. The custom designed icons included in
|
Dave Gancy, released under the GPL; Flaticon by Freepick, released under
|
||||||
SportsPress are released under the GPL.
|
CC BY 3.0. The custom designed icons included in SportsPress are released
|
||||||
|
under the GPL.
|
||||||
|
|
||||||
Wherever third party code has been used, credit has been given in the code's
|
Wherever third party code has been used, credit has been given in the code's
|
||||||
comments.
|
comments.
|
||||||
|
|||||||
168
modules/sportspress-icons.php
Normal file
168
modules/sportspress-icons.php
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Plugin Name: SportsPress Icons
|
||||||
|
Plugin URI: http://themeboy.com/
|
||||||
|
Description: Add vector performance icons to SportsPress.
|
||||||
|
Author: ThemeBoy
|
||||||
|
Author URI: http://themeboy.com/
|
||||||
|
Version: 1.9
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Exit if accessed directly
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||||
|
|
||||||
|
if ( ! class_exists( 'SportsPress_Icons' ) ) :
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main SportsPress Icons Class
|
||||||
|
*
|
||||||
|
* @class SportsPress_Icons
|
||||||
|
* @version 1.9
|
||||||
|
*/
|
||||||
|
class SportsPress_Icons {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public $icons = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
// Define constants
|
||||||
|
$this->define_constants();
|
||||||
|
|
||||||
|
// Define icons
|
||||||
|
$this->get_icons();
|
||||||
|
|
||||||
|
add_filter( 'sportspress_enqueue_styles', array( $this, 'add_styles' ) );
|
||||||
|
add_filter( 'sportspress_performance_icon', array( $this, 'icon' ), 10, 2 );
|
||||||
|
add_filter( 'sportspress_event_performance_icons', array( $this, 'replace_icons' ), 10, 3 );
|
||||||
|
add_filter( 'admin_post_thumbnail_html', array( $this, 'admin_post_thumbnail_html' ), 10, 2 );
|
||||||
|
add_action( 'sportspress_process_sp_performance_meta', array( $this, 'save' ), 10, 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define constants.
|
||||||
|
*/
|
||||||
|
private function define_constants() {
|
||||||
|
if ( !defined( 'SP_ICONS_VERSION' ) )
|
||||||
|
define( 'SP_ICONS_VERSION', '1.9' );
|
||||||
|
|
||||||
|
if ( !defined( 'SP_ICONS_URL' ) )
|
||||||
|
define( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) );
|
||||||
|
|
||||||
|
if ( !defined( 'SP_ICONS_DIR' ) )
|
||||||
|
define( 'SP_ICONS_DIR', plugin_dir_path( __FILE__ ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add stylesheet.
|
||||||
|
*/
|
||||||
|
public static function add_styles( $styles = array() ) {
|
||||||
|
$styles['sportspress-icons'] = array(
|
||||||
|
'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/icons.css',
|
||||||
|
'deps' => '',
|
||||||
|
'version' => SP_ICONS_VERSION,
|
||||||
|
'media' => 'all'
|
||||||
|
);
|
||||||
|
return $styles;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define icons.
|
||||||
|
*/
|
||||||
|
private function get_icons() {
|
||||||
|
$this->icons = apply_filters( 'sportspress_icons', array(
|
||||||
|
'soccerball',
|
||||||
|
'baseball',
|
||||||
|
'basketball',
|
||||||
|
'cricketball',
|
||||||
|
'shoe',
|
||||||
|
'card',
|
||||||
|
) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display vector icon.
|
||||||
|
*/
|
||||||
|
public function icon( $icon = '', $id = 0 ) {
|
||||||
|
if ( ! $id ) return $icon;
|
||||||
|
$meta = get_post_meta( $id, 'sp_icon', true );
|
||||||
|
if ( null !== $meta && in_array( $meta, $this->icons ) ) {
|
||||||
|
$color = get_post_meta( $id, 'sp_color', true );
|
||||||
|
$icon = '<i class="sp-icon-' . $meta . '" style="color:' . $color . '"></i>';
|
||||||
|
}
|
||||||
|
return $icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace icons with vectors when available.
|
||||||
|
*/
|
||||||
|
public function replace_icons( $icons = '', $id = 0, $value = 0 ) {
|
||||||
|
if ( ! $id || ! $value ) return $icons;
|
||||||
|
$icon = get_post_meta( $id, 'sp_icon', true );
|
||||||
|
if ( null !== $icon && in_array( $icon, $this->icons ) ) {
|
||||||
|
$title = get_the_title( $id );
|
||||||
|
$color = get_post_meta( $id, 'sp_color', true );
|
||||||
|
$icons = str_repeat( '<i class="sp-icon-' . $icon . '" title="' . $title . '" style="color:' . $color . '"></i>' . ' ', $value );
|
||||||
|
}
|
||||||
|
return $icons;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Post thumbnail HTML.
|
||||||
|
*/
|
||||||
|
public function admin_post_thumbnail_html( $content = '', $id = 0 ) {
|
||||||
|
// Bypass if no ID
|
||||||
|
if ( ! $id ) return $content;
|
||||||
|
|
||||||
|
// Bypass if not performance post type
|
||||||
|
$post_type = get_post_type( $id );
|
||||||
|
if ( 'sp_performance' !== $post_type ) return $content;
|
||||||
|
|
||||||
|
// Enqueue scripts
|
||||||
|
wp_enqueue_script( 'sp_iconpicker', SP()->plugin_url() . '/assets/js/admin/iconpicker.js', array( 'jquery', 'wp-color-picker', 'iris' ), SP_ICONS_VERSION, true );
|
||||||
|
|
||||||
|
// Get selected icon
|
||||||
|
$has_icon = has_post_thumbnail( $id );
|
||||||
|
$selected = get_post_meta( $id, 'sp_icon', true );
|
||||||
|
if ( $has_icon ) $selected = null;
|
||||||
|
|
||||||
|
// Generate icon selector
|
||||||
|
$icons = '';
|
||||||
|
foreach ( $this->icons as $icon ) {
|
||||||
|
$icons .= '<label class="button"><input name="sp_icon" type="radio" value="' . $icon . '" ' . checked( $selected, $icon, false ) . '></input><i class="sp-icon-' . $icon . '"></i></label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$icons .= '<label class="button"><input name="sp_icon" type="radio" value="" ' . checked( $selected, null, false ) . '></input>' . __( 'Image', 'sportspress' ) . '</label>';
|
||||||
|
|
||||||
|
// Get color value
|
||||||
|
$value = get_post_meta( $id, 'sp_color', true );
|
||||||
|
if ( empty( $value ) ) $value = '111111';
|
||||||
|
|
||||||
|
$color = '<div class="sp-icon-color-box"><input name="sp_color" id="sp_color" type="text" value="' . esc_attr( $value ) . '" size="7" class="colorpick" /> <div id="colorPickerDiv" class="colorpickdiv"></div></div>';
|
||||||
|
|
||||||
|
$content = '<p><strong>' . __( 'Select Icon', 'sportspress' ) . '</strong></p>
|
||||||
|
<p class="sp-icons">' . $icons . '</p>
|
||||||
|
<div class="sp-para sp-custom-colors' . ( $has_icon ? ' hidden' : '' ) . '"><label data-sp-colors="' . $value . '"><strong>' . __( 'Customize', 'sportspress' ) . '</strong><br></label>' . $color . '</div>
|
||||||
|
<div class="sp-custom-thumbnail' . ( $has_icon ? '' : ' hidden' ) . '">' . $content . '</div>';
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save meta boxes data
|
||||||
|
*/
|
||||||
|
public static function save( $post_id, $post ) {
|
||||||
|
update_post_meta( $post_id, 'sp_icon', sp_array_value( $_POST, 'sp_icon', null ) );
|
||||||
|
update_post_meta( $post_id, 'sp_color', sp_array_value( $_POST, 'sp_color', null ) );
|
||||||
|
if ( null != sp_array_value( $_POST, 'sp_icon', null ) ) {
|
||||||
|
delete_post_thumbnail( $post );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
new SportsPress_Icons();
|
||||||
@@ -32,9 +32,11 @@ if ( $teams ):
|
|||||||
if ( ! has_post_thumbnail( $team ) ) continue;
|
if ( ! has_post_thumbnail( $team ) ) continue;
|
||||||
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );
|
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );
|
||||||
|
|
||||||
|
$alt = sizeof( $teams ) == 2 && $i % 2;
|
||||||
|
|
||||||
// Add team name
|
// Add team name
|
||||||
if ( $show_team_names ) {
|
if ( $show_team_names ) {
|
||||||
if ( $i % 2 ) {
|
if ( $alt ) {
|
||||||
$logo .= ' <strong class="sp-team-name">' . get_the_title( $team ) . '</strong>';
|
$logo .= ' <strong class="sp-team-name">' . get_the_title( $team ) . '</strong>';
|
||||||
} else {
|
} else {
|
||||||
$logo = '<strong class="sp-team-name">' . get_the_title( $team ) . '</strong> ' . $logo;
|
$logo = '<strong class="sp-team-name">' . get_the_title( $team ) . '</strong> ' . $logo;
|
||||||
@@ -46,7 +48,7 @@ if ( $teams ):
|
|||||||
|
|
||||||
// Add result
|
// Add result
|
||||||
if ( $show_results ) {
|
if ( $show_results ) {
|
||||||
if ( $i % 2 ) {
|
if ( $alt ) {
|
||||||
$logo = '<strong class="sp-team-result">' . array_shift( $results ) . '</strong> ' . $logo;
|
$logo = '<strong class="sp-team-result">' . array_shift( $results ) . '</strong> ' . $logo;
|
||||||
} else {
|
} else {
|
||||||
$logo .= ' <strong class="sp-team-result">' . array_shift( $results ) . '</strong>';
|
$logo .= ' <strong class="sp-team-result">' . array_shift( $results ) . '</strong>';
|
||||||
@@ -58,7 +60,7 @@ if ( $teams ):
|
|||||||
endforeach;
|
endforeach;
|
||||||
$team_logos = array_filter( $team_logos );
|
$team_logos = array_filter( $team_logos );
|
||||||
if ( ! empty( $team_logos ) ):
|
if ( ! empty( $team_logos ) ):
|
||||||
echo '<div class="sp-template sp-template-event-logos"><div class="sp-event-logos">';
|
echo '<div class="sp-template sp-template-event-logos"><div class="sp-event-logos sp-event-logos-' . sizeof( $teams ) . '">';
|
||||||
$delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );
|
$delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );
|
||||||
echo implode( ' ' . $delimiter . ' ', $team_logos );
|
echo implode( ' ' . $delimiter . ' ', $team_logos );
|
||||||
echo '</div></div>';
|
echo '</div></div>';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||||||
// Initialize totals
|
// Initialize totals
|
||||||
$totals = array();
|
$totals = array();
|
||||||
?>
|
?>
|
||||||
<div class="sp-template sp-template-event-performance sp-template-event-performance-<?php echo $mode; ?>">
|
<div class="sp-template sp-template-event-performance sp-template-event-performance-combined sp-template-event-performance-<?php echo $mode; ?>">
|
||||||
<?php if ( $caption ): ?>
|
<?php if ( $caption ): ?>
|
||||||
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@@ -94,9 +94,11 @@ $totals = array();
|
|||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
|
$icons = '';
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
endif;
|
endif;
|
||||||
|
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
@@ -142,9 +144,11 @@ $totals = array();
|
|||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
|
$icons = '';
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
endif;
|
endif;
|
||||||
|
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||||||
|
|
||||||
// Initialize totals
|
// Initialize totals
|
||||||
$totals = array();
|
$totals = array();
|
||||||
|
|
||||||
|
// Set null
|
||||||
|
if ( ! isset( $position ) ) $position = null;
|
||||||
|
if ( ! isset( $class ) ) $class = null;
|
||||||
?>
|
?>
|
||||||
<div class="sp-template sp-template-event-performance sp-template-event-performance-<?php echo $mode; ?>">
|
<div class="sp-template sp-template-event-performance sp-template-event-performance-<?php echo $mode; ?><?php if ( isset( $class ) ) { echo ' ' . $class; } ?>">
|
||||||
<?php if ( $caption ): ?>
|
<?php if ( $caption ): ?>
|
||||||
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@@ -54,6 +58,8 @@ $totals = array();
|
|||||||
$lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
|
$lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
$data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs );
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ( $data as $player_id => $row ):
|
foreach ( $data as $player_id => $row ):
|
||||||
|
|
||||||
@@ -131,9 +137,11 @@ $totals = array();
|
|||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
|
$icons = '';
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
endif;
|
endif;
|
||||||
|
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
@@ -147,59 +155,10 @@ $totals = array();
|
|||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $show_total || $show_extras ): ?>
|
<?php if ( $show_total ): ?>
|
||||||
<<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
<<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
<?php
|
<?php
|
||||||
if ( $show_extras ) {
|
do_action( 'sportspress_event_performance_table_footer', $data, $labels, $position, $performance_ids );
|
||||||
$row = sp_array_value( $data, -1, array() );
|
|
||||||
$row = array_filter( $row );
|
|
||||||
$row = array_intersect_key( $row, $labels );
|
|
||||||
if ( ! empty( $row ) ) {
|
|
||||||
?>
|
|
||||||
<tr class="sp-extras-row <?php echo ( $i % 2 == 0 ? 'odd' : 'even' ); ?>">
|
|
||||||
<?php
|
|
||||||
if ( $show_players ):
|
|
||||||
if ( $show_numbers ) {
|
|
||||||
echo '<td class="data-number"> </td>';
|
|
||||||
}
|
|
||||||
echo '<td class="data-name">' . __( 'Extras', 'sportspress' ) . '</td>';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
$row = sp_array_value( $data, -1, array() );
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
|
||||||
|
|
||||||
foreach ( $labels as $key => $label ):
|
|
||||||
if ( 'name' == $key )
|
|
||||||
continue;
|
|
||||||
if ( isset( $position ) && 'position' == $key )
|
|
||||||
continue;
|
|
||||||
if ( $key == 'position' ):
|
|
||||||
$value = ' ';
|
|
||||||
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
$value = $row[ $key ];
|
|
||||||
else:
|
|
||||||
$value = ' ';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $mode == 'values' ):
|
|
||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
endforeach;
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '</td>';
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( $show_total ) {
|
|
||||||
if ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ) {
|
if ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ) {
|
||||||
?>
|
?>
|
||||||
<tr class="sp-total-row <?php echo ( $i % 2 == 0 ? 'odd' : 'even' ); ?>">
|
<tr class="sp-total-row <?php echo ( $i % 2 == 0 ? 'odd' : 'even' ); ?>">
|
||||||
@@ -228,10 +187,7 @@ $totals = array();
|
|||||||
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
$value = $row[ $key ];
|
$value = $row[ $key ];
|
||||||
else:
|
else:
|
||||||
$value = sp_array_value( $totals, $key, 0 );
|
$value = apply_filters( 'sportspress_event_performance_table_total_value', sp_array_value( $totals, $key, 0 ), $data, $key );
|
||||||
if ( $show_extras ) {
|
|
||||||
$value += sp_array_value( sp_array_value( $data, -1, array() ), $key, 0 );
|
|
||||||
}
|
|
||||||
endif;
|
endif;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@@ -239,9 +195,11 @@ $totals = array();
|
|||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
|
$icons = '';
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
endif;
|
endif;
|
||||||
|
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
@@ -249,9 +207,10 @@ $totals = array();
|
|||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
|
||||||
</<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
</<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php do_action( 'sportspress_after_event_performance_table', $data, $lineups, $subs, $class ); ?>
|
||||||
@@ -11,16 +11,15 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||||||
|
|
||||||
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) === 'yes' ? true : false;
|
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) === 'yes' ? true : false;
|
||||||
$show_staff = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;
|
$show_staff = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;
|
||||||
$show_extras = get_option( 'sportspress_event_show_extras', 'no' ) === 'yes' ? true : false;
|
|
||||||
$show_total = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;
|
$show_total = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;
|
||||||
$show_numbers = get_option( 'sportspress_event_show_player_numbers', 'yes' ) === 'yes' ? true : false;
|
$show_numbers = get_option( 'sportspress_event_show_player_numbers', 'yes' ) === 'yes' ? true : false;
|
||||||
$split_positions = get_option( 'sportspress_event_split_players_by_position', 'no' ) === 'yes' ? true : false;
|
$split_positions = get_option( 'sportspress_event_split_players_by_position', 'no' ) === 'yes' ? true : false;
|
||||||
$split_teams = get_option( 'sportspress_event_split_players_by_team', 'yes' ) === 'yes' ? true : false;
|
$split_teams = get_option( 'sportspress_event_split_players_by_team', 'yes' ) === 'yes' ? true : false;
|
||||||
$reverse_teams = get_option( 'sportspress_event_performance_reverse_teams', 'no' ) === 'yes' ? true : false;
|
$reverse_teams = get_option( 'sportspress_event_performance_reverse_teams', 'no' ) === 'yes' ? true : false;
|
||||||
$primary = get_option( 'sportspress_primary_performance', null );
|
$primary = sp_get_main_performance_option();
|
||||||
$total = get_option( 'sportspress_event_total_performance', 'all');
|
$total = get_option( 'sportspress_event_total_performance', 'all');
|
||||||
|
|
||||||
if ( ! $show_players && ! $show_staff && ! $show_extras && ! $show_total ) return;
|
if ( ! $show_players && ! $show_staff && ! $show_total ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
@@ -72,9 +71,7 @@ if ( is_array( $teams ) ):
|
|||||||
$players = sp_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $index );
|
$players = sp_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $index );
|
||||||
$has_players = sizeof( $players ) > 1;
|
$has_players = sizeof( $players ) > 1;
|
||||||
|
|
||||||
if ( $show_extras ) {
|
$players = apply_filters( 'sportspress_event_performance_split_team_players', $players );
|
||||||
$players[] = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$show_team_players = $show_players && $has_players;
|
$show_team_players = $show_players && $has_players;
|
||||||
|
|
||||||
@@ -91,9 +88,9 @@ if ( is_array( $teams ) ):
|
|||||||
$data = sp_array_value( array_values( $performance ), $index );
|
$data = sp_array_value( array_values( $performance ), $index );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $show_team_players && ! $show_staff && ! $show_extras && ! $show_total ) continue;
|
if ( ! $show_team_players && ! $show_staff && ! $show_total ) continue;
|
||||||
|
|
||||||
if ( $show_team_players || $show_extras || $show_total ) {
|
if ( $show_team_players || $show_total ) {
|
||||||
if ( $split_positions ) {
|
if ( $split_positions ) {
|
||||||
$positions = get_terms( 'sp_position', array(
|
$positions = get_terms( 'sp_position', array(
|
||||||
'orderby' => 'slug',
|
'orderby' => 'slug',
|
||||||
@@ -138,9 +135,7 @@ if ( is_array( $teams ) ):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( sizeof( $subdata ) ) {
|
if ( sizeof( $subdata ) ) {
|
||||||
if ( $show_extras ) {
|
$subdata = apply_filters( 'sportspress_event_performance_split_team_split_position_subdata', $subdata, $data );
|
||||||
$subdata[-1] = sp_array_value( $data, -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
sp_get_template( 'event-performance-table.php', array(
|
sp_get_template( 'event-performance-table.php', array(
|
||||||
'position' => sp_get_position_caption( $position->term_id ),
|
'position' => sp_get_position_caption( $position->term_id ),
|
||||||
@@ -148,7 +143,6 @@ if ( is_array( $teams ) ):
|
|||||||
'sortable' => $sortable,
|
'sortable' => $sortable,
|
||||||
'show_players' => $show_team_players,
|
'show_players' => $show_team_players,
|
||||||
'show_numbers' => $show_numbers,
|
'show_numbers' => $show_numbers,
|
||||||
'show_extras' => $show_extras,
|
|
||||||
'show_total' => $show_total,
|
'show_total' => $show_total,
|
||||||
'caption' => 0 == $position_index && $team_id ? get_the_title( $team_id ) : null,
|
'caption' => 0 == $position_index && $team_id ? get_the_title( $team_id ) : null,
|
||||||
'labels' => $sublabels,
|
'labels' => $sublabels,
|
||||||
@@ -158,6 +152,7 @@ if ( is_array( $teams ) ):
|
|||||||
'link_posts' => $link_posts,
|
'link_posts' => $link_posts,
|
||||||
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
|
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
|
||||||
'primary' => 'primary' == $total ? $primary : null,
|
'primary' => 'primary' == $total ? $primary : null,
|
||||||
|
'class' => 'sp-template-event-performance-team-' . $index . '-position-' . $position_index,
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,7 +162,6 @@ if ( is_array( $teams ) ):
|
|||||||
'sortable' => $sortable,
|
'sortable' => $sortable,
|
||||||
'show_players' => $show_team_players,
|
'show_players' => $show_team_players,
|
||||||
'show_numbers' => $show_numbers,
|
'show_numbers' => $show_numbers,
|
||||||
'show_extras' => $show_extras,
|
|
||||||
'show_total' => $show_total,
|
'show_total' => $show_total,
|
||||||
'caption' => $team_id ? get_the_title( $team_id ) : null,
|
'caption' => $team_id ? get_the_title( $team_id ) : null,
|
||||||
'labels' => $labels,
|
'labels' => $labels,
|
||||||
@@ -222,7 +216,6 @@ if ( is_array( $teams ) ):
|
|||||||
'sortable' => $sortable,
|
'sortable' => $sortable,
|
||||||
'show_players' => $show_players,
|
'show_players' => $show_players,
|
||||||
'show_numbers' => $show_numbers,
|
'show_numbers' => $show_numbers,
|
||||||
'show_extras' => $show_extras,
|
|
||||||
'show_total' => $show_total,
|
'show_total' => $show_total,
|
||||||
'caption' => sp_get_position_caption( $position->term_id ),
|
'caption' => sp_get_position_caption( $position->term_id ),
|
||||||
'labels' => $labels,
|
'labels' => $labels,
|
||||||
@@ -241,9 +234,8 @@ if ( is_array( $teams ) ):
|
|||||||
'sortable' => $sortable,
|
'sortable' => $sortable,
|
||||||
'show_players' => $show_players,
|
'show_players' => $show_players,
|
||||||
'show_numbers' => $show_numbers,
|
'show_numbers' => $show_numbers,
|
||||||
'show_extras' => $show_extras,
|
|
||||||
'show_total' => $show_total,
|
'show_total' => $show_total,
|
||||||
'caption' => __( 'Performance', 'sportspress' ),
|
'caption' => __( 'Box Score', 'sportspress' ),
|
||||||
'labels' => $labels,
|
'labels' => $labels,
|
||||||
'mode' => $mode,
|
'mode' => $mode,
|
||||||
'data' => $data,
|
'data' => $data,
|
||||||
|
|||||||
Reference in New Issue
Block a user