projects
/
e-DoKo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
651d44e
)
new sort function; should sorrt correctly for solos,etc
author
arun
<arun@nubati.net>
Tue, 16 Jan 2007 15:00:03 +0000
(15:00 +0000)
committer
arun
<arun>
Tue, 16 Jan 2007 15:00:03 +0000
(15:00 +0000)
functions.php
patch
|
blob
|
history
index.php
patch
|
blob
|
history
diff --git
a/functions.php
b/functions.php
index 221bea8f2d028d2ad6066e1a13928503b5b2c9cb..cecc63c5df74b79598cbf5f3a1e164b6a9f416b6 100644
(file)
--- a/
functions.php
+++ b/
functions.php
@@
-523,4
+523,24
@@
function set_gametype($gametype)
}
}
}
}
+function mysort($cards,$gametype)
+{
+ global $TRUMP,$DIAMONDS,$HEARTS,$CLUBS,$SPADES;
+
+ switch($gametype) {
+ case normal:
+ case trump:
+ default:
+ $ALL = array_merge($TRUMP,$DIAMONDS,$CLUBS,$HEARTS,$SPADES,$DIAMONDS);
+ break;
+ }
+
+ $compare = create_function("$a, $b", "return pos_array($a,$ALL)-pos_array($b,$ALL);");
+
+ usort ( $cards, $compare );
+
+ return;
+}
+
+
?>
\ No newline at end of file
?>
\ No newline at end of file
diff --git
a/index.php
b/index.php
index f8bb305cf80957fc7e277139724e631539876cb5..ef047be0f0983f169174417b78b240a810ca9d07 100644
(file)
--- a/
index.php
+++ b/
index.php
@@
-667,7
+667,7
@@
else if(myisset("me"))
}
$mycards = DB_get_hand($me);
}
$mycards = DB_get_hand($me);
-
sort($mycards
);
+
mysort($mycards,$gametype
);
echo "<div class=\"mycards\">\n";
if($myturn && !myisset("card"))
echo "<div class=\"mycards\">\n";
if($myturn && !myisset("card"))