]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_unconfirmed.php
Incomplete code added to handle absent user data
[mailer.git] / inc / modules / admin / what-list_unconfirmed.php
index 568ebf4c63f6bba687a54c8f0fd23f6b40c6bd88..32aa9857ab617fc5f06f64d2c2159555dcb30498 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -115,8 +116,15 @@ LEFT JOIN
 ON
        l.userid=u.userid
 WHERE
-       l.%s='%s' ORDER BY l.userid LIMIT %s",
-                       array($col, $ID, bigintval($max)),__FILE__, __LINE__);
+       l.%s='%s'
+ORDER BY
+       l.userid ASC
+LIMIT %s",
+                       array(
+                               $col,
+                               $ID,
+                               bigintval($max)
+                       ),__FILE__, __LINE__);
 
                // Total number of unconfirmed mails
                $unconfirmed = SQL_NUMROWS($result);
@@ -125,20 +133,30 @@ WHERE
                        // At least one link left to confirm
                        $OUT = ''; $SW = 2;
                        while ($content = SQL_FETCHARRAY($result)) {
-                               // Prepare data for the row template
-                               // @TODO Rewritings: userid->userid
-                               $content = array(
-                                       'sw'     => $SW,
-                                       'u_link' => generateUserProfileLink($content['userid']),
-                                       'userid' => $content['userid'],
-                                       'link'   => $LINK,
-                                       'id'     => $ID,
-                                       'email'  => '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '</a>',
-                                       'status' => translateUserStatus($content['status']),
-                               );
-
-                               // Load row template and switch colors
-                               $OUT .= loadTemplate('admin_list_unconfirmed_row', true, $content);
+                               // User data found? We can take any field of u.
+                               if (!is_null($content['status'])) {
+                                       // Prepare data for the row template
+                                       $content = array(
+                                               'sw'     => $SW,
+                                               'u_link' => generateUserProfileLink($content['userid']),
+                                               'userid' => $content['userid'],
+                                               'link'   => $LINK,
+                                               'id'     => $ID,
+                                               'email'  => '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '</a>',
+                                               'status' => translateUserStatus($content['status']),
+                                       );
+
+                                       // Load row template and switch colors
+                                       $OUT .= loadTemplate('admin_list_unconfirmed_row', true, $content);
+                               } else {
+                                       // Insert color-switch
+                                       $content['sw'] = $SW;
+
+                                       // No user data found
+                                       $OUT .= loadTemplate('admin_list_unconfirmed_row_404', true, $content);
+                               }
+
+                               // Switch color
                                $SW = 3 - $SW;
                        } // END - while
 
@@ -193,7 +211,7 @@ WHERE
 
        // Free result
        SQL_FREERESULT($result_master);
-}
+} // END - if
 
 // [EOF]
 ?>