coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: scohen125 on January 18, 2012, 02:06:17 AM

Title: Language flags only on homepage
Post by: scohen125 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.
Title: Re: Language flags only on homepage
Post by: ΑndrĂ© on January 18, 2012, 01:53:43 PM
Open include/functions.inc.php, find
    if ($gallery_pos) {
        $template    = str_replace('{LANGUAGE_SELECT_FLAGS}', languageSelect('flags'), $template);
    }

and replace with
    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).
Title: Re: Language flags only on homepage
Post by: scohen125 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}

Title: Re: Language flags only on homepage
Post by: ΑndrĂ© on January 21, 2012, 11:05:17 AM
Oops, use that code:
    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);
        }
    }
Title: Re: Language flags only on homepage
Post by: scohen125 on January 22, 2012, 12:49:08 AM
Perfect - thanks.  I think my site looks much better now.  I appreciate your help.