Skip to content

Commit 643ca40

Browse files
authored
Merge pull request #72 from topcoder-platform/issues-490
Issues 490: Fixed challenge roles for user photo links
2 parents 1811ed9 + c1d2628 commit 643ca40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Topcoder/class.topcoder.plugin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2020,7 +2020,7 @@ function userPhoto($user, $options = []) {
20202020

20212021
$userLink = userUrl($fullUser);
20222022
$topcoderProfile = TopcoderPlugin::getTopcoderUser($user);
2023-
if($topcoderProfile !== null) {
2023+
if($topcoderProfile) {
20242024
$attributes['target'] = '_blank';
20252025
$userLink = TopcoderPlugin::getTopcoderProfileUrl($name);
20262026
$topcoderPhotoUrl = val('PhotoUrl', $topcoderProfile);
@@ -2029,12 +2029,14 @@ function userPhoto($user, $options = []) {
20292029
}
20302030
}
20312031

2032+
$isTopcoderAdmin = val('IsAdmin', $topcoderProfile);
20322033
$photoUrl = isset($photoUrl) && !empty(trim($photoUrl)) ? $photoUrl: UserModel::getDefaultAvatarUrl();
20332034
$href = (val('NoLink', $options)) ? '' : ' href="'.url($userLink).'"';
20342035

20352036
Gdn::controller()->EventArguments['User'] = $user;
20362037
Gdn::controller()->EventArguments['Title'] =& $title;
20372038
Gdn::controller()->EventArguments['Attributes'] =& $attributes;
2039+
Gdn::controller()->EventArguments['IsTopcoderAdmin'] =$isTopcoderAdmin;
20382040
Gdn::controller()->fireEvent('UserPhoto');
20392041

20402042
return '<a title="'.$title.'"'.$href.attribute($attributes).'>'

0 commit comments

Comments
 (0)