OBBLM - How to make a house rule that uses sdiff to sort?

However you play online - Java, Vassal, Email, Cyanide etc - talk about it here.
This is also the place for discussing the various tools for managing leagues, teams and so on.

Moderator: TFF Mods

Post Reply
Bakdal
Rookie
Rookie
Posts: 18
Joined: Thu Jan 17, 2013 9:42 am
Location: Denmark

OBBLM - How to make a house rule that uses sdiff to sort?

Post by Bakdal »

My league has just started up a new season and this year we wanted to sort the standings slightly different than the standard HRS options.

The idea was to sort the standings against points and if points were tied then against sdiff. The plan was that points would be awarded in the normal way of win=3 points, tie = 2 points, and loss = 1 point. However I most have gotten something wrong as after the first match both teams got 0 points in the standings after a 1-0 match.

Heres the code defining the House ranking systems from the settings.php file.

Code: Select all

// Rule #5
$hrs[5]['rule']   = array('-pts', '-sdiff');    // Sort teams against: most points, then highest GF-GA.
$hrs[5]['points'] = '3*[won] + 2*[draw] + 1*[lost]'; // The definition of points.
Here's the code from the local settings file also, though I don't think it should matter much as the standings box is set for tournament.

Code: Select all

$settings['fp_standings'] = array(
    # This will display a standings box of the top 6 teams in node (league, division or tournament) with ID = 1
    array(
        'id'     => 11,
        'box_ID' => 2,
        // 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 a standings box for the tournament with ID = 1
        'infocus' => true, # If true a random team from the standings will be selected and its top players displayed.
        /*
            The house ranking system (HRS) NUMBER to sort the table against.
            Note, this is ignored for "type = tournament", since tours have an assigned HRS.
            Also note that using HRSs with fields such as points (pts) for leagues/divisions standings makes no sense as they are tournament specific fields (i.e. it makes no sense to sum the points for teams across different tours to get the teams' "league/division points", as the points definitions for tours may vary).
        */
        'HRS'    => 5, # Note: this must be a existing and valid HRS number from the main settings.php file.
        'title'  => 'The Full Bucket MMXIII Standings',
        'length' => 8,
        # Format: "Displayed table column name" => "OBBLM field name".
        'fields' => array('Name' => 'name', 'PTS' => 'pts', 'TV' => 'tv', 'CAS' => 'cas', 'W' => 'won', 'L' => 'lost', 'D' => 'draw', 'GF' => 'gf', 'GA' => 'ga',),
Site is located at kfc.bakdal.eu Any help getting this standings/HRS thing solved would be appreciated.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM - How to make a house rule that uses sdiff to sor

Post by Shteve0 »

Your code looks fine. The problem is, as you point out, not in the box on the front page, but in the resolution of the house ranking code - it's sorting by the right things, it's just not calculating the points correctly.

After adding HRS Rule 5, did you re-install the database back end procedures in the core panel?

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
Bakdal
Rookie
Rookie
Posts: 18
Joined: Thu Jan 17, 2013 9:42 am
Location: Denmark

Re: OBBLM - How to make a house rule that uses sdiff to sor

Post by Bakdal »

Shteve0 wrote:Your code looks fine. The problem is, as you point out, not in the box on the front page, but in the resolution of the house ranking code - it's sorting by the right things, it's just not calculating the points correctly.

After adding HRS Rule 5, did you re-install the database back end procedures in the core panel?
I thought I did… but apparently I didn't. Because after doing so (and clearing my browser cache) the PTS column in the standings are showing correctly.
Thanks for looking over the code Shteve0 and reminding me to re-install the database back end procedures. Everything looks fine now.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Post by Shteve0 »

No trouble, glad you got it sorted :)

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
User avatar
sann0638
Kommissar Enthusiasmoff
Posts: 6609
Joined: Mon May 08, 2006 10:24 am
Location: Swindon, England

Re: OBBLM - How to make a house rule that uses sdiff to sor

Post by sann0638 »

So is it possible to add in as many different "scoring options" as you want by changing the settings.php file?

Reason: ''
NAF Ex-President
Founder of SAWBBL, Swindon and Wiltshire's BB League - find us on Facebook and Discord
NAF Data wrangler
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM - How to make a house rule that uses sdiff to sor

Post by Shteve0 »

Sorry, I thought I'd replied to this.

Yes - within reason. I guess it depends how many you want and what those options are.

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
Post Reply