| 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;
?> |