Bonus ranking list now contains nicknames, if set
[mailer.git] / inc / libs / bonus_functions.php
index 5b73589..c348118 100644 (file)
@@ -170,6 +170,15 @@ LIMIT 1",
                                // Load data
                                $rows = merge_array($rows, SQL_FETCHARRAY($result_users));
 
+                               // Is ext-nickname active?
+                               if (isExtensionActive('nickname')) {
+                                       // Then get the nickname
+                                       $nick = getNickname($rows['userid']);
+
+                                       // Is it not empty? Then use it
+                                       if (!empty($nick)) $rows['userid'] = $nick . '(' . $rows['userid'] . ')';
+                               } // END - if
+
                                // Translate comma
                                $rows['points'] = translateComma($rows['points']);
                        } // END - if