X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=functions.php;h=f6a26d951aed27c60c58eb7338dcf742cd1a48e8;hp=ce549c1fa2a865f87172588aa869a70ce4e152c8;hb=31fc4a1397b4ffb1c172df7389ca993c52760a32;hpb=618acae3ad3b85d79d68124e7793aa858daed7c3
diff --git a/functions.php b/functions.php
index ce549c1..f6a26d9 100644
--- a/functions.php
+++ b/functions.php
@@ -6,7 +6,11 @@ function mymail($To,$Subject,$message)
if($debug)
{
- $message = str_replace("\n","
",$message);
+ $message = str_replace("\n","
\n",$message);
+ $message = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",
+ "\\0", $message);
+ //$message = ereg_replace("(http.*)[ <>]","\\1 ",$message);
+
echo "
To: $To
Subject: $Subject
$message
\n";
}
else
@@ -415,15 +419,36 @@ function card_value($card)
function create_array_of_random_numbers()
{
+ global $debug;
+
$r = array();
$a = array();
- for($i=0;$i<48;$i++)
- $a[$i]=$i+1;
-
-# $r = array_rand($a,48);
- $r =$a;
-
+ if($debug)
+ {
+ $a[ 0]=1; $a[12]=47; $a[24]=13; $a[36]=37;
+ $a[ 1]=2; $a[13]=48; $a[25]=14; $a[37]=38;
+ $a[ 2]=3; $a[14]=27; $a[26]=15; $a[38]=39;
+ $a[ 3]=4; $a[15]=16; $a[27]=28; $a[39]=40;
+ $a[ 4]=5; $a[16]=17; $a[28]=29; $a[40]=41;
+ $a[ 5]=18; $a[17]=6; $a[29]=30; $a[41]=42;
+ $a[ 6]=19; $a[18]=7; $a[30]=31; $a[42]=43;
+ $a[ 7]=20; $a[19]=8; $a[31]=32; $a[43]=44;
+ $a[ 8]=45; $a[20]=9; $a[32]=21; $a[44]=33;
+ $a[ 9]=46; $a[21]=10; $a[33]=22; $a[45]=34;
+ $a[10]=35; $a[22]=11; $a[34]=23; $a[46]=25;
+ $a[11]=36; $a[23]=12; $a[35]=24; $a[47]=26;
+
+ $r = $a;
+ }
+ else
+ {
+ for($i=0;$i<48;$i++)
+ $a[$i]=$i+1;
+
+ $r = shuffle($a);
+ };
+
return $r;
}
@@ -512,6 +537,9 @@ function set_gametype($gametype)
switch($gametype)
{
case "normal":
+ case "wedding":
+ case "poverty":
+ case "dpoverty":
case "trump":
case "silent":
$CARDS["trump"] = array('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16',
@@ -616,4 +644,9 @@ function sort_comp($a,$b)
return pos_array($a,$ALL)-pos_array($b,$ALL);
}
+function can_call($what,$hash)
+{
+ return 1;
+}
+
?>
\ No newline at end of file