How to do a php switch case for a custom field

Long story short there are two custom fields I want to present as hyperlinks in my user's profiles. 

For example, say you have a field called "twitterhandle", they put in "jpstadtlander" and another profile field called "facebookhandle" which they might put "jpstadtlander" (these are my twitter and FB by the way). 

I want to have something, I'm guessing in the BxBaseProfileView that says something along the lines (obviously the syntax is wrong as I don't know where it's cycling through the array of fields):

 

 

        switch ($arrayname['title'])

                case 'facebookhandle':

                $FieldValue = '<a href="https://facebook.com/[fieldvalue for facebookhandle]">' . [fieldvalue for facebookhandle] . '</a>'

                break;

            case 'twitterhandle':

               $FieldValue = '<a href="https://twitter.com/[fieldvalue for facebookhandle]">' . [fieldvalue for facebookhandle] . '</a>'

                break;

            default:

                break;

        }

 
 
Any ideas? 
Quote · 16 Nov 2017

You are correct that you need to change BxBaseProfileView class, make the following changes near ~323 line, just change the condition to your particular case:

                if ($sValue1 || $aItem['Type'] == 'bool') { //if empty, do not draw
                    $sVal = $this->oPF->getViewableValue($aItem, $sValue1);
                    if ('City' == $aItem['Name'])
                        $sVal = '<a href="https://www.google.com/search?q=' . $sVal . '">' . $sVal . '</a>';
                    $aInputs[] = array(
                        'type'    => 'value',
                        'name'    => $aItem['Name'],
                        'caption' => _t($aItem['Caption']),
                        'value'   => $sVal,
                        'wrap_text' => $aItem['Type'] == 'area',
                    );                   
                }
 
Rules → http://www.boonex.com/terms
Quote · 19 Nov 2017
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.