vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   vBulletin Forum Sideblocks - Countdown (Forum, Sideblock, vBa CMPS, Multiple Countdowns) (https://vborg.vbsupport.ru/showthread.php?t=266689)

Gemma 07-11-2011 10:00 PM

Countdown (Forum, Sideblock, vBa CMPS, Multiple Countdowns)
 
1 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
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>

Change this part to set the countdown target date

Code:

'day':      19,
            'month':    7,
            'year':    2011,
            'hour':    23,
            'min':      59,
            'sec':    59,

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

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>

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

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.



sadaar 07-12-2011 08:28 PM

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?

Gemma 07-12-2011 08:34 PM

Code:

targetDate: {
            'day':      19,
            'month':    7,
            'year':    2011,
            'hour':    23,
            'min':      59,
            'sec':    59,


sadaar 07-12-2011 09:20 PM

Thanks for the quick reply, unfortunately I still am not getting the countdown, just 0's

sadaar 07-12-2011 10:10 PM

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?

K4GAP 07-13-2011 04:52 AM

Uninstalled, would not display anything but 0's.

un? in? 07-13-2011 06:53 AM

Oh, don't work.
Please fix
Demo: http://raovat.vn-news.org/forum.php
Thanks

Gemma 07-13-2011 07:13 AM

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.

Code:

<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">
jQuery(document).ready(function() {
    $('#countdown').countDown({
        targetDate: {
            'day':      2,
            'month':    9,
            'year':    2011,
            'hour':    17,
            'min':      0,
            'sec':      0,
                        'utc':                true
        }
    });
});
</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>

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

Taurus1 07-13-2011 08:46 AM

Works and looks awesome. Thank you so much!

Gemma 07-13-2011 08:51 AM

Quote:

Originally Posted by Taurus1 (Post 2219936)
Works and looks awesome. Thank you so much!

If you are looking to add an image above the countdown, add something like this below </script>
Code:

<div align="center"><img src="LINK TO YOUR IMAGE"><br/><br/>
<span class="digit">BLURB YOU WANT TO DISPLAY</span><br/><br/></div>

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>

Taurus1 07-13-2011 09:06 AM

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?

Gemma 07-13-2011 09:21 AM

Quote:

Originally Posted by Taurus1 (Post 2219945)
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?

I'll look at the title part and see what's up.

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

Gemma 07-13-2011 09:41 AM

Quote:

Originally Posted by Gemma (Post 2219949)
I'll look at the title part and see what's up.

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

Actually, I take that back :o

You'd need to use something like this for a CMS Widget

Code:

<div class="cms_widget">
        <div class="block">
                <div class="cms_widget_header">
                </div>
                <div class="cms_widget_content_restore_widget_content">
<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">
jQuery(document).ready(function() {
    $('#countdown').countDown({
        targetDate: {
            'day':      19,
            'month':    7,
            'year':    2011,
            'hour':    23,
            'min':      59,
            'sec':    59,
                        'utc':                true
        }
    });
});
</script>
<center>
<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></center>
</div>
        </div>
</div>


Kulham 07-13-2011 09:46 AM

FIXED:

1.- Add before..
Code:

<script language="Javascript" type="text/javascript" src="countdown/js/jquery-1.4.1.js"></script>
2.- Check folder permission #0775

3.- Clear Cache sideblock.

Gemma 07-13-2011 09:52 AM

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.

Taurus1 07-13-2011 09:59 AM

That unfortunately don't work for me Gemma. The widget just remains on 00. I was also trying to center in with <center></center> tags wrapped around it, but it wont center. Sorry for the trouble. And thank you so much for your help and effort!

TheChief 07-13-2011 11:44 AM

Added and working fine - Exactly what i was after

Thanks

un? in? 07-13-2011 11:55 AM

Quote:

Originally Posted by Gemma (Post 2219912)
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.

Code:

<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">
jQuery(document).ready(function() {
    $('#countdown').countDown({
        targetDate: {
            'day':      2,
            'month':    9,
            'year':    2011,
            'hour':    17,
            'min':      0,
            'sec':      0,
                        'utc':                true
        }
    });
});
</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>

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

Quote:

Originally Posted by Kulham (Post 2219956)
FIXED:

1.- Add before..
Code:

<script language="Javascript" type="text/javascript" src="countdown/js/jquery-1.4.1.js"></script>
2.- Check folder permission #0775

3.- Clear Cache sideblock.

I don't know.
My site don't work.
I did 2 you in on
Please: help me

Gemma 07-13-2011 11:55 AM

1 Attachment(s)
Quote:

Originally Posted by Taurus1 (Post 2219962)
That unfortunately don't work for me Gemma. The widget just remains on 00. I was also trying to center in with <center></center> tags wrapped around it, but it wont center. Sorry for the trouble. And thank you so much for your help and effort!

vBulletin's CMS is a pile of poo! It really needs an overhaul. Try this (based on a sidebar of 300px)

Upload the contents of the attached zip, CHMOD the coutdown/js folder to 775

Create a new template called vbcms_widget_countdown and copy this code

Code:

<div class="cms_widget">
        <div class="block">
                <div class="cms_widget_header">
<h3><img src="{vb:raw vboptions.bburl}/countdown/style/countdown.png" alt="" /> {vb:raw widget_title}</h3>
                </div>
                <div class="cms_widget_content_restore_widget_content">
<br/>
<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>
<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/countdown_cms.css"></link>
<script type="text/javascript">
jQuery(document).ready(function() {
    $('#countdown').countDown({
        targetDate: {
            'day':      19,
            'month':    7,
            'year':    2011,
            'hour':    23,
            'min':      59,
            'sec':    59,
                        'utc':                true
        }
    });
});
</script>
</div></div>

Change the targetDate info and save the template.

Go to vBulletin CMS > Widgets > Create New Widget

Widget Type - Static HTML
Title - whatever
Save.

Configure the new widget

Enter Static HTML - <div></div>
Template Name - vbcms_widget_countdown
Save

Then go to Layout Manager and place the widget in the sidebar you want it to appear.

Clear the CMS Cache and Flush Cache on vBOptimise (if applicable)

Gemma 07-13-2011 11:57 AM

Quote:

Originally Posted by un? in? (Post 2219990)
I don't know.
My site don't work.
I did 2 you in on
Please: help me

Can you PM me a link to your site and I'll have a look :)

un? in? 07-13-2011 01:13 PM

Quote:

Originally Posted by Gemma (Post 2219992)
Can you PM me a link to your site and I'll have a look :)

Thank you.
My site: http://raovat.vn-news.org/forum.php
Please tell me with Fix
Thanks alot

un? in? 07-13-2011 01:38 PM

Thank for support but my site don't still working.
Haizzzzzzzzz

Gemma 07-13-2011 01:43 PM

Delete the current block and I'll post up instructions on how to create a template based block and see if that works.

Gemma 07-13-2011 01:49 PM

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.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">
jQuery(document).ready(function() {
    $('#countdown').countDown({
        targetDate: {
            'day':      19,
            'month':    7,
            'year':    2011,
            'hour':    23,
            'min':      59,
            'sec':    59,
                        'utc':                true
        }
    });
});
</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>

Save the template.

Go to Forums and Moderators > Forum Block Manager > Add Block > Choose Custom HTML/PHP

Title - Countdown
Content Type- HTML
Content - <div></div>
Template To Use - block_countdown

Save. Purge Cache

Taurus1 07-14-2011 02:35 AM

Hey Gemma, I am so sorry, but that did not work either. (widget) Still remains on 00. It is no biggie. I can leave it out from the my cms. Thanks again for everything! You ROCK!

sadaar 07-14-2011 03:36 AM

It doesn't work for me either. I appreciate the mod and your work in trying to sort it out. I just wonder if there is some other mod that interfears with it? Like I use vBOptimize, and I wonder if it could cause an issue?

Gemma 07-14-2011 08:33 AM

Sorry guys, it must be conflicting with something else. I couldn't possibly say what without testing out on someone's site that is having issues.

One final thing for you both to try, make sure you have uploaded the jquery-1.4.1.js file to the countdown/js folder.

Find:
Code:

<script language="Javascript" type="text/javascript" src="countdown/js/jquery.lwtCountdown-1.0.js"></script>
Above it add:
Code:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
Save the block/template

CHMOD the countdown/js folder to 775

And if you're using vBOptimise go back to your AdminCP > vBOptimise > Flush Cache

See if that works

Taurus1 07-14-2011 09:29 AM

That did it Gemma!! Woooweeee! Thank you so much!

Now please don't kill me for asking this, but is it possible to make the letters itself a bit smaller? On my non-default skins it is too big for the 300px siderbar. (The seconds part goes to the bottom) I suppose the skins itself adds some padding or something.

EDIT: I managed to get it working and looking great now. I edited the .css file. Thanks again for everything Gemma!

Gemma 07-14-2011 10:11 AM

Hallelujah. It's all been a bit messy, I better go back and redo the first post :rolleyes:

Updated to v1.0.1

sadaar 07-14-2011 05:57 PM

I tried the template method, verified the file placement and permissions, even turned off the entire pllug-in system temporarily to see if there was a conflicting mod.... still nothing but 00's.

I wish I could get it to work, it's a nice mod and something my community really needs.

Gemma 07-14-2011 07:55 PM

@sadaar

Can you PM me a link to your site?

keithyboy1 07-15-2011 02:17 PM

very nice,thank you for this.worked first time no probs :)

weave 07-15-2011 04:48 PM

Tried on a vanilla install and all I get is 00000 too.

Will mess with it more later

Gleedo 07-17-2011 02:23 PM

Very nice mod Gemma.

Is it possible to have more than one countdown in the forum sidebar? I tried creating two, and created another template 'block_countdown2' which my 2nd block is set to use in 'Template to Use', but only one of the countdowns works.

Any thoughts appreciated. :)

Gemma 07-17-2011 02:30 PM

1 Attachment(s)
I've not tried but I think the scripts would clash. I'll have a play around later :)

edit: Not as difificult as I thought.

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">
jQuery(document).ready(function() {
    $('#countdown2').countDown({
        targetDate: {
            'day':      00,
            'month':    00,
            'year':    0000,
            'hour':    00,
            'min':      00,
            'sec':    00,
                        'utc':                true
        }
    });
});
</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>

Set the targetDate data and save

($('#countdown2').countDown({ and <div id="countdown2"> are used to call the second countdown).

Create a new forum block in the same way as before but make the template to use: block_countdown2

Macgiber 07-17-2011 06:42 PM

oh the reason the reason is that zeros out only when editing the date the current staff oh oh forum member city.

Gleedo 07-17-2011 07:08 PM

Quote:

Originally Posted by Gemma (Post 2221486)
edit: Not as difificult as I thought.

Thank you very much Gemma - great mod, great support :)

Gemma 07-18-2011 03:05 PM

Quote:

Originally Posted by Macgiber (Post 2221562)
oh the reason the reason is that zeros out only when editing the date the current staff oh oh forum member city.

Sorry, that makes no sense to me :erm:

thetgc 07-23-2011 03:03 PM

I cant seem to get this working either. Even after trying everything that has been posted :(

Gemma 07-23-2011 07:21 PM

Sorry for the delay, was at work :(

Not really sure why it isn't working for some, only thing I can think of is a conflict somewhere. Try removing this from the block_countdown template and add it to your headinclude or footer (footer is my own preference)

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>

If anyone wants to PM me a link to their site I'll have a look, it is hard to try find a solution because it has worked on every site I've installed it on :confused:


All times are GMT. The time now is 10:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01600 seconds
  • Memory Usage 1,967KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (17)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete