Page 2 of 2

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 9:33 pm
by Termin
Hello Christoph,

Error: cms.php on line 833

Code: Select all

$r[] = $p;
Victor

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 9:48 pm
by cmb
Hello Victor,

I've forgotten a closing parentheses :oops: It should be:

Code: Select all

function languagemenu() {
    ... // same as it was
    while (($p = @readdir($fd)) == true ) {
        if (@is_dir($pth['folder']['base'].$p)) {
            if (preg_match('/^[A-z]{2}$/', $p)
                     && !in_array($p, array('my', 'pseudo', 'languages'))) // replace the strings with the names of your "special" language folders
                $r[] = $p;
        }
    }
    ... // same as it was
 
Christoph

Re: How can a website template file .htm

Posted: Sat Sep 10, 2011 9:20 am
by Termin
Hello Christoph,
cmb wrote:('my', 'pseudo', 'languages')))
When replacing the name of the "special" language of the checkboxes are not displayed.
Change two letters in the name of the "special" language:

Code: Select all

&& !in_array($p, array('ps', 'pseudo', 'languages')))

Victor

Re: How can a website template file .htm

Posted: Sat Sep 10, 2011 10:09 am
by cmb
Hello Victor,
Termin wrote:the checkboxes are not displayed.
Do you mean the country flags? :?

If you have 3 folder's you're using for special content with the names xa/, xb/, xc/, you should write:

Code: Select all

&& !in_array($p, array('xa', 'xb', 'xc')))
so these folder will not be interpreted by CMSimple as languages, and will not show up in the language menu.

Christoph

Re: How can a website template file .htm

Posted: Sat Sep 10, 2011 10:51 am
by Termin
Hello Christoph,
cmb wrote: If you have 3 folder's you're using for special content with the names xa/, xb/, xc/, you should write:
This is understandable.
cmb wrote:Do you mean the country flags? :?
Flags of the countries do not appear, this is the same as remove the function languagemenu() from the template.

Should that be was the flag of the uk and en and all.

Victor

Re: How can a website template file .htm

Posted: Sat Sep 10, 2011 11:46 am
by cmb
Hello Victor,
Termin wrote:Flags of the countries do not appear, this is the same as remove the function languagemenu() from the template.
That's strange! I have a test installation with languages en, de, fr, sk and cz. If I write:

Code: Select all

function languagemenu() {
    global $pth, $cf, $sl;
    $t = '';
    $r = array();
    $fd = @opendir($pth['folder']['base']);
    while (($p = @readdir($fd)) == true ) {
        if (@is_dir($pth['folder']['base'].$p)) {
            if (preg_match('/^[A-z]{2}$/', $p)
                && !in_array($p, array('cz', 'de')))
                $r[] = $p;
        }
    }
    var_dump($r); // this line is for debugging; remove later
    if ($fd == true)closedir($fd); if(count($r) == 0)return ''; if($cf['language']['default'] != $sl)$t .= '<a href="'.$pth['folder']['base'].'">'.tag('img src="'.$pth['folder']['flags'].$cf['language']['default'].'.gif" alt="'.$cf['language']['default'].'" title="&nbsp;'.$cf['language']['default'].'&nbsp;" class="flag"').'</a> '; $v = count($r); for($i = 0;
    $i < $v;
    $i++) {
        if ($sl != $r[$i]) {
            if (is_file($pth['folder']['flags'].'/'.$r[$i].'.gif')) {
                $t .= '<a href="'.$pth['folder']['base'].$r[$i].'/">'.tag('img src="'.$pth['folder']['flags'].$r[$i].'.gif" alt="'.$r[$i].'" title="&nbsp;'.$r[$i].'&nbsp;" class="flag"').'</a> ';
            } else {
                $t .= '<a href="'.$pth['folder']['base'].$r[$i].'/">['.$r[$i].']</a> ';
            }
        }
    }
    return ''.$t.'';
}
 
de and cz do not appear in the languagemenu, but en, fr and sk are there (without the currently selected language).

Christoph

Re: How can a website template file .htm

Posted: Sat Sep 10, 2011 1:10 pm
by Termin
Hello Christoph,

Everything turned out, thanks!

Victor

Re: How can a website template file .htm

Posted: Sat Sep 10, 2011 1:41 pm
by cmb
Hello Victor,
Termin wrote:Everything turned out, thanks!
That's fine, you're welcome. :)

But I've seen in the source code of your website that the canonical link is wrong: http://emptypixelcom.crimea.ua/?Chto_novogo_v_PHP5.

I guess you're using the canonical plugin, and it is an misunderstanding with it's help. If you want http://pixelcom.crimea.ua/ as canonical link, you have to leave the url_type empty (enter nothing) instead of entering "empty".

Christoph