Kunena 6.2.6 released

The Kunena team has announce the arrival of Kunena 6.2.6 [K 6.2.6] which is now available for download as a native Joomla extension for J! 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

Posting guide:

For a quick response, please give us as much information that helps us to understand the problem.
Please read first What information should I include when I ask for help (including how to post my configuration report)?
This category is for:
  • Kunena 1.7 product-related issues only; and
  • when your Kunena forum does not work.
Do not use this category:
  • to request adding to or removing from the standard features of Kunena;
  • if your question is of a commonly asked "how to" nature;
  • if you are not using the latest stable release of Kunena; or
  • ▪ general Joomla or website adminstration matters
General hints: How To Ask Questions The Smart Way .
Please read the guides posted as sticky topics in this category.
Also refer to the FAQs menu tab above for frequently asked questions.

Note: Support for, and all questions relating to, K 1.7 will cease on 31 August 2012. Our advice is, if you are having problems with K 1.7, to upgrade to K 2.x as soon as practicable,

Question BUG in latestx.php in K 1.7.2

More
12 years 1 month ago - 12 years 1 month ago #1 by cooldaemon
In Kunena 1.7.2 I found that a latest "4 hours" topics filter doesn't properly work. In example, message posted only a few minutes ago doesn't shown in "4 hours" latest topics list. Other filters "8 hours", "12 hours", "Last visit" and others (seems!) to work.

Investigation taked some time and finally I got a solution (see patch below).

<<< Configuraton >>>
Kunena: 1.7.2 (upgraded from 1.7.1)
Joomla: 1.5.25
uname -a: FreeBSD web05.nic.ru 6.2-RELEASE FreeBSD 8.1-RELEASE-p5 #10: Fri Sep 30 14:45:56 MSK 2011
date: Wed Mar 7 17:37:57 MSK 2012
System (and local) timezone: UTC + 4 <== (this "+4" is a key why "4 hours" filter doesn't work!)
Joomla timezone config: "UTC + 4" (as hoster do)
Kunena config report:
This message contains confidential information

Database collation check: The collation of your table fields are correct

Legacy mode: Disabled | Joomla! SEF: Enabled | Joomla! SEF rewrite: Enabled | FTP layer: Disabled |

This message contains confidential information
htaccess: Exists | PHP environment: Max execution time: 60 seconds | Max execution memory: 32M | Max file upload: 32M

Kunena menu details:
Warning: Spoiler!

Joomla default template details : rhuk_milkyway | author: Andy Miller | version: 1.0.2 | creationdate: 11/20/06

Kunena default template details : Blue Eagle (default) | author: Kunena Team | version: 1.7.2 | creationdate: 2012-01-31

Kunena version detailled: Installed version: 1.7.2 | Build: 5215 | Version name: Omega | Kunena detailled configuration:

Warning: Spoiler!

Third-party components: CommunityBuilder 1.7.1 | UddeIm 2.6

Third-party SEF components: None

Plugins: System - Mootools Upgrade: Disabled | System - Mootools12: Disabled

Modules: Kunena Latest 1.7.2


<<< Investigation >>>
Several hours of debugging with echo() and die() showed a way to the roots. The reason is that a new post's timestamp is saved to DB in UTC, but "latest topics" filter perform calculation using a local time. On some reason in components/com_kunena/latestx.php on line 570 function _getShowListTime() uses time() instead of
CKunenaTimeformat::internalTime()
. In my case time() returns a local time (UTC + 4) and this leads to improper latest "4 hours" topics calculation. Replacing time() with CKunenaTimeformat::internalTime() solved this problem.

<<< Patch >>>
Code:
--- latestx.php.orig 2012-03-07 13:48:00.000000000 +0200 +++ latestx.php 2012-03-07 14:36:33.000000000 +0200 @@ -567,7 +567,7 @@ } else { //Time translation $back_time = $this->show_list_time * 3600; //hours*(mins*secs) - $sincetime = time () - $back_time; + $sincetime = CKunenaTimeformat::internalTime() - $back_time; } return $sincetime;

I also grepped other files and again have found a time() occurance in:
administrator/components/com_kunena/libraries/user.php on line 42.
In other places of code CKunenaTimeformat::internalTime() is widely used. Does I also need to patch user.php against time()?

Am I right with my investigation?
Hope this helps to developers.

Thanks!
---
Dmitry
Attachments:
Last edit: 12 years 1 month ago by cooldaemon.

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

More
12 years 1 month ago #2 by Matias
Thanks! The patch will be useful for many people.

It looks like we have already fixed / changed this in Kunena 2.0.

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

More
12 years 1 month ago #3 by cooldaemon
As I mentioned before, there is also usage of time() in /administrator/components/com_kunena/libraries/user.php
Here is the patch for this:
Code:
--- user.php.orig 2012-03-05 13:28:00.000000000 +0200 +++ user.php 2012-03-19 11:11:47.000000000 +0200 @@ -12,6 +12,8 @@ // Dont allow direct linking defined ( '_JEXEC' ) or die (); +require_once(KUNENA_PATH_LIB.'/kunena.timeformat.class.php'); + /** * Kunena Users Table Class @@ -39,7 +41,7 @@ $this->_db = JFactory::getDBO (); $this->_app = JFactory::getApplication (); $this->_config = KunenaFactory::getConfig (); - $this->_session_timeout = time() - $this->_app->getCfg ( 'lifetime', 15 ) * 60; + $this->_session_timeout = CKunenaTimeformat::internalTime() - $this->_app->getCfg ( 'lifetime', 15 ) * 60; } /**

Hope this also will help kunena 1.7.2 users!
Attachments:

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

Time to create page: 0.402 seconds