The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Countdown (Forum, Sideblock, vBa CMPS, Multiple Countdowns) Details »» | |||||||||||||||||||||||||||||||||||||||
Countdown (Forum, Sideblock, vBa CMPS, Multiple Countdowns)
Developer Last Online: Nov 2023
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 Code:
<li> <div class="block smaller"> <div class="blocksubhead"> <a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a> <span class="blocktitle">{vb:raw blockinfo.title}</span> </div> <div class="widget_content blockbody floatcontainer"> <div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow"> <script language="Javascript" type="text/javascript" src="countdown/js/jquery-1.4.1.js"></script> <script language="Javascript" type="text/javascript" src="countdown/js/jquery.lwtCountdown-1.0.js"></script> <script language="Javascript" type="text/javascript" src="countdown/js/misc.js"></script> <link rel="Stylesheet" type="text/css" href="countdown/style/main.css"></link> <script type="text/javascript"> var jq=$.noConflict(); jq(document).ready(function() { jq('#countdown').countDown({ targetDate: { 'day': 19, 'month': 7, 'year': 2011, 'hour': 23, 'min': 59, 'sec': 59, } }); }); </script> <div> <div id="countdown"> <div class="dash first weeks_dash"> <span class="dash_title">Weeks</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash days_dash"> <span class="dash_title">Days</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash hours_dash"> <span class="dash_title">Hrs</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash minutes_dash"> <span class="dash_title">Mins</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash seconds_dash"> <span class="dash_title">Secs</span> <div class="digit">0</div> <div class="digit">0</div> </div> </div> </div> </div> </div> </div> <div class="underblock"></div> </li> Code:
'day': 19, 'month': 7, 'year': 2011, 'hour': 23, 'min': 59, 'sec': 59, 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 Code:
<li> <div class="block smaller"> <div class="blocksubhead"> <a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a> <span class="blocktitle">{vb:raw blockinfo.title}</span> </div> <div class="widget_content blockbody floatcontainer"> <div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow"> <script language="Javascript" type="text/javascript" src="countdown/js/jquery-1.4.1.js"></script> <script language="Javascript" type="text/javascript" src="countdown/js/jquery.lwtCountdown-1.0.js"></script> <script language="Javascript" type="text/javascript" src="countdown/js/misc.js"></script> <link rel="Stylesheet" type="text/css" href="countdown/style/main.css"></link> <script type="text/javascript"> var jq=$.noConflict(); jq(document).ready(function() { jq('#countdown2').countDown({ targetDate: { 'day': 00, 'month': 00, 'year': 0000, 'hour': 00, 'min': 00, 'sec': 00, } }); }); </script> <div> <div id="countdown2"> <div class="dash first weeks_dash"> <span class="dash_title">Weeks</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash days_dash"> <span class="dash_title">Days</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash hours_dash"> <span class="dash_title">Hrs</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash minutes_dash"> <span class="dash_title">Mins</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash seconds_dash"> <span class="dash_title">Secs</span> <div class="digit">0</div> <div class="digit">0</div> </div> </div> </div> </div> </div> </div> <div class="underblock"></div> </li> 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 - https://vborg.vbsupport.ru/showpost....&postcount=122 To show multiple countdowns on forumhome (screenshots) - https://vborg.vbsupport.ru/showpost....&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. Code:
<img alt="" title="" src="URL TO YOUR IMAGE" width="150" height="225"><br/><br/> <iframe width="240" height="160" src="EMBEDDED YOUTUBE VIDEO LINK" frameborder="0" allowfullscreen></iframe><br/><br/> </div> 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. Download Now
Screenshots
Show Your Support
|
9 благодарности(ей) от: | ||
doctorsexy, fxdigi-cash, GreyGhost, Khriz, nektar, Sage Knight, tekram, WendM |
Comments |
#122
|
||||
|
||||
This is based on your CMPS columns being set at 240px (if you change them to a wider or narrower setting you'll need to work out the css changes yourself)
Download the zip archive in the OP and upload the files. (don't change the file or folder structure) AdminCP > vBa CMPS > Add Module Add a new Template Module Give it a name and set it to active. Template to include: adv_portal_countdown Template Content: Code:
<script language="Javascript" type="text/javascript" src="countdown/js/jquery-1.4.1.js"></script> <script language="Javascript" type="text/javascript" src="countdown/js/jquery.lwtCountdown-1.0.js"></script> <script language="Javascript" type="text/javascript" src="countdown/js/misc.js"></script> <link rel="Stylesheet" type="text/css" href="countdown/style/main.css"></link> <script type="text/javascript"> var jq=$.noConflict(); jq(document).ready(function() { jq('#countdown').countDown({ targetDate: { 'day': 00, 'month': 00, 'year': 0000, 'hour': 00, 'min': 00, 'sec': 00, } }); }); </script> <div> <div id="countdown"> <div class="dash first weeks_dash"> <span class="dash_title">Weeks</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash days_dash"> <span class="dash_title">Days</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash hours_dash"> <span class="dash_title">Hrs</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash minutes_dash"> <span class="dash_title">Mins</span> <div class="digit">0</div> <div class="digit">0</div> </div> <div class="dash seconds_dash"> <span class="dash_title">Secs</span> <div class="digit">0</div> <div class="digit">0</div> </div> </div> Code:
targetDate: { 'day': 00, 'month': 00, 'year': 0000, 'hour': 00, 'min': 00, 'sec': 00, } AdminCP > vBa CMPS > Edit Pages Then add it to whatever page you want it to appear. |
#123
|
|||
|
|||
Gemma, your tech support on this mod is off the chain. Thank you so much for the detailed install instructions. They made all the difference. I installed this mod on my 4.1.7. version board and everything worked perfect the 1st time. I looked for some kind of paypal support the developer area above but didn't see it anywhere. I wanted to send you some $ to show my appreciation for your extra effort. Thanks again!
|
Благодарность от: | ||
Gemma |
#124
|
||||
|
||||
Quote:
|
#125
|
|||
|
|||
i didn't try it yet, what happen if someone post that counting message and the time collapse to zero, it's says realsed "XX time" ago? or it's just vanished?
|
#126
|
||||
|
||||
Quote:
In whichever template you are using (block_countdown, adv_portal_countdown etc) look for the code similar to this Code:
<script type="text/javascript"> var jq=$.noConflict(); jq(document).ready(function() { jq('#countdown').countDown({ targetDate: { 'day': 19, 'month': 7, 'year': 2011, 'hour': 23, 'min': 59, 'sec': 59, } }); }); </script> Code:
<script type="text/javascript"> var jq=$.noConflict(); jq(document).ready(function() { jq('#countdown').countDown({ targetDate: { 'day': 00, 'month': 00, 'year': 0000, 'hour': 00, 'min': 00, 'sec': 00 }, // onComplete function onComplete: function() { jq('#complete_info_message').slideDown(); } }); }); </script> Still in your template find: Code:
<div class="dash seconds_dash"> <span class="dash_title">Secs</span> <div class="digit">0</div> <div class="digit">0</div> </div> Code:
<div class="info_message" id="complete_info_message" style="display: none;"> Countdown complete </div> Save the template. Open the css file and add the following Code:
.info_message { color: #f40c1d; text-align: center; margin: auto; font-weight: bold; } Save the css file and re-upload. Now once the countdown has expired your message will slide down below the timer. (see attached image) |
#127
|
||||
|
||||
Updated: 1.0.3 - Now using jquery-1.6.1.min.js and added noConflict to script
Hopefully the inclusion of noConflict will fix the instances of the countdown showing zeros for some people. Also added some links to examples on vB CMS, Forum Index and in another mod that contains a sidebar (in this case v3 Arcade) To upgrade, replace whichever template(s) you are using with the corresponding one(s) in the OP and set your countdown dates. |
#128
|
|||
|
|||
How do you suggest the update be performed? Should we reload everything, or upload particular files?
|
#129
|
||||
|
||||
Only the template (whichever one(s) you use) needs replaced if you're upgrading, it is only the script parts that have changed so it should be easy enough to compare and edit if you don't want to replace it all.
|
#130
|
|||
|
|||
I use info from thread #122. Where is the temple text I should use?
|
#131
|
||||
|
||||
I've updated all the templates which are linked in the OP - just replace your template with the one in post #122 and add your targetDate information.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|