Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Joined: Mar 2002
Posts: 305
Mod Name / Version - Menubar Clock 1.0
Description - This modification shows the user's local time in the menu bar.
Working Under - UBB.Threads 6.2
Pre-requisites - none
Author - Lisa_P
Credits - dman for requesting
Files Altered - ubbt.inc.php, ubbt_registered.tmpl, ubbt_unregistered.tmpl
Database Altered - none
New Files - none
NOTE: Prints out a user's local date and time in the menu bar, prints out the server's local time for unregistered.
I personally don't care for the way it looks; I'd probably mess with it more to get it to look a little nicer if I wasn't supposed to be getting ready for school.
Attachments
[:"red"]Lisa[/]
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thank you Lisa!
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Joined: Mar 2002
Posts: 305
[:"red"]Lisa[/]
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
heheh, nice
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Joined: Aug 2000
Posts: 1,609
Installed and working great. Thanks! Although, in the registered.tmpl I added the time after the "Mark All Read" option instead of after the $members_link.
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Joined: Mar 2002
Posts: 305
For those who want a clock that updates itself, and shows the user's own computer time, but is in javascript and not php, try this:
In ubbt_registerednav.tmpl and ubbt_unregisterednav.tmpl, find this:
<br />$members_link<br /> |<br /><a href = "$phpurl/markallread.php?Cat=$Cat" $target>{$ubbt_lang['MARKALL']}</a><br /></td><br /></tr><br />$tbclose<br /> and change it to this:
<br />$members_link<br /> |<br /><a href = "$phpurl/markallread.php?Cat=$Cat" $target>{$ubbt_lang['MARKALL']}</a><br /><div id="Clock" class="menubar"> </div><br /><script><br />function tick() {<br /> var hours, minutes, seconds, ap;<br /> var intHours, intMinutes, intSeconds;<br /> var today;<br /> today = new Date();<br /> intHours = today.getHours();<br /> intMinutes = today.getMinutes();<br /> intSeconds = today.getSeconds();<br /> if (intHours == 0) {<br /> hours = "12:";<br /> ap = "A.M.";<br /> } else if (intHours < 12) { <br /> hours = intHours+":";<br /> ap = "A.M.";<br /> } else if (intHours == 12) {<br /> hours = "12:";<br /> ap = "P.M.";<br /> } else {<br /> intHours = intHours - 12<br /> hours = intHours + ":";<br /> ap = "P.M.";<br /> }<br /> if (intMinutes < 10) {<br /> minutes = "0"+intMinutes+":";<br /> } else {<br /> minutes = intMinutes+":";<br /> }<br /> if (intSeconds < 10) {<br /> seconds = "0"+intSeconds+" ";<br /> } else {<br /> seconds = intSeconds+" ";<br /> } <br /> timeString = hours+minutes+seconds+ap;<br /> Clock.innerHTML = timeString;<br /> window.setTimeout("tick();", 100);<br />}<br />window.onload = tick;<br /></script><br /></td><br /></tr><br />$tbclose<br /> that's it
[:"red"]Lisa[/]
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Fans Focus - Focusing on Fans of Sport
(Okay - mainly football (the British variety at the moment - but expanding all the time....)
Joined: Jan 2003
Posts: 141
Journeyman
Journeyman
Joined: Jan 2003
Posts: 141
Ok Lisa, it really works great. I have one question though. Do you know why it would work perfect on every screen except the Main Index screen? You can tell there's something supposed to be there but it's not, but it looks great everywhere else.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
badfrog
somewhere on the coast of Maine
Posts:
94
Joined: March 2007
Forums63
Topics37,575
Posts293,931
Members13,824
Most Online6,139Sep 21st, 2024
Currently Online
Topics Created
Posts Made
Users Online
Birthdays