Galak's banking rule in obblm..
Moderator: TFF Mods
- Daht
- Emerging Star
- Posts: 353
- Joined: Fri Nov 05, 2010 3:31 am
- Location: Las Vegas
Galak's banking rule in obblm..
Working on this in my spare time, as we may want to add this to our perpetual league.
I can get it to work for the team info and statistics by modifying line 864 in class_team_htmlout.php to:
<td><?php echo ($team->tv+$team->treasury-200000)/1000 . 'k'; ?></td>
(using a 200k bank instead of 100, obviously this is easily varied)..
but have yet to crack how to make this adjustment for the pdf out.
I can get it to work for the team info and statistics by modifying line 864 in class_team_htmlout.php to:
<td><?php echo ($team->tv+$team->treasury-200000)/1000 . 'k'; ?></td>
(using a 200k bank instead of 100, obviously this is easily varied)..
but have yet to crack how to make this adjustment for the pdf out.
Reason: ''
- mepmuff
- Legend
- Posts: 3208
- Joined: Sun Dec 28, 2003 1:33 pm
- Location: Utrecht, the Netherlands
Re: Galak's banking rule in obblm..
Don't know where that exact statement is echo'ed, but I think it should read:
<td><?php echo ($team->tv+min(0,$team->treasury-200000)/1000) . 'k'; ?></td>
<td><?php echo ($team->tv+min(0,$team->treasury-200000)/1000) . 'k'; ?></td>
Reason: ''
- Daht
- Emerging Star
- Posts: 353
- Joined: Fri Nov 05, 2010 3:31 am
- Location: Las Vegas
Re: Galak's banking rule in obblm..
Yes it needs to be set to minimum zero for the bank, but that equation doesn't work it puts out the full team value (no bank adjustments) with a k after it (123000k instead of 123k)
Need to either figure out a syntax to use, or create a new variable for treasury minus 200k, minimum zero, to plug in and just add.
Also, for the pdf format printout feild... in pdf_roster.php it's on line 499 as:
$pdf->Mf($team->value + $ind_cost));
that is the formula at the end of the line after formatting code.
I can add +$team->treasury to add all the treasury, but trying to make an equation
$pdf->Mf($team->value + $ind_cost + ($team->treasury - 100000)));
gives the following error:
Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$' in /nfs/www/WWW_pages/daht/obbl/modules/pdf/pdf_roster.php on line 499
The new part of the equation also needs to be minimum 0, so we would need to set a new variable for $team->bank set at treasury - 100k (or whatever value) with a minimum of zero for this as well.
I have yet to find where to try and put that in to test, for either case.
Need to either figure out a syntax to use, or create a new variable for treasury minus 200k, minimum zero, to plug in and just add.
Also, for the pdf format printout feild... in pdf_roster.php it's on line 499 as:
$pdf->Mf($team->value + $ind_cost));
that is the formula at the end of the line after formatting code.
I can add +$team->treasury to add all the treasury, but trying to make an equation
$pdf->Mf($team->value + $ind_cost + ($team->treasury - 100000)));
gives the following error:
Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$' in /nfs/www/WWW_pages/daht/obbl/modules/pdf/pdf_roster.php on line 499
The new part of the equation also needs to be minimum 0, so we would need to set a new variable for $team->bank set at treasury - 100k (or whatever value) with a minimum of zero for this as well.
I have yet to find where to try and put that in to test, for either case.
Reason: ''
- Daht
- Emerging Star
- Posts: 353
- Joined: Fri Nov 05, 2010 3:31 am
- Location: Las Vegas
Re: Galak's banking rule in obblm..
<?$treasury = ($team->treasury - 200000 > 0) ? ($team->treasury - 200000) : 0;$value = ($team->tv + $treasury) / 1000 . 'k';?><td><?= $value ?></td>
on line 864 in class_team_htmlout.php works, can adjust the 200000 to whatever value wanted.
still workin on the pdf output
on line 864 in class_team_htmlout.php works, can adjust the 200000 to whatever value wanted.
still workin on the pdf output
Reason: ''
- Daht
- Emerging Star
- Posts: 353
- Joined: Fri Nov 05, 2010 3:31 am
- Location: Las Vegas
Re: Galak's banking rule in obblm..
picked this back up and I'm a bit stumped due to not actually knowing php..
to get this to work on the team pdf roster I need this:
$pdf->Mf(($team->value+$ind_cost+ $team->treasury-150000)));
to have a provision that treasury-150000 has a minimum of zero.
$team->min(0,$team->treasury-150000) doesn't work still gives negatives to the team value
to get this to work on the team pdf roster I need this:
$pdf->Mf(($team->value+$ind_cost+ $team->treasury-150000)));
to have a provision that treasury-150000 has a minimum of zero.
$team->min(0,$team->treasury-150000) doesn't work still gives negatives to the team value
Reason: ''
- Daht
- Emerging Star
- Posts: 353
- Joined: Fri Nov 05, 2010 3:31 am
- Location: Las Vegas
Re: Galak's banking rule in obblm..
ok figured it out.. above line 499 add the following:
if ( $team->treasury - 150000 > 0 ){
$treasury = $team->treasury - 150000;
} else {
$treasury = 0;
}
$value = ($team->tv + $treasury);
then modify the end of 499 to :
$pdf->Mf($team->value + $treasury + $ind_cost));
and bank rules work in the pdf print rosters
if ( $team->treasury - 150000 > 0 ){
$treasury = $team->treasury - 150000;
} else {
$treasury = 0;
}
$value = ($team->tv + $treasury);
then modify the end of 499 to :
$pdf->Mf($team->value + $treasury + $ind_cost));
and bank rules work in the pdf print rosters
Reason: ''
- nicholasmr
- Experienced
- Posts: 110
- Joined: Mon Oct 22, 2007 1:01 pm
- Location: Copenhagen, Denmark
- Contact:
Re: Galak's banking rule in obblm..
What exactly is this banking rule? Maybe I can help you sort this most effectively .
Nicholas
Nicholas
Reason: ''
- Daht
- Emerging Star
- Posts: 353
- Joined: Fri Nov 05, 2010 3:31 am
- Location: Las Vegas
Re: Galak's banking rule in obblm..
Bank rule was originally intended (and fully tested) for lbr6 but pulled and replaced with the petty cash rules by Jervis at the last minute.
Basically, if your team treasury is over 100k (150k being more popular due to player/reroll costs) it counts toward team value.
I've got it working now to reflect that (at 150k) in both the team value in stats/team page, and the pdf printout.
Basically, if your team treasury is over 100k (150k being more popular due to player/reroll costs) it counts toward team value.
I've got it working now to reflect that (at 150k) in both the team value in stats/team page, and the pdf printout.
Reason: ''
- ChenZhen
- Emerging Star
- Posts: 456
- Joined: Sun Dec 11, 2011 3:30 am
- Location: Twin Cities, MN - USA
- Contact:
Re: Galak's banking rule in obblm..
I'd be interesting in using this for our league (as we use the banking rule), but I'm new to OBBLM and wanted to make sure I didn't mess it up while I tried to make the change!
Could anyone clarify all the changes that were made?
Thanks much!
Could anyone clarify all the changes that were made?
Thanks much!
Reason: ''
- nicholasmr
- Experienced
- Posts: 110
- Joined: Mon Oct 22, 2007 1:01 pm
- Location: Copenhagen, Denmark
- Contact:
Re: Galak's banking rule in obblm..
Yes this was added. You need at least version 0.91 as far as I remember.
Reason: ''
- ChenZhen
- Emerging Star
- Posts: 456
- Joined: Sun Dec 11, 2011 3:30 am
- Location: Twin Cities, MN - USA
- Contact: