vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Clock and Date in Navbar (https://vborg.vbsupport.ru/showthread.php?t=118253)

[email protected] vbmenu_register("postmenu_1093582", true); 10-10-2006 01:13 AM

At 12:01 PM the clock always shows 12:01 AM. Once it reaches 1:00 PM it goes back to the correct time.

Take a look. Maybe a bug in the code. At 12:01 PM it should read 12:01 PM not AM.

COBRAws 10-10-2006 01:23 AM

Can be this hack converted into a plugin?

Thanks

hotwheels 10-11-2006 11:55 PM

Not really needed COBRAws.........It's just a template mod, instead of a .php or query's..

LordDB 10-12-2006 09:36 AM

Quote:

Originally Posted by Aclikyano
Code:

<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h<10) {h="0" + h}
if (h>12) {h-=12;am_pm = "P.M."}
else {am_pm = "A.M."}
document.getElementById("clock").innerHTML=days[day] + " | " + months[month] + "    " + date  + ", " + year + " | " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script>

I rewrote this clock code from another coder...........
This is the more neater version :)

TRY IT FOR YA SELF.

Cheers, Aclikyano, :D for sharing this great revised code...this is what it looks like:

Thursday | October 12, 2006 | 6:33:51 P.M.

Thanks also to, Superfly, for sharing, too!

Br.:cool:

G_Man 10-21-2006 09:20 PM

Took Hotwheels code and tweaked it to fit my site a bit better...

Thanks for the great idea and thanks to hotwheels for his input.

*clicks install* :)

sunnycher 10-26-2006 12:40 AM

Love it!

gamerzindo 11-14-2006 10:06 AM

installed thanks

hepatit-b 11-14-2006 12:33 PM

thanks

johnrizz 11-14-2006 08:17 PM

Pretty cool... ;:=- Thanks

Kadi 11-15-2006 08:01 AM

Hi,

This is great mod. I'd like to add it but I need to translate the days and am/pm. I tried using $vbphrase['varname'] but that messed things up.

What do I do?

Thanks

SuperFly 11-16-2006 12:56 AM

The code is nothing to do with VB, its all Javascript pulled from the home computers.

bklynjava 11-16-2006 01:03 AM

Installed - Nice lil hack.

slappy 11-16-2006 02:40 PM

One side effect of using this clock is that it makes the mouse cursor blink in time with the second counter. Not a major problem, but quite a visible "effect" of the seconds ticking by.

Regards,

Kadi 11-17-2006 12:59 PM

Quote:

Originally Posted by SuperFly (Post 1118312)
The code is nothing to do with VB, its all Javascript pulled from the home computers.

So I can't translate it?

SuperFly 11-17-2006 05:45 PM

What exactly do you want them to say?

Kadi 11-18-2006 10:09 AM

My forum is in Arabic. I would have liked to translate the days and the am/pm into Arabic. Numbers stay the same.

KURTZ 01-07-2007 11:34 AM

i've a question: it's possible to set the date before the month?

pandaram 02-09-2007 12:25 PM

Quote:

Originally Posted by KURTZ (Post 1152549)
i've a question: it's possible to set the date before the month?

Code:

<!-- clock hack-->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months=new Array("1","2","3","4","5","6","7","8","9","10","11","12");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=months[month] + "-" + date + "-" + year + " " + days[day] + " " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->

use this to make in that format

Deadly Assassin 02-10-2007 03:50 AM

Thanks alot,

Excellent :up:

https://vborg.vbsupport.ru/

engineco16 02-11-2007 01:53 PM

I like, thanks!

sdphotoforum 02-12-2007 09:52 AM

Very nice! Thanks.

- Marshall

Gizmo5h1t3 02-16-2007 09:44 AM

date before the month is this, not as shown above....

Quote:

<!-- clock hack-->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday");
var months=new Array("1","2","3","4","5","6","7","8","9","10","11 ","12");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML= date + "-" + months[month] + "-" + year + " " + days[day] + " " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->

deezelpope 03-14-2007 10:41 AM

Damn, that was easy and fast!!! Beautiful!! Thank you very much!!:up: :D

Kadi 03-19-2007 03:01 PM

Quote:

Originally Posted by daPLAYBOY (Post 1095262)
Cheers, Aclikyano, :D for sharing this great revised code...this is what it looks like:

Thursday | October 12, 2006 | 6:33:51 P.M.

Thanks also to, Superfly, for sharing, too!

Br.:cool:

Thanks guys...Superfly, Aclikyano, daPLAYBOY...finally changed it to Arabic and here it is if anybody should need it.

Quote:

<!-- clock hack -->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("الأحد","الإثنين","الثلاثاء","الأربعاء","الخ ميس","الجمعة","السبت");
var months=new Array("يناير","فبراير","مارس","أبريل","مايو","يوني و","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديس مبر");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h<10) {h="0" + h}
if (h>12) {h-=12;am_pm = "مساءً"}
else {am_pm = "صباحاً"}
document.getElementById("clock").innerHTML=days[day] + " | " + months[month] + " " + date + ", " + year + " | " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->

K D Umbaugh 06-03-2007 04:58 PM

works great I just made a minor changes, inserted title and made bold.

if you would like to see Neighborhood Round Table

SuperTaz 06-03-2007 05:53 PM

Very nice...Installed.

lgnd 06-08-2007 12:39 PM

Thank You! Very useful! :)

jderouen 06-14-2007 02:20 PM

Very nice. Installed. Just one question - is it possible to make it use the time zone from whatever the user selects in the UserCP?

jderouen 06-15-2007 04:46 AM

Hmm. It seems to be working fine, except that, at 46 minutes after midnight, the time reads 00:46:21. What's up with that, and how do I fix it?

Thanks!
Joe

CMGU 06-15-2007 03:05 PM

thanks very nice

Rated 07-14-2007 01:48 AM

To make it look like this:

Friday July 13, 2007 10:47:23 PM

Use this code:

<!-- clock hack-->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday");
var months=new Array("January","February","March","April","May"," June","July","August","Septemb er","October","November","December");
var AM_PM;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;AM_PM = "PM"}
else {AM_PM="AM"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=days[day] + " " + months[month] + " " + date + "," + " " + year + " " + h + ":" + m + ":" + s + " " + AM_PM;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->

dismas 07-16-2007 07:34 AM

Installed!

Nice little addition.

For those asking, "Why?", I think it would come in handy if someone is burdened with running Windows and IE when the IE window is maximized and system tray clock can't be seen. No need to make the bar visible just to see the time if it's already in the forum. Plus, if you're looking at the calendar, maybe you need a reminder of the date and time.

WarLion 08-21-2007 07:36 AM

this is the one fro spanish ( mexico )

Quote:

<!-- clock hack-->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Domingo","Lunes","Martes","Miercoles","Juev es","Viernes","Sabado");
var months=new Array("Ene","Feb","Mar","Abr","May","Jun","Jul","A go","Sep","Oct","Nov","Dic");

var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=days[day] + " " + date + "/" + months[month] + "/" + year + " " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->
i love this mod thanks installed

mlucek 08-21-2007 10:41 PM

Sweet and simple !! GREAT !! :D

Tweaked the look to suit my own tastes :

Tues 8-21-2007 [ 4:45:02 PM]

moved the day to the front, got rid of the leading zero on the hours and capitalized the PM/AM :)

*** clicks INSTALL ***

afullcup 10-13-2007 02:38 PM

Is there any way to make this come from the server time? We run auctions on our site and it would be nice if everyone was looking at the same time for auction end. Thanks!

yeku 10-19-2007 12:43 PM

Quote:

Originally Posted by hotwheels (Post 1083199)
and, if you would like to change the color of your font's to stand out more then the other color's in your welcome box, use this code and just change the #0000FF to what ever color you would like.

Quote:

<!-- clock hack -->
<font color="#0000FF">
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sun","Mon","Tue","Wed","Thurs","Fri","Sat") ;
var months=new Array("1","2","3","4","5","6","7","8","9","10","11 ","12");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=months[month] + "-" + date + "-" + year + " " + days[day] + " " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script></font>
<!-- / clock hack -->
With mozilla the change of color does not work...:(:(

some solution or advice?

byee

cafenetland 03-16-2008 02:10 PM

gr8 idea

thx

Rideharder 03-16-2008 05:45 PM

Me liky

www.speedaholic.net

added!

moschino 03-29-2008 06:51 PM

Nice and great on 3.6.8 PL2 tks Installed

OG-G 04-06-2008 07:17 AM

hi nice mod..., however is it possible to show an analogue display... a flash or something.. make it look more intresting.. cheers all


All times are GMT. The time now is 01:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01325 seconds
  • Memory Usage 1,829KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete