Changeset 2968572
- Timestamp:
- 09/19/2023 06:45:06 AM (2 years ago)
- Location:
- eh-gms-feed
- Files:
-
- 8 edited
-
tags/3.6/eh-gms-feed.php (modified) (1 diff)
-
tags/3.6/includes/main-class.php (modified) (4 diffs)
-
tags/3.6/includes/settings.php (modified) (1 diff)
-
tags/3.6/readme.txt (modified) (2 diffs)
-
trunk/eh-gms-feed.php (modified) (1 diff)
-
trunk/includes/main-class.php (modified) (4 diffs)
-
trunk/includes/settings.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eh-gms-feed/tags/3.6/eh-gms-feed.php
r2964754 r2968572 4 4 * Plugin URI: https://wordpress.org/plugins/eh-gms-feed/ 5 5 * Description: Show fixtures, results and tables from England Hockey GMS 6 * Version: 3. 56 * Version: 3.6 7 7 * Author: Matthew Treherne 8 8 * Author URI: https://profiles.wordpress.org/mtreherne -
eh-gms-feed/tags/3.6/includes/main-class.php
r2964754 r2968572 268 268 } 269 269 $html .= $this->process_matches($competition->fixtures); 270 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No '.$this->display_name.'found</td></tr>';270 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No fixtures found</td></tr>'; 271 271 $html .= '</tbody></table>'; 272 $html .= '<div class="gms-footnote">'.($this->team_link ? sprintf(esc_html__( '[Team %1$s%4$s for %2$s also found at%5$s %3$s]', 'eh-gms-feed'), $this->display_name, $competition->competitionName, '<a href="'.$this->team_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>';273 } 274 return $html ?: '<p>'.sprintf(esc_html__( 'No %s were found that matched the criteria.', 'eh-gms-feed' ), $this->display_name).'</p>';272 $html .= '<div class="gms-footnote">'.($this->team_link ? sprintf(esc_html__( '[Team %1$s%4$s for %2$s also found at%5$s %3$s]', 'eh-gms-feed'), 'fixtures', $competition->competitionName, '<a href="'.$this->team_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>'; 273 } 274 return $html ?: '<p>'.sprintf(esc_html__( 'No %s were found that matched the criteria.', 'eh-gms-feed' ), 'fixtures').'</p>'; 275 275 } 276 276 … … 310 310 } 311 311 } 312 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No '.$this->display_name.'found</td></tr>';312 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No fixtures found</td></tr>'; 313 313 $html .= '</tbody></table>'; 314 $html .= '<div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club%3$s match day %1$s also found at%4$s %2$s]', 'eh-gms-feed' ), $this->display_name, '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>';314 $html .= '<div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club%3$s match day %1$s also found at%4$s %2$s]', 'eh-gms-feed' ), 'fixtures', '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>'; 315 315 } 316 316 return $html; … … 325 325 if (!$this->club_link) $this->club_link = $this->get_link('club', $team->clubUrlSlug); 326 326 } 327 if (!$this->filter_match) $html .= '<tr><td colspan=2>No '.$this->display_name.'found</td></tr>';328 $html .= '</tbody></table><div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club %1$s%3$s also found at%4$s %2$s]', 'eh-gms-feed' ), $this->display_name, '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>';327 if (!$this->filter_match) $html .= '<tr><td colspan=2>No teams found</td></tr>'; 328 $html .= '</tbody></table><div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club %1$s%3$s also found at%4$s %2$s]', 'eh-gms-feed' ), 'teams', '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>'; 329 329 return $html; 330 330 } … … 341 341 foreach ($tables as $table_name) { 342 342 $this->table_name = $table_name; 343 $this->display_name = ($table_name == 'combined') ? ' fixtures' : $table_name;343 $this->display_name = ($table_name == 'combined') ? 'results' : $table_name; 344 344 $this->fixture_data = ['Date' => 'fixtureDate', 'Time' => 'fixtureTime', 'Home Team' => ['homeTeam','teamName'], 'Score' => ['homeTeamScore', 'awayTeamScore'], 'Away Team' => ['awayTeam','teamName'], 'Venue' => 'venue']; 345 345 if ($table_name == 'fixtures') unset($this->fixture_data['Score']); -
eh-gms-feed/tags/3.6/includes/settings.php
r2958570 r2968572 21 21 public function __construct($basename) { 22 22 $this->settings = get_option(self::OPTION_NAME) ?? null; 23 $this->default_ajax = $this->settings['default_ajax'] ?? null;24 $this->default_css = $this->settings['default_css'] ?? null;25 $this->default_transient_expiry = $this->settings['transient_expiry'] ?? null;26 $this->default_club_id = $this->settings['club_id'] ?? null;23 if (isset($this->settings['default_ajax'])) $this->default_ajax = $this->settings['default_ajax']; 24 if (isset($this->settings['default_css'])) $this->default_css = $this->settings['default_css']; 25 if (isset($this->settings['transient_expiry'])) $this->default_transient_expiry = $this->settings['transient_expiry']; 26 if (isset($this->settings['club_id'])) $this->default_club_id = $this->settings['club_id']; 27 27 if (is_admin() && ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) { 28 28 add_action( 'admin_init', array( $this, 'settings_init' ) ); -
eh-gms-feed/tags/3.6/readme.txt
r2964754 r2968572 5 5 Tested up to: 6.2 6 6 Requires PHP: 5.3 7 Stable tag: 3. 57 Stable tag: 3.6 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 63 63 == Changelog == 64 64 65 = 3.6 = 66 * Fix to default settings 67 * Fix to class for combined fixtures and results 68 65 69 = 3.5 = 66 70 * Deal with previous season competition in dynamic filter -
eh-gms-feed/trunk/eh-gms-feed.php
r2964754 r2968572 4 4 * Plugin URI: https://wordpress.org/plugins/eh-gms-feed/ 5 5 * Description: Show fixtures, results and tables from England Hockey GMS 6 * Version: 3. 56 * Version: 3.6 7 7 * Author: Matthew Treherne 8 8 * Author URI: https://profiles.wordpress.org/mtreherne -
eh-gms-feed/trunk/includes/main-class.php
r2964754 r2968572 268 268 } 269 269 $html .= $this->process_matches($competition->fixtures); 270 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No '.$this->display_name.'found</td></tr>';270 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No fixtures found</td></tr>'; 271 271 $html .= '</tbody></table>'; 272 $html .= '<div class="gms-footnote">'.($this->team_link ? sprintf(esc_html__( '[Team %1$s%4$s for %2$s also found at%5$s %3$s]', 'eh-gms-feed'), $this->display_name, $competition->competitionName, '<a href="'.$this->team_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>';273 } 274 return $html ?: '<p>'.sprintf(esc_html__( 'No %s were found that matched the criteria.', 'eh-gms-feed' ), $this->display_name).'</p>';272 $html .= '<div class="gms-footnote">'.($this->team_link ? sprintf(esc_html__( '[Team %1$s%4$s for %2$s also found at%5$s %3$s]', 'eh-gms-feed'), 'fixtures', $competition->competitionName, '<a href="'.$this->team_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>'; 273 } 274 return $html ?: '<p>'.sprintf(esc_html__( 'No %s were found that matched the criteria.', 'eh-gms-feed' ), 'fixtures').'</p>'; 275 275 } 276 276 … … 310 310 } 311 311 } 312 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No '.$this->display_name.'found</td></tr>';312 if (!$this->filter_match) $html .= '<tr><td colspan="'.count($this->fixture_data).'">No fixtures found</td></tr>'; 313 313 $html .= '</tbody></table>'; 314 $html .= '<div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club%3$s match day %1$s also found at%4$s %2$s]', 'eh-gms-feed' ), $this->display_name, '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>';314 $html .= '<div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club%3$s match day %1$s also found at%4$s %2$s]', 'eh-gms-feed' ), 'fixtures', '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>'; 315 315 } 316 316 return $html; … … 325 325 if (!$this->club_link) $this->club_link = $this->get_link('club', $team->clubUrlSlug); 326 326 } 327 if (!$this->filter_match) $html .= '<tr><td colspan=2>No '.$this->display_name.'found</td></tr>';328 $html .= '</tbody></table><div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club %1$s%3$s also found at%4$s %2$s]', 'eh-gms-feed' ), $this->display_name, '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>';327 if (!$this->filter_match) $html .= '<tr><td colspan=2>No teams found</td></tr>'; 328 $html .= '</tbody></table><div class="gms-footnote">'.($this->club_link ? sprintf(esc_html__( '[Club %1$s%3$s also found at%4$s %2$s]', 'eh-gms-feed' ), 'teams', '<a href="'.$this->club_link.'" target="_blank">England Hockey Link</a>', '<span class="gms-nomobile">', '</span>') : '').'</div>'; 329 329 return $html; 330 330 } … … 341 341 foreach ($tables as $table_name) { 342 342 $this->table_name = $table_name; 343 $this->display_name = ($table_name == 'combined') ? ' fixtures' : $table_name;343 $this->display_name = ($table_name == 'combined') ? 'results' : $table_name; 344 344 $this->fixture_data = ['Date' => 'fixtureDate', 'Time' => 'fixtureTime', 'Home Team' => ['homeTeam','teamName'], 'Score' => ['homeTeamScore', 'awayTeamScore'], 'Away Team' => ['awayTeam','teamName'], 'Venue' => 'venue']; 345 345 if ($table_name == 'fixtures') unset($this->fixture_data['Score']); -
eh-gms-feed/trunk/includes/settings.php
r2958570 r2968572 21 21 public function __construct($basename) { 22 22 $this->settings = get_option(self::OPTION_NAME) ?? null; 23 $this->default_ajax = $this->settings['default_ajax'] ?? null;24 $this->default_css = $this->settings['default_css'] ?? null;25 $this->default_transient_expiry = $this->settings['transient_expiry'] ?? null;26 $this->default_club_id = $this->settings['club_id'] ?? null;23 if (isset($this->settings['default_ajax'])) $this->default_ajax = $this->settings['default_ajax']; 24 if (isset($this->settings['default_css'])) $this->default_css = $this->settings['default_css']; 25 if (isset($this->settings['transient_expiry'])) $this->default_transient_expiry = $this->settings['transient_expiry']; 26 if (isset($this->settings['club_id'])) $this->default_club_id = $this->settings['club_id']; 27 27 if (is_admin() && ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) { 28 28 add_action( 'admin_init', array( $this, 'settings_init' ) ); -
eh-gms-feed/trunk/readme.txt
r2964754 r2968572 5 5 Tested up to: 6.2 6 6 Requires PHP: 5.3 7 Stable tag: 3. 57 Stable tag: 3.6 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 63 63 == Changelog == 64 64 65 = 3.6 = 66 * Fix to default settings 67 * Fix to class for combined fixtures and results 68 65 69 = 3.5 = 66 70 * Deal with previous season competition in dynamic filter
Note: See TracChangeset
for help on using the changeset viewer.