Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Greetings according to the time of day in the forum

#3
Hey friends, I have now changed it to a switch instruction.

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


 
[Image: autism4all.png]
[x] <= Drive in nail here for new display!
Reply


Messages In This Thread
Greetings according to the time of day in the forum - by tc4me - February 3rd, 2021 at 2:09 PM
RE: Greetings according to the time of day in the forum - by tc4me - February 9th, 2021 at 12:52 PM



Users browsing this thread: 1 Guest(s)

Dark/Light Theme Selector

Contact Us | Makestation | Return to Top | Lite (Archive) Mode | RSS Syndication 
Proudly powered by MyBB 1.8, © 2002-2024
Forum design by Makestation Team © 2013-2024