vBulletin ModsThe Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=266689 |
7 Attachment(s)
Someone PM'd me last week asking for the code I use for my countdown sideblock. So here is the basic countdown (doesn't include the images/blurb that screenshots/demo show)
This countdown uses the users PC clock and calendar to count down to a time and date. What is it? A sideblock on your forum index to countdown to a specific date/event. 1. Upload the contents on the zip archive to your server. Keeping the file structure as is. countdown/js/jquery-1.4.1.js countdown/js/jquery.lwtCountdown-1.0.js countdown/js/misc.js countdown/style/main.css Change the settings of the countdown/js folder to CHMOD 775 2. Go to AdminCP > Forums and Moderators > Forum Block Manager > Add Block Title - Countdown Description - whatever you want Content Type - HTML Content - <div></div> Template to use - block_countdown 3. Go to AdminCP > Styles and Templates > Style Manager > Add New Template Title - block_countdown
Change this part to set the countdown target date
Save the block. 4. Go to AdminCP > Style and Templates > Style Manager > StyleVars > forum_sidebar_width and change the width to atleast 270px You can change the colour of the digits/text to suit your forum by changing references to #5C7099 in the main.css file If you are using vBOptimise go to AdminCP > vBOptimise > Flush Cache To have more than one countdown Create a new template called block_countdown2
Set the targetDate data and save For reference if making more blocks - (jq('#countdownX').countDown({ and <div id="countdownX"> are used to call additional countdowns). Create a new forum block in the same way as before but make the template to use: block_countdown2 To Display on vB Advanced CMPS - http://www.vbulletin.org/forum/showp...&postcount=122 To show multiple countdowns on forumhome (screenshots) - http://www.vbulletin.org/forum/showp...&postcount=158 If you want to add images/videos etc to your countdown all you need to do is add some basic code to the template. Search for </script><div> and after that you would add something like.
If you are upgrading from a previous version, upload the contents of the zip file and replace the template(s) you are using (ie block_countdown, block_countdown2, adv_portal_countdown etc). Set the targetDate. History 1.0.4 - Reverted back to using jquery-1.4.1.js 1.0.3 - Now using jquery-1.6.1.min.js and added noConflict to script 1.0.2 - Cleaned up code, added instructions to zip. Also instruction within thread on how to make CMS widget or have more than one countdown. If anyone wants to further develop any of my addons, you are free to do so. |
Thanks for the mod, it looks great. However, I cannot seem to set it to display anything other and 0's. I tried eliminating the cache time, I tried entering the year in both 2011 and just 11 format. Can you please post an example of a functioning time?
|
|
Thanks for the quick reply, unfortunately I still am not getting the countdown, just 0's
|
Again, I appreciate your support.
I downloaded the zip, upload and overwrote. I verified the directory structure. I deleted the forum block and created a new with a direct cut and paste of your's. Then pasted the sample date and time. I still get nothing but 00's Is it just me? Or is anyone else having this issue? |
Uninstalled, would not display anything but 0's.
|
|
I don't know, it works fine on every site I've installed it on and I've used the same code on them all.
Replace the target date data with your own. If no-one can confirm it working then I'll get one of the mods to delete this. Sorry :( edit: Confirmed as working |
Works and looks awesome. Thank you so much!
|
Quote:
If you want to link the image to something, ie when clicking on the image it would go to a forum post or external site use this format instead, replace the <img src="LINK TO YOUR IMAGE"> with something like this - <a href="http://www.yourlink.com"><img src="http://www.yourimagelink.com/image.jpg" alt="hover over title" width="x" height="x" /></a> |
OH cool! Thank you Gemma. Is there a way for me to use a longer title? When the title is too long it overlaps the box, it is not broken into 2 sentences or so.
And did you release this as widget somewhere? |
Quote:
You should be able to use the same code to make a cms widget but you would need to be using a sidebar of 270px or more for it to display properly |
Quote:
You'd need to use something like this for a CMS Widget
|
FIXED:
1.- Add before..
2.- Check folder permission #0775 3.- Clear Cache sideblock. |
Thanks. I removed the jquery-1.4.1.js lines from the code because it wasn't needed for all the installs I'd made (but I left the script in the zip file). Any time you make a new widget/sideblock it is always recommended to clear or purge the cache.
|
All times are GMT. The time now is 05:41. |
Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.