Skip to content

Commit

Permalink
Исправлен вывод описания к плагину. Добавлена ссылка на проверку верс…
Browse files Browse the repository at this point in the history
…ии плагина
  • Loading branch information
TCSE committed May 5, 2020
1 parent 59831fd commit 62da252
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions AMP4DLE_tcse.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<name>AMP4DLE_tcse</name>
<description>Модуль AMP для DLE by TCSE.</description>
<icon>engine/skins/images/amp4dle.png</icon>
<version>1.0.1</version>
<version>1.0.2</version>
<dleversion>14.0</dleversion>
<versioncompare>greater</versioncompare>
<upgradeurl></upgradeurl>
<upgradeurl>https://online.tcse-cms.com/plugins/amp4dle/check-amp4dle.php</upgradeurl>
<filedelete>1</filedelete>
<needplugin></needplugin>
<mnotice>1</mnotice>
Expand All @@ -28,11 +28,9 @@
<hr>
<h2>Установка</h2>
В .htaccess в корне сайта, ищем в нем код
<pre>RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html$</pre>
<pre style="white-space: inherit">RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html$</pre>
<b>ВЫШЕ</b> вставляем код
<pre>
<pre style="white-space: inherit">
# AMP4DLE_tcse
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)/amp.html$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4&amp=1 [L]
RewriteRule ^([^.]+)/([0-9]+)-(.*)/amp.html$ index.php?newsid=$2&seourl=$3&seocat=$1&amp=1 [L]
Expand All @@ -42,7 +40,6 @@ RewriteRule ^([0-9]+)-(.*)/amp.html$ index.php?newsid=$1&seourl=$2&amp=1 [L]
<h2>Настройка</h2>
У вас есть 2 файла в папке с вашим шаблоном - amp.tpl и custom/amp/amp-fullstory.tpl
В них настраиваем внешний вид ваших amp страниц.
Какие теги можно использовать в amp.tpl и custom/amp/amp-fullstory.tpl:
{full-link} - ссылка на полную новость
[full-link]..[/full-link] - текст между тегами станет ссылкой на полную новость
Expand All @@ -57,34 +54,30 @@ RewriteRule ^([0-9]+)-(.*)/amp.html$ index.php?newsid=$1&seourl=$2&amp=1 [L]
{link-category} - ссылки на категории новости
{site-name} - имя сайта с настроек
{site-url} - полный адрес сайта
{THEME} - адрес сайта с приставкой /templates/ваша_тема]]></notice>
<file name="engine/engine.php">
<operation action="before">
<searchcode><![CDATA[if ($canonical) {]]></searchcode>
{THEME} - адрес сайта с приставкой /templates/ваша_тема]]></notice>
<file name="engine/engine.php">
<operation action="before">
<searchcode><![CDATA[if ($canonical) {]]></searchcode>
<replacecode><![CDATA[if ($subaction == "showfull") {
$metatags .= <<<HTML
<link rel="canonical" href="{$full_link}">
HTML;
$metatags .= <<<HTML
<link rel="amphtml" href="{$amp_link}">
HTML;
};]]></replacecode>
</operation>
</file>
<file name="engine/modules/show.full.php">
<operation action="after">
<searchcode><![CDATA[elseif( $category_id and $cat_info[$category_id]['full_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['full_tpl'] . '.tpl' );]]></searchcode>
<replacecode><![CDATA[elseif ( isset( $_GET["amp"] ) && intval( $_GET["amp"] ) == 1 ) include_once (DLEPlugins::Check(ENGINE_DIR . '/modules/amp.php'));]]></replacecode>
</operation>
<operation action="after">
<searchcode><![CDATA[$tpl->set( '{full-story}', $row['full_story'] );]]></searchcode>
};]]></replacecode>
</operation>
</file>
<file name="engine/modules/show.full.php">
<operation action="after">
<searchcode><![CDATA[elseif( $category_id and $cat_info[$category_id]['full_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['full_tpl'] . '.tpl' );]]></searchcode>
<replacecode><![CDATA[elseif ( isset( $_GET["amp"] ) && intval( $_GET["amp"] ) == 1 ) include_once (DLEPlugins::Check(ENGINE_DIR . '/modules/amp.php'));]]></replacecode>
</operation>
<operation action="after">
<searchcode><![CDATA[$tpl->set( '{full-story}', $row['full_story'] );]]></searchcode>
<replacecode><![CDATA[$amp_link = $short_link . $news_name . "/amp.html";
$tpl->set('{amp_link}', $amp_link);]]></replacecode>
</operation>
$tpl->set('{amp_link}', $amp_link);]]></replacecode>
</operation>
</file>
</dleplugin>
</dleplugin>

0 comments on commit 62da252

Please sign in to comment.