WordPress.org

Ready to get started?Download WordPress

Forums

Football Pool
[resolved] Charts Icon Bonus Question (7 posts)

  1. ARTEFACTOCO
    Member
    Posted 5 months ago #

    Hi Antoine,

    Im sorry if I'm taking a lot your time... This is one of my last questions I guess.

    When I use the shortcode for the bonus questions, the Charts icon does not appear. Could you help me out with this?

    Thanks again.

    https://wordpress.org/plugins/football-pool/

  2. AntoineH
    Member
    Plugin Author

    Posted 5 months ago #

    Which shortcode do you use and what charts icon are you missing?

  3. ARTEFACTOCO
    Member
    Posted 5 months ago #

    Im using this short code for the bonus questions: [fp-predictionform question="1"] I would like to show the icon that links to this page in every question "?view=bonusquestion&question=1" (the page when you see all users answers).

  4. AntoineH
    Member
    Plugin Author

    Posted 5 months ago #

    The prediction form (both shortcode and prediction page) miss this functionality. I will fix it in the next version (2.4.0). If you can't wait, change lines 804-808 in class-football-pool-pool.php to:

    $points = $question['points'] == 0 ? __( 'variable', FOOTBALLPOOL_TEXT_DOMAIN ) : $question['points'];
    $output .= sprintf( '<span class="bonus points">%s %s'
    					, $points
    					, __( 'points', FOOTBALLPOOL_TEXT_DOMAIN )
    			);
    if ( ! $this->question_is_editable( $question['question_timestamp'] ) ) {
    	$output .= sprintf( '<a title="%s" href="%s">',
    						__( 'view other users answers', FOOTBALLPOOL_TEXT_DOMAIN )
    						, esc_url(
    							add_query_arg(
    								array( 'view' => 'bonusquestion', 'question' => $question['id'] ),
    								Football_Pool::get_page_link( 'statistics' )
    							)
    						)
    				);
    	$output .= sprintf( '<img alt="%s" src="%sassets/images/site/charts.png" />',
    						__( 'view other users answers', FOOTBALLPOOL_TEXT_DOMAIN ), FOOTBALLPOOL_PLUGIN_URL );
    	$output .= '</a>';
    }
    $output .= '</span></p>';
  5. ARTEFACTOCO
    Member
    Posted 5 months ago #

    Hi Antoine.

    I did replace the lines and still can't see the icon to go to the page with all users answers.

    Should I do some change to the shortcode file?

    If it helps, when you go to an user page (?user=1) there you have the link to check all user answers in the bonus questions.

    Hope you can help me.

  6. AntoineH
    Member
    Plugin Author

    Posted 5 months ago #

    I did a quick test yesterday and everything seemed to work just fine. Did you check if the question is closed? Because the code above doesn't show the icon when the answer can still be changed.

  7. ARTEFACTOCO
    Member
    Posted 5 months ago #

    You are right... the questions were not closed. I tested closing questions and it worked perfect! Thanks.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.