Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 0 Ответов
  • 4533 Просмотров
*

smart

  • Администратор
  • 6478
  • 1318 / 15
  • Хочешь сделать хорошо — сделай!
JComments в модуле Newsflash
« : 24.07.2009, 23:21:14 »
Так, небольшое решение подкину, а уж внешний вид, думаю и сами настроите.

1. Открываем файл /modules/mod_newsflash/tmpl/default.php и после  строчки:

Код: php
$item		= $list[$flashnum];
добавляем:
Код: php
$comments = JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
require_once (JCOMMENTS_HELPERS . DS . 'contentplugin.php');
if (JCommentsContentPluginHelper::checkCategory($item->catid)) {
$item->comments = JComments::getCommentsCount($item->id, 'com_content');
}
}

2. Открываем файл /modules/mod_newsflash/tmpl/vert.php и перед строчкой:

Код: php
modNewsFlashHelper::renderItem($list[$i], $params, $access);
добавляем:
Код: php
$comments = JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
require_once (JCOMMENTS_HELPERS . DS . 'contentplugin.php');
if (JCommentsContentPluginHelper::checkCategory($list[$i]->catid)) {
$list[$i]->comments = JComments::getCommentsCount($list[$i]->id, 'com_content');
}
}

3. Открываем файл /modules/mod_newsflash/tmpl/horiz.php и после строчки:

Код: php
	<?php foreach ($list as $item) : ?>
добавляем:
Код: php
<?php $comments = JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
require_once (JCOMMENTS_HELPERS . DS . 'contentplugin.php');
if (JCommentsContentPluginHelper::checkCategory($item->catid)) {
$item->comments = JComments::getCommentsCount($item->id, 'com_content');
}
}?>

4. Открываем файл /modules/mod_newsflash/tmpl/_item.php и после кода:

Код: php
       <?php if (isset($item->linkOn) && $item->readmore && $params->get('readmore')) :
     echo '<a class="readmore" href="'.$item->linkOn.'">'.$item->linkText.'</a>';
        endif; ?>
добавляем:
Код: php
       <?php if (isset($item->linkOn) && isset($item->comments)) :
     echo ($item->comments ? ('Comments (<a class="readmore" href="'.$item->linkOn.'#comments">'.$item->comments.'</a>)') : ('<a class="readmore" href="'.$item->linkOn.'#addcomment">Add comment</a>'));
        endif; ?>

Вот собственно и все... Реквизиты для благодарностей у меня в подписи...
« Последнее редактирование: 25.07.2009, 15:35:18 от smart »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Вышла новая версия JComments Fork 4.0.16

Автор ProtectYourSite

Ответов: 79
Просмотров: 10130
Последний ответ 05.02.2024, 23:50:16
от ProtectYourSite
У Jcomments есть аналоги?

Автор ruslan13

Ответов: 10
Просмотров: 2274
Последний ответ 07.12.2023, 20:08:31
от Missile
JComments 3.0.7 в Joomla 3.10.12

Автор rezchik

Ответов: 2
Просмотров: 803
Последний ответ 05.10.2023, 21:44:08
от rezchik
JComments 3.0.7 в Joomla 3.10.12

Автор rezchik

Ответов: 1
Просмотров: 687
Последний ответ 02.10.2023, 22:24:45
от sivers
Модуль JComments Latest

Автор smart

Ответов: 574
Просмотров: 333217
Последний ответ 05.07.2023, 16:42:32
от sertlan