9
$last_character = substr($_SERVER['REQUEST_URI'], -1);
if ($last_character == "/" ) {
$xoopsTpl->assign('en', $_SERVER['REQUEST_URI'].'index.php?lang=english');
$xoopsTpl->assign('es', $_SERVER['REQUEST_URI'].'index.php?lang=spanish');
$xoopsTpl->assign('fr', $_SERVER['REQUEST_URI'].'index.php?lang=french');
}
if ($last_character == "p") {
$xoopsTpl->assign('en', $_SERVER['REQUEST_URI'].'?lang=english');
$xoopsTpl->assign('es', $_SERVER['REQUEST_URI'].'?lang=spanish');
$xoopsTpl->assign('fr', $_SERVER['REQUEST_URI'].'?lang=french');
}
if ($last_character != "/" && $last_character != "p") {
$xoopsTpl->assign('en', $_SERVER['REQUEST_URI'].'&lang=english');
$xoopsTpl->assign('es', $_SERVER['REQUEST_URI'].'&lang=spanish');
$xoopsTpl->assign('fr', $_SERVER['REQUEST_URI'].'&lang=french');
}
... using this way you can change the language if the url ends in '.php', '/' or a file with variables.