Kunena 6.2.5 & module Kunena Latest 6.0.7 released

The Kunena team has announce the arrival of Kunena 6.2.5 [K 6.2.5] which is now available for download as a native Joomla extension for J! 4.3.x/4.4.x/5.0.x. This version addresses most of the issues that were discovered in K 6.1 / K 6.2 and issues discovered during the last development stages of K 6.2

This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 1.7, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Question Add rank in UserList

More
12 years 9 months ago #1 by yannoch
Add rank in UserList was created by yannoch
Hi.
I looking for add a new column in user list page.
How to add the rank (text, no img) of users to the user list page?
It's in userlist.php, but i dont know the name for recover the rank name of user.
Can you help me?

<tr class="ksth userlist">
Code:
<?php if ($this->config->userlist_XXX) : ?> <th class="usersortable"><?php echo JHTML::_( 'grid.sort', 'COM_KUNENA_USRL_XXX', 'XXX', $this->order_dir, $this->order); ?></th> <?php endif; ?>

<tr class="k<?php echo $usrl_class ;?>">
Code:
<?php if ($this->config->userlist_XXX) : ?> <td class="kcol-mid"><?php echo CKunenaLink::GetProfileLink(intval($user->XXX), $this->escape($user->XXX)); ?></td> <?php endif; ?>

"XXX" is what i seek.
Thanks :)

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago - 12 years 9 months ago #2 by yannoch
Replied by yannoch on topic Re: Add rank in UserList
Ok. I resolve problem at top.

Just add this in "userlist.php" in <tr class="ksth userlist">...
Code:
<th class="usersortable"><?php echo JHTML::_( 'grid.sort', 'COM_KUNENA_USRL_RANK_TITLE', 'rank', $this->order_dir, $this->order); ?></th>

And add this in "us-US.com-kunena.ini"
Code:
COM_KUNENA_USRL_RANK_TITLE="Group"

NOW, recover rank...
May be, but dont work
Code:
<td class="kcol-mid"><?php echo $user->rank; ?></td>

DAMN.., i just want to display the rank_title of user ! :angry:
Last edit: 12 years 9 months ago by yannoch.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago - 12 years 9 months ago #3 by yannoch
Replied by yannoch on topic Re: Add rank in UserList
dont work with
Code:
<td class="kcol-mid"><?php echo $user->rank_title; ?></td>

CAN YOU HELP ME PLEASE ?
Last edit: 12 years 9 months ago by yannoch.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #4 by Matias
Replied by Matias on topic Re: Add rank in UserList
echo $user->getRank(0, 'image');
or
echo $user->getRank(0, 'title');

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #5 by yannoch
Replied by yannoch on topic Re: Add rank in UserList
dont work :S
"...Call to undefined method stdClass::getRank() in components/com_kunena/template/default/userlist/userlist.php..."

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #6 by Matias
Replied by Matias on topic Re: Add rank in UserList
I have problems working with Kunena 1.6 because of the code has been changed to better after that. :)

I didn't remember that the page was using results directly from the database and not user objects..

This code is a bit slow, but should work:
Code:
$kuser = KunenaFactory::getUser($user->userid); // If ->userid doesn't work, use ->id echo $kuser->getRank(0, 'image');

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago - 12 years 9 months ago #7 by yannoch
Replied by yannoch on topic Re: Add rank in UserList
It's working fine !
THANKS MATIAS !!! :kiss:

Can you help me to create a filter for groups? :silly:
Last edit: 12 years 9 months ago by yannoch.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #8 by Matias
Replied by Matias on topic Re: Add rank in UserList
Creating a filter in K1.6 is a bit involving. I'd rather do it in 2.0.. There's also another issue: performance, as ranks are not kept in DB, they are recalculated every time..

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #9 by yannoch
Replied by yannoch on topic Re: Add rank in UserList
nice, i have use this , and the rank_title from user is displayed.
Code:
$kuser = KunenaFactory::getUser($user->userid); // If ->userid doesn't work, use ->id echo $kuser->getRank(0, 'title');

But now, how to filter the list by rank?

for exemple:
my varialble is called $rankfilter
in a dropdown menu, i define $rankfilter to 7 for display only users have rank=7
...
:unsure:

Please Log in or Create an account to join the conversation.

Time to create page: 0.421 seconds