BUGFIX: fixed previous commit about sending mail in utf-8
[e-DoKo.git] / include / functions.php
index a332347d38213a4c93c6756061d48e8ce6adbf6d..191823d6de6f45db89e3c144ea307c8522dcbdac 100644 (file)
@@ -218,6 +218,10 @@ function sendmail($To,$Subject,$message)
   if(isset($EMAIL_REPLY))
     $header .= "From: e-DoKo daemon <$EMAIL_REPLY>\r\n";
 
+  $header .= "Content-Type: text/plain; charset = \"UTF-8\";\r\n";
+  $header .= "Content-Transfer-Encoding: 8bit\r\n";
+  $header .= "\r\n";
+
   if($debug)
     {
       /* display email on screen,
@@ -228,15 +232,12 @@ function sendmail($To,$Subject,$message)
                              "<a href=\"$1\">$1</a>", $message);
 
       echo "<br />To: $To<br />";
-      if($header != "")
-       echo $header."<br />";
+      echo $header."<br />";
       echo "Subject: $Subject <br />$message<br />\n";
     }
   else
-    if($header != "")
-      mail($To,$Subject,$message,$header);
-    else
-      mail($To,$Subject,$message);
+    mail($To,$Subject,$message,$header);
+
   return;
 }
 
@@ -1086,8 +1087,8 @@ function display_single_user($r,$start=0)
          $stop    = substr($vacation[1],0,10);
          $comment = $vacation[2];
 
-             $title = "begin: $start  end: $stop $comment";
-             echo "   <span class=\"vacation\" title=\"$title\">$gravatar (on vacation until $stop)</span> \n";
+         $title = _("begin:")." $start  "._("end:")." $stop $comment";
+             echo "   <span class=\"vacation\" title=\"$title\">$gravatar "._("(on vacation until $stop)")."</span> \n";
        }
       else
        echo "   $gravatar \n";
@@ -1449,7 +1450,7 @@ function format_score_table_ascii($score)
 
   /* truncate table if we have too many games */
   $max = sizeof($score);
-  if($max>6) $output.=" (table truncated to last 6 games)\n";
+  if($max>6) $output.=" "._("(table truncated to last 6 games)")."\n";
 
   /* output header */
   foreach($score[0]['players'] as $id=>$points)