vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - YoBroMoFo - Countdown Timer (https://vborg.vbsupport.ru/showthread.php?t=234060)

TimberFloorAu 01-23-2010 10:00 PM

YoBroMoFo - Countdown Timer
 
1 Attachment(s)



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

VonDoom 01-24-2010 08:38 PM

Pretty cool tagged

TimberFloorAu 01-24-2010 08:39 PM

FMD Von you are on the ball today :up:

TimberFloorAu 01-24-2010 08:42 PM

You can remove hours and minutes quite easily and replace with :

Open the js file.

find:
Code:

= days+' days + '+hours+' hours '+mins+' minutes '
Change to:
Code:

= days+' days + '+hours+' : '+mins+' : '
Save and re-upload.

To get rid of seconds.

open header template:

find:
Code:

</span> seconds
Change to:
Code:

</span>
Click save and done.

Dr.osamA 01-25-2010 04:57 AM

gooood jop Man

thnxxx very much

installed + 5 stars
________
Uhwh Warehouse

TimberFloorAu 01-25-2010 05:07 AM

Thanks Dr.

It complies in FF and Chrome, but not in IE.

Hope it comes in useful. Ste

RedHacker 01-25-2010 05:10 AM

Is it possible to inside this in a widget....?

TimberFloorAu 01-25-2010 05:11 AM

Of course, but can you tell me what you would want it to look like ?

RedHacker 01-25-2010 05:13 AM

I would put it as a Widget to countdown to change the time.

etg 2011

TimberFloorAu 01-25-2010 05:32 AM

I dont have much to do with widgets, is this for forum or cms

RedHacker 01-25-2010 05:41 AM

For the CMS :)

TimberFloorAu 01-25-2010 05:42 AM

< k novice here. How do you place a widget IN the cms after creating it ?

RedHacker 01-25-2010 05:46 AM

At the end of page in CMS

TimberFloorAu 01-25-2010 05:48 AM

Best leave it to someone else.

We have a lot of stuff missing from cms.

RedHacker 01-25-2010 05:56 AM

OK but it was be look nice...

fayax 01-28-2010 02:57 AM

good mod but .... umm is it actually going to say yobromofo on it too?

Dont think I want a name like that on my forum.

TimberFloorAu 01-28-2010 03:01 AM

<<< seriously baffled by that. The IMAGE yobromofo is a watermark. Nothing more nothing less.

It also doesnt say My Username
Nor the buttons across the top ;)

Numenorean7 02-09-2010 08:53 PM

This is an awesome mod, it works great. I'd be cool if it was a bit more simple to install and to manage afterward.

wampforum 03-19-2010 04:26 PM

installed but cant get it to show correctly. It shows my own text. and the forum link works fine
but i dont know where to upload the png file too? I added in with the JS file (so forum/js/counter.png)
also what is the var lab for? I couldnt understand that bit.
Finally is it possible to put this just in a specific forum and just in that forum header rather than the main header?
thanks

TimberFloorAu 03-19-2010 06:43 PM

Instructions are pretty simple mate , what png file ?

wampforum 03-22-2010 10:17 AM

not simple enough for me it seems!
re installed and managed to get it working!! (hard been a noob sometimes!)

Is it possible to show this elsewhere then?

thanks

PHILLYFAN 04-13-2010 06:17 PM

alittle new to this.. i believe I did everything correctly however, it's no counting down this is all it says

seconds until Advance to Divisional Round

any reason y?

TimberFloorAu 04-13-2010 07:08 PM

That image doesnt exist Philly.

Did you edit the count.js as per step one ?

PHILLYFAN 04-13-2010 08:00 PM

I'm sure I did it wrong, so my early apologies... this is what i have. I was on the understanding to change the numbers, this is what I have

Quote:

var month = '0'; // 1 through 12 or '*' within the next month, '0' for the current month
var day = '13'; // 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 = 9; // 0 through 23 for the hour of the day
var min = 59; // 0 through 59 for minutes after the hour
var tz = 10; // offset in hours from UCT 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);

mmacrypt 04-14-2010 03:34 AM

I have it installed on my test page and link the image for the guys on the site to take a look at. If they like the feel, I'm going to install it. Would be nice if the edits were a tad easier but I do like it.
https://vborg.vbsupport.ru/external/2010/04/49.png

PHILLYFAN 04-16-2010 08:33 PM

Quote:

Originally Posted by PHILLYFAN (Post 2020738)
I'm sure I did it wrong, so my early apologies... this is what i have. I was on the understanding to change the numbers, this is what I have

any help please?

TimberFloorAu 04-16-2010 08:42 PM

That IMAGE still does not exist for us to check.


Ahhh or is that your signature ?

OK You need to be SPECIFIC mate ;)

mmacrypt 04-17-2010 01:10 AM

Ok, have it installed and working. Thank you. I went ahead and changed it so it upper left on our site. If people want to see it working, feel free to look at http://mmacrypt.com/forum/forum.php, I hope that's ok that I sent a link.

PHILLYFAN 04-17-2010 01:39 AM

Here is what my js file currently says.

Quote:

var month = '0'; // 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 = 11; // 0 through 23 for the hour of the day
var min = 11; // 0 through 59 for minutes after the hour
var tz = 10; // 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);
First line - First like I added a "0" cause it says 0=current month.
Second line - left alone
Third line - left alone
4th and 5th line For hour and min i change to 11. I just added a number to see if it worked.
6th line - not sure what this is ???? offset hours?
7th line - not sure what this is.

I uploaded the js to my forum root ( forum/js)
I made the edit changes like it said.

all it says in the upper right corner is -- # seconds until Off Season Starts

PHILLYFAN 04-17-2010 01:40 AM

Quote:

Originally Posted by mmacrypt (Post 2022490)
Ok, have it installed and working. Thank you. I went ahead and changed it so it upper left on our site. If people want to see it working, feel free to look at http://mmacrypt.com/forum/forum.php, I hope that's ok that I sent a link.

how did u get it to move to the left corner? Also how did u add color to the timer?
thanks

mmacrypt 04-17-2010 02:35 AM

Quote:

Originally Posted by PHILLYFAN (Post 2022506)
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-->


Hall of Famer 04-17-2010 10:00 AM

Screenshots please?

mmacrypt 04-17-2010 03:06 PM

Quote:

Originally Posted by Hall of Famer (Post 2022616)
Screenshots please?

Not sure if this was for me or not but this is how I have it set up, upper left.

https://vborg.vbsupport.ru/external/2010/04/44.png

PHILLYFAN 04-17-2010 04:17 PM

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?

mmacrypt 04-18-2010 04:19 AM

I'm a bit spent, I will do it tomorrow buddy.

PHILLYFAN 04-18-2010 06:49 PM

ok.......

PHILLYFAN 04-20-2010 12:21 AM

anything guys?

mmacrypt 04-21-2010 02:52 AM

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);}}


emath 03-23-2011 08:56 PM

works with vb4.1.2? anyone knows?


All times are GMT. The time now is 05:46 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.01347 seconds
  • Memory Usage 1,826KB
  • 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
  • (11)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (39)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