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

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Top Posters
Pages: [1]   Go Down
  Print  
Author Topic: Top Posters  (Read 9135 times)
0 Members and 1 Guest are viewing this topic.
Velas
Newbie
*

Karma: 0
Offline Offline

Posts: 11


« on: December 03, 2008, 11:17:14 »

Hello, I migrate to Jcomment and it´s perfect for me. Have one question:

Is there any Top Poster module?? I need it, is the only thing that i missed in the component

Thanks
Logged
Velas
Newbie
*

Karma: 0
Offline Offline

Posts: 11


« Reply #1 on: January 28, 2009, 06:04:38 »

nobody?
Logged
smart
Administrator
Hero Member
*****

Karma: 146
Offline Offline

Gender: Male
Posts: 2579



WWW
« Reply #2 on: January 28, 2009, 16:18:46 »

Yes, I have one and it would be released with new version of JComments...But you can test it now:

mod_jcomments_top_j10_v1.0.zip
mod_jcomments_top_j15_v1.0.zip
Logged

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

Karma: 0
Offline Offline

Posts: 11


« Reply #3 on: January 29, 2009, 04:29:58 »

Thanks!

It works well, but it needs a parameter to adjust max avatar height or width

Logged
Velas
Newbie
*

Karma: 0
Offline Offline

Posts: 11


« Reply #4 on: February 15, 2009, 21:38:21 »

how can I change the weigh and heigh in the php fle? THANKSS
Logged
Velas
Newbie
*

Karma: 0
Offline Offline

Posts: 11


« Reply #5 on: March 04, 2009, 10:40:45 »

it´s only says:
Code:
$row->avatar;
and I can´t adjust width or height...
Logged
Velas
Newbie
*

Karma: 0
Offline Offline

Posts: 11


« Reply #6 on: April 07, 2009, 17:35:53 »

any help would be apreciated  Roll Eyes
Logged
smart
Administrator
Hero Member
*****

Karma: 146
Offline Offline

Gender: Male
Posts: 2579



WWW
« Reply #7 on: April 09, 2009, 17:42:21 »

It works well, but it needs a parameter to adjust max avatar height or width

You can setup this via CSS. Something like:

Code: (css)
div.avatar img {width: 32px;}
Logged

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

Karma: 0
Offline Offline

Posts: 11


« Reply #8 on: May 10, 2009, 18:53:08 »

Thaks, i´ve modified it and it works fine, this is the code I use:
Quote
<?php
/**
 * JComments - Joomla Comment System
 *
 * Show top comment posters for JComments
 *
 * @version 1.0
 * @package JComments
 * @filename mod_jcomments_top.php
 * @author Sergey M. Litvinov (smart@joomlatune.ru)
 * @copyright (C) 2006-2008 by Sergey M. Litvinov (http://www.joomlatune.ru)
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 *
 * If you fork this to create your own project,
 * please make a reference to JComments someplace in your code
 * and provide a link to http://www.joomlatune.ru
 **/

(defined('_VALID_MOS') OR defined('_JEXEC')) or die('Direct Access to this location is not allowed.');

global $database;

$count = intval( $params->get( 'count', 5 ) );
$avatar = intval( $params->get( 'avatar', 0 ) );
$profile_link = intval( $params->get( 'profile_link', 0 ) );
$display_name = $params->get('display_name', 'name');
$display_guests = intval( $params->get( 'display_guests', 1 ) );

$database =& JFactory::getDBO();

$query = "SELECT c.userid, c.email, c.name, c.username, '' as avatar, '' as profileLink,  count(c.userid) AS cnt"
         ."\nFROM #__jcomments AS c"
         ."\nWHERE c.published = 1"
         . (($display_guests == 0) ?  "\nAND c.userid != 0" : '')
         ."\nGROUP BY c.userid, c.email, c.name, c.username, avatar, profileLink"
         ."\nORDER BY cnt DESC LIMIT $count "
         ;

$database->setQuery($query);
$rows = $database->loadObjectList();
$a=1;
if (count($rows)) {

   if ($avatar == 1) {

      JPluginHelper::importPlugin('jcomments');

      if (!JPluginHelper::isEnabled('jcomments', 'jcomments.avatar')) {
         $avatar = 0;
         $profile_link = 0;
      } else {
         $dispatcher = & JDispatcher::getInstance();
         $dispatcher->trigger('onPrepareAvatars', array ( &$rows ), false );
      }
   }



?>
<table border="0"><tr>

<style>
td.avatar img {
   //width:40px;
   height:40px;
}

</style>

<?php
   foreach ($rows as $row) {
      if ($avatar == 1) {
?>
   <td align="center" width="20%" class="avatar"><?php echo $row->avatar; ?></td><td width="80%">
<?php
      } else {
      
      }
      $name = $row->name;

      if ( $row->userid && $display_name == 'username' && $row->username != '' ) {
         $name = $row->username;
      }

      if ($profile_link && $row->profileLink != '') {
      echo $a;
      echo '.&nbsp;';
?>
       <a href="<?php echo $row->profileLink; ?>"><?php echo $name; ?></a>
<?php
      } else {
         echo $a;
         echo '.&nbsp;';
         echo $name;
      }
         
      echo ' (' . $row->cnt . ')';
      $a++;
      echo '</td></tr>';
   }
?>
</table>


<?php
}
?>


You can see it here: http://www.todomulero.com at the right of home

« Last Edit: May 10, 2009, 18:55:04 by Velas » Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Top Posters
 
Jump to: