Kunena 6.3.7 Released

The Kunena team has announce the arrival of Kunena 6.3.7 [K 6.3.7] in stable which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x/5.1.x/5.2.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 and issues discovered during the last development stages of K 6.3
Note: Please go to the Kunena Dashboard after an upgrade so that the Kunena database tables are also updated.

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.

Solved Possible (hack) to show amount of received "Thank You's" below avatar?

More
12 years 7 months ago - 12 years 7 months ago #1 by kj2010
Hello,
i searched the forum for this question but couldn't find any similar one among the 1,300+ results.
Please forgive me if this question was already asked and simply give me a link to the corresponding topic if it exists. Sorry.


Question:
Is it possible (hack?) to show the amount of the received "Thank You's" below the forum avatars?

Thanks for any answer in advance!
Regards,
Martin
Last edit: 12 years 7 months ago by sozzled. Reason: Change topic icon

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

More
12 years 7 months ago #2 by Matias
The template file can be found from
/components/com_kunena/template/default/profile/summary.php
/components/com_kunena/template/default/view/profile.*.php

Remember that if you change these files, they will be overridden during the next Kunena upgrade/installation.

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

More
12 years 7 months ago - 12 years 7 months ago #3 by gimenezadrian
Search the file: com_kunena/template/default/view/view.php

Search the line:
Code:
<?php foreach ( $this->messages as $message ) $this->displayMessage($message) ?>

Add up:
Code:
<?php global $kunena_gracias; $ids = array(); foreach ($this->messages as $m) { if (!in_array($m->userid, $ids)) { $ids[] = $m->userid; $kunena_gracias[$m->userid] = 0; } } $db =& JFactory::getDBO(); $db->setQuery("SELECT count(*) as total, targetuserid as userid FROM #__kunena_thankyou WHERE targetuserid IN (".implode(',',$ids).") GROUP by targetuserid"); $tmp = $db->loadObjectList(); foreach ($tmp as $obj) $kunena_gracias[$obj->userid] = $obj->total; ?>


Search the file: com_kunena/template/default/view/profile.vertical.php

Search the line:
Code:
<?php if ( $this->userkarma ) : ?> <li class="kpost-karma"> <span class="kmsgkarma"> <?php echo $this->userkarma ?> </span> </li> <?php endif ?>

Add down:
Code:
<li class="kpost-gracias-recibidas"><?php echo JText::_('COM_KUNENA_THANKYOU_GOT'); ?>: <?php global $kunena_gracias; echo $kunena_gracias[$this->userid]; ?></li>

Result:


EDIT: Fixed dependency if karma enabled. Added language from the .ini
Attachments:
Last edit: 12 years 7 months ago by gimenezadrian. Reason: Fixed dependency if karma enabled. Added language from the .ini
The following user(s) said Thank You: sunnyjey, kj2010

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

More
12 years 7 months ago #4 by kj2010
THANK YOU very much gimenezadrian for the fast and very detailed explanation.
It works perfectly. Wonderful!

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

More
12 years 7 months ago - 12 years 7 months ago #5 by DaTOkz
*** Spanish text removed by moderator ***
Last edit: 12 years 7 months ago by sozzled.

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

More
12 years 7 months ago #6 by sozzled

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

More
More
12 years 7 months ago #8 by sunnyjey
Thanks you gimenezadrian for this nice and useful tweak.

Is it possible to diaplay Thank you message when ONLY member received atleast 1 thank you?

In other words - Thank you recived:0 should not be displayed.

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

More
12 years 7 months ago - 12 years 7 months ago #9 by gimenezadrian

sunnyjey wrote: Thanks you gimenezadrian for this nice and useful tweak.

Is it possible to diaplay Thank you message when ONLY member received atleast 1 thank you?

In other words - Thank you recived:0 should not be displayed.

Yes, with an if, but, i'm not a programmer.

Any ideas?

EDIT: I think this feature has K2.0
Last edit: 12 years 7 months ago by gimenezadrian.

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

Time to create page: 0.408 seconds