Register Members List Search Today's Posts Mark Forums Read

Reply
 
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.

Screenshots

Click image for larger version

Name:	eventcountdown.jpg
Views:	2483
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 07 Oct 2001 23:29

  #16  
Old 17 Oct 2010, 03:42
CharlieDelta CharlieDelta is offline
 
Join Date: Apr 2010
Originally Posted by trophyrider View Post
I can confirm this works as well.
Thank you.
Reply With Quote
  #17  
Old 17 Oct 2010, 07:58
betts02's Avatar
betts02 betts02 is offline
 
Join Date: Jun 2009
Originally Posted by betts02 View Post
Hey buddy,

You're missing an ob_start at the front of this script. Recommend you add it in, otherwise the block will break the script that started before it as well as itself.
Originally Posted by trophyrider View Post
The script works fine in the forum block area if you add:

ob_start();

at the beginning of the php script.
Originally Posted by trophyrider View Post
As i stated then ?

Also looking more into this

If you post and event it shows up
But if you then post an event before the first event it does not display

Will get it working myself anyway mate cheers
Reply With Quote
  #18  
Old 17 Oct 2010, 12:32
JohnKF JohnKF is offline
 
Join Date: Oct 2010
Thanks for that advice about ob_start();
It's my first script you know
Reply With Quote
  #19  
Old 17 Oct 2010, 12:35
JohnKF JohnKF is offline
 
Join Date: Oct 2010
Originally Posted by betts02 View Post
As i stated then ?

Also looking more into this

If you post and event it shows up
But if you then post an event before the first event it does not display

Will get it working myself anyway mate cheers
I think it may be because it's cached the first event. I usually clear the CMS cache whenever I change anything just to be sure. If you find another cause though please let me know; thanks.

Last edited by JohnKF; 20 Oct 2010 at 08:53. Reason: corrected spelling
Reply With Quote
  #20  
Old 18 Oct 2010, 18:49
betts02's Avatar
betts02 betts02 is offline
 
Join Date: Jun 2009
Something is not correct here

I have an event in 2 days time, Yet its showing the event is due NOW

Will look into this myself but if you manage to figure it out post up dude
Reply With Quote
  #21  
Old 20 Oct 2010, 08:56
JohnKF JohnKF is offline
 
Join Date: Oct 2010
Originally Posted by betts02 View Post
Something is not correct here

I have an event in 2 days time, Yet its showing the event is due NOW

Will look into this myself but if you manage to figure it out post up dude
Is the event a full day event or a ranged event? Also, what time zone are you in as a client and what time zone is the server in?
Reply With Quote
  #22  
Old 24 Oct 2010, 15:07
MadtownHDJunkie MadtownHDJunkie is offline
 
Join Date: Mar 2009
not sure how to add the calendar id to get it to pull from forums calendar...any help appreciated.
Reply With Quote
  #23  
Old 24 Oct 2010, 18:34
JohnKF JohnKF is offline
 
Join Date: Oct 2010
If you look near the start of the PHP code you will see...
$event_calendarid="1";
...just change the number to the id of the calendar you want to use.
Reply With Quote
  #24  
Old 24 Oct 2010, 22:10
MadtownHDJunkie MadtownHDJunkie is offline
 
Join Date: Mar 2009
yah...it should be 1 , the default. it just shows today's date.
Reply With Quote
  #25  
Old 24 Oct 2010, 22:12
MadtownHDJunkie MadtownHDJunkie is offline
 
Join Date: Mar 2009
got it .....ty
Reply With Quote
  #26  
Old 25 Oct 2010, 15:09
red-dna red-dna is offline
 
Join Date: Mar 2006
A way to display a picture for the event and not the title?
Reply With Quote
  #27  
Old 25 Oct 2010, 16:47
starman™ starman™ is offline
 
Join Date: Apr 2008
Installed and working just fine as far as I can tell. Thank you very much indeed.
Would it be possible to include the ability to add a picture or format the event title with a different colour?
Reply With Quote
  #28  
Old 25 Oct 2010, 22:57
DjEddie DjEddie is offline
 
Join Date: Nov 2007
Hi,

I've tried to get this to work on the forum block without any luck .. the block shows up but no countdown of the no event text shows ..

any suggestions? ..

ive created forum block .. selected custom html/php .. fillout out the fields with templete block-html ..
aswell as the script code for the js file is in headerinclude templete..

Thanks
Reply With Quote
  #29  
Old 26 Oct 2010, 04:07
starman™ starman™ is offline
 
Join Date: Apr 2008
Is the URL in the script code for the js file pointing to the right place?
Reply With Quote
  #30  
Old 26 Oct 2010, 09:59
cindy helmond's Avatar
cindy helmond cindy helmond is offline
 
Join Date: Feb 2006
Real name: cindy
Originally Posted by DjEddie View Post
Hi,

I've tried to get this to work on the forum block without any luck .. the block shows up but no countdown of the no event text shows ..

any suggestions? ..

ive created forum block .. selected custom html/php .. fillout out the fields with templete block-html ..
aswell as the script code for the js file is in headerinclude templete..

Thanks
me to not working here
Reply With Quote
Reply


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 15:43.

Layout Options | Width: Wide Color: