X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=functions.php;h=45416a786c9a5d00317c6c861d8213704847a96c;hp=e9ead78166e0c3b3031f2dee5a01d8fd02e323ac;hb=d40474acceedefcd9aa3ae7dc314c260f81537fe;hpb=22390bdc9d72fe7b32375d3be898ee0fd8137a88 diff --git a/functions.php b/functions.php index e9ead78..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; } @@ -156,7 +156,6 @@ function get_winner($p,$mode) $c3 = $p[3]; $c4 = $p[4]; - /* first card is better than all the rest */ if( compare_cards($c1,$c2,$mode) && compare_cards($c1,$c3,$mode) && compare_cards($c1,$c4,$mode) ) return 1; @@ -364,7 +363,7 @@ function card_value($card) case 48: return 0; default: - echo "something went wrong, please contact the admin. ErrorCode: 2
"; + echo "something went wrong, please contact the admin. ErrorCode: 2 - $card
"; return 0; } } @@ -524,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