Page 1 of 1

Front page: event boxes

Posted: Tue Jun 06, 2017 3:41 am
by jcopersito
For some reason my event boxes are either blank - or only show the entire league.....

Very frustrating....

Here is the code example:
I am trying to get these to work within a division or tournament, not an entire league.

Code: Select all

/*********************
 *   Front page: event boxes
 *********************/

$settings['fp_events'] = array(
    /*
        Event boxes can show for any league, division or tournament the following:
            dead        - recent dead players
            sold        - recent sold players
            hired       - recent hired players
            skills      - recent player skill picks
    */
    array(
        'id'        => $get_lid, # Node ID
        'box_ID'    => 5,
        // Please note: 'type' may be either one of: 'league', 'division' or 'tournament'
        'type'      => 'tournament', # This sets the node to be a tournament. I.e. this will make an event box for the tournament with ID = 1
        'title'     => 'Latest Dead Players (Tournament)', # Table title
        'content'   => 'dead', # Event type
        'length'    => 5, # Number of entries in table
    ),

array(
        'id'        => $get_lid, # Node ID
        'box_ID'    => 6,
        // Please note: 'type' may be either one of: 'league', 'division' or 'tournament'
        'type'      => 'tournament', # This sets the node to be a tournament. I.e. this will make an event box for the tournament with ID = 1
        'title'     => 'Latest Skills (Tournament)', # Table title
        'content'   => 'skills', # Event type
        'length'    => 10, # Number of entries in table
    ),
);

Re: Front page: event boxes

Posted: Tue Jun 06, 2017 9:27 am
by Vanguard
You need to make sure the ID and TYPE match. The code you've given is using your League ID but is set to Tournament for type. This means that it's looking for a tournament with the same ID as your League, which may not exist.
If you go to www.yourdomain.com/troubleshoot.php, you'll get an info page with all of your league, division and tournament IDs. You can then replace $get_lid with the correct value.

Re: Front page: event boxes

Posted: Wed Jun 07, 2017 3:13 pm
by jcopersito
Now the problem is - the team I have created is not tied to that division or tournament - and I cannot figure out why....

Does not even show up in the standings...

Re: Front page: event boxes

Posted: Wed Jun 07, 2017 7:53 pm
by E99
If it is a free for all league, it will be in the standings once you have scheduled (and may be reported) a match for that team.

Re: Front page: event boxes

Posted: Thu Jun 08, 2017 10:30 pm
by jcopersito
Instead of hard coding it, is there a variable I can use instead that is pulling the Tournament ID? Could I just comment out the code and paste it into the custom CSS box of the admin page?

Re: Front page: event boxes

Posted: Fri Jun 09, 2017 10:31 am
by Vanguard
jcopersito wrote:Instead of hard coding it, is there a variable I can use instead that is pulling the Tournament ID? Could I just comment out the code and paste it into the custom CSS box of the admin page?
No, the custom CSS is only for formatting, it can't affect the page content.
$get_prime should work to pull in the Primary Tournament ID. You can then set that from the League Admin page.

Code: Select all

/*********************
 *   Front page: event boxes
 *********************/

$settings['fp_events'] = array(
    /*
        Event boxes can show for any league, division or tournament the following:
            dead        - recent dead players
            sold        - recent sold players
            hired       - recent hired players
            skills      - recent player skill picks
    */
    array(
        'id'        => $get_prime, # Node ID
        'box_ID'    => 5,
        // Please note: 'type' may be either one of: 'league', 'division' or 'tournament'
        'type'      => 'tournament', # This sets the node to be a tournament. I.e. this will make an event box for the tournament with ID = 1
        'title'     => 'Latest Dead Players (Tournament)', # Table title
        'content'   => 'dead', # Event type
        'length'    => 5, # Number of entries in table
    ),

array(
        'id'        => $get_prime, # Node ID
        'box_ID'    => 6,
        // Please note: 'type' may be either one of: 'league', 'division' or 'tournament'
        'type'      => 'tournament', # This sets the node to be a tournament. I.e. this will make an event box for the tournament with ID = 1
        'title'     => 'Latest Skills (Tournament)', # Table title
        'content'   => 'skills', # Event type
        'length'    => 10, # Number of entries in table
    ),
);