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: How to Change theme header image on change of language...?  (Read 9997 times)

0 Members and 1 Guest are viewing this topic.

azzu5

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
How to Change theme header image on change of language...?
« on: January 17, 2006, 08:15:45 am »

Hi All,

Iam using 1.3.5 version..

I am using 2 languages for my gallery Englsih and Arabic... Now i want to change the theme header image according to language..!

B'coz i have different header images for Arabic & English..

Please help me i how i can change those images.. ???

Thanx

Azim
« Last Edit: January 20, 2006, 06:20:26 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to Change theme header image on change of language...?
« Reply #1 on: January 17, 2006, 09:09:31 am »

you'll have to create a custom header, see http://forum.coppermine-gallery.net/index.php?topic=9863.msg44419#msg44419 and various other threads that explain this.
Logged

azzu5

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How to Change theme header image on change of language...?
« Reply #2 on: January 17, 2006, 09:59:37 am »

you'll have to create a custom header, see http://forum.coppermine-gallery.net/index.php?topic=9863.msg44419#msg44419 and various other threads that explain this.

Hi,
I have already changed gallery theme header and footer to my website theme..

But my question is i have 2 images "ar-header.jpg" and "en-header.jpg" and default language is english so i m showing "en-header.jpg" and when i 'll select labgauge as Arabic i want to show "ar-header.jpg"

As in the url i m not always getting "lang=English or Arabaic" variable so i could use it show the proper images..!

I tried to solve this way but it dont knwo that much...help me.

template.html: Inserted this code on the page top
Code: [Select]
{MY_HEADER}
theme.php:
Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    header("Content-Type: text/html; charset=$charset");
    user_save_profile();

Now i want some code here to know what is my current langauge......something like this

Code: [Select]

// Store current languge in this variable
$current_language= ????????????;

if ($current_language=="English")
{
       //Set Arabic Header
       $my_header_img = "ar_header.jpg";
}
else
{
       //Set English Header
      $my_header_img = "en_header.jpg";
}


Now i can send this filename to template.htm

Code: [Select]

$template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
'{MY_HEADER}' => $my_header_img,
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{MAIN_MENU}' => theme_main_menu(),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        );

    echo template_eval($template_header, $template_vars);
}

Now here i want only one value somehaw
Code: [Select]
$current_language= ?????????;

I dont know whether i m right or not but pls tell me how to solve this..

thankx,

Azim

« Last Edit: January 17, 2006, 10:18:45 am by azzu5 »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to Change theme header image on change of language...?
« Reply #3 on: January 17, 2006, 10:13:22 am »

you'll have to do as I suggested and then add an if/then switch that checks the user's selected language. Check for $USER['lang']
Logged

azzu5

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How to Change theme header image on change of language...?
« Reply #4 on: January 17, 2006, 10:32:50 am »

i am not getting any value in this $USER['lang']   ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to Change theme header image on change of language...?
« Reply #5 on: January 17, 2006, 10:37:41 am »

did you make $USER global?
Logged

azzu5

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How to Change theme header image on change of language...?
« Reply #6 on: January 17, 2006, 10:51:01 am »

Ok now i got the value

But still there is something wrong..

Now when i changed language from Dropdown selection..... in $USER['lang'] only "english" value is showing not arabic or any other.

Ho wi'll know current language after changing from dropdown list..

Regards,
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to Change theme header image on change of language...?
« Reply #7 on: January 17, 2006, 11:02:47 am »

try $_GET['lang']
Logged

azzu5

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How to Change theme header image on change of language...?
« Reply #8 on: January 17, 2006, 11:21:14 am »

Geting only once after selecting from dropdown

/gallery/thumbnails.php?album=lastcom&cat=0&lang=english

but when i go to another page

/gallery/thumbnails.php?album=lastup&cat=0

"lang=" is not there in the url...!

where is the languge is stored..? in the cookies..?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to Change theme header image on change of language...?
« Reply #9 on: January 18, 2006, 12:53:20 am »

where is the languge is stored..? in the cookies..?
yes
Logged

azzu5

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How to Change theme header image on change of language...?
« Reply #10 on: January 18, 2006, 01:53:24 pm »

I checked the cookies also..but i think that is also encrypted..cant acces that..! :(

is there any way to solve my problem..pls

thankx
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to Change theme header image on change of language...?
« Reply #11 on: January 19, 2006, 04:57:16 pm »

I don't have the coppermine source code available at the computer I'm typing this reply at. I suggest you review the vars and constants defined in include/init.inc.php, there should be one that holds the language. Maybe you'll need to add another if/then switch that checks if the user has chosen a custom language and fallback to the default language if he hasn't.
Logged

azzu5

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How to Change theme header image on change of language...?
« Reply #12 on: January 20, 2006, 05:18:20 pm »

Hi GauGau,

Finally my problem is Solved  :)

$USER['lang'] is saving changed language name...

I was getting this value only once..so when i got this value i saved it to the own cookies and then retrived it in theme.php and sent it to template.php and it works fine...

Thanx for your all support and such beatiful gallery..

Cheers  :-*
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.