Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

This category contains miscellaneous, uncategorised third-party extensions (e.g. JomSocial, Community Builder, etc.) relating to older versions of Kunena that are no longer supported.

This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.

The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, the ideas in these topics may not work with later versions and, for that reason, the topics are locked.

Question Display Post Count?

More
16 years 1 week ago - 16 years 1 week ago #46225 by sozzled
Replied by sozzled on topic Re: Display Post Count?
joomlamanisdaman wrote:

post count is a measure of authority and I'd like the users to be able to see it in JomSocial. What code would I need to add to make this possible?

This is basically what this whole discussion hinges upon. How to change JomSocial so that it picks up information from Kunena. If the folks at JomSocial can't provide you with an answer, there's your answer. The rest of us gumby users are just guessing.

[strike]There is no "number of posts" value stored in the jos_fb_users table in Kunena.[/strike] You have to [strike]calculate that total with a SQL query from all the messages posted and then[/strike] correlate the Kunena information with the JomSocial user record (if such a records exist ... and I guess they would). I'm sure it can be done but, as I have no understanding of the JomSocial internals, I can't help you.

EDIT: strike out incorrect information
Last edit: 16 years 1 week ago by sozzled. Reason: incorrect information

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

More
16 years 1 week ago #46410 by Matias
Replied by Matias on topic Re: Display Post Count?
Sozzled: you're wrong. Each user has posts field which contains total posts written by that user.

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

More
16 years 1 week ago - 16 years 1 week ago #46434 by sozzled
Replied by sozzled on topic Re: Display Post Count?
:blush: Moi? Wrong? How could that possibly be? :laugh:

Touché, Matias!

Perhaps this is another good reason why I should stay clear of JomSocial issues. Less trouble for me to get into! :P
Last edit: 16 years 1 week ago by sozzled.

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

More
16 years 1 week ago #46440 by WinuxFF
Replied by WinuxFF on topic Re: Display Post Count?
Matias wrote:

Sozzled: you're wrong. Each user has posts field which contains total posts written by that user.


Well than, that makes complete thing a totally different and new story.
Didnt knew that, thanks Matias.
Now its fairly easy to display posts count.
Code:
$db =& JFactory::getDBO(); $db->setQuery("SELECT posts FROM #__fb_users WHERE userid=".$userid); $posts = (int)$db->loadResult();

I have also replied to OP at Jomsocial forums
www.jomsocial.com/forum/index.php?f=5&t=...b_v=viewtopic#p93404

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

More
16 years 1 week ago #46462 by joomlamanisdaman
BEAUTIFUL.

Thank you all so much! (Especially WinuxFF)

I'm glad we were to take this conversation and turn it into a solution! :D

I got it work exactly how I want it to :D You guys are FANTASTIC!

WinuxFF's code needs a little bit more to actually work (if you copied exactly what he had into php and returned $posts, you'll always end up showing 0).

Here's the full code you need. If you're using the blackout template, change the file in this directory:
components/com_community/templates/blackout/profile.header.php

If you want to place the post count underneath the Karma (if you have it enabled),

After where it says
Code:
<td class="profile-details"> <table cellpadding="0" cellspacing="0"> <?php if($config->get('enablekarma')){ ?> <tr class="profile-detail"> <td class="profile-detail-title"><?php echo JText::_('CC KARMA'); ?></td> <td><img src="<?php echo $karmaImgUrl; ?>" alt="" /></td> </tr> <?php } ?>

Add this:
Code:
<!--KUNENA POST COUNT ADDITION --> <?php $userid = $user->id; $db =& JFactory::getDBO(); $db->setQuery("SELECT posts FROM #__fb_users WHERE userid=".$userid); $posts = (int)$db->loadResult(); ?> <tr class="profile-detail"> <td class="profile-detail-title">Forum Posts</td> <td><?php echo $posts ?> posts</td> </tr> <!--END KUENEA POST COUNT CODE-->

Hope that helps anyone else that has this issue! :D
We've taken a seemingly complex problem and turned it into a simple one. ;)

Good work guys!

(P.S. I suggest adding this feature to the Kunena website.)

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

More
15 years 8 months ago #56590 by WinuxFF
Replied by WinuxFF on topic Re: Display Post Count?
TBH, i dont like the way we solved this. It uses direct SQL query.
Im trying to optimize my site as much as i can, and reducing the numbers of queries is a top priority for me now.
Is there any API documentation for Kunena 1.6 yet?

Thanks

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

Time to create page: 0.251 seconds