I am not expert with PHP, but I am learning!
I implemented basic, but fun piece of code on my site to greet people (Good Evening/Afternoon/Morning/ and Late Shift). If you could benefit from this code on your phorum sites, use it and enjoy it:
<?
$afternoon = "Good afternoon! blablablah";
$evening = "Good evening! blablablah";
$late = "Glad to see you so late! blahblahblah";
$morning = "Good morning! blahblahblah";
//Get the current hour
$current_time = date(G);
// between 12:00 p.m. and 4:00 p.m.
if ($current_time >= 12 && $current_time <= 16) {
echo $afternoon;
}
// between 5:00 p.m. and 11:00 p.m.
elseif ($current_time >= 17 && $current_time <= 24) {
echo $evening;
}
// between midnight and 5:00 a.m.
elseif ($current_time >= 1 && $current_time <= 5) {
echo $late;
}
// between 6:00 a.m. and 11:00 a.m.
elseif ($current_time >= 6 && $current_time <= 11) {
echo $morning;
}
?>