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: Language flags only on homepage  (Read 2563 times)

0 Members and 1 Guest are viewing this topic.

scohen125

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 100
    • Retina Gallery
Language flags only on homepage
« on: January 18, 2012, 02:06:17 am »

I have added the language flags token to my homepage using the curves theme and adding the token {LANGUAGE_SELECT_FLAGS} just above {MESSAGE_BLOCK} in the file template.html .

www.RetinaGallery.com

I'd like it to show only on the homepage and not on all subsequent album or category pages clicked.
It seems like the site visitor can choose his or her language once and then use the site without the flags appearing on each page.  This would save some space on the top of each page and make the website look cleaner.  I appreciate any help with this.  Thanks.

I've attached my template.html file.
Thank you and Happy New Year.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Language flags only on homepage
« Reply #1 on: January 18, 2012, 01:53:43 pm »

Open include/functions.inc.php, find
Code: [Select]
    if ($gallery_pos) {
        $template    = str_replace('{LANGUAGE_SELECT_FLAGS}', languageSelect('flags'), $template);
    }
and replace with
Code: [Select]
    if ($gallery_pos) {
        global $CPG_PHP_SELF;
        $superCage = Inspekt::makeSuperCage();
        if ($CPG_PHP_SELF == 'index.php' && !$superCage->get->keyExists('cat')) {
            $template    = str_replace('{LANGUAGE_SELECT_FLAGS}', languageSelect('flags'), $template);
        }
    }
(not tested).
Logged

scohen125

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 100
    • Retina Gallery
Re: Language flags only on homepage
« Reply #2 on: January 20, 2012, 11:59:25 pm »

I think this is close.
I upgraded coppermine to 1.5.18 (with some trepidation) and then did the revision you posted.

You can go the site www.RetinaGallery.com

On pages other than the homepage, instead of showing the actual language flags, the website shows the text with brackets:
{LANGUAGE_SELECT_FLAGS}

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Language flags only on homepage
« Reply #3 on: January 21, 2012, 11:05:17 am »

Oops, use that code:
Code: [Select]
    if ($gallery_pos) {
        global $CPG_PHP_SELF;
        $superCage = Inspekt::makeSuperCage();
        if ($CPG_PHP_SELF == 'index.php' && !$superCage->get->keyExists('cat')) {
            $template    = str_replace('{LANGUAGE_SELECT_FLAGS}', languageSelect('flags'), $template);
        } else {
            $template    = str_replace('{LANGUAGE_SELECT_FLAGS}','', $template);
        }
    }
Logged

scohen125

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 100
    • Retina Gallery
Re: Language flags only on homepage
« Reply #4 on: January 22, 2012, 12:49:08 am »

Perfect - thanks.  I think my site looks much better now.  I appreciate your help. 
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.