Author |
Message |
Tizwit
Involved


Joined: Aug 29, 2004
Posts: 324
Location: New Mexico
|
Posted:
Sat Sep 04, 2004 2:58 am |
|
Before going to PHP-Nuke I was trying to find a counter of some sorts and now I am wondering if anyone may know how or may know of a block that can do the following..
The site I am focusing on is related to diabetes. Someone is diagnosed with diabetes every 40 seconds. Diabetes kills one American every 3 minutes. I want to make a counter that counts this statistics like this..
Does anyone know how or where I can find something like this?
Thank you for the help |
_________________ Brian
www.4Support.org
Helping the Children in the NM Children's Hospital |
|
|
 |
Tao_Man
Involved


Joined: Jul 15, 2004
Posts: 252
Location: OKC, OK
|
Posted:
Sat Sep 04, 2004 11:57 am |
|
Should be able to whip somethng up like that. I will be busy today but maybe can get to it tonight, or maybe a real programmer will step in and have something for you.
You mught want to post in the for hire forum also. |
_________________ ------------------------------------------
To strive, to seek, to find, but not to yield!
I don't know Kara-te but I do know cra-zy, and I WILL use it! |
|
|
 |
Tizwit

|
Posted:
Mon Sep 06, 2004 11:19 pm |
|
Sorry about the delay. Just got back into town.. Thank you for any help you could offer |
|
|
|
 |
Tao_Man

|
Posted:
Tue Sep 07, 2004 2:11 pm |
|
it will be a bit, something came up and will not have a lot of free time. maybe someone else will step in, anyway its on my list. |
|
|
|
 |
Tao_Man

|
Posted:
Tue Sep 07, 2004 10:01 pm |
|
Well this is down and dirty, will play around with it some more. It is also not real time, working on that.
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Diabetes_Counter.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
// $cts is the time to start counting from
$cts = strtotime("01/01/2004");
$ctn = time(); //now
$ctd = $ctn - $cts; //diffrence in time
$content = "Someone is diagnosed with diabetes every 40 seconds. It kills every 3 minutes<p>";
$content .= "This year alone over ".floor($ctd/40)." have been diagnosed<p>";
$content .= "<b>Over ".floor($ctd/180)." have been killed!</b>";
?>
|
Let me know good/bad/ugly. |
|
|
|
 |
Tao_Man

|
Posted:
Tue Sep 07, 2004 10:03 pm |
|
Woot! hadn't noticed broke a 100 posts.  |
|
|
|
 |
Tizwit

|
Posted:
Tue Sep 07, 2004 10:28 pm |
|
Congrats on the 100+ posts.
Got it up and running Thank you.. now I will be working on the cosmetics some.. any tips from anyone that would make an improvement in your eyes please let me know |
|
|
|
 |
Tao_Man

|
Posted:
Wed Sep 08, 2004 8:59 am |
|
Well it is down an dirty, I wrote it late and was getting tired and wanted to let you have what I had done so far.
I am more of a coder then a web designer so I was never much good at making things look pretty.
I will fiddel with it a bit more. |
|
|
|
 |
Tizwit

|
Posted:
Wed Sep 08, 2004 9:15 am |
|
Thanx for your help. I unfortunaly am neither a coder nor a designer. I will stick with Nursing its what I do best. I just do webstuff to help get rid of some of the stress which I see from day to day |
|
|
|
 |
Tao_Man

|
Posted:
Wed Sep 08, 2004 11:09 am |
|
here is one little thing that makes it look a bit better
change
$content .= "This year alone over ".floor($ctd/40)." have been diagnosed<p>";
$content .= "<b>Over ".floor($ctd/180)." have been killed!</b>";
to
$content .= "This year alone over ".format_number(floor($ctd/40))." have been diagnosed<p>";
$content .= "<b>Over ".format_number(floor($ctd/180))." have been killed!</b>";
that will print the number out like 123,456 instead of 123456 |
|
|
|
 |
Tao_Man

|
Posted:
Wed Sep 08, 2004 11:25 am |
|
ok new block with minor tweeks.
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Diabetes_Counter.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$counttimestart = "01/01/2004";
$cts = strtotime($counttimestart); // $cts is the time to start counting from
$ctn = time(); //now
$ctd = $ctn - $cts; //diffrence in time in seconds
$content = "<center>Someone is diagnosed with diabetes every 40 seconds. It kills every 3 minutes.<p>";
$content .= "Since $counttimestart over ".number_format(floor($ctd/40))." have been diagnosed.<p>";
$content .= "<b>Over ".number_format(floor($ctd/180))." have been killed!</center></b>";
?>
|
|
|
|
|
 |
Tizwit

|
Posted:
Wed Sep 08, 2004 12:19 pm |
|
|
|
 |
|