Good evening my helpers! I have a multidimensional array $data like this:
Array
(
[0] => thunderteszt
[1] => orevikod
[2] => 5400
[3] => 6
)
Array
(
[0] => bakterhaz1982
[1] => $s$w$0ffТΉЏИÐΞЯ
[2] => 5540
[3] => 3
)
Array
(
[0] => bakterhaz1982
[1] => $s$w$0ffТΉЏИÐΞЯ
[2] => 5570
[3] => 2
)
Array
(
[0] => bakterhaz1982
[1] => $s$w$0ffТΉЏИÐΞЯ
[2] => 5740
[3] => 1
)
Array
(
[0] => thunderteszt
[1] => orevikod
[2] => 5840
[3] => 5
)
Array
(
[0] => thunderteszt
[1] => orevikod
[2] => 5890
[3] => 4
)
You can see I have arrays with repeated nick in row[1] ($s$w$0ffТΉЏИÐΞЯ). I will pick up the lowest value (row[2]) from the repeated arrays.
Therafter I will make a new array from the picked values and I will see only the following:
Array
(
[0] => thunderteszt
[1] => orevikod
[2] => 5400
[3] => 6
)
Array
(
[0] => bakterhaz1982
[1] => $s$w$0ffТΉЏИÐΞЯ
[2] => 5540
[3] => 3
)
What I have tried:
function pts_panel_on($aseco) {
global $pts;
$maniapos = -1;
$linkmaniapos = -0.2;
$linkmaniapos2 = -0;
$xml = '<manialinks><manialink id="40400">';
$xml .= '<frame posn="48.2 15 0">';
if (empty($pts->finish)) return true;
$beerok=array();
foreach($pts->finish as $key=>$row){
$becenev[$key] = $row['nick'];
$ido[$key] = $row['score'];
}
array_multisort($ido, SORT_ASC, $becenev, SORT_ASC, $pts->finish );
foreach($pts->finish as $data){
print_r(array_values($data));
$rpointinc++;
$linkmaniapos = ($linkmaniapos - 3) ;
$linkmaniapos2 = ($linkmaniapos2 - 3) ;
$maniapos = ($maniapos - 3) ;
if ($rpointinc <= 10) {
$xml .= '<format textsize="1"/><label posn="-19.3 ' . $linkmaniapos. '
1.5" sizen="30 3 2" scale="0.3" style="TextRaceChrono" halign="center"
text="$s$0f0'.$rpointinc .' "/>';
$xml .= '<format textsize="1"/><label posn="-27.5 ' . $linkmaniapos . ' 1.5"
sizen="30 3 2" halign="left" scale="0.3" style="TextRaceChrono"
text="$s$fff'.formatTime($data['score']).' "/>';
$xml .= '<format textsize="1.7"/><label posn="-16.5 ' . $linkmaniapos . '
1.6" sizen="12 3 2" halign="left" text="$000' . $data['nick'] . ' "/>';
$xml .= '<quad sizen="4 3" posn="-19.6 ' . $maniapos . ' 1" valign="center"
halign="center" style="Bgs1InRace" substyle="NavButton" />';
$xml .= '<quad sizen="6.2 3" posn="-24.9 ' . $maniapos . ' 1"
valign="center" halign="center" style="Bgs1InRace" substyle="NavButton" />';
$xml .= '<quad sizen="17 3" posn="-17.4 ' . $maniapos . ' 1.1"
valign="center" halign="left" style="Bgs1InRace" substyle="NavButton"/>';
}
}
$xml .= '</frame>';
$xml .= '</manialink></manialinks>';
foreach ($pts->Players as $data2) {
$aseco->client->query("SendDisplayManialinkPageToLogin", $data2['login'],
$xml, 0, false);
}
}