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)
-   -   Forum Home Enhancements - Automatic updating clock in navbar. (https://vborg.vbsupport.ru/showthread.php?t=147037)

UltimateOreo! 05-11-2007 10:00 PM

Automatic updating clock in navbar.
 
I relalized that the little clock in the footer was a little small, and it didnt update without a refresh, and I don't think anyone really uses it. Although, for me, a clock is very useful, so why not get it noticed? Thats what this hack attempts to do. This hack is NOT based off server time, only time the browser sends.
I DO realize other hacks like this were made, but this one in my opinion is placed nicer, and is cleaner.
Demo is at www.bralphasquad.com/forums

Support is only in this thread for users who click install.

wolfe 10-06-2007 12:22 AM

nice mod m8 edit it a bit to show seconds and correctly show the am / pm.

PHP Code:

<br /><b>Time Now:</b

<
span id="digitalclock" class="styling"></span>
<
script>
<!--
var 
alternate=0
var standardbrowser=!document.all&&!document.getElementById

if (standardbrowser)
document.write('<form name="tick"><input type="text" name="tock" size="6/form>')

function 
show(){
if (!
standardbrowser)
var 
clockobj=document.getElementByIddocument.getElementById("digitalclock") : document.all.digitalclock
var Digital=new Date()
var 
hours=Digital.getHours()
var 
minutes=Digital.getMinutes()
var 
dn"AM"
var seconds=Digital.getSeconds()

if (
hours==12dn="PM" 
if (hours>12){
dn="PM"
hours=hours-12
}
if (
hours==0hours=12
if (hours.toString().length==1)
hours="0"+hours
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds

if (standardbrowser){
if (
alternate==0)
document.tick.tock.value=hours+":"+minutes+":"+seconds+" "+dn
else
document.tick.tock.value=hours+" "+minutes+" "+seconds+" "+dn
}
else{
if (
alternate==0)
clockobj.innerHTML=hours+":"+minutes+":"+seconds+" "+dn
else
clockobj.innerHTML=hours+":"+minutes+":"+seconds+" "+dn
}
alternate=(alternate==0)? 0
setTimeout
("show()",1000)
}
window.onload=show
//-->
</script


yoyoyoyo 10-06-2007 04:23 AM

demo is not working


All times are GMT. The time now is 07:52 AM.

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.01030 seconds
  • Memory Usage 1,735KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete