It is useful to highlight the actual code being replaced.
Many thanks all the same!!
Stuart
----------------------------
So for clarification.... To those who want to use this feature...
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 = '<table class="profile_info_block" cellspacing="0" cellpadding="1">';
foreach( $aItems as $aItem ) {
$sValue1 = $this -> oPF -> getViewableValue( $aItem, $this -> _aProfile[ $aItem['Name'] ] );
if( !$sValue1 ) //if empty, do not draw
continue;
$sRet .= '<tr>';
$sRet .= '<td class="profile_info_label">' . htmlspecialchars( _t( $aItem['Caption'] ) ) . ':</td>';
if( $this -> bCouple ) {
if( in_array( $aItem['Name'], $this -> aCoupleMutualItems ) ) {
$sRet .= '<td class="profile_info_value" colspan="2">' . $sValue1 . '</td>';
} else {
$sValue2 = $this -> oPF -> getViewableValue( $aItem, $this -> _aCouple[ $aItem['Name'] ] );
$sRet .= '<td class="profile_info_value1">' . $sValue1 . '</td>';
$sRet .= '<td class="profile_info_value2">' . $sValue2 . '</td>';
}
} else {
$sRet .= '<td class="profile_info_value" >' . $sValue1 . '</td>';
}
$sRet .= '</tr>';
}
$sRet .= '</table>';
if ($bNoDB) {
return $sRet;
} else {
echo DesignBoxContent( _t($sCaption), $sRet, 1 );
}
}
and
REPLACE WITH:
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 = '<table class="profile_info_block" cellspacing="0" cellpadding="1">';
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 .= '<tr>';
$sRet .= '<td class="profile_info_label">' . _t( "_Age" ) . ':</td>';
$ageValue1 = age($sValue1);
if( $this -> bCouple ) {
if( in_array( $aItem['Name'], $this -> aCoupleMutualItems ) ) {
$sRet .= '<td class="profile_info_value" colspan="2">' . $ageValue1 . '</td>';
} else {
$sValue2 = $this -> oPF -> getViewableValue( $aItem, $this -> _aCouple[ $aItem['Name'] ] );
$ageValue2 = age($sValue2);
$sRet .= '<td class="profile_info_value1">' . $ageValue1 . '</td>';
$sRet .= '<td class="profile_info_value2">' . $ageValue2 . '</td>';
}
} else {
$sRet .= '<td class="profile_info_value" >' . $ageValue1 . '</td>';
}
}else{
$sRet .= '<tr>';
$sRet .= '<td class="profile_info_label">' . htmlspecialchars( _t( $aItem['Caption'] ) ) . ':</td>';
if( $this -> bCouple ) {
if( in_array( $aItem['Name'], $this -> aCoupleMutualItems ) ) {
$sRet .= '<td class="profile_info_value" colspan="2">' . $sValue1 . '</td>';
} else {
$sValue2 = $this -> oPF -> getViewableValue( $aItem, $this -> _aCouple[ $aItem['Name'] ] );
$sRet .= '<td class="profile_info_value1">' . $sValue1 . '</td>';
$sRet .= '<td class="profile_info_value2">' . $sValue2 . '</td>';
}
} else {
$sRet .= '<td class="profile_info_value" >' . $sValue1 . '</td>';
}
}
$sRet .= '</tr>';
}
$sRet .= '</table>';
if ($bNoDB) {
return $sRet;
} else {
echo DesignBoxContent( _t($sCaption), $sRet, 1 );
}
}
It worked GREAT!
Thanks for the help!
You are a blessing to this community!
Sean