Register Members List Search Today's Posts Mark Forums Read

Mod Options
Countdown to Calendar Event Details »
Countdown to Calendar Event
Mod Version: 1.01, by JohnKF (Member) JohnKF is offline
Developer Last Online: Oct 2013 I like it Show Printable Version Email this Page

vB Version: 4.0.6 Rating: (5 votes - 4.20 average) Installs: 57
Released: 15 Oct 2010 Last Update: Never Downloads: 343
Not Supported Template Edits Additional Files Re-usable Code Translations  

This widget picks up the next 2 events from a calendar of your choice.

It displays a countdown to the first event then once the first event has arrived it begins a countdown to the second event. The only reason for picking up two events is that someone may visit the page close to the end of the first event then see the no event message. By picking up two events such a visitor will see the countdown to the second event start.

To install...

From the ZIP file, extract eventcountdown.js and copy it to your site.

Navigate to AdminCP -> Style & Templates -> Style Manager -> Edit Template
Double click the headinclude template to edit it and add the following just above the first <script tag you find...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

...the above assumes you have copied eventcountdown.js file in to a folder called scripts. Adjust the src path to wherever you have placed the .js file.

Navigate to AdminCP -> CMS -> Widgets.
Create a PHP Type Widget and paste the below code.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To create a forum block...
  1. Navigate to AdminCP -> Forums & Moderators -> Forum Blocks Manager
  2. Click the Add Block button
  3. From the drop down list select Custom HTML/PHP
  4. Click the Continue button
  5. Give the block a title (e.g. Event Countdown) and a short description
  6. Set the cache time to 1 minute
  7. In Content Type select PHP
  8. In Content paste the PHP code above in to the text box
  9. Click the Save button

You can set the value for $event_calendarid to the calendar that you want countdown events to come from. Change $no_events_message to the HTML you want to have appear when there are no events left in the selected calendar.

This is the first widget I've written so if you spot any errors or improvements that can be made then please let me know.

If you have an all day event in the calendar the countdown is to the begining of that day. Add a ranged event to the calendar for an exact time. Also, allow for any changes that may occur if a change to or from DST occurs.

Added ob_start(); to beginning of script (17th Oct, 2010)

To have a picture make the Title of the event in the calendar the HTML to display the picture. For example...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

...which shows as the text above in the calendar title, but displays as text and a picture in the countdown.

Download Now

Only licensed members can download files, Click Here for more information.


Click image for larger version

Name:	eventcountdown.jpg
Views:	2489
Size:	8.2 KB
ID:	122828  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
[RELEASE vB 2.0.3] Countdown To Calendar Events mister vBulletin 2.x Full Releases 18 08 Oct 2001 00:29

Old 08 May 2011, 12:12
TheChief TheChief is offline
Join Date: Nov 2010
Also, has anyone figured out how to display more than one event as mine still only shows one eventhough i've amended the:

("SELECT eventid, title, dateline_from from " . TABLE_PREFIX . "event WHERE calendarid='".$event_calendarid."' $and order by dateline_from ASC LIMIT 2"); to ASC LIMIT 5
Reply With Quote
Old 31 Jul 2011, 09:48
kylek kylek is offline
Join Date: Oct 2003
Real name: Kyle
Anyone having any luck with this.
Reply With Quote
Old 29 Dec 2011, 22:31
kylek kylek is offline
Join Date: Oct 2003
Real name: Kyle
Dam, was hoping someone took a look and got it working for the latest versions of vb.
Reply With Quote
Old 29 Apr 2012, 12:30
mgurain's Avatar
mgurain mgurain is offline
Join Date: Apr 2005
Real name: Mohammed Al-Gurain
The idea of this mod is perfect, any body can upgrade it ?

Reply With Quote
Old 18 Sep 2012, 15:42
DocZaius DocZaius is offline
Join Date: Mar 2011
Hm. Forum block works perfectly, but the widget is just blank.
Reply With Quote
Old 19 Sep 2012, 17:40
edytwinky edytwinky is offline
Join Date: Sep 2007
ANybody using this on vb 4.2?
Reply With Quote
Old 07 May 2013, 05:04
fxdigi-cash fxdigi-cash is offline
Join Date: Jul 2012
ok, this is what I was looking for, but seems have some issue with multiple events...!!

I wish I know how to fix it...
Reply With Quote
Old 21 Aug 2013, 00:16
Vick98 Vick98 is offline
Join Date: Nov 2010
Can anyone rework this mod?
Reply With Quote
Old 21 Aug 2013, 00:22
tbworld tbworld is offline
Join Date: Oct 2008
The code is marked reusable. So if someone wants to tell me in detail what is not working and under what circumstances, I will take a look at it when I have the time. I can't promise anything because I haven't looked at the calendar code in awhile. Some code isn't fixable and I do not have the time to rewrite the whole modification.

I will try to fix the known issues, I will not be taking on support of the mod.
Reply With Quote
Old 19 Sep 2013, 14:43
VanFenix VanFenix is offline
Join Date: Aug 2013
I cannot get this to function on my VB 4.2.1
The headinclude on my template is edited - path is correct to the .js file.

I've got the widget created
Widget Name = Event Countdown
Widget Type = PHP Direct Execution
Within the Configure area I have pasted the wall of code.

Forum Block Manager.
Name : Event Countdown
cache time - 1 minute
active : yes
type : php
content - ( I have the wall of source in there )

The problem is that the block on the forums page has no content in it.
Calendar ID is : 1
Reply With Quote
Old 18 Nov 2013, 05:42
Glenn379's Avatar
Glenn379 Glenn379 is offline
Join Date: Aug 2002
Real name: Ben
This would be very helpful but the mod doesn't work for me. If this gets reworked, I'd be very interested.
Final Fantasy Community
Reply With Quote
Old 19 Feb 2014, 17:24
Yetist0rm Yetist0rm is offline
Join Date: Feb 2014
Does anyone have this working as a widget on 4.2.2? I would really love to use this but I can't seem to get it to work!
Reply With Quote
Old 02 Mar 2014, 13:39
poita poita is offline
Join Date: Jan 2010
Keen to see this updated for 4.2.2

Hopefully someone can get it working
Vbulletin Newbie, please be nice to me.

OpelAus Forums |:|:|:|:| XR5 ST Owners Club
Reply With Quote
Old 25 Jan 2015, 14:33
fxwoody's Avatar
fxwoody fxwoody is offline
Join Date: Jun 2010
It works for me in 4.2.2 pl4. Setup the HTML "on" in the calendar option to help out
Is there a way to translate the "weeks, days, hours" in french ??
Stuck on this one and as for the image with the heading, i can't get this to work
Reply With Quote
Old 02 Jul 2015, 22:06
htscpl's Avatar
htscpl htscpl is offline
Join Date: Sep 2003
Location: Houston
Real name: Henry
Just Installed and seems to be working on VB 4.2.2 PL4. Would like multiple events but for right now I will take what I can get.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Mod Options

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

New To Site? Need Help?

All times are GMT. The time now is 03:50.

Layout Options | Width: Wide Color: