×
Kunena 5.1.14 Released - Security release (13 Aug 2019)

The Kunena team is proud to announce the arrival of Kunena 5.1.14 [K5.1.14] which is now available for download as a native Joomla extension for Joomla 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1.14. This update fixed 1 security issue.

× This category is for discussing issues with the K 2.0 Blue Eagle template.

As general background, My Joomla site template makes a mess of Kunena .

We do not answer questions about other templates for Kunena here.

If you are having problems then, for your own benefit, it would save us all a lot of time if you would kindly post your configuration report when you ask for help from this forum. If you do not post your configuration report we will not ask you for it but you will probably not get your problem solved, either.

Question change number format from 20k to 20,000

More
6 years 10 months ago - 6 years 10 months ago #1 by woonydanny
How can i change the output in the Kunena Stats module to show the full number, so instead of 10k i would like it to show the full number of 10,000

Also, curious how I can change the format of the numbers for the index page as well. eg. change 12.5k to 12,500 etc - See image below:


still wish that i can write my forum signature through a jomsocial plugin and do it from my jomsocial profile :(
Attachments:
Last edit: 6 years 10 months ago by woonydanny.

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

More
6 years 10 months ago #2 by sozzled
I understand the issue. I know that this question has cropped up around the time of K 1.6 when the scaling of numbers was introduced. I can't remember exactly where I saw the answer but I'm sure it's somewhere on the forum.

The way it's done is to remove the scaling logic from the PHP source code. The difficulty for me is how to advise you where is that PHP code. Perhaps you will discover this yourself or perhaps another member of the forum will provide you with an answer. Basically, I think the answer is a PHP hack. Remember to put the hack back whenever you upgrade Kunena.

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

More
6 years 10 months ago - 6 years 10 months ago #3 by woonydanny
I thought I had seen this a few years ago as well but couldn't find it after searching.

So I have spent alot longer searching and have finally found the topic:

www.kunena.org/forum/160-K-16-and-K-17-C...9?limitstart=0#68442

There is a hack there, but not sure if it works 100% as saw this comment in same topic:

www.kunena.org/forum/160-K-16-and-K-17-C...9999?start=20#119511


Also, unsure of which file this is in now in Kunena 2.0.2

It would be good if it was setting in the backend of kunena to have the ability to choose.

Can this please be done, so it is tested, and also so we don't have to hack it at each kunena upgrade. I am sure there are lots of users out there that the numbers would be preferred than the abbreviations.

still wish that i can write my forum signature through a jomsocial plugin and do it from my jomsocial profile :(
Last edit: 6 years 10 months ago by woonydanny.

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

More
6 years 10 months ago #4 by sozzled
As I recall posting yesterday on the forum, hacks for older versions of Kunena will not work in K 2.0 because the filenames and locations have all been changed - this was done to make K 2.0 compliant with Joomla MVC. Therefore, in all probability, the hack you saw in How to get "10.48k" replies to display as "10,480" replies? will not work in K 2.0. Thanks for finding the topic, BTW. I knew it was here somewhere! :)

I don't know either what you have to change. A good text search tool will probably reveal the location of the code and which file it now resides in. Yes, it would be good to know the answer for the benefit of others in your situation.

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

More
6 years 10 months ago #5 by woonydanny
As i said above, i don't particularly want to make a hack. I would like this as an option in the backend that by default changes it to 'k' and 'm' but for those that want to set it at the full numbers they have the option to.

Doesnt seem like it would be a very hard backend config setting to do for the devs...

still wish that i can write my forum signature through a jomsocial plugin and do it from my jomsocial profile :(

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

More
6 years 10 months ago - 6 years 10 months ago #6 by sozzled

peetree21 wrote: Doesnt seem like it would be a very hard backend config setting to do for the devs...

For each additional setting added to the Forum Configuration there has to be a place to store that setting; this means a change to the database. Then you have to modify the report generator to report on this new setting, not to mention, modify the view so that you use the stored value in the right way. Whenever there is a change to the Kunena database, this means we're discussing a new version. I hope you now understand that these kinds of design changes are not exactly as trivial as people may first suspect.

If this optional usage setting feature idea was as easy to implement as suggested, then anyone with an elementary understanding of Joomla, PHP coding and database design could do this job in less than than no time. I wonder if you posted this question asking for a quotation from a skilled Joomla developer, what would be their quotation to undertake this work on your behalf and would that then persuade you to reconsider the "configurability" aspect of the task?

This should be a fairly simple task to make the desired changes and to protect your customised work by building the required rules into your own custom Kunena template.
Last edit: 6 years 10 months ago by sozzled.

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

More
6 years 10 months ago #7 by woonydanny
Sometimes I think you write for the sake of writing. Your last response was just not necessary. I understand the process and realise that by adding a setting it is going to mean some changes to the extension.

I think this would be a useful addition to the core extension that would suit many users.

If there weren't any changes to kunena it would sit stagnant, so obviously the extension is going to have changes made to it going forward. Frankly, on a coding issue I would prefer to hear a response from Matias et al.

still wish that i can write my forum signature through a jomsocial plugin and do it from my jomsocial profile :(

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

More
6 years 10 months ago #8 by sozzled
You say it's not that hard to add extra options to the configuration. I say it's not as easy as you think. I respect your opinion to ask questions. Please respect my opinion, too, even if you disagree or do not like my responses.

My response was not specifically targeted at you; I was merely trying to explain, for the benefit of others reading this topic, that when we're discussing the addition of new configuration options, we're discussing a very different issue from a hack.

When Matias or other developers have time to devote from their busy schedules, they will respond in their own good time. I do not make promises on their behalf.

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

More
6 years 6 months ago - 6 years 6 months ago #9 by Mikote
Hello.

I made this modification and works fine.

In Kunena 2.0.4 need to modify the function formatLargeNumber found in:
/administrator/components/com_kunena/libraries/view.php

Original code:
public function formatLargeNumber($number, $precision = 3) {
		$output = '';
		// Do we need to reduce the number of significant digits?
		if ($number >= 10000){
			// Round the number to n significant digits
			$number = round ($number, -1*(log10($number)+1) + $precision);
		}
		if ($number < 10000) {
			$output = $number;
		} elseif ($number >= 1000000) {
			$output = $number / 1000000 . JText::_('COM_KUNENA_MILLION');
		} else {
			$output = $number / 1000 . JText::_('COM_KUNENA_THOUSAND');
		}
 
		return $output;
	}

Modify code:

public function formatLargeNumber($number, $precision = 3) {
// $output = '';
// Do we need to reduce the number of significant digits?
$salida=$number;
// if ($number >= 10000){
// // Round the number to n significant digits
// $number = round ($number, -1*(log10($number)+1) + $precision);
// }
// if ($number < 10000) {
// $output = $number;
// } elseif ($number >= 1000000) {
// $output = $number / 1000000 . //JText::_('COM_KUNENA_MILLION');
// } else {
// $output = $number / 1000 . //JText::_('COM_KUNENA_THOUSAND');
// }

return $salida;
}


I hope it helpful, regards :)

Miguel
Madrid (Spain)
Last edit: 6 years 6 months ago by Mikote.

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

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 1.242 seconds