Your forgot to edit usergroupids. Please follow me:
PHP Code:
if ($action=="changelanguage") {
include("./global.php");
if ($bbuserinfo['usergroupid']=='YYY' AND $language='en')
{
$DB_site->query("UPDATE user SET usergroupid=XXX, styleid=ZZZ WHERE userid=$bbuserinfo[userid]");
}
if ($bbuserinfo['usergroupid']=='XXX' AND $language='ar')
{
$DB_site->query("UPDATE user SET usergroupid=YYY, styleid=WWW WHERE userid=$bbuserinfo[userid]");
}
$goto="index.php?s=$session[sessionhash]";
eval("standardredirect(\"".gettemplate("language_changed")."\",\"$goto\");");
}
and
PHP Code:
if ($bbuserinfo['usergroupid']=='XXX') {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=en">English</a> ';}
elseif ($bbuserinfo['usergroupid']=='YYY') {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=ar">Arabic</a> ';}
In the codes above:
All XXX will be replaced with the usergroupid of the English users
All YYY will be replaced with the usergroupid of the Arabic users
All ZZZ will be replaced with the styleid of the English styleset
All WWW will be replaced with the styleid of the Arabic styleset
If you dont know how to find usergroup ids
this should help..