thanks for the quick response...I found a good solution just by messing with the code of punbbs date function (inspired by this post: http://punbb.org/forums/viewtopic.php?id=7436)
here is my code:
function format_time($timestamp, $date_only = false) { global $pun_config, $lang_common, $pun_user; if (!$date_only) { $diff = time() - $timestamp; // .... if ($timestamp == '') { return $lang_common['Never']; } // .... }
I'm not a good PHP developer, but this looks pretty strange to me.
I mean, you calculate using $timestamp and later you check if $timestamp has a propper value.
I think PHP takes care of this (at least it tries to).
But it would be better if you first check $timestamp for the propper value and then use it for calculating.