How can a website template file .htm

Please post answers on the most frequently asked questions about CMSimple
Termin
Posts: 101
Joined: Thu Jan 27, 2011 8:55 am
Contact:

Re: How can a website template file .htm

Post by Termin » Fri Sep 09, 2011 9:33 pm

Hello Christoph,

Error: cms.php on line 833

Code: Select all

$r[] = $p;
Victor

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: How can a website template file .htm

Post by cmb » Fri Sep 09, 2011 9:48 pm

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
Christoph M. Becker – Plugins for CMSimple_XH

Termin
Posts: 101
Joined: Thu Jan 27, 2011 8:55 am
Contact:

Re: How can a website template file .htm

Post by Termin » Sat Sep 10, 2011 9:20 am

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

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: How can a website template file .htm

Post by cmb » Sat Sep 10, 2011 10:09 am

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
Christoph M. Becker – Plugins for CMSimple_XH

Termin
Posts: 101
Joined: Thu Jan 27, 2011 8:55 am
Contact:

Re: How can a website template file .htm

Post by Termin » Sat Sep 10, 2011 10:51 am

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

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: How can a website template file .htm

Post by cmb » Sat Sep 10, 2011 11:46 am

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
Christoph M. Becker – Plugins for CMSimple_XH

Termin
Posts: 101
Joined: Thu Jan 27, 2011 8:55 am
Contact:

Re: How can a website template file .htm

Post by Termin » Sat Sep 10, 2011 1:10 pm

Hello Christoph,

Everything turned out, thanks!

Victor

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: How can a website template file .htm

Post by cmb » Sat Sep 10, 2011 1:41 pm

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
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply