Fix for birthday timestamps < 0 (why this?)
[mailer.git] / inc / modules / admin / what-list_user.php
index 15990d4acc4275e76656fbf5e71a8e220dcf9f9f..9e689ce6c4f681b95cf119af98289d26a960bade 100644 (file)
@@ -79,7 +79,10 @@ if (GET_EXT_VERSION("user") >= "0.3.4") {
 if (EXT_IS_ACTIVE("country")) {
        // Add country code
        $MORE .= ", country_code";
-} // END - if
+} else {
+       // Add direct value
+       $MORE .= ", country";
+}
 
 // Init unset data (bad that we change $_GET here!)
 if (empty($_GET['letter'])) { $_GET['letter'] = _ALL2;    }
@@ -115,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>]";
 
+               // 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
-               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);
@@ -223,7 +237,7 @@ LIMIT 1",
 
        // Calculate page count (0.5 fixes a bug with page count)
        if (getConfig('user_limit') == 0) {
-               getConfig('user_limit') = 100;
+               $_CONFIG['user_limit'] = 100;
                LOAD_TEMPLATE("admin_settings_saved", false, EXTENSION_WARNING_USER_LIMIT);
        } // END - if
 
@@ -323,7 +337,7 @@ LIMIT 1",
                        if (EXT_IS_ACTIVE("country")) {
                                // Then overwrite country information
                                $content['country'] = COUNTRY_GENERATE_INFO($content['country_code']);
-                       } elseif ($content['country'] == 0) {
+                       } elseif ($content['country'] == "") {
                                // Zero ID???
                                $content['country'] = "???";
                        }