| Persistent Realities Forum Index » Tutorials, articles, downloads | The time now is Tue Sep 07, 2010 11:49 pm |
![]() |
PHP unreal query |
| PHP unreal query |
BETEP`
|
Hello,
I have a little question: is it possible to sort players by frags, or by team for example? In another hand, is there any way to replace 'Team' value? Atm is '1' or '0' (that info you got from unreal server by default I guess) so can you introduce a variable in order to change it into 'Terrorists' and 'Special Forces' for example? thank you |
|||||||
ricky112
|
Hi,
To chance the team to text you can use the str_replace(); function. Find: <td width="<?=$typewidth;?>" bgcolor="<?=$rowcolor;?>"> <?=getiteminfo("team_" . $actualid,$chunks);?> </td> Replace with: <td width="<?=$typewidth;?>" bgcolor="<?=$rowcolor;?>"> <?=str_replace(Array("0","1","255"), Array("Red", Blue", "Spec."), getiteminfo("team_" . $actualid,$chunks));?> </td> (dint test it.) I hope this helped you |
|||||||
|
Almar Joling Site Admin
|
It would be possible to reorder the array by team id. I haven't tried it myself, now have the intention to (unless there is still interest in it)
If you first get all the player information and store it in a temporary array, you could probably find some multisort function on the PHP manual site to sort the array properly. It might be an hour work though. |
|||||||
|
