Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Countdown Timer
nalexandre
Join Date: Nov 2008
Posts: 25

 

Show Printable Version Email this Page Subscription
nalexandre nalexandre is offline 05-16-2009, 10:00 PM

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.
Attached Images
File Type: bmp CT.bmp (140.1 KB, 331 views)
Reply With Quote
  #2  
Old 05-18-2009, 07:46 AM
Come2Daddy Come2Daddy is offline
 
Join Date: May 2008
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

actually, I'v been looking for this, too

thanx for sharing
Reply With Quote
  #3  
Old 05-20-2009, 02:36 PM
highlander56 highlander56 is offline
 
Join Date: Jan 2009
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Regards

Michael
Reply With Quote
  #4  
Old 05-20-2009, 03:31 PM
nalexandre nalexandre is offline
 
Join Date: Nov 2008
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 05-20-2009, 05:10 PM
highlander56 highlander56 is offline
 
Join Date: Jan 2009
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thanks!

Michael
Reply With Quote
  #6  
Old 06-04-2009, 09:30 PM
mpjaicom mpjaicom is offline
 
Join Date: Dec 2008
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been looking for this.

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

Thanks.
Reply With Quote
  #7  
Old 06-04-2009, 11:39 PM
SVTCobraLTD SVTCobraLTD is offline
 
Join Date: Jul 2007
Location: PA
Posts: 841
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mpjaicom View Post
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>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:39 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.04449 seconds
  • Memory Usage 2,280KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete