plugins/ProfileExtender/class.profileextender.plugin.php
public function UserInfoModule_OnBasicInfo_Handler($Sender) {
      try {
         // Get the custom fields
         $ProfileFields = Gdn::UserModel()->GetMeta($Sender->User->UserID, 'Profile.%', 'Profile.');

         // Import from CustomProfileFields if available
         if (!count($ProfileFields) && is_object($Sender->User) && C('Plugins.CustomProfileFields.SuggestedFields', FALSE)) {
            $ProfileFields = Gdn::UserModel()->GetAttribute($Sender->User->UserID, 'CustomProfileFields', FALSE);
			   if ($ProfileFields) {
			      // Migrate to UserMeta & delete original
			      Gdn::UserModel()->SetMeta($Sender->User->UserID, $ProfileFields, 'Profile.');
			      Gdn::UserModel()->SaveAttribute($Sender->User->UserID, 'CustomProfileFields', FALSE);
			   }
         }
         
         // Send them off for magic formatting
         $ProfileFields = $this->ParseSpecialFields($ProfileFields);
         
         // Get all field data, error check
         $AllFields = $this->GetProfileFields();
         if (!is_array($AllFields) || !is_array($ProfileFields))
            return;

         // Display all non-hidden fields
         $ProfileFields = array_reverse($ProfileFields);
         foreach ($ProfileFields as $Name => $Value) {
            if (!$Value)
               continue;
            if (!GetValue('OnProfile', $AllFields[$Name]))
               continue;
            if (!in_array($Name, $this->MagicLabels))
               $Value = Gdn_Format::Links(htmlspecialchars($Value));
            echo ' <dt class="ProfileExtend Profile'.Gdn_Format::AlphaNumeric($Name).'">'.Gdn_Format::Text($AllFields[$Name]['Label']).'</dt> ';
            echo ' <dd class="ProfileExtend Profile'.Gdn_Format::AlphaNumeric($Name).'">'.$Value.'</dd> ';
         }
      } catch (Exception $ex) {
         // No errors
      }
   }
public function UserInfoModule_OnBasicInfo_Handler($Sender) {
      try {
         // Get the custom fields
         $ProfileFields = Gdn::UserModel()->GetMeta($Sender->User->UserID, 'Profile.%', 'Profile.');

         // Import from CustomProfileFields if available
         if (!count($ProfileFields) && is_object($Sender->User) && C('Plugins.CustomProfileFields.SuggestedFields', FALSE)) {
            $ProfileFields = Gdn::UserModel()->GetAttribute($Sender->User->UserID, 'CustomProfileFields', FALSE);
			   if ($ProfileFields) {
			      // Migrate to UserMeta & delete original
			      Gdn::UserModel()->SetMeta($Sender->User->UserID, $ProfileFields, 'Profile.');
			      Gdn::UserModel()->SaveAttribute($Sender->User->UserID, 'CustomProfileFields', FALSE);
			   }
         }
         
         // Send them off for magic formatting
         $ProfileFields = $this->ParseSpecialFields($ProfileFields);
         
         // Get all field data, error check
         $AllFields = $this->GetProfileFields();
         if (!is_array($AllFields) || !is_array($ProfileFields))
            return;

         // Display all non-hidden fields
         $ProfileFields = array_reverse($ProfileFields);
         foreach ($ProfileFields as $Name => $Value) {
            if (!$Value)
               continue;
            if (!GetValue('OnProfile', $AllFields[$Name]))
               continue;
            if (!in_array($Name, $this->MagicLabels))
               $Value = Gdn_Format::Links(htmlspecialchars($Value));
            echo ' <dt class="ProfileExtend Profile'.Gdn_Format::AlphaNumeric($Name).'">'.Gdn_Format::Text($AllFields[$Name]['Label']).'</dt> ';
            echo ' <dd class="ProfileExtend Profile'.Gdn_Format::AlphaNumeric($Name).'">'.$Value.'</dd> ';
         }
      } catch (Exception $ex) {
         // No errors
      }
   }
public function UserInfoModule_OnBasicInfo_Handler ( $ Sender ) { try { // Get the custom fields $ ProfileFields = Gdn :: UserModel ( ) -> GetMeta ( $ Sender -> User -> UserID , 'Profile.%' , 'Profile.' ) ; // Import from CustomProfileFields if available if ( ! count ( $ ProfileFields ) && is_object ( $ Sender -> User ) && C ( 'Plugins.CustomProfileFields.SuggestedFields' , FALSE ) ) { $ ProfileFields = Gdn :: UserModel ( ) -> GetAttribute ( $ Sender -> User -> UserID , 'CustomProfileFields' , FALSE ) ; if ( $ ProfileFields ) { // Migrate to UserMeta & delete original Gdn :: UserModel ( ) -> SetMeta ( $ Sender -> User -> UserID , $ ProfileFields , 'Profile.' ) ; Gdn :: UserModel ( ) -> SaveAttribute ( $ Sender -> User -> UserID , 'CustomProfileFields' , FALSE ) ; } } // Send them off for magic formatting $ ProfileFields = $ this -> ParseSpecialFields ( $ ProfileFields ) ; // Get all field data, error check $ AllFields = $ this -> GetProfileFields ( ) ; if ( ! is_array ( $ AllFields ) || ! is_array ( $ ProfileFields ) ) return ; // Display all non-hidden fields $ ProfileFields = array_reverse ( $ ProfileFields ) ; foreach ( $ ProfileFields as $ Name => $ Value ) { if ( ! $ Value ) continue ; if ( ! GetValue ( 'OnProfile' , $ AllFields [ $ Name ] ) ) continue ; if ( ! in_array ( $ Name , $ this -> MagicLabels ) ) $ Value = Gdn_Format :: Links ( htmlspecialchars ( $ Value ) ) ; echo ' <dt class="ProfileExtend Profile' . Gdn_Format :: AlphaNumeric ( $ Name ) . '">' . Gdn_Format :: Text ( $ AllFields [ $ Name ] [ 'Label' ] ) . '</dt> ' ; echo ' <dd class="ProfileExtend Profile' . Gdn_Format :: AlphaNumeric ( $ Name ) . '">' . $ Value . '</dd> ' ; } } catch ( Exception $ ex ) { // No errors } }
Display custom fields on Profile.
Display custom fields on Profile .