From 5a69c64c3f0e288829c6daef7d4768bea16b9fa5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 2 Apr 2010 12:00:05 +0000 Subject: [PATCH] Incomplete code added to handle absent user data --- .gitattributes | 1 + inc/expression-functions.php | 5 ++ inc/modules/admin/what-list_unconfirmed.php | 51 ++++++++++++------- .../admin/admin_list_unconfirmed_row_404.tpl | 5 ++ 4 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 templates/de/html/admin/admin_list_unconfirmed_row_404.tpl diff --git a/.gitattributes b/.gitattributes index f2fb25c472..69ada070cd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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_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 diff --git a/inc/expression-functions.php b/inc/expression-functions.php index b1e95c2ef6..e74d378463 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -184,5 +184,10 @@ function doExpressionValidatorLinks ($data) { return $code; } +// Expression call-back for dynamic messages +function doExpressionMessage ($data) { + die('
'.htmlentities(print_r($data, true)).'
'); +} + // [EOF] ?> diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php index ffbde1c309..32aa9857ab 100644 --- a/inc/modules/admin/what-list_unconfirmed.php +++ b/inc/modules/admin/what-list_unconfirmed.php @@ -116,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); @@ -126,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' => '' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '', - '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' => '' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '', + '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 @@ -194,7 +211,7 @@ WHERE // Free result SQL_FREERESULT($result_master); -} +} // END - if // [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 index 0000000000..4b42f81dac --- /dev/null +++ b/templates/de/html/admin/admin_list_unconfirmed_row_404.tpl @@ -0,0 +1,5 @@ + + + {%message=ADMIN_USER_DATA_NOT_FOUND,$content[userid]%} + + -- 2.39.5