Incomplete code added to handle absent user data
authorRoland Häder <roland@mxchange.org>
Fri, 2 Apr 2010 12:00:05 +0000 (12:00 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 2 Apr 2010 12:00:05 +0000 (12:00 +0000)
.gitattributes
inc/expression-functions.php
inc/modules/admin/what-list_unconfirmed.php
templates/de/html/admin/admin_list_unconfirmed_row_404.tpl [new file with mode: 0644]

index f2fb25c472b766a1f623be6ef5a95eaa977b90a3..69ada070cd2b2cd9b83c678543ad584330d30ec8 100644 (file)
@@ -1157,6 +1157,7 @@ templates/de/html/admin/admin_list_transfer_row.tpl -text
 templates/de/html/admin/admin_list_unconfirmed.tpl -text
 templates/de/html/admin/admin_list_unconfirmed_list.tpl -text
 templates/de/html/admin/admin_list_unconfirmed_row.tpl -text
 templates/de/html/admin/admin_list_unconfirmed.tpl -text
 templates/de/html/admin/admin_list_unconfirmed_list.tpl -text
 templates/de/html/admin/admin_list_unconfirmed_row.tpl -text
+templates/de/html/admin/admin_list_unconfirmed_row_404.tpl -text
 templates/de/html/admin/admin_list_user.tpl -text
 templates/de/html/admin/admin_list_user_alpha.tpl -text
 templates/de/html/admin/admin_list_user_pagenav.tpl -text
 templates/de/html/admin/admin_list_user.tpl -text
 templates/de/html/admin/admin_list_user_alpha.tpl -text
 templates/de/html/admin/admin_list_user_pagenav.tpl -text
index b1e95c2ef6932df503a5dc581664dd78c02e3fa6..e74d3784635e456d0cbcfe825bb1acb7875f0179 100644 (file)
@@ -184,5 +184,10 @@ function doExpressionValidatorLinks ($data) {
        return $code;
 }
 
        return $code;
 }
 
+// Expression call-back for dynamic messages
+function doExpressionMessage ($data) {
+       die('<pre>'.htmlentities(print_r($data, true)).'</pre>');
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index ffbde1c309d580a5f2d62b010981ffc67172b91e..32aa9857ab617fc5f06f64d2c2159555dcb30498 100644 (file)
@@ -116,8 +116,15 @@ LEFT JOIN
 ON
        l.userid=u.userid
 WHERE
 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);
 
                // Total number of unconfirmed mails
                $unconfirmed = SQL_NUMROWS($result);
@@ -126,20 +133,30 @@ WHERE
                        // At least one link left to confirm
                        $OUT = ''; $SW = 2;
                        while ($content = SQL_FETCHARRAY($result)) {
                        // 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
 
                                $SW = 3 - $SW;
                        } // END - while
 
@@ -194,7 +211,7 @@ WHERE
 
        // Free result
        SQL_FREERESULT($result_master);
 
        // Free result
        SQL_FREERESULT($result_master);
-}
+} // END - if
 
 // [EOF]
 ?>
 
 // [EOF]
 ?>
diff --git a/templates/de/html/admin/admin_list_unconfirmed_row_404.tpl b/templates/de/html/admin/admin_list_unconfirmed_row_404.tpl
new file mode 100644 (file)
index 0000000..4b42f81
--- /dev/null
@@ -0,0 +1,5 @@
+<tr>
+       <td align="center" class="switch_sw$content[sw] bottom" colspan="4">
+               {%message=ADMIN_USER_DATA_NOT_FOUND,$content[userid]%}
+       </td>
+</tr>