<?xml version="1.0" encoding="utf-8"?>
<dleplugin>
<name>Leech Tag</name>
<description>by https://lazydev.pro/</description>
<icon></icon>
<version>1.0</version>
<dleversion>13.0</dleversion>
<versioncompare>greater</versioncompare>
<upgradeurl></upgradeurl>
<filedelete>0</filedelete>
<needplugin></needplugin>
<mysqlinstall><![CDATA[]]></mysqlinstall>
<mysqlupgrade><![CDATA[]]></mysqlupgrade>
<mysqlenable><![CDATA[]]></mysqlenable>
<mysqldisable><![CDATA[]]></mysqldisable>
<mysqldelete><![CDATA[]]></mysqldelete>
<phpinstall><![CDATA[]]></phpinstall>
<phpupgrade><![CDATA[]]></phpupgrade>
<phpenable><![CDATA[]]></phpenable>
<phpdisable><![CDATA[]]></phpdisable>
<phpdelete><![CDATA[]]></phpdelete>
<file name="engine/modules/main.php">
<operation action="before">
<searchcode><![CDATA[echo $tpl->result['main'];]]></searchcode>
<replacecode><![CDATA[include (DLEPlugins::Check(ENGINE_DIR . '/modules/link.php'));]]></replacecode>
</operation>
</file>
<file name="engine/modules/link.php">
<operation action="create">
<replacecode><![CDATA[<?php
/**
* Тег, [leech], скрытия ссылок в шаблонах
*
* @link https://lazydev.pro/
* @author LazyDev <email@lazydev.pro>
**/
include_once (DLEPlugins::Check(ENGINE_DIR . '/classes/parse.class.php'));
$parse = new ParseFilter();
$tpl->result['main'] = preg_replace_callback(
"#\\[leech=(.+?)\\](.*?)\\[/leech\\]#umis",
function($pregArray) use ($parse) {
return $parse->build_url([ 1 => 'leech', 2 => $pregArray[1], 3 => $pregArray[2]]);
},
$tpl->result['main']
);
]]></replacecode>
</operation>
</file>
</dleplugin>