SimplePortal
Customization => Custom Coding => Topic started by: solarsailor on March 19, 2017, 08:45:41 AM
-
Hello, people!
I have some little question.
Sorry for my english and 'amazing' php knowledge ;)
I need to put one page to another, like [SiNaN] made it for blocks (http://simpleportal.net/index.php?topic=5332.msg32204;topicseen#msg32204).
My site has 2 languages. I want to make About-page, but with changeable content inside. If user switch language to english - About-page will be in english too.
So, as i understand, i need to make two BBC pages: aboutEN (with english text) and aboutRU (with russian text). Then i need a php page with code like this:
global $context;
if ($context['user']['language'] == 'russian-utf8')
// output russian page
if ($context['user']['language'] == 'english')
// output english page
What code should i put after IF condition to display the page i need?
-
It may be easier to do just one PHP page and:
global $context;
$about_page = array(
'english' => 'This is the content of the about page in English',
'russian-utf8' => 'This is the content of the about page in Russian'
);
if (isset($about_page[$context['user']['language']]))
{
$about_language = $context['user']['language'];
}
else
{
$about_language = 'english';
}
echo parse_bbc($about_page[$about_language]);
-
Thank you so much!