Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author AntoineH

    (@antoineh)

    I have some examples on this forum to change the looks of the plugin to work as a pick a winner (search for “footballpool javascript pick ’em”). The draw is not supported in this javascript, but it may be an example you can work on.

    Requires javascript/jQuery knowledge.

    Thread Starter jrhenry17

    (@jrhenry17)

    Hi Antoine,
    Thanks for the reply.
    I am not really familiar with javascript/jQuery.
    But I would really love to try out the pick em style.
    Can you guide me please? Like where to put the code etc. Or do you have the pick em plugin to download?
    I am doing this site on my localhost so I can refer any live details to you yet.

    Regards,
    Henry

    Plugin Author AntoineH

    (@antoineh)

    You can put the javascript in your theme header file. Or use a plugin that makes adding custom scripts easier.

    Thread Starter jrhenry17

    (@jrhenry17)

    DO you mean this code:
    // pick’em style predictions (v2.3.8 and below)
    jQuery( document ).ready( function() {
    jQuery( ‘table.matchinfo.input tr’ ).filter( function() {
    $this = jQuery( this );
    return $this.attr( ‘id’ ) && $this.attr( ‘id’ ).substr( 0, 5 ) === ‘match’;
    } )
    .each( function() {
    selected = 0;
    jQuery( ‘td.score’, this ).each( function( index ) {
    $this = jQuery( this );
    value = $this.text();
    if ( value == ” && $this.children().length > 0 ) {
    $this.siblings( ‘.home, .away’ )
    .css( ‘cursor’, ‘pointer’ )
    .bind( ‘click’, function() {
    $this = jQuery( this );
    team = $this.attr( ‘class’ ); // home or away
    $this.siblings( ‘.score’ ).find( ‘input[name^=”_’ + team + ‘”]’ ).val( ‘1’ );
    $this.siblings( ‘.score’ ).find( ‘:not(input[name^=”_’ + team + ‘”])’ ).val( ‘0’ );
    $this.css( ‘font-weight’, ‘bold’ ).css( ‘color’, ‘orange’ );
    $this.siblings( ‘:not(.’ + team + ‘)’ ).css( ‘font-weight’, ‘normal’ ).css( ‘color’, ” );
    } );

    value = jQuery( ‘input’, this ).val();
    }

    selector = ( index == 0 ) ? ‘.home’ : ‘.away’;
    if ( value == ‘1’ ) $this.siblings( selector ).css( ‘font-weight’, ‘bold’ )
    .css( ‘color’, ‘orange’ );

    $this.hide();
    } );
    } );

    jQuery( ‘table.matchinfo.input’ ).show();
    } );

    Thread Starter jrhenry17

    (@jrhenry17)

    Do I have to un-activate the plugin before editing the code. Or the plugin will automatically change to pic em style after I insert the code?
    Will the settings look different from the backend?

    Regards,
    Henry

    Thread Starter jrhenry17

    (@jrhenry17)

    Hi there Antoine,
    I tried the football plugin without editing any code.
    I set full score=1 point and toto score=1 point
    my prediction was 3-0 and i set the result to 3-0. I should get 2 points but I get only 1 point.

    Regards,
    Henry

    Plugin Author AntoineH

    (@antoineh)

    No. Full score and toto score do not add up. See help page for examples.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Match Prediction’ is closed to new replies.