EzPortal - Portal Software for Forums
EzPortal Forums => ezBlocks => Topic started by: DenDen66 on April 14, 2016, 07:44:15 am
-
I have one forum that is trilangual.
I want some blocks to appear on the basis of the language that is presently used by SMF.
IF the language is French, then block A will appear., if it is English, then block B will appear and finally if is Spanish then Block C will appear.
Now I understand that it could also be the same block showing different part of its content depending on the language of SMF.
Is this possible? As anyone ever done this before?
-
Not currently possible
-
What would it take?
-
A good amount of coding if I were to add this as an option to ezportal. You can probably write a custom php script that checks the user language that optouts the current block content based on the users language.
-
You can probably write a custom php script that checks the user language that optouts the current block content based on the users language.
That is what I was trying to express earlier on, when I asked if it was possible. I was thinking of creating a php block.
How would I do this? Would I need three different PHP block or just one.
-
Just one block use $user_info['language']
-
Thank you. I will try this.
-
Not currently possible
Curious, can't you put php inside block ? say like $txt['side_block_language'] then define it inside index.<language>.php that'll change its content for every different language?
-
This is how the problem was solved:
if(isset($_POST['language']) && $_POST['language'] == 'french-utf8' || $_SESSION['language'] == 'french-utf8'){
echo '
';
}
elseif($_POST['language'] == 'spanish_es-utf8' || $_SESSION['language'] == 'spanish_es-utf8')
{
echo '
}
else
{
echo '
';
}
-
Good tip!