Hello, sorry for the late reply.
I don’t have an account on Github (got my own SVN), so i’ll paste what you need to get here. It’s quick and dirty, so it’ll probably need some optimization. Here’s the code (I believe you’ll know where this is located) :
/**
* Format comment contents
*/
function format_comment($commentdata)
{
$comment = array();
$comment['comment_number'] = isset($commentdata['comment_number']) ? $commentdata['comment_number'] : '';
$comment['pid'] = $commentdata['comment_post_ID'];
$comment['home'] = get_option('home');
$comment['user_id'] = $commentdata['user_id'];
$date_format = (!empty($this->options['input_date'])) ? $this->options['input_date'] : $this->options_default['input_date'];
//$comment['time'] = date_i18n($date_format, strtotime($commentdata['comment_date']));
$difference = time() - strtotime(get_gmt_from_date($commentdata['comment_date']));
$weeks = round($difference / 604800);
$difference = $difference % 604800;
$days = round($difference / 86400);
$difference = $difference % 86400;
$hours = round($difference / 3600);
$difference = $difference % 3600;
$minutes = round($difference / 60);
$difference = $difference % 60;
$seconds = $difference;
if ($weeks > 0) {
if ($weeks == 1) {
$comment['time'] = $weeks . ' ' . __('week', $this->_folder); }
else { $comment['time'] = $weeks . ' ' . __('weeks', $this->_folder); }
} else if ($days > 0) {
if ($days == 1) {
$comment['time'] = $days . ' ' . __('day', $this->_folder); }
else { $comment['time'] = $days . ' ' . __('days', $this->_folder); }
} else if ($hours > 0) {
if ($hours == 1) {
$comment['time'] = $hours . ' ' . __('hour', $this->_folder); }
else { $comment['time'] = $hours . ' ' . __('hours', $this->_folder); }
} else if ($minutes > 0) {
if ($minutes == 1) {
$comment['time'] = $minutes . ' ' . __('minute', $this->_folder); }
else { $comment['time'] = $minutes . ' ' . __('minutes', $this->_folder); }
} else if ($seconds >= 0) {
if ($seconds <= 1) {
$comment['time'] = $seconds . ' ' . __('second', $this->_folder); }
else { $comment['time'] = $seconds . ' ' . __('seconds', $this->_folder); }
}
//$comment['time'] = get_time_diff($commentdata['comment_date']);
//$comment['time'] = apply_filters('bwp_rc_date_format', $comment['time'], $commentdata['comment_date']);
// for dynamic comment_type loading
$comment['comment_type'] = $commentdata['comment_type'];
$comment['type'] = $commentdata['comment_type'];
// Format post_title, also trim it if necessary - @since 1.1.0
I’ve commented the parts in your code that aren’t used anymore.
For this to work neatly, the cache needs to be disabled. Adding an option to turn off the cache would be nice (it’d need to be activated by default if this procedure is used though) ??
Do you have any way to quickly turn off the cache in your code? I’d love to do a quick fix in the code for my website.
Regards,
Zanes