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

Question External Ad code conflicting with Kunena

More
17 years 1 week ago - 17 years 1 week ago #14948 by woonydanny
I have been given this ad code by an advertising company to place on my site. When i add it to my template index.php file i get a kunena error.

<!-- begin ad tag (tile=1) -->
<?php function microtime_float() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$ord=microtime_float(); ?>

then there is some more ad code here specific to my site

<!-- End ad tag -->


now when i do this i get an error:
Code:
Fatal error: Cannot redeclare microtime_float() in /home/mysite/public_html/components/com_kunena/lib/kunena.parser.base.php on line 68

What does this mean? It seems like there is a conflict with Kuinena and the php stuff in the ad code?

I am running J1.5.9, K1.08, MySql 5.0.67, PHP 5.2.6

Any ideas?

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

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

More
17 years 1 week ago #14953 by grumblemarc
Have you checked with the person that gave you the code?

We love stars on the Joomla Extension Directory . :-)

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

More
17 years 1 week ago #15030 by woonydanny
I emailed them back and posted here the same time. Though it gave a kunena error so i thought here would be best to ask.

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
17 years 1 week ago - 17 years 1 week ago #15037 by sozzled
G'day, mate

What you could try is the following (to remove the attempted multiply-declared PHP function "microtime_float"):
Code:
<!-- begin ad tag (tile=1) --> <?php function microtime_float_ad() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $ord=microtime_float_ad(); ?> ... <!-- End ad tag -->
Last edit: 17 years 1 week ago by sozzled.

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

More
17 years 1 week ago #15047 by johnnydement
is strange, microtime_float is a php function to get the server time in miliseconds, and you're not declaring it here, just using :huh:

May it be due to the changes made to it in PHP5?

Try with microtime(true) instead of microtime()

Chech php documentation about it: www.php.net/microtime

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

More
17 years 1 week ago - 17 years 1 week ago #15052 by sozzled
I beg to differ, johnny. The statement
Code:
<?php function microtime_float() { ... }
is a function declaration. I've searched: there is no intrinsic function microtime_float() in PHP (V4 or V5). There is, however the intrinsic function microtime() which obtains the Unix epoch time in milliseconds at the server.

The function microtime_float() is declared in kunena.parser.base.php at line 68. Attempting to declare the function a second time (as described in original question) will result in a runtime error.
Last edit: 17 years 1 week ago by sozzled.

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

Time to create page: 0.288 seconds