Plugin Directory

Changeset 3073918


Ignore:
Timestamp:
04/19/2024 03:31:37 PM (22 months ago)
Author:
mtreherne
Message:

Release of Version 3.15

Location:
eh-gms-feed
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • eh-gms-feed/tags/3.15/css/gms-default.css

    r3066677 r3073918  
    44.gms-table th, .gms-table td { border: 1px solid; padding: 3px 10px; border-color: silver }
    55.gms-footnote, .gms-filter { margin: 0 0 2rem }
    6 .gms-clubteam:not(.gms-button) { font-weight: 700 }
     6.gms-clubteam:not(.gms-button), .gms-boldteam { font-weight: 700 }
    77.gms-filter > div { margin: 0 0 1rem }
    88.gms-filter fieldset { width: fit-content }
     
    2323/* Helps makes GMS feed responsive depending on screen size and input device */
    2424@media screen and (max-width: 767px) { .gms-table { overflow-x: auto; display: block; white-space: nowrap } .gms-nomobile { display: none } }
     25@media not screen and (max-width: 767px) { .gms-mobile { display: none } }
    2526@media (hover: hover) and (pointer: fine) { .gms-detaillink { cursor: pointer } .gms-detaillink:hover { background-color: yellow } }
    2627
     
    4445.gms-map-google, .gms-map-apple { background-color: white }
    4546.gms-map-waze { background-color: #05c8f7 }
    46 .gms-fixture .gms-card > * { margin-top: 0.5rem; margin-bottom: 0.5rem }
     47.gms-fixture .gms-card > *, .gms-cardform { margin-top: 0.5rem; margin-bottom: 0.5rem }
    4748.gms-fixturedetails { display: flex; flex-wrap: wrap; gap: 1rem }
    4849.gms-fixturedetails > div { flex-grow: 1; padding: 0.5rem 0.5rem; border-radius: 0.5rem }
  • eh-gms-feed/tags/3.15/eh-gms-feed.php

    r3066677 r3073918  
    44 * Plugin URI: https://wordpress.org/plugins/eh-gms-feed/
    55 * Description: Show fixtures, results and tables from England Hockey GMS
    6  * Version: 3.14
     6 * Version: 3.15
    77 * Author: Matthew Treherne
    88 * Author URI: https://profiles.wordpress.org/mtreherne
  • eh-gms-feed/tags/3.15/includes/coreAPI.php

    r3066677 r3073918  
    222222    }
    223223
    224     private function is_beforetoday($valid_date) {
     224    protected function is_beforetoday($valid_date) {
    225225        return $valid_date < (new \DateTime())->setTime(0,0);
    226226    }
     
    422422    private function process_table ($data, $custom=false) {
    423423        $html = ''; $link = $this->comp_link;
    424         $league_data = ['Team' => 'teamName', 'Played' => 'gamesPlayed', 'Won' => 'gamesWon', 'Drawn' => 'gamesDrawn', 'Lost' => 'gamesLost', 'For' => 'goalsFor', 'Against' => 'goalsAgainst', 'GD' => 'goalsDifference', 'Points' => 'totalPoints'];
     424        $league_data = ['Team' => 'teamName', 'P<span class="gms-nomobile">layed</span>' => 'gamesPlayed', 'W<span class="gms-nomobile">on</span>' => 'gamesWon', 'D<span class="gms-nomobile">rawn</span>' => 'gamesDrawn', 'L<span class="gms-nomobile">ost</span>' => 'gamesLost', 'For' => 'goalsFor', 'Against' => 'goalsAgainst', 'GD' => 'goalsDifference', '<span class="gms-mobile">Pts</span><span class="gms-nomobile">Points</span>' => 'totalPoints'];
    425425        if ($custom) { $league_data['PPG'] = 'PPG'; $league_data['Form'] = 'form'; }
    426         $html .= '<table class="gms-table gms-table-'.$this->display_name.($custom ? ' gms-table-custom' : '').'"><thead><tr><th></th>';
    427         foreach ($league_data as $column_title => $field_name) $html .= '<th>'.$column_title.'</th>';
    428         $html .= '</tr></thead><tbody>';
     426        if ($custom && $this->show_list) $html .= '<div class="gms-list">';
     427        else {
     428            $html .= '<table class="gms-table gms-table-'.$this->display_name.($custom ? ' gms-table-custom' : '').'"><thead><tr><th></th>';
     429            foreach ($league_data as $column_title => $field_name) $html .= '<th'.($column_title == 'For' || $column_title == 'Against' ? ' class="gms-nomobile"' : '').'>'.$column_title.'</th>';
     430            $html .= '</tr></thead><tbody>';
     431        }
    429432        foreach ($data as $position => $team) {
    430433            $class = '';
     
    433436                if (!$link) $link = $this->get_link('team', $team->teamEntityUrlSlug);
    434437            }
    435             $html .= '<tr'.$class.'><td>'.($position+1).'</td>';
    436             foreach ($league_data as $field_name) {
    437                 $suffix = '';
    438                 if ($custom && $field_name == 'teamName' && $this->show_gender && isset($team->gender)) $suffix = ' ('.$team->gender.')';
    439                 if ($field_name == 'form') {
    440                     if (count($team->form) > 5) $team->form = array_slice($team->form, -5, 5);
    441                     $team->form = implode(' ', $team->form);
    442                     $html .= '<td>'.$team->form.'</td>';
    443                 }
    444                 else $html .= '<td>'.(isset($team->{$field_name}) ? esc_html($team->{$field_name}.$suffix) : '').'</td>';
    445             }
    446             $html .= '</tr>';
    447         }
    448         if (empty($data)) $html .= '<tr><td colspan="'.(count($league_data)+1).'">No data for teams found</td></tr>';
    449         $html .= '</tbody></table>';
     438            if ($custom) {
     439                if (count($team->form) > 5) $team->form = array_slice($team->form, -5, 5);
     440                $team->form = implode(' ', $team->form);
     441                if ($this->show_gender && isset($team->gender)) $team->teamName .= ' ('.$team->gender.')';
     442            }
     443            if ($custom && $this->show_list) $html .= '<div class="gms-card" data-team="'.$team->teamId.'"><div class="gms-boldteam">'.($position+1).'. '.esc_html($team->teamName).'</div><div>Won: '.$team->gamesWon.' | For: '.$team->goalsFor.' | GD: '.$team->goalsDifference.'</div><div>Points: '.$team->totalPoints.' | PPG: '.$team->PPG.'</div><div class="gms-cardform">'.$team->form.'</div></div>';
     444            else {
     445                $html .= '<tr'.$class.' data-team="'.$team->teamId.'"><td>'.($position+1).'</td>';
     446                foreach ($league_data as $field_name) {
     447                    if ($field_name == 'form') $html .= '<td>'.$team->form.'</td>';
     448                    else $html .= '<td'.($field_name == 'goalsFor' || $field_name == 'goalsAgainst' ? ' class="gms-nomobile"' : '').'>'.(isset($team->{$field_name}) ? esc_html($team->{$field_name}) : '').'</td>';
     449                }
     450                $html .= '</tr>';
     451            }
     452        }
     453        if ($custom && $this->show_list) {
     454            if (empty($data)) $html .= '<div>No data found for any teams</div>';
     455            $html .= '</div>';
     456        }
     457        else {
     458            if (empty($data)) $html .= '<tr><td colspan="'.(count($league_data)+1).'">No data found for any teams</td></tr>';
     459            $html .= '</tbody></table>';
     460        }
    450461        $html .= '<div class="gms-footnote">'.($link ? sprintf(esc_html__( '[%5$s%3$s %1$s also found at%4$s %2$s]', 'eh-gms-feed' ), $this->comp_name ? 'for '.$this->comp_name : '', '<a href="'.$link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>', ($custom ? esc_html__('Data') : esc_html__('Table'))) : ($custom ? esc_html__('[League table for selected teams]') : '')).'</div>';
    451462        return $html;
     
    682693            });
    683694            $html .= $this->process_table($league_data, true);
    684             if ($no_data) $html .= $this->show_api_error(sprintf(esc_html__( 'Failed to retrieve data for %s of selected team(s)', 'eh-gms-feed' ), $no_data));
     695            if ($no_data) $html .= $this->show_api_error(sprintf(esc_html__( 'No data found for %s of selected team(s)', 'eh-gms-feed' ), $no_data));
    685696        }
    686697        else $html .= $this->show_api_error(esc_html__( 'You have selected a custom league table without any teams', 'eh-gms-feed' ));
  • eh-gms-feed/tags/3.15/includes/main-class.php

    r3066677 r3073918  
    119119        $team_count = count($this->multiple_teams);
    120120        if ($team_count > 1 && ($this->atts_show['show'] != 'league' || $team_count > $this->teamlimit || $this->atts_show['method'] == 'api-dynamic')) {
    121             $message = sprintf(esc_html__( 'You can only show a static league table with multiple teams (up to %s allowed).', 'eh-gms-feed' ), $this->teamlimit);
     121            $message = sprintf(esc_html__( 'You can only show a custom league table without filter and up to %s teams.', 'eh-gms-feed' ), $this->teamlimit);
    122122            $this->not_valid .= '<p>'.$message.'</p>';
    123123            $valid = false;
     
    146146        wp_register_script('EH_GMS_Feed', plugin_dir_url(__DIR__).'js/eh-gms-feed.js', ['jquery'], '3.14', true);
    147147        wp_localize_script('EH_GMS_Feed', 'eh_gms_feed_ajax_obj', ['ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce('get_gms_table')]);
    148         wp_register_style('EH_GMS_Feed', plugin_dir_url(__DIR__).'css/gms-default.css',[],'3.14');
     148        wp_register_style('EH_GMS_Feed', plugin_dir_url(__DIR__).'css/gms-default.css',[],'3.15');
    149149        if ($this->settings->default_css == 'yes') wp_enqueue_style('EH_GMS_Feed');
    150150    }
  • eh-gms-feed/tags/3.15/readme.txt

    r3066677 r3073918  
    55Tested up to: 6.5
    66Requires PHP: 5.3
    7 Stable tag: 3.14
     7Stable tag: 3.15
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6262
    6363== Changelog ==
     64
     65= 3.15 =
     66* Show as list option added to custom league
     67* League column titles responsive to screen size
     68* Change to default CSS for custom league list view
    6469
    6570= 3.14 =
  • eh-gms-feed/trunk/css/gms-default.css

    r3066677 r3073918  
    44.gms-table th, .gms-table td { border: 1px solid; padding: 3px 10px; border-color: silver }
    55.gms-footnote, .gms-filter { margin: 0 0 2rem }
    6 .gms-clubteam:not(.gms-button) { font-weight: 700 }
     6.gms-clubteam:not(.gms-button), .gms-boldteam { font-weight: 700 }
    77.gms-filter > div { margin: 0 0 1rem }
    88.gms-filter fieldset { width: fit-content }
     
    2323/* Helps makes GMS feed responsive depending on screen size and input device */
    2424@media screen and (max-width: 767px) { .gms-table { overflow-x: auto; display: block; white-space: nowrap } .gms-nomobile { display: none } }
     25@media not screen and (max-width: 767px) { .gms-mobile { display: none } }
    2526@media (hover: hover) and (pointer: fine) { .gms-detaillink { cursor: pointer } .gms-detaillink:hover { background-color: yellow } }
    2627
     
    4445.gms-map-google, .gms-map-apple { background-color: white }
    4546.gms-map-waze { background-color: #05c8f7 }
    46 .gms-fixture .gms-card > * { margin-top: 0.5rem; margin-bottom: 0.5rem }
     47.gms-fixture .gms-card > *, .gms-cardform { margin-top: 0.5rem; margin-bottom: 0.5rem }
    4748.gms-fixturedetails { display: flex; flex-wrap: wrap; gap: 1rem }
    4849.gms-fixturedetails > div { flex-grow: 1; padding: 0.5rem 0.5rem; border-radius: 0.5rem }
  • eh-gms-feed/trunk/eh-gms-feed.php

    r3066677 r3073918  
    44 * Plugin URI: https://wordpress.org/plugins/eh-gms-feed/
    55 * Description: Show fixtures, results and tables from England Hockey GMS
    6  * Version: 3.14
     6 * Version: 3.15
    77 * Author: Matthew Treherne
    88 * Author URI: https://profiles.wordpress.org/mtreherne
  • eh-gms-feed/trunk/includes/coreAPI.php

    r3066677 r3073918  
    222222    }
    223223
    224     private function is_beforetoday($valid_date) {
     224    protected function is_beforetoday($valid_date) {
    225225        return $valid_date < (new \DateTime())->setTime(0,0);
    226226    }
     
    422422    private function process_table ($data, $custom=false) {
    423423        $html = ''; $link = $this->comp_link;
    424         $league_data = ['Team' => 'teamName', 'Played' => 'gamesPlayed', 'Won' => 'gamesWon', 'Drawn' => 'gamesDrawn', 'Lost' => 'gamesLost', 'For' => 'goalsFor', 'Against' => 'goalsAgainst', 'GD' => 'goalsDifference', 'Points' => 'totalPoints'];
     424        $league_data = ['Team' => 'teamName', 'P<span class="gms-nomobile">layed</span>' => 'gamesPlayed', 'W<span class="gms-nomobile">on</span>' => 'gamesWon', 'D<span class="gms-nomobile">rawn</span>' => 'gamesDrawn', 'L<span class="gms-nomobile">ost</span>' => 'gamesLost', 'For' => 'goalsFor', 'Against' => 'goalsAgainst', 'GD' => 'goalsDifference', '<span class="gms-mobile">Pts</span><span class="gms-nomobile">Points</span>' => 'totalPoints'];
    425425        if ($custom) { $league_data['PPG'] = 'PPG'; $league_data['Form'] = 'form'; }
    426         $html .= '<table class="gms-table gms-table-'.$this->display_name.($custom ? ' gms-table-custom' : '').'"><thead><tr><th></th>';
    427         foreach ($league_data as $column_title => $field_name) $html .= '<th>'.$column_title.'</th>';
    428         $html .= '</tr></thead><tbody>';
     426        if ($custom && $this->show_list) $html .= '<div class="gms-list">';
     427        else {
     428            $html .= '<table class="gms-table gms-table-'.$this->display_name.($custom ? ' gms-table-custom' : '').'"><thead><tr><th></th>';
     429            foreach ($league_data as $column_title => $field_name) $html .= '<th'.($column_title == 'For' || $column_title == 'Against' ? ' class="gms-nomobile"' : '').'>'.$column_title.'</th>';
     430            $html .= '</tr></thead><tbody>';
     431        }
    429432        foreach ($data as $position => $team) {
    430433            $class = '';
     
    433436                if (!$link) $link = $this->get_link('team', $team->teamEntityUrlSlug);
    434437            }
    435             $html .= '<tr'.$class.'><td>'.($position+1).'</td>';
    436             foreach ($league_data as $field_name) {
    437                 $suffix = '';
    438                 if ($custom && $field_name == 'teamName' && $this->show_gender && isset($team->gender)) $suffix = ' ('.$team->gender.')';
    439                 if ($field_name == 'form') {
    440                     if (count($team->form) > 5) $team->form = array_slice($team->form, -5, 5);
    441                     $team->form = implode(' ', $team->form);
    442                     $html .= '<td>'.$team->form.'</td>';
    443                 }
    444                 else $html .= '<td>'.(isset($team->{$field_name}) ? esc_html($team->{$field_name}.$suffix) : '').'</td>';
    445             }
    446             $html .= '</tr>';
    447         }
    448         if (empty($data)) $html .= '<tr><td colspan="'.(count($league_data)+1).'">No data for teams found</td></tr>';
    449         $html .= '</tbody></table>';
     438            if ($custom) {
     439                if (count($team->form) > 5) $team->form = array_slice($team->form, -5, 5);
     440                $team->form = implode(' ', $team->form);
     441                if ($this->show_gender && isset($team->gender)) $team->teamName .= ' ('.$team->gender.')';
     442            }
     443            if ($custom && $this->show_list) $html .= '<div class="gms-card" data-team="'.$team->teamId.'"><div class="gms-boldteam">'.($position+1).'. '.esc_html($team->teamName).'</div><div>Won: '.$team->gamesWon.' | For: '.$team->goalsFor.' | GD: '.$team->goalsDifference.'</div><div>Points: '.$team->totalPoints.' | PPG: '.$team->PPG.'</div><div class="gms-cardform">'.$team->form.'</div></div>';
     444            else {
     445                $html .= '<tr'.$class.' data-team="'.$team->teamId.'"><td>'.($position+1).'</td>';
     446                foreach ($league_data as $field_name) {
     447                    if ($field_name == 'form') $html .= '<td>'.$team->form.'</td>';
     448                    else $html .= '<td'.($field_name == 'goalsFor' || $field_name == 'goalsAgainst' ? ' class="gms-nomobile"' : '').'>'.(isset($team->{$field_name}) ? esc_html($team->{$field_name}) : '').'</td>';
     449                }
     450                $html .= '</tr>';
     451            }
     452        }
     453        if ($custom && $this->show_list) {
     454            if (empty($data)) $html .= '<div>No data found for any teams</div>';
     455            $html .= '</div>';
     456        }
     457        else {
     458            if (empty($data)) $html .= '<tr><td colspan="'.(count($league_data)+1).'">No data found for any teams</td></tr>';
     459            $html .= '</tbody></table>';
     460        }
    450461        $html .= '<div class="gms-footnote">'.($link ? sprintf(esc_html__( '[%5$s%3$s %1$s also found at%4$s %2$s]', 'eh-gms-feed' ), $this->comp_name ? 'for '.$this->comp_name : '', '<a href="'.$link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>', ($custom ? esc_html__('Data') : esc_html__('Table'))) : ($custom ? esc_html__('[League table for selected teams]') : '')).'</div>';
    451462        return $html;
     
    682693            });
    683694            $html .= $this->process_table($league_data, true);
    684             if ($no_data) $html .= $this->show_api_error(sprintf(esc_html__( 'Failed to retrieve data for %s of selected team(s)', 'eh-gms-feed' ), $no_data));
     695            if ($no_data) $html .= $this->show_api_error(sprintf(esc_html__( 'No data found for %s of selected team(s)', 'eh-gms-feed' ), $no_data));
    685696        }
    686697        else $html .= $this->show_api_error(esc_html__( 'You have selected a custom league table without any teams', 'eh-gms-feed' ));
  • eh-gms-feed/trunk/includes/main-class.php

    r3066677 r3073918  
    119119        $team_count = count($this->multiple_teams);
    120120        if ($team_count > 1 && ($this->atts_show['show'] != 'league' || $team_count > $this->teamlimit || $this->atts_show['method'] == 'api-dynamic')) {
    121             $message = sprintf(esc_html__( 'You can only show a static league table with multiple teams (up to %s allowed).', 'eh-gms-feed' ), $this->teamlimit);
     121            $message = sprintf(esc_html__( 'You can only show a custom league table without filter and up to %s teams.', 'eh-gms-feed' ), $this->teamlimit);
    122122            $this->not_valid .= '<p>'.$message.'</p>';
    123123            $valid = false;
     
    146146        wp_register_script('EH_GMS_Feed', plugin_dir_url(__DIR__).'js/eh-gms-feed.js', ['jquery'], '3.14', true);
    147147        wp_localize_script('EH_GMS_Feed', 'eh_gms_feed_ajax_obj', ['ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce('get_gms_table')]);
    148         wp_register_style('EH_GMS_Feed', plugin_dir_url(__DIR__).'css/gms-default.css',[],'3.14');
     148        wp_register_style('EH_GMS_Feed', plugin_dir_url(__DIR__).'css/gms-default.css',[],'3.15');
    149149        if ($this->settings->default_css == 'yes') wp_enqueue_style('EH_GMS_Feed');
    150150    }
  • eh-gms-feed/trunk/readme.txt

    r3066677 r3073918  
    55Tested up to: 6.5
    66Requires PHP: 5.3
    7 Stable tag: 3.14
     7Stable tag: 3.15
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6262
    6363== Changelog ==
     64
     65= 3.15 =
     66* Show as list option added to custom league
     67* League column titles responsive to screen size
     68* Change to default CSS for custom league list view
    6469
    6570= 3.14 =
Note: See TracChangeset for help on using the changeset viewer.