Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
Tizwit
Involved
Involved


Joined: Aug 29, 2004
Posts: 324
Location: New Mexico

PostPosted: Sat Sep 04, 2004 2:58 am Reply with quote

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 Only registered users can see links on this board! Get registered or login!
Helping the Children in the NM Children's Hospital 
View user's profile Send private message Visit poster's website
Tao_Man
Involved
Involved


Joined: Jul 15, 2004
Posts: 252
Location: OKC, OK

PostPosted: Sat Sep 04, 2004 11:57 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
Tizwit
PostPosted: Mon Sep 06, 2004 11:19 pm Reply with quote

Sorry about the delay. Just got back into town.. Thank you for any help you could offer
 
Tao_Man
PostPosted: Tue Sep 07, 2004 2:11 pm Reply with quote

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
PostPosted: Tue Sep 07, 2004 10:01 pm Reply with quote

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
PostPosted: Tue Sep 07, 2004 10:03 pm Reply with quote

Woot! hadn't noticed broke a 100 posts. Smile
 
Tizwit
PostPosted: Tue Sep 07, 2004 10:28 pm Reply with quote

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
PostPosted: Wed Sep 08, 2004 8:59 am Reply with quote

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
PostPosted: Wed Sep 08, 2004 9:15 am Reply with quote

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
PostPosted: Wed Sep 08, 2004 11:09 am Reply with quote

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
PostPosted: Wed Sep 08, 2004 11:25 am Reply with quote

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
PostPosted: Wed Sep 08, 2004 12:19 pm Reply with quote

looks Great Thanx
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©