The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Countdown to Calendar Event Details »» | |||||||||||||||||||||||||||||
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... HTML Code:
<script src="scripts/eventcountdown.js" type="text/javascript"></script> Navigate to AdminCP -> CMS -> Widgets. Create a PHP Type Widget and paste the below code. PHP Code:
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... HTML Code:
Your Event<br /><img src="images/picture.gif" width="140" height="130" alt=""> Download Now
Screenshots
Show Your Support
|
Comments |
#32
|
|||
|
|||
Quote:
working url ? www.yoursite.com/forum/scripts/js ???? ore without www. |
#33
|
|||
|
|||
Quote:
also when trying this on the widget cms side .. it only shows todays date in the countdown area .. so forum block and widget aren't working for me atm :S thanks for the help |
#34
|
|||
|
|||
I need some help on creating a side block. I paste the code in when creating a block and have already added a calendar event.
When I go to the forum, all it shows is the code. What are the selections I need to choose when creating a side block using this code? |
#35
|
|||
|
|||
When you create a Forum Block you need to select PHP in the Content Type section.
|
#36
|
|||
|
|||
The code uses the title of the event in the calender to display above the countdown.
I suggest you create a calendar specific to Countdown Events and set it for Admin view only; as long as you set the correct calender ID in the code it will still be picked up. To have a picture make the Title of the event in the calendar the HTML to display the picture. For example in the forum I look after I have the following as an event title... HTML Code:
Halloween Evening<br /><img src="files/bv/images/halloween/pumpkin.gif" width="140" height="130" alt=""> You can see this at http://www.buckshawvillage.com/forum.php You can use whatever HTML you like in the event title. The code on that site is set up a little different to that posted here. Seconds are not shown until less than 24 hours. At zero there is a firework display over the page which lasts for 1 minute. Other than that it functions the same and the HTML title will work fine. |
#37
|
|||
|
|||
Quote:
I did select php and then pasted the code in. As I said, once I create an event in the calendar, the side block shows the code I input from here instead of the event countdown. I'm sure its something simple, but I don't know how else to paste code and choose 'php' as the content type. |
#38
|
|||
|
|||
It was something simple. I'm a doofus.
|
#39
|
|||
|
|||
Share it with us please; it may help others who make a similar mistake.
|
#40
|
|||
|
|||
I didn't put the line of code in the template as instructed. haha.
I did input my first event and the countdown was off by an hour, so I deleted the event and put it up again an hour different, but the countdown remained the same. Any way to clear that? Is it cached? |
#41
|
|||
|
|||
You need to set the cache time to 1 minute.
For a widget this is done via the Configure link. For a forum block this is done via the Edit link. If the cache time is set too high, say 60 minutes, then a visitor may get a countdown that could be up to an hour out of date. Even at 1 minute it will take up to 1 minute before a change in an edited event is replicated in the countdown. If you're in a time zone that's currently using DST you should check your event as soon as DST ends as it may be an hour out in the countdown. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|