@@ -947,6 +947,23 @@ function gdn_dispatcher_beforeControllerMethod_handler($sender, $args){
947
947
* Add scripts. Add script to hide iPhone browser bar on pageload.
948
948
*/
949
949
public function base_render_before ($ sender ) {
950
+ if (isset ($ _SERVER ['HTTP_REFERER ' ])) {
951
+ $ url = $ _SERVER ['HTTP_REFERER ' ];
952
+ parse_str ( parse_url ( $ url , PHP_URL_QUERY ), $ array );
953
+ $ embedType = $ array ['mbed_type ' ];
954
+ if ($ embedType == 'mfe ' ) {
955
+ $ sender ->addDefinition ('MFEEmbedded ' , '1 ' );
956
+ $ sender ->MasterView = 'mfe ' ;
957
+ // logMessage(__FILE__,__LINE__,'TopcoderPlugin','base_render_before',"Use Embed Master Template due to HTTP_REFERER".$url);
958
+ }
959
+ }
960
+
961
+ // Force view options
962
+ if (getIncomingValue ('embed_type ' ) == 'mfe ' ) {
963
+ $ sender ->addDefinition ('MFEEmbedded ' , '1 ' );
964
+ $ sender ->MasterView = 'mfe ' ;
965
+ // logMessage(__FILE__,__LINE__,'TopcoderPlugin','base_render_before',"Use Embed Master Template due to Query Param");
966
+ }
950
967
if (is_object ($ sender ->Head )) {
951
968
$ sender ->Head ->addString ($ this ->getJS ());
952
969
}
@@ -2450,7 +2467,7 @@ function userPhoto($user, $options = []) {
2450
2467
$ isTopcoderAdmin = val ('IsAdmin ' , $ topcoderProfile );
2451
2468
$ photoUrl = isset ($ photoUrl ) && !empty (trim ($ photoUrl )) ? $ photoUrl : UserModel::getDefaultAvatarUrl ();
2452
2469
$ isUnlickableUser = TopcoderPlugin::isUnclickableUser ($ name );
2453
- $ href = (val ('NoLink ' , $ options )) || $ isUnlickableUser ? '' : ' href=" ' .url ($ userLink ).'" ' ;
2470
+ $ href = (val ('NoLink ' , $ options )) || $ isUnlickableUser || getIncomingValue ( ' embed_type ' ) == ' mfe ' ? '' : ' href=" ' .url ($ userLink ).'" ' ;
2454
2471
2455
2472
Gdn::controller ()->EventArguments ['User ' ] = $ user ;
2456
2473
Gdn::controller ()->EventArguments ['Title ' ] =& $ title ;
@@ -2540,7 +2557,7 @@ function userAnchor($user, $cssClass = null, $options = null) {
2540
2557
}
2541
2558
2542
2559
// Go to Topcoder user profile link instead of Vanilla profile link
2543
- $ isUnlickableUser = TopcoderPlugin::isUnclickableUser ($ name );
2560
+ $ isUnlickableUser = getIncomingValue ( ' embed_type ' ) == ' mfe ' || TopcoderPlugin::isUnclickableUser ($ name );
2544
2561
$ userUrl = $ isUnlickableUser ? '# ' : topcoderUserUrl ($ user , $ px );
2545
2562
2546
2563
$ topcoderProfile = TopcoderPlugin::getTopcoderUser ($ userID );
0 commit comments