PDA

View Full Version : vBulletin Forum Sideblocks - VC_Countdown (FORUM BLOCK)


midnz
10-09-2011, 10:00 PM
D E S C R I P T I O N

Countdown timer for forum sidebars that is configurable from the admin control panel. This countdown timer will calculate the remaining time left to reach your targeted event according to the GMT Time Zone Offset that you have pre-set in the admincp (VC_Countdown options). This countdown will expire at the same moment in time for all viewers, regardless of their separate time zones.

You can count down to any future month/day/time within the next 12 months.

This countdown timer is ideal for counting down to:
- have competitors meet at the same time for tournaments on gaming servers (which is what I have used it for)
- for fixed term offers
- for items available in X days
- for sale begins in X days time
or for whatever else tickles your fancy.

This is a no-frills countdown timer but there are no files to upload to your server and there is no need to fiddle around with templates and codes to adjust the countdown expiry date.
You can easily adjust this countdown display to suit forum sidebar widths from 165px to 300px.

I N S T R U C T I O N S

1. Import Product
Plugins & Products / Manage Products / Add/Import Product
Import: product-vc_countdown.xml

2. Create Forum Block
Forums & Moderators / Forum Blocks Manager / Add Block

Select Block Type: Custom HTML/PHP
Title: Event Timer (or whatever you prefer)
Description: VC_Countdown Event Timer
Content Type: HTML
Content: <div></div>
Template to use: block_VC_Countdown

3. Configure VC_Countdown
Admincp / Settings / Options / VC_Countdown

________________________________________


PLEASE NOTE: I have only tested this as working on 4.0.8 PL4.
Confirmed working well on 4.1.3 by rammieone (https://vborg.vbsupport.ru/member.php?u=347772)______________________________ __________

Updates:
v1.0.3
Removed superfluous css
Added css to enable proper font-color control over all four strings of text
Added ability to include background image
v1.0.4
Added 4 levels of bgimage transparency
Added bgimage 100% height & width of forum block container
Removed option for image:repeat
Added padding options for between (Event Name & top of forum block) and (Event Name & Countdown Numbers)
v1.0.5
Removed "X Days from Now" option (If you don't experience save/default problems using version 1.0.4 there is no need to update to 1.0.5)

ProFifaLeagues
10-11-2011, 05:19 AM
Confirmed working well on 4.1.3 too thank you

oldlock
10-11-2011, 12:56 PM
Great mod. One question - any idea how to align the output so it's central in the block ? Std <center> tags don't seem to work. ?

socialteenz
10-11-2011, 03:54 PM
Thank you.
INSTALLED.

midnz
10-11-2011, 05:29 PM
Great mod. One question - any idea how to align the output so it's central in the block ? Std <center> tags don't seem to work. ?

Have you set the 1st option "FORUM SIDEBAR WIDTH" correctly? That setting should centralise the output according to the width of your forum sidebar.

If you have already set that option correctly and the output is not properly aligned, would you mind providing a link for me to view and also list the browser you're using?

ceho
10-11-2011, 07:19 PM
oldlock seems to be right, I have the same issue, width is set correctly, on Opera and FF. I am playing around with the mod, it's actually cool. The event name font color doesn't work from the ACP (condition is missing in the CSS of the template), but that's not a big deal. What I really don't get is to add any extra content to the block, whatever I try it's "only" showing the countdown, I cannot add an image or anything like this. Any idea how to solve this? Otherwise it's a great mod, I have been looking for something like this for a while :). Thanks!

Edit: never mind, I wrote the extras right into the template, that worked ;-).

midnz
10-11-2011, 08:09 PM
oldlock seems to be right, I have the same issue, width is set correctly, on Opera and FF. I am playing around with the mod, it's actually cool. The event name font color doesn't work from the ACP (condition is missing in the CSS of the template), but that's not a big deal. What I really don't get is to add any extra content to the block, whatever I try it's "only" showing the countdown, I cannot add an image or anything like this. Any idea how to solve this? Otherwise it's a great mod, I have been looking for something like this for a while :). Thanks!

Edit: never mind, I wrote the extras right into the template, that worked ;-).

I noticed that I missed an option to change the font colour of the counter numbers ... oops! I've already added that option in to an updated .xml that I'm working on as well as removed some superfluous style code that either wasn't necessary or interfered with the alignment of the Expired Notice. (attached - removed attachment)

I'm not sure yet why the display might not be aligned properly for some people.
All of the text within the display should be aligned centre as per the style sheet within the template.
The main div was made to be 20px smaller than the width of the forum sidebar; IE: If your sidebar is 180px wide, and you select the first option (FORUM SIDEBAR WIDTH) at 180px, then the main countdown div would be reduced to 160px. So you could select the next higher option (FORUM SIDEBAR WIDTH) to see if that helps with alignment.

You might want to share how you managed to include a bgimage for the sake of others want to do that too.
You might also want to click that "Mark as Installed" button :)

oldlock
10-12-2011, 11:08 AM
Thanks. Changing the width solved my issue.

midnz
10-13-2011, 06:03 PM
Version 1.0.3
- added an option to include a background image
- tidied up some CSS

ProFifaLeagues
10-15-2011, 07:00 PM
Update works great again with 4.1.3 Thanks mate superb work

exhibitionpoult
11-06-2011, 11:58 PM
I have just installed this mod on 4.1.6 and it seems to be working fine.

KeystoneAirsoft
12-11-2011, 10:45 PM
:( Not working on 4.1.8. Hope one day this is updated for new vers of vbulletin.

midnz
12-12-2011, 05:18 PM
:( Not working on 4.1.8. Hope one day this is updated for new vers of vbulletin.
I'm upgrading my own forum to 4.1.8 within the next 24 hours or so. I'll be see what the problem might be once that is done.

OldSchoolDSL
12-12-2011, 07:20 PM
:( Not working on 4.1.8. Hope one day this is updated for new vers of vbulletin.

Installed and working on 4.1.8 .... For a little over 1 month now.... :confused:

See for yourself.....

Http://www.SociallyUncensored.eu/forums/

I would suspect you have something conflicting. Try turning off all your other modifications and see if it works.

OldSchoolDSL
12-13-2011, 06:52 AM
Confirmed working on

4.1.9 beta 1

But keep in mind this could change upon the release of 4.1.9 final.

So this should easily work for 4.1.8

midnz
12-15-2011, 09:16 PM
:( Not working on 4.1.8. Hope one day this is updated for new vers of vbulletin.

I've upgraded my own forum to 4.1.8 and, as already stated by OldSchoolDSL, it works.

I wonder if you might have missed following one of the instructions when you created your forum block (Template to use: block_VC_Countdown)?

You need to change the "Template to use" from "block_html" to "block_VC_Countdown" by simply typing it to that field.

Please see the attached image:

ttran
02-12-2012, 10:33 PM
Tried to install on 4.1.10 it worked but just wonder if you can make 2 or more countdown events at the same time. That would be great.
THanks.

midnz
02-12-2012, 11:33 PM
Tried to install on 4.1.10 it worked but just wonder if you can make 2 or more countdown events at the same time. That would be great.
THanks.
It's not possible to have more than one countdown using this mod in its current form.

Mr_Running
02-13-2012, 01:42 AM
@midnz
4.1.10
I just downloaded and install and this warning come up in the vBAdmin CP

see attachment :)

midnz
02-13-2012, 06:17 AM
@midnz
4.1.10
I just downloaded and install and this warning come up in the vBAdmin CP

see attachment :)
Do you have [DBTech] User Status & Moods (https://vborg.vbsupport.ru/showthread.php?t=243754) installed and with the Latest Status Block enabled? If so, read here (http://www.dragonbyte-tech.com/f60/latest-status-block-5161/). If not, let me know and I'll investigate further.

Mr_Running
02-13-2012, 11:59 AM
Yes, I have it installed.
I had read that post but forgot about it. :) Thanks

I have installed others mods with the Latest Status Block enabled.
VC_Countdown was first mod I had seen the warning displayed.

Installed.
Cheers, :)

Merjawy
02-13-2012, 05:49 PM
Installed on 4.1.10 and works great, only one issue for RTL boards, the numbers don't align with the tags..

seconds numbers are aligned with Days which is really weird to see the number of days change by the second :)

I guess I will have to edit the code


EDIT: Fixed the issue by editing the template to align the numbers with the right tags.. Works great so it looks...

Thanks

Mr_Running
02-13-2012, 06:34 PM
TARGET DAY

When selecting
of the month
it works but when going back to the settings it defaults to
days from now

It Appears it may not take Daylight Saving Time into effect?
and
what about a leap year? 2012

midnz
02-13-2012, 11:17 PM
TARGET DAY
When selecting
of the month
it works but when going back to the settings it defaults to
days from now

Yes, I did notice that too. Eg; When selecting 24th of the month it defaults to 24 days from now (after saving the settings). The countdown isn't affected unless you press the save button again after it defaults to that different option. I don't know why it does that yet but it annoys me enough that I'll look in to it further when time permits.

It Appears it may not take Daylight Saving Time into effect?
and what about a leap year? 2012
Daylight Saving Time:
I haven't tried counting down from standard time to a period within daylight savings time. Have you tried doing this and found the calculation not to be accurate?
Leap Years:
Calculations made, prior to Feb 29th of a leap year, that expire beyond Feb 29th should still be accurate.

Mr_Running
02-17-2012, 03:58 PM
Yes, it appears to be off by one day and one hour.

midnz
02-17-2012, 07:40 PM
Yes, it appears to be off by one day and one hour.
Cheers for that.
Changing your GMT Offset option to that which will be accurate at the completion of the countdown should work. Maybe it would be wise for me to simply add that instruction.
Likewise, an instruction advising the consideration of an extra day to compensate for a calculation made prior to Feb 29th of a leap year and expiring after Feb 29th of a leap year should fix that issue. I'll look at adding an option that adds one day to the calculation where Feb 29th becomes an issue, knowing that I will need to do that before 2016.

tommyxv
03-08-2012, 07:04 AM
Yes, I did notice that too. Eg; When selecting 24th of the month it defaults to 24 days from now (after saving the settings). The countdown isn't affected unless you press the save button again after it defaults to that different option. I don't know why it does that yet but it annoys me enough that I'll look in to it further when time permits.

Daylight Saving Time:
I haven't tried counting down from standard time to a period within daylight savings time. Have you tried doing this and found the calculation not to be accurate?
Leap Years:
Calculations made, prior to Feb 29th of a leap year, that expire beyond Feb 29th should still be accurate.

Any fix for this yet...It gets me everytime, when i edit it.

midnz
03-08-2012, 07:29 AM
Any fix for this yet...It gets me everytime, when i edit it.
No sorry, I haven't had the opportunity to look at it yet. I'll try to make some time this weekend (it's Thursday night at the time of posting this) to resolve the issue.

tommyxv
03-08-2012, 10:03 PM
Ok, cool. Thanks

midnz
03-10-2012, 08:24 PM
TARGET DAY
When selecting
of the month
it works but when going back to the settings it defaults to
days from now

Any fix for this yet...It gets me everytime, when i edit it.

Version 1.0.5
Removed the "X Days from Now" option to fix this issue.

tommyxv
03-10-2012, 08:47 PM
Sweet. Thanks!

Mr_Running
03-10-2012, 08:52 PM
Version 1.0.5
Excellent working on vB 4.1.11

Mr_Running
03-10-2012, 09:04 PM
Cheers for that.
Changing your GMT Offset option to that which will be accurate at the completion of the countdown should work. Maybe it would be wise for me to simply add that instruction.
Likewise, an instruction advising the consideration of an extra day to compensate for a calculation made prior to Feb 29th of a leap year and expiring after Feb 29th of a leap year should fix that issue. I'll look at adding an option that adds one day to the calculation where Feb 29th becomes an issue, knowing that I will need to do that before 2016.

Yes, any chance to have Daylight savings and Leap year solved...factored in the settings.

Presently we have to deal with this all year. :p;) 2012.

Cheers.:)

wilford brimley
05-21-2012, 03:20 AM
any way to have multiple counters?

midnz
05-21-2012, 05:09 AM
any way to have multiple counters?

Yes, there is a way to have multiple counters however that would mean coding a separate .xml for each new counter required. It's not something that I have the spare time to do honestly.

TheSupportForum
05-21-2012, 03:34 PM
works in 4.1.12 thx, just what i needed

Hawk7173
06-07-2012, 01:27 AM
Trying to get his to work in my side blocks instead of going across the bottom. I've changed the template to block_html in both the product and the block manager. Block shows, but not the timer....

Any ideas as to why?

midnz
06-07-2012, 05:38 AM
Trying to get his to work in my side blocks instead of going across the bottom. I've changed the template to block_html in both the product and the block manager. Block shows, but not the timer....

Any ideas as to why?
The correct code to use can be found in an attached image in post #16 of this thread. See here (https://vborg.vbsupport.ru/attachment.php?attachmentid=135105&d=1323987132) for your convenience.
Have you typed "block_VC_Countdown" in the "template to use" field?

Hawk7173
06-07-2012, 01:55 PM
I changed that to block_html as the side bar uses that template.

Hawk7173
06-07-2012, 03:15 PM
I did some playing with the blocks manager and managed to get it to do what I wanted.

Thanks for the help.

goc-forum.de
06-16-2012, 09:35 PM
How can i show 2 countdowns in sidebar? I mean how can i set 2 different dates/times? For countdown 1 and coundown 2? Is this possible?

midnz
06-17-2012, 12:03 AM
How can i show 2 countdowns in sidebar? I mean how can i set 2 different dates/times? For countdown 1 and coundown 2? Is this possible?
It's not currently possible however it would be possible to do if a separate .xml file was coded with details that didn't conflict with details on the original .xml file and then imported that.
I'm currently supporting my daughter and my very sick 6yr old granddaughter who has just begun chemotherapy treatment. I hope you understand when I say that I just have no spare time nor the mindset to code at present.
If you can find someone else willing to code that .xml file for you, point them to this post where I give my consent for them to duplicate my work so that you can have your second counter.

Karma1337
06-17-2012, 03:00 AM
It does not show up. Any solutions?
I'm using 4.2.1

FTG LIQUID CL
06-17-2012, 03:47 AM
do you know if this will work with 4.1.12

FTG LIQUID CL
06-17-2012, 04:15 AM
never mind ,it works great

midnz
06-17-2012, 05:26 AM
It does not show up. Any solutions?
I'm using 4.2.1
I haven't upgraded to 4.2.X yet and so I can't test for issues. I'll probably upgrade in 2-3 weeks. I'm sorry I can't be of more help at the moment.

FTG LIQUID CL
06-17-2012, 06:12 PM
is the any way to use this in the same forum more than once

midnz
06-18-2012, 05:35 AM
is the any way to use this in the same forum more than once
Not currently. See post #42 above please.

Gecuba
06-18-2012, 09:13 AM
Works fine with 4.2.0. Thanks!

mohammad6006
07-12-2012, 05:00 PM
GMT/UTC OFFSET

how can i add GMT +3:30 ?

midnz
07-12-2012, 07:04 PM
GMT/UTC OFFSET

how can i add GMT +3:30 ?
Try overwriting with the attached .xml please.

Boylen33
08-01-2012, 06:14 AM
How do you turn the countdown so it doesn't display? I disabled the mod but it still shows up. I only want to use it when I actually have something to count down to.

Nevermind...figured it out! disabled the block.

LgsOfChampions
08-01-2012, 04:32 PM
works great with 4.2 p2

mjfutures
08-20-2012, 12:23 AM
Just installed on my brand new forum, works great!

hawaiibillT
11-03-2013, 09:17 PM
working good with 4.2.1 pl1. any chance you will someday make it into a widget to use in the cms?

midnz
11-04-2013, 03:47 AM
working good with 4.2.1 pl1. any chance you will someday make it into a widget to use in the cms?

I hadn't considered making a CMS widget, but I might do that after 2013 is over and done with.
Please mark as installed if you're using this countdown timer :).

hawaiibillT
11-04-2013, 07:33 PM
done and thanks for the timer its perfect for counting down to basketballball games.

Ba'al
11-05-2013, 12:08 AM
Not working for me,it doesnt show at all, i followed the instructions to the letter, it seems weird not having any html code in the content area other than <div></div>.

Sorry: We are running 4.2.0 PL3

midnz
11-05-2013, 03:18 AM
Not working for me,it doesnt show at all, i followed the instructions to the letter, it seems weird not having any html code in the content area other than <div></div>.

Sorry: We are running 4.2.0 PL3

The code is pulled from the template block_VC_Countdown

Could it be that you've not added that template name as shown in the image below (circled in red)?

https://vborg.vbsupport.ru/attachment.php?attachmentid=135105&d=1323987132

Ba'al
11-05-2013, 09:19 PM
The code is pulled from the template block_VC_Countdown

Could it be that you've not added that template name as shown in the image below (circled in red)?

https://vborg.vbsupport.ru/attachment.php?attachmentid=135105&d=1323987132Yes sir i added it, the only thing i dont have that you have is a description, i never add a description.

I am using Bop5's sidebar everywhere if that makes a difference.

I just re enabled it and it's working but my image doesnt work and the timer is about 11 hours off, any ideas?

Edit: Nevermind, it's all working now, for some reason the helper was telling me my offset should be +/5.00 but that was incorrect,i changed it to -/5.00 and everything is good.

Ba'al
11-05-2013, 09:49 PM
1 question,can you add a height variant option, the width is fine but the height squishes my image down, my image is 220X220 and by doing that you can up the text pixel size as 14px is a little small for us.


If i go into the code on line 32 and edit this height:80px; to this height:220px; and then re-upload and over write the xml will that make the change for me?

midnz
11-06-2013, 03:35 AM
1 question,can you add a height variant option, the width is fine but the height squishes my image down, my image is 220X220 and by doing that you can up the text pixel size as 14px is a little small for us.


If i go into the code on line 32 and edit this height:80px; to this height:220px; and then re-upload and over write the xml will that make the change for me?

Yes, doing that will change the height of the image display.
You might also need to consider changing the height of the counter - look on line 62.
You might also need to play with the alignment of days,hrs,min etc but adding or removing spaces. Look on line 123.
Experiment to see how it looks by making one of those changes at a time until you get what you're looking for.

Ba'al
11-06-2013, 09:44 PM
Yes, doing that will change the height of the image display.
You might also need to consider changing the height of the counter - look on line 62.
You might also need to play with the alignment of days,hrs,min etc but adding or removing spaces. Look on line 123.
Experiment to see how it looks by making one of those changes at a time until you get what you're looking for.
Alright thanx i'll give it a try and report back.

ok, so far so good, image @ 220px is good set font weight to bold, now on what line do i find the spacing between the counter numbers i want to move them closer because as i go up in size they move further out.

midnz
11-07-2013, 03:28 AM
Alright thanx i'll give it a try and report back.

ok, so far so good, image @ 220px is good set font weight to bold, now on what line do i find the spacing between the counter numbers i want to move them closer because as i go up in size they move further out.

I don't believe that's an option I'm sorry. There is no adjustment for the spacing between the separate counter numbers. I've looked at the javascript and I can't see where/how that option could be included.

Ba'al
11-07-2013, 04:37 AM
I don't believe that's an option I'm sorry. There is no adjustment for the spacing between the separate counter numbers. I've looked at the javascript and I can't see where/how that option could be included.
Thats cool, its working great and i will continue to tweak it, thanks for all your help.

jasff
09-28-2014, 10:09 PM
I'm running vB 4.2.2. I'm checking in to see if this will work properly and if the installation instructions are updated/complete.

Thank you

midnz
09-29-2014, 10:36 PM
I'm running vB 4.2.2. I'm checking in to see if this will work properly and if the installation instructions are updated/complete.

Thank you
It works on my 4.2.2 installation. The instructions remain unchanged.

jasff
10-14-2014, 04:27 AM
Thanks for this great mod.

I'm trying to adjust the Forum Block to 220 x 220

For some reason I can't locate where I can adjust the lines for the sizes.
Any direction on where to locate it?

Thank you. Running 4.2.2

midnz
10-15-2014, 03:03 AM
Thanks for this great mod.

I'm trying to adjust the Forum Block to 220 x 220

For some reason I can't locate where I can adjust the lines for the sizes.
Any direction on where to locate it?

Thank you. Running 4.2.2

AdminCP/ Settings/ Options/ VC_Countdown > Forum Sidebar Width - change that to 220 using the drop down option.

I didn't include a height option but you might be able to achieve what you want by increasing the padding between some of the other options.
Check ... Event Name / Adjust padding between EVENT NAME and top of container and Adjust padding between EVENT NAME and COUNTDOWN NUMBERS

jasff
10-15-2014, 06:43 PM
Thanks midnz,

Yes, the height is what I can't get to adjust. I wanted to know where to get into the coding to adjust.

I saw Ba'al where he mentioned changing the height in coding.
I don't know where to access that.

I'll still try and play around in the paddings, but seems to cut the numbers off and the cell height doesn't expand.

midnz
10-16-2014, 03:04 AM
Thanks midnz,

Yes, the height is what I can't get to adjust. I wanted to know where to get into the coding to adjust.

I saw Ba'al where he mentioned changing the height in coding.
I don't know where to access that.

I'll still try and play around in the paddings, but seems to cut the numbers off and the cell height doesn't expand.

1. AdminCP > 2. Styles & Templates > 3. Search in templates > 4. ... type... block_VC_Countdown ... and press the "Find" button > 5. ... double click on that result to bring the template in to view. You can make edits to the font sizes in there.


If you screw it up you can depress the "Revert" button to reset that template back to the original one. You'll find that "Revert" button at 4. in the above directions. Good luck :)

jasff
10-18-2014, 08:23 PM
Thank you! I found where to change the box to 220.

Next questions is how to allign and adjust font? Here are the couple things I want to do:

1. When I expand the box from 80 to 220, the text is top center alligned. Where and how can I center the text in the coding?

2. I want to bold the font so that it stands out more. Possible to change the font size? I would need specifics if possible on how to do this.

This would be a great start. Thanks again micnz.

midnz
10-20-2014, 11:48 PM
1. When I expand the box from 80 to 220, the text is top center alligned. Where and how can I center the text in the coding?

The following HTML code is just one part of the CSS code (code within the STYLE tags) that affects one part of the Counter. You'll find the below piece of CSS code between the STYLE tags within the HEAD of the document.
#period {
font-size: 10px;
color: {vb:raw vboptions.vccountdown_period_fontcolour};
font-family: Arial,sans-serif;
font-weight: normal;
letter-spacing: 0;
margin-right: 1px;
text-transform: uppercase;
text-align: center;
}Check the text-align: center; part. That allows you to center any text where you include id="period" in the coding between the BODY tags.

Using the CSS code above you can understand what part of the Countdown Timer it affects by looking at the DIV tags to find the code that has <div id="period" included.
NB: See the beginning of the above CSS code that says #period { ? That's your clue.

So, using the example above you can find the following part of the Countdown Timer that it affects. Whatever is in the CSS code above affects the HTML code below because it begins with <div id="period"

<div id="period">days&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrs&nbsp;&nbsp;&nbsp;&nbsp; mins&nbsp;&nbsp;&nbsp; secs&nbsp;</div>Using that logic you can find the DIV that you want to affect (<div id="name") and look in between the STYLE tags for the CSS code that begins with that same #name or .name and then edit, delete or add to that CSS code to change what you want.

2. I want to bold the font so that it stands out more. Possible to change the font size? I would need specifics if possible on how to do this.

Look again in the CSS code for the following:
font-size: 10px; (increase or decrease the number 10 to make your text bigger or smaller)

font-weight: bold; (add this line to the CSS code that relates to the <div> that you want to affect by making all text bold)

mapleleaffans
07-09-2015, 11:44 PM
Great mod! I was thinking about adding something like this for a bit! Thank you midnz!