Page 11 of 21

Re: Clean URLs

Posted: Tue Jun 24, 2014 2:10 pm
by cmb
Maxim wrote:Не хочу дублировать одни и те же буквы.
If you want to use $cf['uri']['lowercase']="", you have to.

See also an alternative solution that delivers nice URLs (at least for some languages) without the need for urichar_org/new.

URLify.php

Posted: Wed Jun 25, 2014 5:27 am
by Maxim
Доброе утро.

[ external image ] Получилось, но URLify.php наверно больше памяти занимает. Наверно Urichar (org/new) лучше.
[ external image ] Es passiert ist, aber URLify.php wahrscheinlich mehr Speicher belegt. Wahrscheinlich Urichar (org/new) besser.
[ external image ] Turned out, but URLify.php probably more memory is. Probably Urichar (org/new) better.

Помогите добавить ".html" и удалить "?"

Posted: Mon Jan 26, 2015 10:18 am
by Maxim
Помогите добавить ".html" и удалить "?"
Help add ".html" and delete "?"

Code: Select all

<link rel="prev" href="/cmsimplexh/?menu-levels-and-headings/menu-level-2-page-1">
<link rel="next" href="/cmsimplexh/?menu-levels-and-headings/menu-level-2-page-1/menu-level-3-page-2">
<link rel="canonical" href="http://localhost/cmsimplexh/menu-levels-and-headings/menu-level-2-page-1/menu-level-3-page-1">
<td class="previous"><a href="/cmsimplexh/menu-levels-and-headings/menu-level-2-page-1.html?" rel="prev">« prev</a></td>
<td class="next"><a href="/cmsimplexh/menu-levels-and-headings/menu-level-2-page-1/menu-level-3-page-2.html?" rel="next">next »</a></td>
CleanURLs 1.6.5:
maxim-full-cmsimple-xh-165-cleanurls-20154c60df546305.zip
maxim-addon-cmsimple-xh-165-cleanurls-2054c60e073f045.zip
maxim-config-cmsimple-xh-165-cleanurls-254c60e13a638b.zip
maxim-bkr-cmsimple-xh-165-cleanurls-201554c60e1d4c739.zip

Снимки экрана:
Screenshots:
1html54c6117f66502.png
2html54c6118811a03.png

http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html

"prev" и "next"

Posted: Mon Jan 26, 2015 2:54 pm
by Maxim
"prev"
tplfuncs.php
Меняем эту строчку:

Code: Select all

return tag('link rel="prev" href="' . $sn . '?' . $u[$index] . '"');
На эту:

Code: Select all

return tag('link rel="prev" href="' . $sn . $u[$index] . '.html"');
"next"
Меняем эту строчку:

Code: Select all

return tag('link rel="next" href="' . $sn . '?' . $u[$index] . '"');
На эту:

Code: Select all

return tag('link rel="next" href="' . $sn . $u[$index] . '.html"');
"canonical"
userfuncs.php
Меняем эту строчку:

Code: Select all

. htmlspecialchars($url, ENT_COMPAT, 'UTF-8') . '"') . "\n";
На эту:

Code: Select all

. htmlspecialchars($url, ENT_COMPAT, 'UTF-8') . '.html"') . "\n";
"previous"
tplfuncs.php
Меняем эти строки:

Code: Select all

function previouspage()
{
    global $tx;

    $index = XH_findPreviousPage();
    if ($index !== false) {
        return a($index, '" rel="prev') . $tx['navigator']['previous'] . '</a>';
    }
}
На эти (1.6.2):

Code: Select all

function previouspage()
{
    global $s, $cl, $tx;

    for ($i = $s - 1; $i > -1; $i--) {
        if (!hide($i)) {
            return a($i, '') . $tx['navigator']['previous'] . '</a>';
        }
    }
}
"next"
Меняем эти строки:

Code: Select all

function nextpage()
{
    global $tx;

    $index = XH_findNextPage();
    if ($index !== false) {
        return a($index, '" rel="next') . $tx['navigator']['next'] . '</a>';
    }
}
На эти (1.6.2):

Code: Select all

function nextpage()
{
    global $s, $cl, $tx;

    for ($i = $s + 1; $i < $cl; $i++) {
        if (!hide($i)) {
            return a($i, '') . $tx['navigator']['next'] . '</a>';
        }
    }
}

Re: Clean URLs

Posted: Tue Mar 03, 2015 1:17 pm
by cmb
I received a support request regarding failing page internal links when using clean URLs, e.g. something like the following will not work correctly:

Code: Select all

<a href="#anchor">see below</a> 
The following addition to cmsimple/userfuncs.php is supposed to fix this issue:

Code: Select all

/*
 * Fix links to anchors on same page.
 */
if (!(XH_ADM && $edit)) {
    $i = $s > -1 ? $s : 0;
    $c[$i] = preg_replace(
        '/<a([^>]*)href="?#(.*)"?/',
        '<a$1href="' . $su . '#$2"',
        $c[$i]
    );
} 

Re: Clean URLs

Posted: Tue May 05, 2015 9:34 pm
by wsim123
cmb wrote:I received a support request regarding failing page internal links when using clean URLs, e.g. something like the following will not work correctly:

Code: Select all

<a href="#anchor">see below</a>
The following addition to cmsimple/userfuncs.php is supposed to fix this issue:

Code: Select all

/*
 * Fix links to anchors on same page.
 */
if (!(XH_ADM && $edit)) {
    $i = $s > -1 ? $s : 0;
    $c[$i] = preg_replace(
        '/<a([^>]*)href="?#(.*)"?/',
        '<a$1href="' . $su . '#$2"',
        $c[$i]
    );
}
-------------------------------------------------------------------------------
Dies ist zwar keine Anschlussfrage aber auch zu Clean Urls.

Ich habe die Maxim-Version beiseite gelegt und die deutsche Version installiert (ohne .htaccess im root)

In der Sprachdatei habe ich Ä|Ö|Ü|ä|ö|ü|ß|&|&|--| durch Ae|Oe|Ue|ae|oe|ue|ss|||-| ersetzt
und habe jetzt nur noch das Fragezeichen nach der Basisurl. Gibt es eine einfache Methode dieses zu beseitigen ?

Re: Clean URLs

Posted: Tue May 05, 2015 9:44 pm
by cmb
wsim123 wrote:und habe jetzt nur noch das Fragezeichen nach der Basisurl. Gibt es eine einfache Methode dieses zu beseitigen ?
Nein. Die "Beseitigung des Fragezeichens" ist genau das, was die Clean-URL-Lösung macht (oder versucht zu machen). Ich hoffe nach wie vor, dass zumindest der grundlegende (optionale) Support für clean URLs in XH 1.7 Einzug halten wird. Das spart Maxim die Arbeit immer wieder die entsprechenden Anpassungen vorzunehmen, und dürfte auch die entsprechende Unterstützung durch Plugins vorantreiben.

Re: Clean URLs

Posted: Wed Jan 20, 2016 6:20 am
by Maxim
cmb wrote:
Maxim wrote:Настройки" > "CMS" > "Show homepage" - не меняется.
Indeed. We will hopefully address this issue in CMSimple_XH 1.6.2. For now you can use (space instead of underscore):

Code: Select all

$mtx['show homepage']="Startseite anzeigen";
Maxim wrote:Не везде нужно переводить и в "Настройки > CMS" и в "Настройки > Язык"
К примеру:
\cmsimple\languages\metaru.php

Code: Select all

$mtx['images']="Изображения";
$mtx['language']="Язык";
I'm not sure if I understand you correctly. If some translations are not necessary, they can be skipped completely (just remove the lines from metaXY.php). If more translations are needed, they can be inserted to the file. However, I'm still not sure, if the translation capabilities are fine grained enough; it might be necessary to translate certain words differently in different contexts.
Maxim wrote:Я только начал переводить, не много могу сказать.
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html
Thanks. I hope you'll find some time to finish the translation. :)

Re: Clean URLs

Posted: Fri Mar 11, 2016 10:13 am
by Nicky
Hi there, is this a manual how to create Clean URLs? I'm very interested as well, but unfortunately it seems to contain a lot of Russian characters, which I can't read.. :?

Does the file exist in English (or French, German) somewhere?

Thanks in advance.

Re: Clean URLs

Posted: Fri Mar 11, 2016 1:14 pm
by Nicky