Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: Simple question about number of topics
Pages: [1]   Go Down
  Print  
Author Topic: Simple question about number of topics  (Read 1824 times)
0 Members and 2 Guests are viewing this topic.
7weight
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« on: May 13, 2010, 01:56:42 »

i've been trying to configure a script to simply display the number of comments in a content item. the file that i'd like for the number to display in is:
/components/com_content/views/article/tmpl/default.php

any suggestions? i searched the forums and read the developer's support docs, but i'm not a proficient php developer, yet.

thanks in advance.
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: May 13, 2010, 02:05:33 »

Why not use for that the JComments content plugin?
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
7weight
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #2 on: May 13, 2010, 03:36:24 »

Why not use for that the JComments content plugin?

that could work. what i'm doing is putting the articles content into one tab, and the comments and comment form into another tab. i'd like for the total number of comments to be displayed in the comments tab label.  is there a pre-written script that will display the number of comments that i can insert in the article tmpl file?
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #3 on: May 13, 2010, 05:49:03 »

If you want display comments count in /components/com_content/views/article/tmpl/default.php you need insert next code:

Code: (php)
<?php
$commentsPath 
JPATH_ROOT.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (
file_exists($commentsPath)) {
require_once($commentsPath);
$count JComments::getCommentsCount($this->article->id'com_content');
echo $count ? ('('$count ')') : '';
?>
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
7weight
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #4 on: May 13, 2010, 06:36:37 »

you are the freakin' man. solid great work. Grin
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: Simple question about number of topics
 
Jump to: