Bonus ranking list now contains nicknames, if set
authorRoland Häder <roland@mxchange.org>
Thu, 29 Oct 2009 00:32:20 +0000 (00:32 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 29 Oct 2009 00:32:20 +0000 (00:32 +0000)
inc/functions.php
inc/libs/bonus_functions.php

index 9cd97a5890e348df795c823a58f6095aad5697a6..0048109565812153f65ca8df08c1c64097237ab6 100644 (file)
@@ -935,18 +935,25 @@ function countSelection ($array) {
 
 // Generate XHTML code for the CAPTCHA
 function generateCaptchaCode ($code, $type, $DATA, $userid) {
-       return '<IMG border="0" alt="Code" src="{?URL?}/mailid_top.php?userid=' . $userid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '" />';
+       return '<img border="0" alt="Code ' . $code . '" src="{?URL?}/mailid_top.php?userid=' . $userid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '" />';
 }
 
 // Generates a timestamp (some wrapper for mktime())
-function makeTime ($H, $M, $S, $stamp) {
+function makeTime ($hours, $minutes, $seconds, $stamp) {
        // Extract day, month and year from given timestamp
-       $day   = date('d', $stamp);
-       $month = date('m', $stamp);
-       $year  = date('Y', $stamp);
+       $days   = date('d', $stamp);
+       $months = date('m', $stamp);
+       $years  = date('Y', $stamp);
 
        // Create timestamp for wished time which depends on extracted date
-       return mktime($H, $M, $S, $month, $day, $year);
+       return mktime(
+               $hours,
+               $minutes,
+               $seconds,
+               $months,
+               $days,
+               $years
+       );
 }
 
 // Redirects to an URL and if neccessarry extends it with own base URL
index 5b7358917ef5bec4e9a2ba12e4b24bdc0c207ee6..c348118bbfd3169eccee73e8fac7e9c800984bd1 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