Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
<?xml version="1.0" encoding="utf-8"?>
<dleplugin>
<name>Category-count SQL optimize by Sander</name>
<description>Кеширование счетчика количества новостей для построения постраничной навигации
https://sandev.pro/web/141-optimizaciya-dle.html</description>
<icon></icon>
<version>1.1</version>
<dleversion></dleversion>
<versioncompare>less</versioncompare>
<upgradeurl></upgradeurl>
<filedelete>0</filedelete>
<needplugin></needplugin>
<mnotice>0</mnotice>
<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>
<notice><![CDATA[]]></notice>
<file name="engine/modules/show.short.php">
<operation action="before">
<searchcode><![CDATA[ $count_all = $db->super_query( $sql_count );]]></searchcode>
<replacecode><![CDATA[ $sql_count_cache = dle_cache('news_select-count');
if ($sql_count_cache !== false) {
$count_cache = json_decode($sql_count_cache, true);
} else {
$count_cache = [];
}
$cache_hash = md5($sql_count);
if (!is_null($count_cache[$cache_hash])) {
$count_all = (int)$count_cache[$cache_hash];
} else {]]></replacecode>
<searchcount>1</searchcount>
</operation>
<operation action="after">
<searchcode><![CDATA[ $count_all = $count_all['count'];]]></searchcode>
<replacecode><![CDATA[ $count_cache[$cache_hash] = (int)$count_all;
create_cache('news_select-count', json_encode($count_cache));
}]]></replacecode>
</operation>
</file>
</dleplugin>