Page 1 of 1

OBBLM help needed - Front Page Tournament Standings

Posted: Sun May 11, 2014 7:17 pm
by BigSexy
How do I get the front page to display the standing for the current tournament? It does not show up. I was able to figure out Most Casualties and Most Touchdowns and add one for SPPs but can't figure out Standings. FYI, don't know PHP so just stumbling around.

Re: OBBLM help needed - Front Page Tournament Standings

Posted: Wed May 14, 2014 9:29 am
by Vanguard
The front page setup is specified in the localsettings/settings_?.php file, where ? is the numerical ID of your League.
It's worth explaining that OBBLM uses a hierarchical structure of Leagues, Divisions and Tournaments which it refers to as nodes. For example, my current league has the following setup:

Code: Select all

WBBL (League ID=2)
    - WBBL (Division ID=1)
        - WBBL Season 1 (Tournament ID=3)
        - WBBL Season 2 (Tournament ID=4)
        - WBBL Season 3 (Tournament ID=5)
The IDs are automatically generated when you create a node, starting at one and incrementing. They are also specific to each level, so your first league, division and tournament will all have ID=1.
There is no easy way to discover the ID of a node that I am aware of, I've done it previously with a little trial and error. If you are comfy with MySQL you can look at the tables and get the info there. (Table leagues[i/] Field lid, Table divisons[i/] Field did, Table tours[i/] Field tid

In the settings_?php file there should be a section titled Front page: tournament standings boxes starting around line 75. You need to edit this section to show your tournament standings. Set id equal to the ID of your tournament and set type equal to 'tournament'. You can have standings for Leagues and Divisions too, so you have to specify that it is a tournament table you want. Next you need to set the box_ID, this specifies which position the table will appear in on the right hand side of your page. I have mine set to 1 so it appears first, but it's entirely up to you. Just ensure that each box you have set up (League, Most CAS, Most TDs etc) all have a unique ID.

Here's a copy of my setup for your reference:

Code: Select all

/*********************
 *   Front page: tournament standings boxes
 *********************/

$settings['fp_standings'] = array(
    array(
        'id'     => 5, # Node ID
        'box_ID' => 1,
        // Please note: 'type' may be either one of: 'league', 'division' or 'tournament'
        'type'   => 'tournament', 
        'infocus' => false, 
        'HRS'    => 1, # Note: this must be a existing and valid HRS number from the main settings.php file.
        'title'  => 'WBBL Season 3', # Table title
        'length' => 12, # Number of entries in table
        # Format: "Displayed table column name" => "OBBLM field name". For the OBBLM fields available see http://nicholasmr.dk/obblmwiki/index.php?title=Customization
        'fields' => array('Name' => 'name', 'TV' => 'tv', 'P' => 'played', 'W' => 'won', 'D' => 'draw', 'L' => 'lost', 'TDF' => 'gf', 'TDA' => 'ga', 'CAS' => 'cas', 'PTS' => 'pts',),
    ),
);

Re: OBBLM help needed - Front Page Tournament Standings

Posted: Wed May 14, 2014 4:46 pm
by BigSexy
Thanks for the help. With the default ID=>1, nothing shows up. When I changed it to 2, standings appeared but from a previous tournament. When I set it to 3 nothing appeared again. Does OBBLM count tournaments you may have created and then deleated, such as test setups? I guess I may have do some trial and error.

Okay, that might be the case. We've had 3 tournaments and I got up to ID=> 7 until I got the proper standings. Also had a moment of panic when I titled the standings,"Spring '14 Season Standings" and the whole page disappeared. Apparently you can't put them extra apostrophes in there. :lol:

Posted: Wed May 14, 2014 6:32 pm
by Shteve0
Welcome to the world of experimenting with php :)

Yes, deleted tournaments count. I think there's a shortcut to looking at the numbering of leagues accessible from the public site... Can anyone recall where it is?

Re: OBBLM help needed - Front Page Tournament Standings

Posted: Wed May 14, 2014 6:41 pm
by Shteve0
Aha, here you go. You need to get to the Tournament Standings page - here's ours: http://wbbl.nzbbn.com/index.php?section ... type=tours

If you click on one of the tournaments, the new page that opens up has a url that looks something like this:

Code: Select all

http://wbbl.nzbbn.com/index.php?section=matches&type=tourmatches&trid=4
...which tells me that I need to reconfigure the tables on the front to tournament with id=4.

Note that the standings boxes are not all configured to look for a tournament by default; some will look for the league or division! It's an important distinction, so have a think about what it is you want to show on that front page before it catches you by surprise.

Re: OBBLM help needed - Front Page Tournament Standings

Posted: Wed May 14, 2014 7:30 pm
by BigSexy
That's a great tip. Thanks Shteve0. Got the part about "league, division, tournament". Got my other boxes set up the way I want, just couldn't get the standings to work for me, but now it's all good. Thanks guys.