Fix for birthday timestamps < 0 (why this?)
authorRoland Häder <roland@mxchange.org>
Thu, 25 Dec 2008 20:29:04 +0000 (20:29 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 25 Dec 2008 20:29:04 +0000 (20:29 +0000)
inc/databases.php
inc/modules/admin/what-list_user.php

index 191aa54571b7ee900b668373e00e0b9a9b65de4d..7faf6d6567921c17ec05e850db6cd9c4f2897530 100644 (file)
@@ -115,7 +115,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "706");
+define('CURR_SVN_REVISION', "707");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 7aac557d3a2620223daec4f273047409231a1589..9e689ce6c4f681b95cf119af98289d26a960bade 100644 (file)
@@ -118,8 +118,19 @@ LIMIT 1",
                if ($REFS > 0) $REFS = $BASE."&amp;what=list_refs&amp;u_id=".$uid."\">".$REFS."</A>]";
                if ($CATS > 0) $CATS = $BASE."&amp;what=list_cats&amp;u_id=".$uid."\">".$CATS."</A>]";
 
                if ($REFS > 0) $REFS = $BASE."&amp;what=list_refs&amp;u_id=".$uid."\">".$REFS."</A>]";
                if ($CATS > 0) $CATS = $BASE."&amp;what=list_cats&amp;u_id=".$uid."\">".$CATS."</A>]";
 
+               // Calculate timestamp for birthday
+               $stamp = MAKE_DATETIME(mktime(0, 0, 0, $DATA['birth_month'], $DATA['birth_day'], $DATA['birth_year']), "3");
+
+               // Is this above zero?
+               if ($stamp > 0) {
+                       // Then use it
+                       define('_BIRTHDAY', $stamp);
+               } else {
+                       // Zero or below so set zero!
+                       define('_BIRTHDAY', MAKE_DATETIME(0, "3"));
+               }
+
                // Prepare data for template
                // Prepare data for template
-               define('_BIRTHDAY', MAKE_DATETIME(mktime(0, 0, 0, $DATA['birth_month'], $DATA['birth_day'], $DATA['birth_year']), "3"));
                define('_REFS' , $REFS);
                define('_CATS' , $CATS);
                define('_LINKS', $LINKS);
                define('_REFS' , $REFS);
                define('_CATS' , $CATS);
                define('_LINKS', $LINKS);