Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Different headers based on language  (Read 6572 times)

0 Members and 1 Guest are viewing this topic.

jsmoke

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Different headers based on language
« 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.

« Last Edit: February 15, 2007, 11:05:12 pm by Nibbler »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Different headers based on language
« Reply #1 on: February 15, 2007, 07:23:40 am »

Something like this:
Code: [Select]
<?php
if ($CONFIG['lang'] == 'japanese') {
 
// display the menu in Japanese
} else {
  
// display the default language menu
}
?>
Logged

jsmoke

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Different headers based on language
« Reply #2 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

Code: [Select]
<?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....

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

Nibbler

  • Guest
Re: Different headers based on language
« Reply #3 on: February 15, 2007, 10:42:54 pm »

Code: [Select]
<?php

global $CONFIG;

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

Logged

jsmoke

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Different headers based on language
« Reply #4 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.

Logged
Pages: [1]   Go Up
 

Page created in 0.042 seconds with 19 queries.