11 Replies Latest reply on Aug 27, 2010 5:01 AM by jacknewton

    Counter...Need a hint....help!

    jacknewton

      Guys/gals

       

      I am taking over an existing website; http://villagefantome.ca/accueil.html

       

      This site was done last year by someone else, who inserted on the bottom a counter.... days, hours, minutes before the start of the event...

       

      See on the bottom and see the codes.

       

      Can you please tell me where to look in order to put the 2010 date? And what to do so that the counter works...it is currently at 0.

       

      I tried to force the numbers, but it doesn't go down.

       

      Please help!I am no coder, so please explain clearly.

       

      Greatly appreciated!!!

       

      Jack

        • 1. Re: Counter...Need a hint....help!
          BenPleysier Adobe Community Professional & MVP

          In effets.js change the date

          function ecrire(){
                         today  = new Date();
                         todayEpoch  = today.getTime();
                        
                         target = new Date(2009, 9, 23);
                         targetEpoch = target.getTime();
                        
                         secondesLeft = Math.floor((targetEpoch - todayEpoch) / 1000);
                         secondesLeft = secondesLeft + 61200;

          The only thing is that I cannot discover where the function is called. Try the above first and if it doesn't work, come back here and we will write a bit of code to start the function off.

          • 2. Re: Counter...Need a hint....help!
            hans-g. Adobe Community Professional & MVP

            Hi Jack,

             

            in addition to vw2ureg's hint: It seems (for me) there is a file missing in your main-directory, called "iepngfix.htc", to which various entries in your source code and the "effets.js" refer.

             

            Hans-G.

            • 3. Re: Counter...Need a hint....help!
              jacknewton Level 1

              Nope, it doesn't work.

               

              Ano other suggestions?

               

              Or would you know another quick program I could put instead?

              • 4. Re: Counter...Need a hint....help!
                jacknewton Level 1

                Found the page you are refering to; Here are the codes...

                 

                 

                <public:component>

                 

                <public:attach event="onpropertychange" onevent="doFix()" />

                 

                <script type="text/javascript">

                 

                // IE5.5+ PNG Alpha Fix v1.0RC4


                // (c) 2004-2005 Angus Turnbull http://www.twinhelix.com

                 

                // This is licensed under the CC-GNU LGPL, version 2.1 or later.
                // For details, see: http://creativecommons.org/licenses/LGPL/2.1/

                 


                // This must be a path to a blank image. That's all the configuration you need.
                if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';

                 


                var f = 'DXImageTransform.Microsoft.AlphaImageLoader';

                 

                function filt(s, m)
                {
                if (filters[f])
                {
                  filters[f].enabled = s ? true : false;
                  if (s) with (filters[f]) { src = s; sizingMethod = m }
                }
                else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
                }

                 

                function doFix()
                {
                // Assume IE7 is OK.
                if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
                  (event && !/(background|src)/.test(event.propertyName))) return;

                 

                var bgImg = currentStyle.backgroundImage || style.backgroundImage;

                 

                if (tagName == 'IMG')
                {
                  if ((/\.png$/i).test(src))
                  {
                   if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
                    style.width = offsetWidth + 'px';
                   filt(src, 'scale');
                   src = blankImg;
                  }
                  else if (src.indexOf(blankImg) < 0) filt();
                }
                else if (bgImg && bgImg != 'none')
                {
                  if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
                  {
                   var s = RegExp.$1;
                   if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
                    style.width = offsetWidth + 'px';
                   style.backgroundImage = 'none';
                   filt(s, 'crop');
                   // IE link fix.
                   for (var n = 0; n < childNodes.length; n++)
                    if (childNodes[n].style) childNodes[n].style.position = 'relative';
                  }
                  else filt();
                }
                }

                 

                doFix();

                 

                </script>
                </public:component>
                • 5. Re: Counter...Need a hint....help!
                  BenPleysier Adobe Community Professional & MVP
                  <script language="javascript" type="text/javascript">
                  <!--
                  function popitup(url,height,width) {
                       newwindow=window.open(url,'name','scrollbars=1,height=600,width=825');
                       if (window.focus) {newwindow.focus()}
                       return false;
                  }

                  function popitup2(url,height,width) {
                       newwindow=window.open(url,'name','scrollbars=0,height=400,width=470');
                       if (window.focus) {newwindow.focus()}
                       return false;
                  }
                  window.onload =
                  ecrire;
                  // -->
                  </script>

                  Add the above to your document within the SCRIPT section

                  • 6. Re: Counter...Need a hint....help!
                    jacknewton Level 1

                    Damn, doesn't work...any other idea?

                     

                    BTW I really appreciate you take the time to help me out. Really.

                    • 7. Re: Counter...Need a hint....help!
                      jacknewton Level 1

                      You meant to add this in the iepngfix.htc right? That's what I did.

                      • 8. Re: Counter...Need a hint....help!
                        BenPleysier Adobe Community Professional & MVP

                        Sorry, the red line to the existing black lines in your main document.

                        • 9. Re: Counter...Need a hint....help!
                          jacknewton Level 1

                          Got it!! It works! You are a genius...

                           

                          Now last question - I promise!!!

                           

                          The countdown is incorrect, any idea where I put the date? We are 2 months away, and it shows 30 days...

                           

                          Also, I do not see the same codes in the pages http://www.villagefantome.ca/evenement.html, http://www.villagefantome.ca/communiques.html, http://www.villagefantome.ca/photos.html, http://www.villagefantome.ca/benevoles.html, http://www.villagefantome.ca/directions.html, http://www.villagefantome.ca/contact.html and the counter shows 0....I tried to check for a line that says function popitup but I can't find it...

                           

                          Sorry for my ignorance... 

                          • 10. Re: Counter...Need a hint....help!
                            BenPleysier Adobe Community Professional & MVP

                            In effets.js change/add the following code in red

                            function ecrire(Y, M, D){
                                today  = new Date();
                                todayEpoch  = today.getTime();
                               
                                target = new Date(Y, M-1, D);
                                targetEpoch = target.getTime();
                               
                                secondesLeft = Math.floor((targetEpoch - todayEpoch) / 1000);
                                secondesLeft = secondesLeft + 61200;

                            Then where you previously added window.onload = ecrire; change that to

                            window.onload = ecrire(2010, 10, 27);

                            Where 2010 is the year, 10 is the month and 27 is the day of the event. Change these values to suit

                             

                            In each of the other documents (pages) make sure that you reference the JacaScript as follows

                            <script type="text/javascript" src="js/effets.js"></script>

                            The pages that I have looked at already has this reference.

                             

                            Then add the following to each of the other documents just above the </head> tag

                            <script>window.onload = ecrire(2010, 10, 27);</script>

                            Keeping in mind to change the values in green to suit.

                            • 11. Re: Counter...Need a hint....help!
                              jacknewton Level 1

                              Thanks-Thanks-Thanks!!!!