Prevents multiple nationality from the same country (Closes #1097).
[platal.git] / plugins / function.profile.php
index 53f2a5d..dfc4bf3 100644 (file)
@@ -27,7 +27,7 @@ function smarty_function_profile($params, &$smarty)
     $with_link  = $params->b('link', true);
     $with_groupperms = $params->b('groupperms', true);
     $user = $params->v('user');
-    if (ctype_digit($user)) {
+    if (is_int($user) || ctype_digit($user)) {
         $user = User::getWithUID($user);
     }
 
@@ -47,7 +47,7 @@ function smarty_function_profile($params, &$smarty)
             $name = '<a href="profile/' . $profile->hrid() . '" class="popup2">' . $name . '</a>';
         }
     }
-    if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin') {
+    if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {
         $name = '<strong>' . $name . '</strong>';
     }
     return $name;