username();
$user = new User($username);
$name = '';
if ($user->nickname()) {
$name = $user->nickname();
} elseif ($user->firstName()) {
$name = $user->firstName();
}
$labelGoodMorning = $L->g('good-morning');
$labelGoodAfternoon = $L->g('good-afternoon');
$labelGoodEvening = $L->g('good-evening');
$labelGoodNight = $L->g('good-night');
echo '
';
echo '
' . $L->g('Welcome') . '
';
echo '';
return <<
$(document).ready(function() {
$("#hello-message").fadeOut(1000, function() {
var date = new Date()
var hours = date.getHours()
if (hours > 6 && hours < 12) {
$(this).html('$labelGoodMorning, $name');
} else if (hours >= 12 && hours < 18) {
$(this).html('$labelGoodAfternoon, $name');
} else if (hours >= 18 && hours < 22) {
$(this).html('$labelGoodEvening, $name');
} else {
$(this).html('$labelGoodNight, $name');
}
}).fadeIn(1000);
});
EOF;
}
}