'soccer', 'program' => '', 'subcategory' => '', 'tags' => '', 'showhidden' => false, 'showstaff' => false, 'show' => 'standings,schedule', 'url' => 'https://www.amilia.com/store/en/usa-amilia-group/shop/products', 'api' => 'https://www.amilia.com/PublicApi/usa-amilia-group/en/', 'version' => '0' ), $atts); $uid = rand(); $api = $a['api']; $sport = $a['sport']; $program = $a['program']; if (!is_numeric($program)) $program = 'null'; $subCategory = $a['subcategory']; if (!is_numeric($subCategory)) $subCategory = 'null'; $tags = $a['tags']; $showHidden = $a['showhidden'] == 1 ? 1 : 0; $showStaff = $a['showstaff'] == 1 ? 1 : 0; $show = $a['show']; $clientJSFile = plugins_url('amilia-store-standings-client.js', __FILE__).'?v='.$a['version']; $lang = __("en", 'amilia-store'); $errorWhenNojQuery = __("Amilia calendar requires jQuery. It cannot be shown.", 'amilia-store'); $errorNoProgram = __("No programs found.", 'amilia-store'); $legend = $sport == 'football' ? __("GP = Games played, W = Win, T = Tie, L = Lost, % = Percentage, PDiff = Point difference, Pts = Points", 'amilia-store') : __("GP = Games played, W = Win, T = Tie, L = Lost, F = Goals for, A = Goals against, GD = Goal differential, Pts = Points", 'amilia-store'); $label_Team = __("Team", 'amilia-store'); $label_Home = __("Home", 'amilia-store'); $label_Away = __("Away", 'amilia-store'); $label_Officials = __("Officials", 'amilia-store'); $label_GP = __("GP", 'amilia-store'); $label_W = __("W", 'amilia-store'); $label_T = __("T", 'amilia-store'); $label_L = __("L", 'amilia-store'); $label_F = __("F", 'amilia-store'); $label_A = __("A", 'amilia-store'); $label_GD = __("GD", 'amilia-store'); $label_Perc = __("%", 'amilia-store'); $label_PDiff = __("PDiff", 'amilia-store'); $label_Pts = __("Pts", 'amilia-store'); $label_Location = __("Location", 'amilia-store'); $label_Date = __("Date/time", 'amilia-store'); $label_ViewInStore = __("View in Store", 'amilia-store'); $label_AddToCalendar = __("Add to calendar", 'amilia-store'); $pleaseWait = __("Please wait...", 'amilia-store'); $standings = __("Standings", 'amilia-store'); $games = __("Games", 'amilia-store'); $warning = __("Warning!", 'amilia-store'); $warningMsg = __("Some games cannot be created because we identified more or less than 2 teams meeting at same time and place. Please ensure there are exactly 2 teams per location at a given time. Alternatively, you can use Tags to group a pair of teams playing at the same location.", 'amilia-store'); $calendarSvg = ''; $html = << EOD; if ($lang == 'fr') $html .= << EOD; $html .= <<
EOD; if (strpos($show, 'standings') !== false) $html .= <<$standings $calendarSvg $label_AddToCalendar EOD; if ($sport == 'football') { $html .= <<$label_Perc EOD; } else { $html .= <<$label_F EOD; } $html .= <<$label_Pts
$label_Team $label_GP $label_W $label_L $label_T$label_PDiff$label_A $label_GD
$pleaseWait

$legend

EOD; if (strpos($show, 'schedule') !== false) $html .= <<$games $calendarSvg $label_AddToCalendar EOD; if ($showStaff) $html .= <<$label_Officials EOD; $html .= <<$label_Home
$label_Location $label_Date$label_Away
$pleaseWait
EOD; $html .= <<

EOD; return $html; } add_shortcode('amilia_store_standings', 'amilia_store_standings_shortcode_handler'); ?>