PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  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
gizmo2
Hangin' Around


Joined: Sep 15, 2007
Posts: 34
Location: Germany

PostPosted: Sun Jun 21, 2009 12:08 pm Reply with quote Back to top

I'm looking for a script that displays a countdown the other way. I need to show how much years, days and minutes ago a special date was. I need to show with this block how old my daugter is. Does anyone knows such a script?

Thanks in advance!


Last edited by gizmo2 on Sun Jun 21, 2009 3:08 pm; edited 1 time in total
View user's profile Send private message
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 1536
Location: North Carolina

PostPosted: Sun Jun 21, 2009 12:37 pm Reply with quote Back to top

Code:
<?php
###############################################################################
# RavenNuke(tm) Countup block  http://trickedoutnews.com
###############################################################################
# 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 (stristr($_SERVER['SCRIPT_NAME'], "block-Countup.php"))
{
   Header("Location: ../../index.php");
   die();
}
$stamp = strtotime("1 april 1970 "); //the date you where born
$stamp2 = strtotime("now");
$diff = ($stamp2 - $stamp);
$years = floor($diff / 31556927.29); //the average year is 365.242214 days :)
$months = floor(($diff -$years * 31556927.29)/ 2629743.941); // the average month :P
$days = floor(($diff- $years * 31556927.29 - $months * 2629743.941) / 86400);
$return = "I am $years year $months months $days days old";
$content = $return;
?>


Put this in a file in your blocks folder named block-Countup.php and change the 1 april 1970 to the date of birth you want.
View user's profile Send private message Send e-mail Visit poster's website
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 1536
Location: North Carolina

PostPosted: Tue Jun 23, 2009 6:19 am Reply with quote Back to top

This one shows years, months, days, hours, minutes, seconds

Code:
<?php
###############################################################################
# RavenNuke(tm) Countup block  http://trickedoutnews.com
###############################################################################
# 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 (stristr($_SERVER['SCRIPT_NAME'], "block-Countup.php"))
{
   Header("Location: ../../index.php");
   die();
}
$stamp = strtotime("1 april 1980 12:00:00"); //the date you where born
$stamp2 = strtotime("now");
$diff = ($stamp2 - $stamp);
$years = floor($diff / 31556927.29); //the average year is 365.242214 days :)
$months = floor(($diff -$years * 31556927.29)/ 2629743.941); // the average month :P
$days = floor(($diff- $years * 31556927.29 - $months * 2629743.941) / 86400);
$hour = floor(($diff- $years * 31556927.29 - $months * 2629743.941 - $days * 86400)/ 3600);
$min = floor(($diff- $years * 31556927.29 - $months * 2629743.941 - $days * 86400 - $hour * 3600) / 60);
$sec = floor($diff- $years * 31556927.29 - $months * 2629743.941  - $days * 86400 - $hour * 3600 - $min * 60);
$return = "I am $years years $months months $days days $hour h $min m $sec s old";
$content = $return;
?>
View user's profile Send private message Send e-mail 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