Personalized Variables
3 posters
Page 1 of 1
Personalized Variables
This may be more of a support question, but it didn't fit in with any of the forums.
Is there a way to make personalized variables to use in the forum (like {USER} and {FORUMLINK})? I want one that gives the current time and date. Is there already one, or is there a way to make one? Thanks.
Is there a way to make personalized variables to use in the forum (like {USER} and {FORUMLINK})? I want one that gives the current time and date. Is there already one, or is there a way to make one? Thanks.
Re: Personalized Variables
Good Morning!/Afternoon!/Evening! with realtime time and current date.
- Code:
<SCRIPT LANGUAGE="JavaScript">datetoday = new Date();timenow=datetoday.getTime();datetoday.setTime(timenow);thehour = datetoday.getHours();if (thehour > 18) display = "Evening";else if (thehour >12) display = "Afternoon";else display = "Morning";var greeting = ("Good " + display + "!");document.write(greeting);</script> It is <script language="Javascript"> function getime() { var date= new Date(); var h = date.getHours(); var m = date.getMinutes(); var s = date.getSeconds(); var ampm="A.M."; if (h > 11) { ampm="P.M." } if (h > 12) { h-=12 } if(m<10){ m="0"+m } if(s<10){ s="0"+s } clock.innerHTML=h+ ":" +m+ ":" +s+ " " +ampm; setTimeout("getime()",100) }</script><title>Clock</title><span id="clock" class="clock"></span><body onload=getime();> <script language = "JavaScript">var now = new Date();var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var monNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");document.write("and today's date is " + dayNames[now.getDay()] + " " + monNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear());</script>
Re: Personalized Variables
OK thanks, it works great. But is there a way to put it in a variable to use in the site description? Like {TIMEDATE} or something? It's OK if there isn't, I can just use it on the homepage, but I would like to know. Thanks!
Re: Personalized Variables
You can add that code to the forum homepage though, by clicking the general tab in admin panel, then Homepage Block>Configuration..then add to Homepage Message.(scroll down)
Re: Personalized Variables
Support is for the support forum
=> Lock
=> Lock
Caihlem- Energetic
- Posts : 8969
Reputation : 342
Language : English, French & Female
Location : You can't fly like the phenix
Similar topics
» Moving from 1 personalized domain to a new personalized domain
» Variables
» More Variables?
» i need help with variables
» Variables
» Variables
» More Variables?
» i need help with variables
» Variables
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum