1
scrapie
I would like a module that can do a countdown ticker
  • 2004/11/30 10:21

  • scrapie

  • Just popping in

  • Posts: 50

  • Since: 2004/5/24


Like the ones available on this website

http://www.tickercentral.com

Can anyone make this? I am not a code writter....

2
coopersita
Re: I would like a module that can do a countdown ticker

Did you checked Countdown?

Also you can create a custom block and add a Javascript countdown (there are many availabe for free at several scripting sites like ).hotscripts

3
toolsmythe
Re: I would like a module that can do a countdown ticker
  • 2004/12/20 5:26

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


I just implemented one on my site. Javascript based, in a custom HTML block:

You will need to define a <DIV> with an ID="countdownTextArea" where you want the countdown.

<script type="text/javascript">
<!--
   function 
getTime()
   {
      var 
textArea self.document.getElementById"countdownTextArea" );

      if ( 
textArea == null )
      {
        
alert"Text Area Not Found!!!" );
        return;
      }

      
currenttime = new Date();



      
//The next line is the target countdown value
      //It is based on LOCAL TIME to the countdown value
      
targettime = new Date"January 1 2005 00:00:00" );

      
dcdays = ( targettime currenttime ) / 1000 60 60 24;
      
dcdaysRound Math.floordcdays );
      
dchours = ( targettime currenttime ) / 1000 60 60 - ( 24 dcdaysRound );
      
dchoursRound Math.floordchours );
      
dcminutes = ( targettime currenttime ) / 1000 60 - ( 24 60 dcdaysRound ) - ( 60 dchoursRound );
      
dcminutesRound Math.floordcminutes );
      
dcseconds = ( targettime currenttime ) / 1000 - ( 24 60 60 dcdaysRound ) - ( 60 60 dchoursRound ) - ( 60 dcminutesRound );
      
dcsecondsRound Math.rounddcseconds );

      
// This formats the countdown text.  You can change this to do it any way you like.
      
textArea.innerHTML fillTextdcdaysRound2"0" 
                         + 
checkPlural" Day"dcdaysRound 
                         + 
", " 
                         
fillTextdchoursRound2"0" 
                         +  
checkPlural" Hour"dchoursRound 
                         + 
", " 
                         
fillTextdcminutesRound2"0"dcminutesRound 
                         + 
checkPlural" Minute"dcminutesRound 
                         + 
"<BR>and " fillTextdcsecondsRound2"0" 
                         + 
checkPlural" second"dcsecondsRound );
      
      if ( 
currenttime >= targettime )
      {
         
// This is the message when the target datetime is hit.  Make sure the countdown string format matches
         // The one above.
         
textArea.innerHTML "00 Days, 00 Minutes, 00 Hours<BR>and 00 Seconds<BR><BR><B>Happy New Year!!</B>";
         return;
      }


      
newtime window.setTimeout"getTime();"1000 );
   }


   function 
checkPluralnounvalue )
   {
      
noun = ( value == ) ? noun noun "s";
      return ( 
noun );
   }


   function 
fillTexttextlengthfillChar )
   {
      
// If someone knows an esier way to do this
      // please post it.  This seems like an awful
      // lot of work to left fill a string.  It
      // *DOES* work though <grin>
      
var counter 0;
      var 
localFillChar fillChar.toString();
      var 
tempText text.toString();

      while ( 
tempText.length length )
      {
         
tempText localFillChar.toString() + tempText.toString();
         if ( 
counter length )
         {
            break;
         }
      }

      return ( 
tempText );
   }

//-->
</script>

<
DIV ALIGN="center" STYLE="font-size: x-small;">
<
B>The magic happens in ....</B><BR>
</
DIV>
<
DIV ID="countdownTextArea" ALIGN="center" STYLE="font-size: xx-small;">
</
DIV>
<
script type="text/javascript">
<!--
self.document.onLoad getTime();
//-->
</script>

4
scrapie
Re: I would like a module that can do a countdown ticker
  • 2004/12/27 23:38

  • scrapie

  • Just popping in

  • Posts: 50

  • Since: 2004/5/24


I tried countdown but it does not work can anyone help me?

The countdown ticker is attached to the persons signature.

5
ajuden
Re: I would like a module that can do a countdown ticker
  • 2005/1/5 18:41

  • ajuden

  • Just popping in

  • Posts: 87

  • Since: 2003/4/17


What was wrong with the countdown module? I'm the developer of it. Please report in here. Thanks.

Alan

6
nassauer
Re: I would like a module that can do a countdown ticker
  • 2005/1/6 14:23

  • nassauer

  • Just popping in

  • Posts: 18

  • Since: 2005/1/6 1


Quote:

toolsmythe wrote:
I just implemented one on my site. Javascript based, in a custom HTML block:

You will need to define a <DIV> with an ID="countdownTextArea" where you want the countdown.


Excellent!! I was just looking for exactly this. Works great--thanks!

7
PaniX
Re: I would like a module that can do a countdown ticker
  • 2005/2/14 11:21

  • PaniX

  • Just popping in

  • Posts: 4

  • Since: 2005/2/9 1


Quote:

ajuden wrote:
What was wrong with the countdown module? I'm the developer of it. Please report in here. Thanks.

Alan


Your countdown module are great. But i need a countdown module that only webmaster can use and put in a block.

You have the skill to make one. Hope you make one soon!

8
krystinevo
Re: I would like a module that can do a countdown ticker

Works like a charm... thanks for providing this Alan!

Gotta have a Christmas countdown ticker Only 51 shopping days left!

Kristine
Everything is as it should be

9
dizzymarkus
Re: I would like a module that can do a countdown ticker

J script worked great ty very much nice and simple lol. I run a kids 1/4 midget racing site in NY USA and they luv tho see how many days left to racing season :0)

Markus

10
JMorris
Re: I would like a module that can do a countdown ticker
  • 2006/1/22 0:10

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Here's an amazingly simple PHP-based countdown timer I found. We chose to use this script over a Javascript version because we have a lot of dial-up visitors and adding more javascripts to the site was slowing it down.

Live demo (bottom-right block on homepage):http://cit.wvup.edu

Just paste the following code (exactly as shown) in a Custom PHP block and edit to suite:

?>
<?
// enter target date below like this: "January 2, 2001"
$target "February 10, 2006";

// enter string of what this start date is. $top_text appears above the counter, $bottom_text displays below the counter
$top_text "There are ";
$bottom_text "until the last day to apply to graduate in May!";

//--------------------------
$now strtotime ("now");
$then strtotime ("$target");
$difference $then $now;
$num $difference/86400;
$days intval($num);
$num2 = ($num $days)*24;
$hours intval($num2);
$num3 = ($num2 $hours)*60;
$mins intval($num3);
$num4 = ($num3 $mins)*60;
?>
<div style="font-weight:bold;" align="center"> <? echo $top_text ?><br />
  <table border="0" cellspacing="0" cellpadding="0" style="color:#00CC00;font-size:10px;font-family:'Courier New', Courier, mono;border-top:2px solid #AAAAAA;border-right:2px solid #333333;border-bottom:2px solid #333333;border-left:2px solid #AAAAAA;background-color:#000;padding:0px;width:125px;">
    <tr align="center" valign="middle">
      <td><? echo $days ?></td>
      <td>:</td>
      <td><? echo $hours ?></td>
      <td>:</td>
      <td><? echo $mins ?></td>
    </tr>
    <tr align="center" valign="middle">
      <td>Days</td>
      <td>|</td>
      <td>Hrs</td>
      <td>|</td>
      <td>Mins</td>
  </table>
  <? echo $bottom_text ?> </div>
<?


It may look like there are extra short tags ?> <? at the begining and ending of the script. There are not. Those are put there to force XOOPS to allow for user-controlled switching of PHP and HTML. Otherwise, all the above HTML would have had to have been output using lines like echo ('</div>');. Way too messy and time consuming.

Essentially, by placing a ?> at the beginning and a <? at the end of your PHP block, you nullify the unseen <? and ?>, thereby allowing you to define where YOU want your PHP and HTML and making troubleshooting 10x easier.

Hope this helps. Sorry for getting off topic towards the end there.

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

Login

Who's Online

163 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 163


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits