RE: Time-oriented login messages. // MyBB 02-22-2014, 11:37 PM
#5
(02-22-2014, 11:36 PM)cxS Wrote: This would be a stupid way of doing it IMO... MyBB variables do exist. A better way would be to look at the $mybb->user['timezone'] and $mybb->user['dst'] variables and edit the PHP directly.
(original) global.lang.php:
Code:$l['welcome_back'] = "<strong>Welcome back, {1}</strong>. You last visited: {2}";
(original) global.php:
Code:$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link($mybb->user['username'], $mybb->user['uid']), $lastvisit);
(modified) global.lang.php:
Code:$l['welcome_back'] = "<strong>{1}, {2}</strong>. You last visited: {3}";
(modified) global.php:
Code:$dyn_welcome_msg = ''; // use $mybb->user['timezone'] and $mybb->user['dst'] here // check time // decide what to display for $dyn_welcome_msg $lang->welcome_back = $lang->sprintf($lang->welcome_back, $dyn_welcome_msg, build_profile_link($mybb->user['username'], $mybb->user['uid']), $lastvisit);
You do realize that I didn't create this, right? I only copied it over.
![[Image: BXqGARG.png]](https://i.imgur.com/BXqGARG.png)










![[+]](https://sinister.li/images/modern/collapse_collapsed.png)