Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...National Debt CounterNational Debt Counter
Previous
 
Next
New Post
1/3/2007 7:59 AM
 

Hi, I'm looking for a piece of code that counts up like the NDC.  We have a company intranet and the boss wants a rolling count of sales. Lets say we will have sales of 50m for the year, I would like a counter that started on Jan1 to count up and on December 31 stop at 50m.  Is it possible to insert this into a html/text box. It sounds simple, but I can't program.  Thanks!

s

 
New Post
1/3/2007 9:10 AM
 

You could use our dbHTML module.  If you wanted the info to display actual data from a database you could create the select statement to return it.  Or you could do some tricky sql that calculated the number of days and multiplied it by a daily factor.  Or hourly for that matter.  This would update each time the page is refreshed not a dynamic scrolling affect like a car odometer. 

mj


Michael Jackson
Brillnat.com
Custom module development
Database access tokenized HTML modules
 
New Post
1/3/2007 9:45 AM
 

Thanks mhj96813.  The boss is looking for the rolling odometer look.  The data will not be pulled from a database but from estimated numbers.  We know about how much we will do in a year so it should just be some sort of formula where I plug in the numbers for the month and for the year and it counts up by sales per minute.

Thanks

 
New Post
1/4/2007 4:14 PM
 

Ok I found some javascript that works in a regular .asp page but I can't get it to work in DNN.  I tried placing it in the header section but no joy.  Could someone see if this code will even run on DNN.

<script language="JavaScript">

 

function maind()

{

 startdate = new Date()

 now(startdate.getYear(),startdate.getMonth(),startdate.getDate(),startdate.getHours(),startdate.getMinutes(),startdate.getSeconds())

}

 

function ChangeValue(number,pv)

{

 numberstring =""

 var j=0

 var i=0

 while (number > 1)

  {

     numberstring = (Math.round(number-0.5) % 10) + numberstring

     number= number / 10

     j++

     if (number > 1 && j==3) {

   numberstring = "," + numberstring

   j=0}

     i++

  }

  numberstring= " " + numberstring+".00"

  

 

 if (pv==1) { document.schuld.schuld.value = numberstring }

 if (pv==2) {document.newnow.newnow.value = numberstring}

 

}

 

function now(year,month,date,hours,minutes,seconds)

{      

 startdatum = new Date(year,month,date,hours,minutes,seconds)

 

 var now = 1970000.0

 var now2 = 25000000.0

 var groeipercentage = (now2 - now) / now *100

 var groeiperseconde = (now * (groeipercentage/100))/365.0/24.0/60.0/60.0

 nu = new Date ()               

 schuldstartdatum = new Date (2007,1,1)                           

 secondenoppagina = (nu.getTime() - startdatum.getTime())/1000

 totaleschuld= (nu.getTime() - schuldstartdatum.getTime())/1000*groeiperseconde + now

 

 ChangeValue(totaleschuld,1);

 ChangeValue(secondenoppagina*groeiperseconde,2);

 

 timerID = setTimeout("now(startdatum.getYear(),startdatum.getMonth(),startdatum.getDate(),startdatum.getHours(),startdatum.getMinutes(),startdatum.getSeconds())",200)

}

</script>

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...National Debt CounterNational Debt Counter


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out