set languages can also be used by UID now; make mymail langauge sensitive
[e-DoKo.git] / digest.php
index 07625192fd57e90ca9f18d69f1d1459c8bb12e3a..241622871a9cb8efc32992af0b17598e7753afaf 100644 (file)
@@ -53,21 +53,7 @@ foreach($users as $uid)
     $PREF = DB_get_PREF($uid);
 
     // set users language preference
     $PREF = DB_get_PREF($uid);
 
     // set users language preference
-    $language = $PREF['language'];
-
-    switch($language)
-      {
-      case 'de':
-       putenv("LC_ALL=de_DE");
-       setlocale(LC_ALL, "de_DE");
-       // Specify location of translation tables
-       bindtextdomain("edoko", "./locale");
-       // Choose domain
-       textdomain("edoko");
-       break;
-      default:
-       /* do nothing */
-      }
+    set_language($PREF['language']);
 
     // calculate mod by digest-time
     switch($PREF['digest'])
 
     // calculate mod by digest-time
     switch($PREF['digest'])
@@ -105,6 +91,16 @@ foreach($users as $uid)
        // get messages
        $messages = DB_get_digest_message_by_email($email);
 
        // get messages
        $messages = DB_get_digest_message_by_email($email);
 
+       // check messages for outdated ones and delete those
+       foreach ($messages as $key=>$mess)
+         {
+           if($mess[2] == 'your_turn' && $uid != DB_get_player_by_gameid($mess[3]) )
+             {
+               DB_digest_delete_message($mess[0]);
+               unset($messages[$key]);
+             }
+         }
+
        // add them together
        if(sizeof($messages))
          {
        // add them together
        if(sizeof($messages))
          {