Code: Select all
$sql = $db->sql_query("SELECT * FROM ".$prefix."_lang_code WHERE lang_id=2");
while ($row = $db->sql_fetchrow($sql)) {
define("_".$row['tagname']."","".$row['string']."");
echo 'Tagname: _'.$row['tagname'].' | Text: '.$row['string'].'<br>';
}I want it to choose which lang_id it should use depending on first, if a cookie is active with the preferred language like this:
Code: Select all
$cookie_read = explode("|", base64_decode($user));
//define variables to hold cookie values.
$userid = $cookie_read[0];
$language = $cookie_read[6];Code: Select all
$browser_lang = strtolower( $_SERVER["HTTP_ACCEPT_LANGUAGE"] );I have a db table (".$prefix."_lang_languages) with the installed language with these fields(id, lang_long, lang_short) where the lang_short field is the field that matches the browser lang id (en, de, da, se, etc...)
Can this be done and if yes... how? Hope somebody can help or guide me in the right direction