Please note that this tutorial assumes that you know a very small amount of JavaScript. It's targeted towards beginners, since more advanced JavaScript coders could probably whip this out in a minute.
This code is really simple - in the Header, if the user is visiting in the morning, a message saying "Good Morning!" will be shown, and if they are visiting in the afternoon/evening, a message saying "Good Afternoon!" will be displayed. This all refers to their timezone, not anything set by the board.
Okay. First you need to go to ACP>Templates and Style>Templates>Template Name>Header Templates>Header.
Now, you can add this script almost anywhere here, but as always, give thought to the style of your forum. I have an Apart style installed, and I have this message next to the "Search" button where it blends in nicely.
Now, add this code anywhere, but remember it will show up wherever you add it:
It's that easy! You now have a dynamic greeting that will respond to the user's clock, instead of responding to the board timezone.
I hope this helps you.
Updated 26/09/12
This code is really simple - in the Header, if the user is visiting in the morning, a message saying "Good Morning!" will be shown, and if they are visiting in the afternoon/evening, a message saying "Good Afternoon!" will be displayed. This all refers to their timezone, not anything set by the board.
Okay. First you need to go to ACP>Templates and Style>Templates>Template Name>Header Templates>Header.
Now, you can add this script almost anywhere here, but as always, give thought to the style of your forum. I have an Apart style installed, and I have this message next to the "Search" button where it blends in nicely.
Now, add this code anywhere, but remember it will show up wherever you add it:
<p id="mywelcomemessage"></p>
<script type="text/javascript"><!--
var d = new Date();
var time = d.getHours();
if (time > 12)
{
document.getElementById("mywelcomemessage").innerHTML="<strong>Good Afternoon!</strong>";
}
else
{
document.getElementById("mywelcomemessage").innerHTML="<strong>Good Morning!</strong>";
}
//-->
</script>
It's that easy! You now have a dynamic greeting that will respond to the user's clock, instead of responding to the board timezone.
I hope this helps you.
Updated 26/09/12
Please don't PM me for support.