HomeUnityForums

Age v. Date of Birth

 
New Topic
Post Reply
Flag/Unflag
 
  • Author
  • Message
 
creechs

posts: 37

Aug 25, 2008 21:10    Quote
Points: 1   Vote

I know there are scripts out there for this, but I don't believe one should pay money to have something like this changed that was included in a pervious version of Dolphin. How do I change the date of birth to show only the user's age in view profile. Also, how do i turn the age itself into a searchable item for matching.

 

Thanks in advance for the help!

dirtsinger

posts: 26

Aug 26, 2008 13:17    Quote
Points: 0   Vote

Right!  I would also like to have profiles show member's AGE instead of Date of Birth.  I shouldn't have to pay for that option.  Someone must have the script for that.

 

By the way, I do have Age in my Advance Search.  All I did was in the "Fields Builder" section, was add the "DateofBirth" block, and then I changed the Caption to say "Age".  It automatically created a searchable birthdate range based on matching to member's birthyears.

 

 

www.FreePersonalClassifieds.com

RumpyBumpy

posts: 719

Aug 26, 2008 17:06    Quote
Points: 0   Vote

I agree we should not need a 'mod' for simple basic functions?  WHO wants their birthdate public?



The dateObirth block is already there with age in v6.1.4 advanced search ......
.

mrpowless

posts: 281

Aug 26, 2008 17:14    Quote
Points: 1   Vote

have fun guys...dont pull your hair out

creechs

posts: 37

Aug 26, 2008 21:24    Quote
Points: 0   Vote

 

heres mine...note _Age language key needs to be added

templates/base/BxBaseProfileView.php

 

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>';

...........

...........

............

 

and ends with

}

 

theres a line or two then it says function again.

 

have fun guys...dont pull your hair out

 

I attempted your recommendation (Thanks by the way)..

I got this error:

Fatal error: Cannot redeclare BxBaseProfileView::showBlockPFBlock() in /home1/findyou5/public_html/templates/base/scripts/BxBaseProfileView.php on line 326

Where did I go wrong?   I don't have templates/base/bxbaseprofileview.php. I only have the directory listed above.  Do I need to paste it in a certain spot?

Thanks again!

RumpyBumpy

posts: 719

Aug 26, 2008 21:28    Quote
Points: 0   Vote

It's in my v6.1.4 zip so you either possibly have an older version or it didn't get uploaded  ..... 
.

creechs

posts: 37

Aug 26, 2008 21:49    Quote
Points: 0   Vote

 

It's in my v6.1.4 zip so you either possibly have an older version or it didn't get uploaded  ..... 
.

 

It is not in my zip. I am using 6.1.4 as well. Downloaded about 8 days ago.

RumpyBumpy

posts: 719

Aug 26, 2008 22:12    Quote
Points: 0   Vote

I attempted your recommendation (Thanks by the way)..

I got this error:

Fatal error: Cannot redeclare BxBaseProfileView::showBlockPFBlock() in /home1/findyou5/public_html/templates/base/scripts/BxBaseProfileView.php on line 326

Where did I go wrong?   I don't have templates/base/bxbaseprofileview.php. I only have the directory listed above.  Do I need to paste it in a certain spot?

Thanks again!

Check you paths  .....  it is /templates/base/scripts/  ..... 
.

creechs

posts: 37

Aug 26, 2008 22:30    Quote
Points: 0   Vote

 

 

I attempted your recommendation (Thanks by the way)..

I got this error:

Fatal error: Cannot redeclare BxBaseProfileView::showBlockPFBlock() in /home1/findyou5/public_html/templates/base/scripts/BxBaseProfileView.php on line 326

Where did I go wrong?   I don't have templates/base/bxbaseprofileview.php. I only have the directory listed above.  Do I need to paste it in a certain spot?

Thanks again!

Check you paths  .....  it is /templates/base/scripts/  ..... 
.

 

I put the code in the file located in Templates/base/scripts.   Mr. P. stated originally it was in the templates/base/file.php.  I inserted his code into the templates/base/scripts/BxBaseProfileView.php   and got the following error.

Fatal error: Cannot redeclare BxBaseProfileView::showBlockPFBlock() in /home1/findyou5/public_html/templates/base/scripts/BxBaseProfileView.php on line 326

Where did I go wrong?  All I had to do was insert the code correct? After a } and before the next function line?  Does placement on a certain line matter?

Thanks!

RumpyBumpy

posts: 719

Aug 26, 2008 22:51    Quote
Points: 0   Vote

You have pasted extraneous wording that does NOT go in the code  .....


heres mine...note _Age language key needs to be added

templates/base/BxBaseProfileView.php

the above is NOT part of the code  .....


The code starts with the following lines  .....

function showBlockPFBlock( $sCaption, $sContent, $bNoDB = false ) {
$iBlockID = (int)$sContent
;

..... 
.....

..... 
echo DesignBoxContent( _t($sCaption), $sRet, 1 );
}
}
the code ENDS with the above three lines  ..... 

The rest is NOT part of the code  .....

If you follow the posts you know that a function

starts with

blahblah  ..... 
.

creechs

posts: 37

Aug 26, 2008 22:58    Quote
Points: 0   Vote

 

You have pasted extraneous wording that does NOT go in the code  .....


heres mine...note _Age language key needs to be added

templates/base/BxBaseProfileView.php

the above is NOT part of the code  .....

The code starts with the following lines  .....

function showBlockPFBlock( $sCaption, $sContent, $bNoDB = false ) {
$iBlockID = (int)$sContent
;

..... 
.....

..... 
echo DesignBoxContent( _t($sCaption), $sRet, 1 );
}
}
the code ENDS with the above three lines  ..... 

The rest is NOT part of the code  .....

If you follow the posts you know that a function

starts with

blahblah  ..... 
.

 

I posted the exact code beginning with function showblockpfblock ... yada yada... and ending with the two "}" on seperate lines. I copy and pasted into my php file.  I attempted again in a different location in the document. I got the error again, just different line number.

mrpowless

posts: 281

Aug 26, 2008 23:01    Quote
Points: 1   Vote

hi guys replace function do not add...sorry

creechs

posts: 37

Aug 26, 2008 23:08    Quote
Points: 2   Vote

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

Stuart038

posts: 383

Aug 26, 2008 23:17    Quote
Points: 0   Vote

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

creechs

posts: 37

Aug 26, 2008 23:19    Quote
Points: 1   Vote

 

 

It is useful to highlight the actual code being replaced.

 

Many thanks all the same!!

 

Stuart

 

----------------------------

 

 

 Stuart,

 

Everyting in the "FIND" quote. will be replaced with... everything in the "REPLACE WITH" quote.

Stuart038

posts: 383

Aug 26, 2008 23:23    Quote
Points: 0   Vote
 Hi, that does make sense but you do have an underscore in the first half, hence my initial confusion. A different color for the replacement code perhaps.... :-) Anyway, it was good of you to post code samples, I wish more 'coders' would do same!! Regards, Stuart
creechs

posts: 37

Aug 26, 2008 23:28    Quote
Points: 1   Vote

 

 Hi, that does make sense but you do have an underscore in the first half, hence my initial confusion. A different color for the replacement code perhaps.... :-) Anyway, it was good of you to post code samples, I wish more 'coders' would do same!! Regards, Stuart

 

Yeah it automatically did that when I hit the "code" feature. I apologize for that.  Hoped it all helped!

RumpyBumpy

posts: 719

Aug 27, 2008 00:06    Quote
Points: 1   Vote

Well after all the confusion  .....  it works perfectly!

Thanks mrpowless! And everyone else  ..... 
.

dirtsinger

posts: 26

Aug 27, 2008 14:55    Quote
Points: 0   Vote

Thanks everyone!

 

I've got it working too.  I really appreciate all the help on this forum...

 

 

 

 

 

www.FreePersonalClassifieds.com

Synergy

posts: 9

Aug 27, 2008 15:20    Quote
Points: 0   Vote

Thanks everyone works great.

tomsche

posts: 50

Aug 28, 2008 07:02    Quote
Points: 0   Vote

Great. Thanks!!!

Laughing

killerhaai

posts: 429

Aug 28, 2008 09:23    Quote
Points: 0   Vote

Thanks working perfect

gameutopia

posts: 352

Sep 01, 2008 04:16    Quote
Points: 0   Vote

If you are not sure how to edit this for dolphin 6.1.4 and don't have any mods and would prefer to just get the already modded file to upload to your host you can do so here:

date of birth to age

gameutopia

Stuart038

posts: 383

Sep 01, 2008 04:42    Quote
Points: 0   Vote
 Hello gameutopia, I did all of that and tried to add the _Age language key. Dolphin 6.1.4. already has an _Age language key. hence it would not compile. I still get the date of birth in members area. Any ideas? Stuart
gameutopia

posts: 352

Sep 01, 2008 04:59    Quote
Points: 0   Vote

Mine did not originally have one. So no problem. If you have problems you can try a different language key for age such as _Age2 follow the same instructions but add the language key _Age2 instead.

Then in the actual file templates/base/scripts/BxBaseProfileView.php and instructions find:

_Age

And change to _Age2 instead.

The original should work unless you have some other customizations going on.

But certainly worth a try. This is a real fast quick mod, and does away with the date of birth display.

See my link for screen shots and more info if you haven't already.

gameutopia

Stuart038

posts: 383

Sep 01, 2008 05:09    Quote
Points: 0   Vote

Created new _Age2 key but no change

Stuart

Mine did not originally have one. So no problem. If you have problems you can try a different language key for age such as _Age2 follow the same instructions but add the language key _Age2 instead.

Then in the actual file templates/base/scripts/BxBaseProfileView.php and instructions find:

_Age

And change to _Age2 instead.

The original should work unless you have some other customizations going on.

But certainly worth a try. This is a real fast quick mod, and does away with the date of birth display.

See my link for screen shots and more info if you haven't already.

gameutopia

gameutopia

posts: 352

Sep 01, 2008 05:14    Quote
Points: 0   Vote

And you added the code and changed the code to reflect _Age2 in templates/base/scripts/BxBaseProfileView.php per the instructions?

I thought you originally had this squared away as posted above?

I just added this for others. But if not be sure you have also properly edit the code in the above file if you are changing and adding _Age2 to the language file. The php file will also need to be updated to relect that and you will also need date of birth in profile fields.

Stuart038

posts: 383

Sep 01, 2008 05:18    Quote
Points: 0   Vote

Updated the templates/base/scripts/BxBaseProfileView.php re _Age2 and created the _Age2 language key with the category profile fields. Still does not work. Do I need to update the actual Builders/Fields/DOB block itself?

//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 = '<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( "_Age2" ) . ':</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 );
}
}

//end date of birth mod

And you added the code and changed the code to reflect _Age2 in templates/base/scripts/BxBaseProfileView.php per the instructions?

I thought you originally had this squared away as posted above?

I just added this for others. But if not be sure you have also properly edit the code in the above file if you are changing and adding _Age2 to the language file. The php file will also need to be updated to relect that and you will also need date of birth in profile fields.

gameutopia

posts: 352

Sep 01, 2008 05:23    Quote
Points: 0   Vote

No updating anything else providing you don't have any customization going on. The date of birth block must be available for members or guests depending on your preference. If not, hence they wont see it. Are you seeing the date of birth or age or nothing at all? If nothing at all you need to allow the particular membership or guest to have viewing rights to see it.

Stuart038

posts: 383

Sep 01, 2008 05:25    Quote
Points: 0   Vote

I am getting the DOB.

 

Stuart

gameutopia

posts: 352

Sep 01, 2008 05:34    Quote
Points: 0   Vote

I think you need to review the instructions from the beginning. And the version of dolphin you are using. I can not speak for any customizations. But you are certainly welcome to join my site and enter any legit or fictious date you wish. It will automatically convert your date of birth to your age. The only time you need to enter your date of birth is during account/join page setup. Nobody else see's your date of birth. They only see your age. Change it to another year and your age is automatically adjusted. All I can say is signup and see it in action it works perfect for me. Otherwise back trace all your steps and keep trying. This really is one of the more simple ones out there. Perhaps there is some mis-understanding or something we are overlooking. If nothing else try my site and never log in again at least you know it does work and it's a matter of coding and compiling. Don't know what else to tell you Stuart.

gameutopia

dialme.com

Stuart038

posts: 383

Sep 01, 2008 05:38    Quote
Points: 0   Vote

Do we need to alter the script like this:

//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 = '<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( "_Age2" ) . ':</td>';

$ageValue1 = age($sValue1);
if( $this -> bCouple ) {
if( in_array( $aItem['Name'], $this -> aCoupleMutualItems ) ) {
$sRet .= '<td class="profile_info_value" colspan="2">' . $age2Value1 . '</td>'; // Something like this?
} 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 );
}
}

//end date of birth mod

I think you need to review the instructions from the beginning. And the version of dolphin you are using. I can not speak for any customizations. But you are certainly welcome to join my site and enter any legit or fictious date you wish. It will automatically convert your date of birth to your age. The only time you need to enter your date of birth is during account/join page setup. Nobody else see's your date of birth. They only see your age. Change it to another year and your age is automatically adjusted. All I can say is signup and see it in action it works perfect for me. Otherwise back trace all your steps and keep trying. This really is one of the more simple ones out there. Perhaps there is some mis-understanding or something we are overlooking. If nothing else try my site and never log in again at least you know it does work and it's a matter of coding and compiling. Don't know what else to tell you Stuart.

gameutopia

dialme.com

gameutopia

posts: 352

Sep 01, 2008 05:48    Quote
Points: 0   Vote

Do not touch:

$age2

Only _Age2 if you are modding as specified. $age2 would mess this up. You are only wanting to change the language key not all the others.

gameutopia

posts: 352

Sep 01, 2008 05:50    Quote
Points: 0   Vote

Otherwise stuart if you did add the language key _Age2 I will gladdly send you the .php file that will reflect this if you pm with an email. and don't change anything else.

Stuart038

posts: 383

Sep 01, 2008 05:51    Quote
Points: 0   Vote

Do not touch:

$age2

Only _Age2 if you are modding as specified. $age2 would mess this up. You are only wanting to change the language key not all the others.

I cannot see what I can be doing that is wrong. I inserted your code (off your website) and created the language key _Age2.

I have not made any additional changes to the existing DOB Blocks. I did move them about (Action inaction and back again) to see if that would help. Nada.

Stuart

lrepton

posts: 545

Sep 23, 2008 12:11    Quote
Points: 0   Vote

Downloaded gameutopia's file...

-

Thanks for doing this for the community!

-

L

dartin

posts: 81

Oct 09, 2008 10:12    Quote
Points: 0   Vote

I used gameutopia's mod - here:  http://www.dialme.com/articles/entry/Age-to-Date-of-Birth-Mod and it worked fine, except on the profile page it showed :  _Age  instead of just Age.

Where can I remove the "_"

Thanks - I am learning slowly with the help of these forums.

BraggingRights

posts: 11

Oct 10, 2008 14:42    Quote
Points: 0   Vote

I used gameutopia's mod - here:  http://www.dialme.com/articles/entry/Age-to-Date-of-Birth-Mod and it worked fine, except on the profile page it showed :  _Age  instead of just Age.

Where can I remove the "_"

Thanks - I am learning slowly with the help of these forums.

Admin - Builders - Field Builder?

MichelSwiss

posts: 315

Oct 10, 2008 20:08    Quote
Points: 0   Vote

Add a new text string _Age and with the text string value Age from your Admin Panel - Settings - Languages Settings ;-)

dartin

posts: 81

Oct 10, 2008 23:10    Quote
Points: 0   Vote

Add a new text string _Age and with the text string value Age from your Admin Panel - Settings - Languages Settings ;-)

Thank you - that solved the problem and I learnt something new !!

MichelSwiss

posts: 315

Oct 11, 2008 01:04    Quote
Points: 0   Vote

You are welcome :-) Thank you for feedback :-)

gameutopia

posts: 352

Oct 11, 2008 06:08    Quote
Points: 0   Vote

Hey BraggingRights,

Glad MichelSwiss helped you out and got you squared away. You do need to add or edit the language key which is in the instructions I posted near the bottom of the page.

Read and review the instuctions over again for anyone not sure about this. It is all there, perhaps sometimes we get in a hurry and forget a step or omit one.

Glad it worked out for you though.

Anyone else interested in the "Date of Birth to Age" Modification you can find it here:
http://www.dialme.com/articles/entry/Age-to-Date-of-Birth-Mod

Questions post here and I'm sure others will help you out. Otherwise contact me at my site as I do not frequent these forums as much as I used to due to a number of reasons.

gameutopia

killerhaai

posts: 429

Oct 11, 2008 07:10    Quote
Points: 0   Vote

Thanks gameutopia, your solution is working perfect!

tomsche

posts: 50

Oct 11, 2008 07:11    Quote
Points: 0   Vote

In Dolphin 6.2 you can select Age or Birthday.

Boonex added this new (old) function.

http://www.boonex.com/trac/dolphin/ticket/411

Cheers

Tom

erel9999

posts: 3

Oct 25, 2008 15:01    Quote
Points: 0   Vote

yes this is not normal that function should be basic functionnality I am disappointed Cry

Admin boonex, can you integrate this function in one update dolphin please ?

© 2008 BoonEx Ltd

ABN 27 127 966 581