Skip to content

user last visit shortcodes (2) look wrong  #4665

@Jimmi08

Description

@Jimmi08

Bug Description

I have imported this field according this
$target['user_lastvisit'] = $source['user_lastvisit'];
and it is not displayed correctly (but it is correct in database)

I think that this:

	function sc_user_lastvisit($parm='')
	{
		return $this->var['user_currentvisit'] ? e107::getDate()->convert_date($this->var['user_currentvisit'], "long") : "<i>".LAN_USER_33."</i>";
	}
	
	
	function sc_user_lastvisit_lapse($parm='')
	{	
		return $this->var['user_currentvisit'] ? e107::getDate()->computeLapse($this->var['user_currentvisit']) : '';
	}

Should be at least:

	function sc_user_lastvisit($parm='')
	{
		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']) : e107::getDate()->computeLapse($this->var['user_lastvisit']);
	}

Not sure when user_currentvisit is filled. I suppose it is mean that the user is online? if yes, then a message "online" would be better.

The problem with the solution above is that if that field is not filled it shows the time 1.1.1970 (in according format)

I would suppose that convert_date() or computeLapse() returns nothing if there is no date sent.

value of $this->var['user_lastvisit'] is string(1) "0"

Thanks

Metadata

Metadata

Assignees

Labels

type: bugA problem that should not be happening

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions