- Posts: 4
- Thank you received: 0
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
Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.
Question Customized Kunena Statistics
16 years 3 months ago #37639
by tobik999
Customized Kunena Statistics was created by tobik999
I am currently asking myself if it would be possible to set up customized statistics that shows most popular threads, most active users and positive karma in a given time frame, like just the current month or the previous month. Any ideas on this?
Please Log in or Create an account to join the conversation.
16 years 3 months ago #37646
by sozzled
Blue Eagle vs. Crypsis reference guide
Read my blog and
Replied by sozzled on topic Re:Customized Kunena Statistics
I have built a module that shows the most popular threads (which users can customise for a particular time frame) - the information is based on the number of views for each topic; see
Kunena "Popular Threads" module
.
It should be possible to build a similar module to show the most active users based on the number of posts they write.
It is not possible to obtain information about Karma because there is no log of who gives (or receives) Karma or when there's an adjustment made to the user's Karma. This is one of the main criticisms that we have had about Karma: there is no accountability for it. This is also why a lot of people choose to disable the feature. Please see Kunena Karma and Unanswered thread as just one example of these discussions; there are others.
It should be possible to build a similar module to show the most active users based on the number of posts they write.
It is not possible to obtain information about Karma because there is no log of who gives (or receives) Karma or when there's an adjustment made to the user's Karma. This is one of the main criticisms that we have had about Karma: there is no accountability for it. This is also why a lot of people choose to disable the feature. Please see Kunena Karma and Unanswered thread as just one example of these discussions; there are others.
Blue Eagle vs. Crypsis reference guide
Read my blog and
Please Log in or Create an account to join the conversation.
16 years 3 months ago - 16 years 3 months ago #37689
by tobik999
Replied by tobik999 on topic Re:Customized Kunena Statistics
First of all: Many thanks for this great module 
I firstly thought about statistics which thread in the current month got the most views, but when I looked at the database tables of kunena I noticed that this is impossible and it would be also be somehow stupid because in the top list would be always the same threads. But the way this module works it will change each month which is quite better.
So now I am trying to customize this module to show the most active users in a given time frame. I guess I will just have to change the code I copied below (beside the regular changes for a new module):
I guess the following sql query is what I need to run:
But how can I get the links to the profiles?
I firstly thought about statistics which thread in the current month got the most views, but when I looked at the database tables of kunena I noticed that this is impossible and it would be also be somehow stupid because in the top list would be always the same threads. But the way this module works it will change each month which is quite better.
So now I am trying to customize this module to show the most active users in a given time frame. I guess I will just have to change the code I copied below (beside the regular changes for a new module):
Code:
$query ="SELECT thread, SUM(hits) AS `total_views`, subject, catid, id FROM #__fb_messages AS `dsn` WHERE " . implode(" AND ",$where). " GROUP BY thread ORDER BY total_views DESC LIMIT 0,$numberPost;";
$db->setQuery($query);
$rows = $db->loadObjectList();
for($i=0,$n=count($rows);$i<$n;$i++)
{
$row=$rows[$i];
echo $i+1 . ". " . CKunenaLink::GetThreadLink('view', $row->catid, $row->id, kunena_htmlspecialchars(stripslashes($row->subject)), '', 'follow', '')
. " ($row->total_views " . _GEN_HITS . ")<br />";
}
Code:
$query ="SELECT name, COUNT(*) AS `total_posts`, userid FROM #__fb_messages AS `dsn` WHERE " . implode(" AND ",$where). " GROUP BY name ORDER BY total_posts DESC LIMIT 0,$numberPost;";
$db->setQuery($query);
$rows = $db->loadObjectList();
Last edit: 16 years 3 months ago by tobik999. Reason: close to solution
Please Log in or Create an account to join the conversation.
16 years 3 months ago - 16 years 3 months ago #37692
by tobik999
Replied by tobik999 on topic Re:Customized Kunena Statistics
Everything is working fine now! I attached the module to this post so everyone can enjoy it!
Last edit: 16 years 3 months ago by tobik999.
Please Log in or Create an account to join the conversation.
16 years 3 months ago - 16 years 3 months ago #37693
by sozzled
Blue Eagle vs. Crypsis reference guide
Read my blog and
Replied by sozzled on topic Re:Customized Kunena Statistics
To produce a list of who are your most active users (i.e., those who post messages the most) your query should be something like this:
EDIT: I see that you've beaten me to the solution. I looked at your code. It looks like it should do everything that you asked for. Well done!
Code:
$query = "SELECT COUNT( * ) AS `posts` , name FROM #__fb_messages AS `dsn`
WHERE " . implode(" AND ",$where) . " GROUP BY name ORDER BY posts DESC
LIMIT 0,$numberPost;";
EDIT: I see that you've beaten me to the solution. I looked at your code. It looks like it should do everything that you asked for. Well done!
Blue Eagle vs. Crypsis reference guide
Read my blog and
Last edit: 16 years 3 months ago by sozzled.
Please Log in or Create an account to join the conversation.
16 years 3 months ago #37695
by tobik999
Replied by tobik999 on topic Re:Customized Kunena Statistics
It is all done now (take a look at the module I posted above)! The query you posted is almost correct, you just need the userid to build the link to the profile, although I had to change that all posts are counted not just the first of a thread. But many many thanks for your pre-work!
Please Log in or Create an account to join the conversation.
Time to create page: 0.250 seconds