Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
YoBroMoFo - Countdown Timer Details »»
YoBroMoFo - Countdown Timer
Version: 1.00, by TimberFloorAu TimberFloorAu is offline
Developer Last Online: Jan 2013 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.0.1 Rating:
Released: 01-23-2010 Last Update: Never Installs: 23
Template Edits
Re-useable Code Translations  
No support by the author.




YoBroMoFo - Countdown Timer

Takes 5 minutes to upload, and do 2 template edits. Please mark installed if you use, as

all of our modifications are totally free of charge and openly shared with the vbulletin

community.

Anyhoo - Let's Get started.

*************
STEP ONE
*************
Open count.js from the js folder

Change these lines below to match the event you are counting down to:

Code:
var month = '*'; // 1 through 12 or '*' within the next month, '0' for the current month
var day = '26';   // day of month or + day offset
var dow = 3;     // day of week sun=1 sat=7 or 0 for whatever day it falls on
var hour = 0;    // 0 through 23 for the hour of the day
var min = 0;    // 0 through 59 for minutes after the hour
var tz = 10;     // offset in hours from UTC to your timezone
Click save

Then upload the js folder to forum root. Path should be:
www.yoursite.com/forum/js

click merge if this folder exists

*************
STEP TWO
*************

goto admincp >> styles and templates >> your template >>

search for: header and open it

find:
Code:
<input type="hidden" name="vb_login_md5password_utf" />
            </form>    
        </vb:if>
Add AFTER:

Code:
<!--yobromofo.com countdown timer start-->
<li><span id="yobromofo-countdown-timer"></span> seconds <a 

href="http://www.yobromofo.com/forum/f3/the-australia-day-thread-17840/">until Australia 

Day</a></li>
<!--yobromofo.com countdown timer end-->
Change:
"http://www.yobromofo.com/forum/f3/the-australia-day-thread-17840/" to the forum thread

this countdown refers to. If you dont need a link, then change to...

Code:
<!--yobromofo.com countdown timer start-->
<li><span id="yobromofo-countdown-timer"></span> seconds until Australia Day</li>
<!--yobromofo.com countdown timer end-->
Change: until Australia Day to match your event name

Click SAVE

*************
STEP TWO ( final step )
*************

open headinclude

at very bottom add

Code:
<!--yobromofo.com countdown js file start-->
<script type="text/javascript" src="js/count.js">
</script>
<!--yobromofo.com countdown js file end-->
ensure the path is correct.

Click save.

You are DONE !

to change the event date etc. just edit the js file, reupload you are done.
to change the event title, change it in the header template.

Have fun.

Steve aka timberfloorau from YoBroMoFo.com British Expats Forum

Download Now

File Type: zip yobromofo-counter.zip (6.6 KB, 159 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 04-17-2010, 02:35 AM
mmacrypt's Avatar
mmacrypt mmacrypt is offline
 
Join Date: Feb 2010
Location: Colorado
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by PHILLYFAN View Post
how did u get it to move to the left corner? Also how did u add color to the timer?
thanks
I moved it as the 2nd line in the header, here is my code starting at the top of the header.
Code:
  <div id="newnav">
<div style="font-weight:bold;float:left;padding:0 0 0 15px"><!--yobromofo.com countdown timer start-->
<li><font color="#FF0000"><span id="yobromofo-countdown-timer"></span> seconds <a style="color:#2B60DE" href="http://mmacrypt.com/forum/showthread.php?7002-UFC-113-Machida-vs.-Shogun-II">until UFC 113</a></font></li>
<!--yobromofo.com countdown timer end-->
Reply With Quote
  #33  
Old 04-17-2010, 10:00 AM
Hall of Famer Hall of Famer is offline
 
Join Date: Apr 2009
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Screenshots please?
Reply With Quote
  #34  
Old 04-17-2010, 03:06 PM
mmacrypt's Avatar
mmacrypt mmacrypt is offline
 
Join Date: Feb 2010
Location: Colorado
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hall of Famer View Post
Screenshots please?
Not sure if this was for me or not but this is how I have it set up, upper left.

Reply With Quote
  #35  
Old 04-17-2010, 04:17 PM
PHILLYFAN PHILLYFAN is offline
 
Join Date: Jul 2008
Location: Hell
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mmacrypt could u copy your js and paste it here so I can see how you have it set up? I would greatly appreciate it man?
Reply With Quote
  #36  
Old 04-18-2010, 04:19 AM
mmacrypt's Avatar
mmacrypt mmacrypt is offline
 
Join Date: Feb 2010
Location: Colorado
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm a bit spent, I will do it tomorrow buddy.
Reply With Quote
  #37  
Old 04-18-2010, 06:49 PM
PHILLYFAN PHILLYFAN is offline
 
Join Date: Jul 2008
Location: Hell
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok.......
Reply With Quote
  #38  
Old 04-20-2010, 12:21 AM
PHILLYFAN PHILLYFAN is offline
 
Join Date: Jul 2008
Location: Hell
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anything guys?
Reply With Quote
  #39  
Old 04-21-2010, 02:52 AM
mmacrypt's Avatar
mmacrypt mmacrypt is offline
 
Join Date: Feb 2010
Location: Colorado
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry buddy, got super busy. Here is how I have mine set up, didn't change much at all.

Code:
ar month = '5'; // 1 through 12 or '*' within the next month, '0' for the current month
var day = '8';   // day of month or + day offset
var dow = 0;     // day of week sun=1 sat=7 or 0 for whatever day it falls on
var hour = 20;    // 0 through 23 for the hour of the day
var min = 0;    // 0 through 59 for minutes after the hour
var tz = -6;     // offset in hours from UTC to your timezone
var lab = 'yobromofo-countdown-timer';  // id of the entry on the page where the counter is to be inserted

function start() {displayCountdown(setCountdown(month,day,hour,min,tz),lab);}
loaded(lab,start);

// Countdown Javascript
// copyright 20th April 2005, 1st November 2009 by Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the code in this script (including these
// comments) is used without any alteration
// you may change the start function if required
// code adapted for vbulletin by timberfloorau of yobromofo.com british expats australia
var pageLoaded = 0; window.onload = function() {pageLoaded = 1;}
function loaded(i,f) {if (document.getElementById && document.getElementById(i) != null) f(); else if (!pageLoaded) setTimeout('loaded(\''+i+'\','+f+')',100);
}
function setCountdown(month,day,hour,min,tz) {var m = month; if (month=='*') m = 0;  var c = setC(m,day,hour,tz); if (month == '*' && c < 0)  c = setC('*',day,hour,tz); return c;} function setC(month,day,hour,tz) {var toDate = new Date();if (day.substr(0,1) == '+') {var day1 = parseInt(day.substr(1));toDate.setDate(toDate.getDate()+day1);} else{toDate.setDate(day);}if (month == '*')toDate.setMonth(toDate.getMonth() + 1);else if (month > 0) { if (month <= toDate.getMonth())toDate.setFullYear(toDate.getFullYear() + 1);toDate.setMonth(month-1);}
if (dow >0) toDate.setDate(toDate.getDate()+(dow-1-toDate.getDay())%7);
toDate.setHours(hour);toDate.setMinutes(min-(tz*60));toDate.setSeconds(0);var fromDate = new Date();fromDate.setMinutes(fromDate.getMinutes() + fromDate.getTimezoneOffset());var diffDate = new Date(0);diffDate.setMilliseconds(toDate - fromDate);return Math.floor(diffDate.valueOf()/1000);}
function displayCountdown(countdn,cd) {if (countdn < 0) document.getElementById(cd).innerHTML = "Sorry, you are too late."; else {var secs = countdn % 60; if (secs < 10) secs = '0'+secs;var countdn1 = (countdn - secs) / 60;var mins = countdn1 % 60; if (mins < 10) mins = '0'+mins;countdn1 = (countdn1 - mins) / 60;var hours = countdn1 % 24;var days = (countdn1 - hours) / 24;document.getElementById(cd).innerHTML = days+' days '+hours+' hours '+mins+' minutes '+secs;setTimeout('displayCountdown('+(countdn-1)+',\''+cd+'\');',999);}}
Reply With Quote
  #40  
Old 03-23-2011, 08:56 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works with vb4.1.2? anyone knows?
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 09:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04573 seconds
  • Memory Usage 2,334KB
  • Queries Executed 27 (?)
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
  • (7)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete