X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=functions.php;h=45416a786c9a5d00317c6c861d8213704847a96c;hp=ec7dfacbf67d247a8ada7f713732d468bdd9f2fe;hb=7ecd66ab61eb1f0e8d32e75570b4809b57ae79d5;hpb=b8227ddb12516d5bdb0db8a3ec46083b02caee79 diff --git a/functions.php b/functions.php index ec7dfac..45416a7 100644 --- a/functions.php +++ b/functions.php @@ -26,8 +26,8 @@ function myisset() foreach($args as $arg) { $ok = $ok * isset($_REQUEST[$arg]); - /* echo "$arg: ok = $ok
"; - */ + /*echo "$arg: ok = $ok
"; + */ } return $ok; } @@ -523,4 +523,20 @@ function set_gametype($gametype) } } +function mysort($cards,$gametype) +{ + usort ( $cards, "sort_comp" ); + return $cards; +} + +function sort_comp($a,$b) +{ + global $TRUMP,$DIAMONDS,$HEARTS,$CLUBS,$SPADES; + + $ALL = array(); + $ALL = array_merge($TRUMP,$DIAMONDS,$CLUBS,$HEARTS,$SPADES,$DIAMONDS); + + return pos_array($a,$ALL)-pos_array($b,$ALL); +} + ?> \ No newline at end of file