coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 language => Topic started by: jsmoke on February 14, 2007, 11:50:24 PM

Title: Different headers based on language
Post by: jsmoke on February 14, 2007, 11:50:24 PM
I tried searching the forums to see how to do this, but I wasn't successful, so here goes...

I'm working on a dual language site for my friend who runs bike tours in Japan.  I've got it set up with different pages for each language, and 2 menus (one for each in english and japanese).  How can I feed the correct menu to the header in Coppermine based on the language?   I figure there must be a way to configure the include for the header to use the language variable, but I'm not quite sure how.

Title: Re: Different headers based on language
Post by: Joachim Müller on February 15, 2007, 07:23:40 AM
Something like this:
<?php
if ($CONFIG['lang'] == 'japanese') {
 
// display the menu in Japanese
} else {
  
// display the default language menu
}
?>
Title: Re: Different headers based on language
Post by: jsmoke on February 15, 2007, 10:38:18 PM
Hmmmmm.....I guess I'm putting that code in the wrong place.

I was planning on using the {CUSTOM_HEADER} to place the code.   I've tried

<?php
if ($CONFIG('lang') == 'japanese') {
// display Japanese menu
include ('../includes/menu-j.html')
} else {
// display English
include ('../includes/menu.html')
}
?>


and I get the following....


Parse error: syntax error, unexpected '}' in /home/freeride/public_html/gallery/include/menus.php on line 5


Title: Re: Different headers based on language
Post by: Nibbler on February 15, 2007, 10:42:54 PM

<?php

global $CONFIG;

if (
$CONFIG('lang') == 'japanese') {
// display Japanese menu
include '../includes/menu-j.html';
} else {
// display English
include '../includes/menu.html';
}
?>

Title: Re: Different headers based on language
Post by: jsmoke on February 15, 2007, 10:54:16 PM
Shoot, I just figured it out on my own.  Forgot the line terminator.

Thanks, works like a charm.