- $OUT = LOAD_TEMPLATE("admin_list_unconfirmed_header", true);
- $SW = 2;
- while(list($uid, $status, $sname, $fname, $gender, $email) = SQL_FETCHROW($result))
- {
- // Prepare data for the row template
- $content = array(
- 'sw' => $SW,
- 'u_link' => ADMIN_USER_PROFILE_LINK($uid),
- 'uid' => $uid,
- 'link' => $LINK,
- 'id' => $ID,
- 'email' => "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$sname." ".$fname."</a>",
- 'status' => TRANSLATE_STATUS($status),
- );
-
- // Load row template and switch colors
- $OUT .= LOAD_TEMPLATE("admin_list_unconfirmed_row", true, $content);
- $SW = 3 - $SW;
- }
- $OUT .= "</table>\n";
-
- // Free memory
- SQL_FREERESULT($result);
-
- // Store table rows in a constant
- define('__LIST_UNCON_LISTING', $OUT);
- }
- else
- {
+ $OUT = '';
+ while ($row = SQL_FETCHARRAY($result)) {
+ // User data found? We can take any field of u.
+ if (!is_null($row['status'])) {
+ // Prepare data for the row template
+ $row = array(
+ 'userid' => $row['userid'],
+ 'link' => $mailType,
+ 'id' => $ID,
+ 'email' => '<a href="' . generateEmailLink($row['email'], 'user_data') . '">{%pipe,translateGender=' . $row['gender'] . '%} ' . $row['surname'] . ' ' . $row['family'] . '</a>',
+ 'status' => $row['status'],
+ );
+
+ // Load row template and switch colors
+ $OUT .= loadTemplate('admin_list_unconfirmed_row', true, $row);
+ } else {
+ // No user data found
+ $OUT .= loadTemplate('admin_list_unconfirmed_row_404', true, $row);
+ }
+ } // END - while
+
+ // Render it in our new listing
+ $OUT = loadTemplate('admin_list_unconfirmed_list', true, $OUT);
+ } else {