mirror of
https://github.com/e107inc/e107.git
synced 2025-07-12 10:36:20 +02:00
Merge pull request #4741 from Jimmi08/user-last-visit-shortcodes
Fixes #4665 correct user last visit information
This commit is contained in:
@ -182,13 +182,13 @@ class user_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_user_lastvisit($parm='')
|
function sc_user_lastvisit($parm='')
|
||||||
{
|
{
|
||||||
return $this->var['user_currentvisit'] ? e107::getDate()->convert_date($this->var['user_currentvisit'], "long") : "<i>".LAN_USER_33."</i>";
|
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='')
|
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']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -141,6 +141,7 @@ class e_date
|
|||||||
function convert_date($datestamp, $mask = '')
|
function convert_date($datestamp, $mask = '')
|
||||||
{
|
{
|
||||||
$datestamp = (int) $datestamp;
|
$datestamp = (int) $datestamp;
|
||||||
|
if($datestamp == 0) return "";
|
||||||
|
|
||||||
if(empty($mask))
|
if(empty($mask))
|
||||||
{
|
{
|
||||||
@ -596,6 +597,7 @@ class e_date
|
|||||||
function computeLapse($older_date, $newer_date = FALSE, $mode = FALSE, $show_secs = TRUE, $format = 'long')
|
function computeLapse($older_date, $newer_date = FALSE, $mode = FALSE, $show_secs = TRUE, $format = 'long')
|
||||||
{
|
{
|
||||||
$older_date = (int) $older_date;
|
$older_date = (int) $older_date;
|
||||||
|
if($older_date == 0) return "";
|
||||||
|
|
||||||
if(empty($newer_date))
|
if(empty($newer_date))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user