1. فایل index.php را باز کنید،
2. کد زیر را پیدا کنید:
$tpl->copy_template = preg_replace ( "#\\{custom category=['\"](.+?)['\"] template=['\"](.+?)['\"] aviable=['\"](.+?)['\"] from=['\"](.+?)['\"] limit=['\"](.+?)['\"] cache=['\"](.+?)['\"]\\}#ies", "custom_print('\\1', '\\2', '\\3', '\\4', '\\5', '\\6', '{$dle_module}')", $tpl->copy_template );
با کد زیر جایگزین کنید:
$tpl->copy_template = preg_replace ( "#\\{custom category=['\"](.+?)['\"] template=['\"](.+?)['\"] aviable=['\"](.+?)['\"] from=['\"](.+?)['\"] limit=['\"](.+?)['\"] cache=['\"](.+?)['\"] groupnews=['\"](.+?)['\"]\\}#ies", "custom_print('\\1', '\\2', '\\3', '\\4', '\\5', '\\6', '{$dle_module}','\\7')", $tpl->copy_template );
3. فایل engine/modules/functions.php را بازکنید،
4. کد زیر را پیدا کنید:
function custom_print($custom_category, $custom_template, $aviable, $custom_from, $custom_limit, $custom_cache, $do)
با کد زیر جایگزین کنید:
function custom_print($custom_category, $custom_template, $aviable, $custom_from, $custom_limit, $custom_cache, $do, $groupnews)
5. فایل engine/modules/show.custom.php را باز کنید،
6. کد زیر را پیدا کنید:
while ( $row = $db->get_row( $sql_result ) ) {
در زیر آن کد زیر را قرار دهید:
$groupnews = explode(",",$groupnews);
$row2 = $db->get_row( $db->query("SELECT user_group FROM " . PREFIX . "_users WHERE name='" . $row['autor'] . "' LIMIT 0,1") );
if ( ! (in_array($row2['user_group'],$groupnews))) continue;
حالا می توانید از تگ custom بصورت زیر استفاده کنید:
{custom category="1" template="test" aviable="global" from="0" limit="3" cache="no" groupnews="3,4"}
اطلاعات