Help with age in Search results

Hi all and thank you for all the help.

I followed the instructions below to change the date format from YYYY-mm-dd to mm-dd-YYYY. The below instructions fixed the date format in the Profile View, however, and with due all respect to George for providing the fix below, it messed up the age in the Member Search profile results. So the age now is displayed as the YYYY of birth. I revised the new code (bolow) back to the original BUT the YYYY still shows as the age in the Member Search results. I even reinstated my backup (inc/classes/BxDolProfileFields.php) of course renaming the other, howerer, I still get the same results. The age is displayed as YYYY. PLEASE HELP. I don't know what to do to fix this. THANK YOU SO MUCH. Best wishes. Tony

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Member Search results below:


Offline
gemini
43% match
-1949 y/o _XXXXXX from , United Kingdom flag
biker bear seeks seniors for sexy fun...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

inc/classes/BxDolProfileFields.php solution works, but it mess "last login" and "last edit" dates. So small correction can fix that too.

find:

function getViewableDate( $sDate ) {
return $sDate;
}

and replace it with:

function getViewableDate( $sDate ) {
return (strftime(getParam('short_date_format'), strtotime($sDate)));
}

function getViewableDate2( $sDate ) {
return $sDate;
}

Now we have two functions: one that we modified and will use for our date and original one getViewableDate2 which will use to avoid wrong "last" dates. Now we need to go and use that getViewableDate2 at "last" dates. Find this function getViewableValue( $aItem, $sValue ) and there is:

case 'DateLastEdit':
case 'DateLastLogin':
return $this -> getViewableDate( $sValue );

just replace getViewableDate with getViewableDate2 like:

case 'DateLastEdit':
case 'DateLastLogin':
return $this -> getViewableDate2( $sValue );

and done. Now you have correct dates for DOB and last login/edit.

Cheers,

George

Quote · 24 Feb 2009

 

Hi all and thank you for all the help.

 

I followed the instructions below to change the date format from YYYY-mm-dd to mm-dd-YYYY. The below instructions fixed the date format in the Profile View, however, and with due all respect to George for providing the fix below, it messed up the age in the Member Search profile results. So the age now is displayed as the YYYY of birth. I revised the new code (bolow) back to the original BUT the YYYY still shows as the age in the Member Search results. I even reinstated my backup (inc/classes/BxDolProfileFields.php) of course renaming the other, howerer, I still get the same results. The age is displayed as YYYY. PLEASE HELP. I don't know what to do to fix this. THANK YOU SO MUCH. Best wishes. Tony

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

Member Search results below:

 

Offline
gemini
43% match
-1949 y/o _XXXXXX from , United Kingdom flag
biker bear seeks seniors for sexy fun...

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

 

inc/classes/BxDolProfileFields.php solution works, but it mess "last login" and "last edit" dates. So small correction can fix that too.

find:

function getViewableDate( $sDate ) {
return $sDate;
}

and replace it with:

function getViewableDate( $sDate ) {
return (strftime(getParam('short_date_format'), strtotime($sDate)));
}

function getViewableDate2( $sDate ) {
return $sDate;
}

Now we have two functions: one that we modified and will use for our date and original one getViewableDate2 which will use to avoid wrong "last" dates. Now we need to go and use that getViewableDate2 at "last" dates. Find this function getViewableValue( $aItem, $sValue ) and there is:

case 'DateLastEdit':
case 'DateLastLogin':
return $this -> getViewableDate( $sValue );

just replace getViewableDate with getViewableDate2 like:

case 'DateLastEdit':
case 'DateLastLogin':
return $this -> getViewableDate2( $sValue );

and done. Now you have correct dates for DOB and last login/edit.

Cheers,

George

 Maybe it's just me, but if we are going 2 have 2 types of viewable dates, then why in the last part of this mod are replacing getViewableDate with getViewableDate2?  Wouldn't it make sense to add this below instead of replacing the function?  Not a php expert, not even close, but the logic here seems to say you would need getViewableDate & getViewableDate2 in order to display both properly.

Quote · 24 Feb 2009
 
 
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.