New function isValidUserid() introduced, more rewrites to EL:
[mailer.git] / inc / modules / admin / what-list_user.php
index 61ace388a9a9cb568cf3613645feb40265198a43..87e9901869dc176511512f618ea9776eaf6b6b5e 100644 (file)
@@ -119,9 +119,9 @@ LIMIT 1",
 
                // Add links to the numbers
                if ($content['links'] > 0) $content['links'] = $base . '&amp;what=list_links&amp;userid=' . $userid . '%}">' . $content['links'] . '</a>]';
-               if ($content['refid'] > 0) $content['refid'] = $base . '&amp;what=list_user&amp;userid=' . $content['refid'] . '%}">'.$content['refid'] . '</a>]';
-               if ($content['refs']  > 0) $content['refs']  = $base . '&amp;what=list_refs&amp;userid=' . $userid . '%}">' . $content['refs'] . '</a>]';
-               if ($content['cats']  > 0) $content['cats']  = $base . '&amp;what=list_cats&amp;userid=' . $userid . '%}">' . $content['cats'] . '</a>]';
+               if (isValidUserId($content['refid'])) $content['refid'] = $base . '&amp;what=list_user&amp;userid=' . $content['refid'] . '%}">'.$content['refid'] . '</a>]';
+               if ($content['refs']  > 0) $content['refs']  = $base . '&amp;what=list_refs&amp;userid=' . $userid . '%}">' . translateComma($content['refs']) . '</a>]';
+               if ($content['cats']  > 0) $content['cats']  = $base . '&amp;what=list_cats&amp;userid=' . $userid . '%}">' . translateComma($content['cats']) . '</a>]';
 
                // Fix empty module
                if (empty($content['last_module'])) $content['last_module'] = '---';
@@ -285,9 +285,6 @@ LIMIT 1",
                        // Merge more data in
                        $content = merge_array($content, $templateContent);
 
-                       // Set refid link
-                       if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
-
                        // Get number of unconfirmed mails
                        $content['links'] = countSumTotalData($content['userid'], 'user_links', 'id', 'userid', true);
                        if ($content['links'] > 0) $content['links'] = $base . '&amp;what=list_links&amp;userid=' . $content['userid'] . '%}">' . translateComma($content['links']) . '</a>]';
@@ -316,7 +313,7 @@ LIMIT 1",
                        $content['locked']         = countSumTotalData($content['userid'], 'user_points', 'locked_points');
 
                        // If we have at least one referal, make it clickable to referal list
-                       if ($content['refs'] > 0) $content['refs'] = $base . '&amp;what=list_refs&amp;userid=' . $content['userid'] . '%}">' . $content['refs'] . '</a>]';
+                       if ($content['refs'] > 0) $content['refs'] = $base . '&amp;what=list_refs&amp;userid=' . $content['userid'] . '%}">' . translateComma($content['refs']) . '</a>]';
 
                        // Is the lock reason not set?
                        if (!isset($content['lock_reason'])) $content['lock_reason'] = '---';