If you prefer to manually edit the file yourself you should first make a back up of the original /templates/base/scripts/BxBaseProfileView.php
Then open the file up and find:
function showBlockPFBlock( $sCaption, $sContent, $bNoDB = false ) {
$iBlockID = (int)$sContent;
if( !isset( $this -> aPFBlocks[$iBlockID] ) or empty( $this -> aPFBlocks[$iBlockID]['Items'] ) )
return '';
$aItems = $this -> aPFBlocks[$iBlockID]['Items'];
$sRet = '
';
foreach( $aItems as $aItem ) {
$sValue1 = $this -> oPF -> getViewableValue( $aItem, $this -> _aProfile[ $aItem['Name'] ] );
if( !$sValue1 ) //if empty, do not draw
continue;
$sRet .= '';
$sRet .= '| ' . htmlspecialchars( _t( $aItem['Caption'] ) ) . ': | ';
if( $this -> bCouple ) {
if( in_array( $aItem['Name'], $this -> aCoupleMutualItems ) ) {
$sRet .= '' . $sValue1 . ' | ';
} else {
$sValue2 = $this -> oPF -> getViewableValue( $aItem, $this -> _aCouple[ $aItem['Name'] ] );
$sRet .= '' . $sValue1 . ' | ';
$sRet .= '' . $sValue2 . ' | ';
}
} else {
$sRet .= '' . $sValue1 . ' | ';
}
$sRet .= '
';
}
$sRet .= '
';
if ($bNoDB) {
return $sRet;
} else {
echo DesignBoxContent( _t($sCaption), $sRet, 1 );
}
}
And replace with:
//start date of birth mod
function showBlockPFBlock( $sCaption, $sContent, $bNoDB = false ) {
$iBlockID = (int)$sContent;
if( !isset( $this -> aPFBlocks[$iBlockID] ) or empty( $this -> aPFBlocks[$iBlockID]['Items'] ) )
return '';
$aItems = $this -> aPFBlocks[$iBlockID]['Items'];
$sRet = '';
foreach( $aItems as $aItem ) {
$sValue1 = $this -> oPF -> getViewableValue( $aItem, $this -> _aProfile[ $aItem['Name'] ] );
if( !$sValue1 ) //if empty, do not draw
continue;
if($aItem['Name'] == "DateOfBirth")
{
$sRet .= '';
$sRet .= '| ' . _t( "_Age" ) . ': | ';
$ageValue1 = age($sValue1);
if( $this -> bCouple ) {
if( in_array( $aItem['Name'], $this -> aCoupleMutualItems ) ) {
$sRet .= '' . $ageValue1 . ' | ';
} else {
$sValue2 = $this -> oPF -> getViewableValue( $aItem, $this -> _aCouple[ $aItem['Name'] ] );
$ageValue2 = age($sValue2);
$sRet .= '' . $ageValue1 . ' | ';
$sRet .= '' . $ageValue2 . ' | ';
}
} else {
$sRet .= '' . $ageValue1 . ' | ';
}
}else{
$sRet .= '
';
$sRet .= '| ' . htmlspecialchars( _t( $aItem['Caption'] ) ) . ': | ';
if( $this -> bCouple ) {
if( in_array( $aItem['Name'], $this -> aCoupleMutualItems ) ) {
$sRet .= '' . $sValue1 . ' | ';
} else {
$sValue2 = $this -> oPF -> getViewableValue( $aItem, $this -> _aCouple[ $aItem['Name'] ] );
$sRet .= '' . $sValue1 . ' | ';
$sRet .= '' . $sValue2 . ' | ';
}
} else {
$sRet .= '' . $sValue1 . ' | ';
}
}
$sRet .= '
';
}
$sRet .= '
';
if ($bNoDB) {
return $sRet;
} else {
echo DesignBoxContent( _t($sCaption), $sRet, 1 );
}
}
//end date of birth mod
Upload the already modded file to:
/templates/base/scripts/BxBaseProfileView.php
Over-writing the original.
*In your Dolphin Admin Panel "Builders" "Fields Builder" "View Profile" Date of Birth must be in the "Active Items" for a Member.
*If you do not have Date of Birth in the Active Items area you need to drag it up there. This mod is just changing there actual Date of Birth to Age.