Данный хак добавит два тега
НИЖЕ вставляем
Вот и все. Теперь сможете использовать в fullstory.tpl вышеописанные теги.
Установка простая, открываем engine/modules/show.full.php и ищем САМЫЙ ПЕРВЫЙ встречающийся код[commented]Вы оставляли комментарий к этому фильму[/commented]
[not-commented]Вы не оставляли комментарий к этому фильму[/not-commented]
PHP:
$tpl->compile( 'content' );
PHP:
if ( $is_logged ) {
$comm_news = $db->super_query("SELECT COUNT(id) as count FROM " . PREFIX . "_comments WHERE user_id = '{$member_id['user_id']}' AND post_id = '{$newsid}'");
$comm_news = $comm_news['count'];
if ( $comm_news > 0 ) {
$tpl->result['content'] = preg_replace( "#\[commented\](.+?)\[/commented\]#ims", "$1", $tpl->result['content'] );
$tpl->result['content'] = preg_replace( "#\[not-commented\](.+?)\[/not-commented\]#ims", "", $tpl->result['content'] );
} else {
$tpl->result['content'] = preg_replace( "#\[commented\](.+?)\[/commented\]#ims", "", $tpl->result['content'] );
$tpl->result['content'] = preg_replace( "#\[not-commented\](.+?)\[/not-commented\]#ims", "$1", $tpl->result['content'] );
}
} else {
$tpl->result['content'] = preg_replace( "#\[commented\](.+?)\[/commented\]#ims", "", $tpl->result['content'] );
$tpl->result['content'] = preg_replace( "#\[not-commented\](.+?)\[/not-commented\]#ims", "$1", $tpl->result['content'] );
}