vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Countdown Timer (https://vborg.vbsupport.ru/showthread.php?t=213879)

nalexandre 05-16-2009 10:00 PM

Countdown Timer
 
1 Attachment(s)
Info:

This is a little mod i made, because i was looking for a similar mod, but did not find anything, so i made this one. Hope someone use it!! :)

What does it do?

It put?s a countdown timer on the head of your forum.

Features:

Easy to use/install.

Installation:


My choice was at the top, but change it as you like.

Go to AdminCP>Styles & Templates>Header>Find "<!-- nav buttons bar -->" , right before paste this:

HTML Code:

<script LANGUAGE="JavaScript">
<!--
// by CMBP
var now = new Date();
var event = new Date("[COLOR="Red"]Dec 31 2009 12:00:00[/COLOR]");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.days.value = days;
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
document.form1.seconds.value = seconds;
ID=window.setTimeout("update();",1000);
}
// -->

</script>
<p><font face="Arial" size="3">Countdown To [COLOR="Red"]December 31, 2009, at 12:00[/COLOR]: </font></p>
<form name="form1"><p><font face="Arial" size="2">Days <input type="text" name="days" value="0" size="3"> Hours
<input type="text" name="hours" value="0" size="4"> Minutes <input type="text" name="minutes" value="0"
size="7">
Seconds <input type="text" name="seconds" value="0" size="7"> </font> </p>
</form>

Redifine the target time to countdown as you wish " in red"

Screenshots:

See the example in attach.

Thank you.

Come2Daddy 05-18-2009 07:46 AM

actually, I'v been looking for this, too

thanx for sharing :)

highlander56 05-20-2009 02:36 PM

I like this script...nice.
But....how does one go about actually setting the time?
Perhaps I am missing something obvious.:D

Regards

Michael

nalexandre 05-20-2009 03:31 PM

Hi, to set the target time you must enter the date where i put in red.

Quote:

<script LANGUAGE="JavaScript">
<!--
// by CMBP
var now = new Date();
var event = new Date("Dec 31 2009 12:00:00");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.days.value = days;
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
document.form1.seconds.value = seconds;
ID=window.setTimeout("update();",1000);
}
// -->
</script>
<p><font face="Arial" size="3">Countdown To December 31, 2009, at 12:00: </font></p>
<form name="form1"><p><font face="Arial" size="2">Days <input type="text" name="days" value="0" size="3"> Hours
<input type="text" name="hours" value="0" size="4"> Minutes <input type="text" name="minutes" value="0"
size="7"> Seconds <input type="text" name="seconds" value="0" size="7"> </font> </p>
</form>
Thanks and sorry about my english :)

highlander56 05-20-2009 05:10 PM

Thanks.
When I installed it in a web page, it did not count down.
Now, it does....

Thanks!

Michael

mpjaicom 06-04-2009 09:30 PM

I've been looking for this.

Is there a way to add text to this. Maybe i'm missing it.

Thanks.

SVTCobraLTD 06-04-2009 11:39 PM

Quote:

Originally Posted by mpjaicom (Post 1823595)
I've been looking for this.

Is there a way to add text to this. Maybe i'm missing it.

Thanks.

Isnt this the part for the text??

Quote:

// -->
</script>
<p><font face="Arial" size="3">Countdown To December 31, 2009, at 12:00: </font></p>
<form name="form1"><p><font face="Arial" size="2">Days <input type="text" name="days" value="0" size="3"> Hours
<input type="text" name="hours" value="0" size="4"> Minutes <input type="text" name="minutes" value="0"
size="7"> Seconds <input type="text" name="seconds" value="0" size="7"> </font> </p>
</form>


All times are GMT. The time now is 07:07 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.01023 seconds
  • Memory Usage 1,737KB
  • 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_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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