The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Personalized Variables

3 posters

Go down

Personalized Variables Empty Personalized Variables

Post by AMV_Ph34r March 26th 2008, 1:32 am

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.
AMV_Ph34r
AMV_Ph34r
New Member

Male Posts : 24
Reputation : 0
Language : English
Location : North Carolina

http://engrishamvmix.darkbb.com

Back to top Go down

Personalized Variables Empty Re: Personalized Variables

Post by Decibel March 26th 2008, 1:58 am

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>&nbsp;It is&nbsp;<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();>&nbsp;<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>
Decibel
Decibel
Forumember

Male Posts : 201
Reputation : 10
Language : english
Location : Canada

http://decibels.forumsmusic.com

Back to top Go down

Personalized Variables Empty Re: Personalized Variables

Post by AMV_Ph34r March 26th 2008, 2:05 am

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!
AMV_Ph34r
AMV_Ph34r
New Member

Male Posts : 24
Reputation : 0
Language : English
Location : North Carolina

http://engrishamvmix.darkbb.com

Back to top Go down

Personalized Variables Empty Re: Personalized Variables

Post by Decibel March 26th 2008, 2:06 am

I believe the {variables} can only be done serverside.
Decibel
Decibel
Forumember

Male Posts : 201
Reputation : 10
Language : english
Location : Canada

http://decibels.forumsmusic.com

Back to top Go down

Personalized Variables Empty Re: Personalized Variables

Post by AMV_Ph34r March 26th 2008, 2:07 am

Alright, thanks anyway. Smile
AMV_Ph34r
AMV_Ph34r
New Member

Male Posts : 24
Reputation : 0
Language : English
Location : North Carolina

http://engrishamvmix.darkbb.com

Back to top Go down

Personalized Variables Empty Re: Personalized Variables

Post by Decibel March 26th 2008, 2:09 am

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)
Decibel
Decibel
Forumember

Male Posts : 201
Reputation : 10
Language : english
Location : Canada

http://decibels.forumsmusic.com

Back to top Go down

Personalized Variables Empty Re: Personalized Variables

Post by Caihlem March 26th 2008, 8:16 am

Support is for the support forum Wink

=> Lock
Caihlem
Caihlem
Energetic

Male Posts : 8969
Reputation : 342
Language : English, French & Female
Location : You can't fly like the phenix

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum