
Originally Posted by
guido2004
I don't see you use the $language, nor send an email. Perhaps it happens all in here:
includes/mailunactivated_lang.php
?
The "$language" is used for setting which "locale" a user uses... Forinstance, if a user has the locale "da_DK", the script should uses the tag "_LANG_TEST" with the lang_id as defined in the "includes/lang.php".
lang.php script:
PHP Code:
if ($language == 'da_DK') {
///// DANISH /////
$result45 = mysql_query('SELECT * FROM '.$prefix.'_lang_code WHERE lang_id=1');
while ($row45 = mysql_fetch_assoc($result45)) {
$string = $row45['string'];
define("_".$row45['tagname']."","".$string."");
}
} else {
///// ENGLISH /////
$result46 = mysql_query('SELECT * FROM '.$prefix.'_lang_code WHERE lang_id=2');
while ($row46 = mysql_fetch_assoc($result46)) {
$string = $row46['string'];
define("_".$row46['tagname']."","".$string."");
}
}
And my loop script simplyfied:
PHP Code:
$sql="SELECT * FROM ".$prefix."_users";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)){
$username = $row['username'];
$language = $row['locale'];
include ("includes/lang.php");
echo $username. '<br>';
echo ''._LANG_TEST.'<br><br>';
}
So in my user table a user could look like this:
username=test
locale=da_DK
Now if a user has "en_GB" or anything else than "da_DK" it should use the "_LANG_TEST" tag with lang_id=2.
The problem is though, if I have 3 users in my table/loop like this:
username=test1
locale=no_NO
username=test2
locale=en_GB
username=test3
locale=da_DK
The output looks like this:
test1
This is in english
test2
This is in english
test3
This is in english
Now the username "test3" should have the "_LANG_TEST" written in danish, but somehow it also comes out in english?!?!?
If the first users locale was "da_DK" all the users "_LANG_TEST" would come out in dansih, when infact the other users should be in english...
Hope this claryfies a bit, and is able to make you help me better...
Bookmarks