af3
Forum Replies Created
-
Forum: Plugins
In reply to: [Football Pool] Add “Currently Playing”Hi @antoineh
I cant get the gmt time to substract correctly.. seems like the parameters are all in utc? so i tried to convert the server utc to gmt.. with my limited php, this is what i have so far but the minutes are -ve and not calculating properly.<?php /** * Plugin Name: Football Pool - Playing Now */ // Save this plugin in the "/wp-content/plugins" folder and activate it // class FootballPoolExtensionPlayNow { public static function init_extension() { add_filter( 'footballpool_predictionform_match_template', array( __CLASS__, 'match_row_template' ), null, 2 ); add_filter( 'footballpool_predictionform_match_template_params', array( __CLASS__, 'change_params' ), null, 4 ); } public static function change_params( $match_template_params, $match_id, $user_id, $is_user_page ) { $current_date = gmdate('M d, Y', strtotime('+ 8 hours')); $current_time = gmdate('H:i s', strtotime('+ 8 hours')); $mynote = ''; if ( $current_date == $match_template_params['match_datetime_formatted'] ) { $match_time = $match_template_params['match_time']; $diff = strtotime($current_time) - strtotime($match_time); $min_diff = $diff / 60; $hour = floor($min_diff) / 60; $min = ($min_diff % 60); if ($min < 116) { $mynote = '<span class="playing-now">Started ' .round($min,0). ' min ago</span>'; } if ($min < 1 ) { $mynote = '<span class="playing-now">Starting in '.$hour.' hr and '.$min.' min</span>'; } if ($minutes > 116 ) { $mynote = '<span class="playing-now">Completed just now</span>'; } // assume by min 116 since start, match is completed. } if ( $current_date > $match_template_params['match_datetime_formatted'] ) { $mynote = '<span class="playing-now">Completed</span>'; } $match_template_params['play_started'] = $mynote; return $match_template_params; } public static function match_row_template( $match_template, $is_user_page ) { if ( ! $is_user_page ) { if ( strpos( $match_template, '<tr>' ) !== false ) { $match_template = '<tr id="match-%match_id%-%form_id%" class="%css_class%" title="' . __('match', 'football-pool') . ' %match_id%"> <td class="time">%match_time% %play_started%</td> <td class="home">%home_team%</td> <td class="flag">%home_team_flag%</td> <td class="score">%home_input%</td> <td>-</td> <td class="score">%away_input%</td> <td class="flag">%away_team_flag%</td> <td class="away">%away_team%</td> <td>%joker%</td> <td title="' . __('score', 'football-pool') . '" class="numeric">%user_score%</td> <td>%stats_link%</td> </tr>'; } else { $match_template = '<div id="match-%match_id%-%form_id%" class="%css_class% match-card match-type-%match_type_id%" title="' . __( 'match', 'football-pool' ) . ' %match_id%"> <div class="match-card-header"> <span class="matchdate">%match_datetime_formatted%</span> <span class="time">%match_time% %play_started%</span> </div> <div class="flag">%home_team_flag%</div> <div class="flag">%away_team_flag%</div> <div class="home">%home_team%</div> <div class="away">%away_team%</div> <div class="score"> %home_input% <div class="actual-score">%home_actual_score%</div> </div> <div class="score"> %away_input% <div class="actual-score">%away_actual_score%</div> </div> <div class="match-card-footer"> <div class="user-score">%user_score_txt%</div> <div class="fp-icon">%stats_link%</div> <div class="fp-icon">%joker%</div> </div> </div>'; } } return $match_template; } } add_filter( 'plugins_loaded', array( 'FootballPoolExtensionPlayNow', 'init_extension' ) );Forum: Plugins
In reply to: [Football Pool] Add “Currently Playing”Got it done. It turns out quite simple. Thanks for the save codes & templates.
Forum: Plugins
In reply to: [Football Pool] Reset score after group gamesJust to share, I added this to the ranking page’s header in the theme. This hides the empty text for option value 1, and use option 5 (for my case to be shown as default).
<script> jQuery(document).ready(function() { jQuery("#ranking option[value="+1+"]").hide(); jQuery("#ranking option[value="+5+"]").attr('selected','selected'); }); </script>Forum: Plugins
In reply to: [Football Pool] Understanding League & MatchesThanks @antoineh
Yes, I want to have multiple championships where users by league group can participate. Thank you for your suggestions — i think it will work and will try it for a smaller group of people.
Anyway, cuurious if anyone tried this plugin on multisite — this can perhaps one solution to have multiple championships.
Cheers
Forum: Plugins
In reply to: [Football Pool] Reset score after group gamesThanks again! the option=1 can be hidden using jquery. thanks
Forum: Plugins
In reply to: [Football Pool] Reset score after group gamesAdditionally, the message “No results yet. Below is a list of all users.” only appears in the Ranking page, not on the default statistic page where the selection will return empty page. Using WordPress 2021 theme.
Forum: Plugins
In reply to: [Football Pool] Reset score after group gamesForum: Plugins
In reply to: [Football Pool] predicted matches – after 90 or ET?I think it’s up to your own rules because you add the final actual score manually.
Forum: Plugins
In reply to: [Football Pool] Reset score after group gamesOMG! I didnt see this. I can create & define ranking based on matches, round of 16 etc! Wow this is awesome.
I created the rankings are user can select which ranking to show on the Statistics page (despite the other rankings are for future matches — it will return empty page).
However, on the ranking page — seems like only the default ranking is shown as there is no selection/dropdown to select ranking to show (despite I activated User-defined in plugin option in admin). Is this as intended (because Round of 16 ranking etc is still empty) ?
Thanks again for the help.
- This reply was modified 4 years, 11 months ago by af3.
Forum: Plugins
In reply to: [Football Pool] Making team-list into multicolumn doesnt workI added this to make the text appears on top.
ol.team-list li a, ol.stadium-list li a { display: flex; align-items: top; }Forum: Plugins
In reply to: [Football Pool] Making team-list into multicolumn doesnt workThat works. You are awesome!
Forum: Plugins
In reply to: [Football Pool] Add “Currently Playing”Thank for the suggestion. I just dont know how to do it 🙂
Forum: Plugins
In reply to: [Football Pool] Count down to “next” matchits already doing that.. no ?
Forum: Plugins
In reply to: [Football Pool] Money in the potok.
Forum: Plugins
In reply to: [Football Pool] Group winners scoringthanks