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: how can i show the comments quantity?
Pages: [1]   Go Down
  Print  
Author Topic: how can i show the comments quantity?  (Read 449 times)
0 Members and 3 Guests are viewing this topic.
birken
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« on: February 03, 2012, 21:52:20 »

Hi guys,

i am new in the forum and have discovered this nice extension Smiley


i wonder if somebody could help me with my code, i have added the code below to my site and i got jcomment to work with my compenent.

this is the code that works fine:

Code:
<?php
   $commentsPath 
JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
   if (
is_file($commentsPath))  {
   require_once(
JPATH_SITE.DS.'libraries'.DS.'joomla'.DS.'database'.DS.'table'.DS.'user.php');
   require_once(
$commentsPath);
   echo 
JComments::showComments($i->idcom_mycomp$i->name);
   }
   
?>

so my questions that i want to show comment quantity on another page? i tried the code below that joomtune shows in developer page, this one:
Code:
  $comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
  if (file_exists($comments)) {
    require_once($comments);
    $count = JComments::getCommentsCount($id, 'com_mycomp');
    echo $count ? ('Comments('. $count . ')') : 'Add comment';
  }

but as i am not a coder i wonder if somebody know this by seing my working code above?

Warm regards Birken
« Last Edit: February 04, 2012, 15:20:26 by birken » Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: how can i show the comments quantity?
 
Jump to: