]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_unconfirmed.php
A lot while() conditions rewritten to SQL_FETCHARRAY(), see bug #107, @TODO tags...
[mailer.git] / inc / modules / admin / what-list_unconfirmed.php
index 0c009ba6b8a8435825f9071a1ea0bb61e87319a0..4ec7a6470e1a705a6afd27f918141b6c5ebd7f8e 100644 (file)
@@ -84,12 +84,15 @@ if ($listed === true) {
        $result = SQL_QUERY($sql, __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Mail order / bonus mail found!
+               // @TODO Rewrite this to $content = SQL_FETCHARRAY(), look some lines above for two differrent queries
                list($stats_id, $sender, $subj, $text, $url, $stamp, $max) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
 
                // Transfer data to constants for the template
                if (($stats_id > 0) && ($ID == "-1")) $ID = $stats_id;
                if ($col == "bonus_id") $sender = 0;
+
+               // @TODO Rewrite these constants
                define('__LIST_UNCON_SENDER' , $sender);
                define('__LIST_UNCON_SUBJECT', COMPILE_CODE($subj));
                define('__LIST_UNCON_TEXT'   , COMPILE_CODE($text));
@@ -107,22 +110,25 @@ ON l.userid=u.userid
 WHERE l.%s='%s' ORDER BY l.userid LIMIT %s",
                        array($col, $ID, bigintval($max)),__FILE__, __LINE__);
                $unconfirmed = SQL_NUMROWS($result);
+
+               // @TODO Rewrite this constant
                define('__LIST_UNCO_UNCONFIRMED', $unconfirmed);
 
                if ($unconfirmed > 0) {
                        // At least one link left to confirm
                        $OUT = LOAD_TEMPLATE("admin_list_unconfirmed_header", true);
                        $SW = 2;
-                       while (list($uid, $status, $sname, $fname, $gender, $email) = SQL_FETCHROW($result)) {
+                       while ($content = SQL_FETCHARRAY($result)) {
                                // Prepare data for the row template
+                               // @TODO Rewritings: uid->userid
                                $content = array(
                                        'sw'     => $SW,
-                                       'u_link' => ADMIN_USER_PROFILE_LINK($uid),
-                                       'uid'    => $uid,
+                                       'u_link' => ADMIN_USER_PROFILE_LINK($content['userid']),
+                                       'uid'    => $content['userid'],
                                        'link'   => $LINK,
                                        'id'     => $ID,
-                                       'email'  => "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$sname." ".$fname."</a>",
-                                       'status' => TRANSLATE_STATUS($status),
+                                       'email'  => "<a href=\"".CREATE_EMAIL_LINK($content['email'], "user_data")."\">".TRANSLATE_GENDER($content['gender'])." ".$content['surname']." ".$content['family']."</a>",
+                                       'status' => TRANSLATE_STATUS($content['status']),
                                );
 
                                // Load row template and switch colors