PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
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 Back to top

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
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 Back to top

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.
View user's profile Send private message Visit poster's website
Tizwit
Involved
Involved


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

PostPosted: Mon Sep 06, 2004 11:19 pm Reply with quote Back to top

Sorry about the delay. Just got back into town.. Thank you for any help you could offer
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: Tue Sep 07, 2004 2:11 pm Reply with quote Back to top

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

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

Woot! hadn't noticed broke a 100 posts. Smile
View user's profile Send private message Visit poster's website
Tizwit
Involved
Involved


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

PostPosted: Tue Sep 07, 2004 10:28 pm Reply with quote Back to top

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

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.
View user's profile Send private message Visit poster's website
Tizwit
Involved
Involved


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

PostPosted: Wed Sep 08, 2004 9:15 am Reply with quote Back to top

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

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

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>";
?>
View user's profile Send private message Visit poster's website
Tizwit
Involved
Involved


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

PostPosted: Wed Sep 08, 2004 12:19 pm Reply with quote Back to top

looks Great Thanx
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum