From 2fa73df934cd44bb87f380d5b83a92211adfb112 Mon Sep 17 00:00:00 2001 From: Jimmi08 Date: Sat, 2 Apr 2022 14:57:37 +0200 Subject: [PATCH] #4665 correct user last visit information CLOSES #4665 --- e107_core/shortcodes/batch/user_shortcodes.php | 4 ++-- e107_handlers/date_handler.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php index 3cd99b4f6..2d3bbdbf2 100644 --- a/e107_core/shortcodes/batch/user_shortcodes.php +++ b/e107_core/shortcodes/batch/user_shortcodes.php @@ -182,13 +182,13 @@ class user_shortcodes extends e_shortcode function sc_user_lastvisit($parm='') { - return $this->var['user_currentvisit'] ? e107::getDate()->convert_date($this->var['user_currentvisit'], "long") : "".LAN_USER_33.""; + return $this->var['user_currentvisit'] ? e107::getDate()->convert_date($this->var['user_currentvisit'], "long") : e107::getDate()->convert_date($this->var['user_lastvisit'], "long"); } function sc_user_lastvisit_lapse($parm='') { - return $this->var['user_currentvisit'] ? e107::getDate()->computeLapse($this->var['user_currentvisit']) : ''; + return $this->var['user_currentvisit'] ? e107::getDate()->computeLapse($this->var['user_currentvisit']) : e107::getDate()->computeLapse($this->var['user_lastvisit']); } diff --git a/e107_handlers/date_handler.php b/e107_handlers/date_handler.php index 6db0976b1..3a52a244f 100644 --- a/e107_handlers/date_handler.php +++ b/e107_handlers/date_handler.php @@ -141,6 +141,7 @@ class e_date function convert_date($datestamp, $mask = '') { $datestamp = (int) $datestamp; + if($datestamp == 0) return ""; if(empty($mask)) { @@ -596,6 +597,7 @@ class e_date function computeLapse($older_date, $newer_date = FALSE, $mode = FALSE, $show_secs = TRUE, $format = 'long') { $older_date = (int) $older_date; + if($older_date == 0) return ""; if(empty($newer_date)) {