Новости Joomla

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

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 3.0.7.9

Автор akteon25

Ответов: 1
Просмотров: 726
Последний ответ 21.02.2025, 12:41:06
от NewUsers
152-ФЗ jcomments электронная почта комментатора

Автор basn

Ответов: 1
Просмотров: 739
Последний ответ 12.02.2025, 12:01:20
от basn
Как отключить капчу в jcomments 4?

Автор Алено4ка

Ответов: 1
Просмотров: 1719
Последний ответ 02.08.2024, 20:53:02
от ProtectYourSite
Вышла новая версия JComments Fork 4.0.16

Автор ProtectYourSite

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

Автор ruslan13

Ответов: 10
Просмотров: 3913
Последний ответ 07.12.2023, 20:08:31
от Missile