New sorting criteria

Status: finished.
Here you can find pre-releases of JoomLeague, Errors and problems with these versions should only be discussed in this board.
NOTICE: BETA and RC versions should not be used on a live site! No support on upgrading to the final version!

Moderator: And_One

User avatar
ndriu
Donator
Donator
Posts: 17
Joined: Sat Dec 08, 2007 8:03 pm
Contact:

New sorting criteria

Postby ndriu » Fri Nov 19, 2010 2:30 am

Hello

Can you help me with adding new sorting criteria to my ranking? I need modify my ranking to volleyball and I need second sorting criteria: sets ratio (sets won/lost).

I modyfied /views/ranking/tmpl/efault_rankingrows.php to show sets ratio in ranking but I have trouble with sorting by it.

case 'RATIO':
echo '<td valign="top" style="text-align:center;';
if ( $color != '' )
{
echo 'background-color:' . $color;
}
echo '">';
printf( $format, sprintf( "%.2F", ($showRow->sum_team1_result)/($showRow->sum_team2_result) ));
echo '</td>';
echo "\n";
break;


How can I modyfy /helpers/ranking.php? I tryied to use defined function goalAvg() (line 1101)? In line 791 is function _cmpAvg which use goalAvg() but after adding "AVG" criteria in admin, sorting is not correct?

Thank you and best regards.

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: New sorting criteria

Postby timoline » Fri Nov 19, 2010 8:07 am

Which version(I assume 1.5)?

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: New sorting criteria

Postby timoline » Fri Nov 19, 2010 1:28 pm

Check,
[syntax="php"]
case 'LEGS_RATIO':
echo '<td class="rankingrow"';
if ( $color != '' )
{
echo 'style="background-color:' . $color;
}
echo '">';
if ($team->sum_team2_legs == 0)
{
$legsratio=$team->sum_team1_legs/0.1;
}
else
{
$legsratio=$team->sum_team1_legs/$team->sum_team2_legs;
}
printf( $format, $legsratio );
echo '</td>';
echo "\n";
break;
[/syntax]

I think this is what you want?....or?

Committed to git ;)

User avatar
ndriu
Donator
Donator
Posts: 17
Joined: Sat Dec 08, 2007 8:03 pm
Contact:

Re: New sorting criteria

Postby ndriu » Fri Nov 19, 2010 10:31 pm

Thanks for your reply.

The problem is that I put the sets into goals and don't use legs. I'm not sure how to use legs.

I thought that the best way for me was to add new value 'ratio'. When I put into column 'RESULTS' it show me something like: 13:5 but I need 13:5=2,6.

Best regards.

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: New sorting criteria

Postby timoline » Sat Nov 20, 2010 10:50 am

dont know exactly what you want now,
but sets=legs :confused:

User avatar
ndriu
Donator
Donator
Posts: 17
Joined: Sat Dec 08, 2007 8:03 pm
Contact:

Re: New sorting criteria

Postby ndriu » Sat Nov 20, 2010 10:35 pm

Yes but probably my version is too old and I need to update my JL. I have set "use sets" on in my profile configuration but all scores in volleyball profiles (with "use sets" on) are counted as goals (results).

When I try to show LEGS in ranking I have blank column.

Thanks
J1.5.22, JoomLeague - v1.5.05a


Return to “1.5.0-a (Alpha)”

Who is online

Users browsing this forum: No registered users and 3 guests

cron