February 9th, 2021 at 12:52 PM
Hey friends, I have now changed it to a switch instruction.
If you have the time, please post improvements :-) THANK YOU
If you have the time, please post improvements :-) THANK YOU
Code:
//Begin Time welcome Tc4me
$uhrzeit = gmdate($mybb->settings['timeformat'],TIME_NOW + $mybb->user['timezone'] * 3600);
switch ($uhrzeit) {
case $uhrzeit <= 4:
$lang->welcome_back = $lang->sprintf($lang->welcome_back_night, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $timenow);
break;
case $uhrzeit <= 10:
$lang->welcome_back = $lang->sprintf($lang->welcome_back_morning, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $timenow);
break;
case $uhrzeit <= 18:
$lang->welcome_back = $lang->sprintf($lang->welcome_back_day, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $timenow);
break;
case $uhrzeit <= 22:
$lang->welcome_back = $lang->sprintf($lang->welcome_back_evening, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $timenow);
break;
default:
$lang->welcome_back = $lang->sprintf($lang->welcome_back_night, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $timenow);
}
//End Time welcome Tc4me